Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.0 KiB

  1. // FaxControl.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f FaxControlps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "FaxControl.h"
  9. #include "FaxControl_i.c"
  10. #include "IFaxControl.h"
  11. #include "Faxutil.h"
  12. CComModule _Module;
  13. BEGIN_OBJECT_MAP(ObjectMap)
  14. OBJECT_ENTRY(CLSID_FaxControl, CFaxControl)
  15. END_OBJECT_MAP()
  16. /////////////////////////////////////////////////////////////////////////////
  17. // DLL Entry Point
  18. extern "C"
  19. BOOL FaxControl_DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  20. {
  21. if (dwReason == DLL_PROCESS_ATTACH)
  22. {
  23. _Module.Init(ObjectMap, hInstance, &LIBID_FAXCONTROLLib);
  24. DisableThreadLibraryCalls(hInstance);
  25. }
  26. else if (dwReason == DLL_PROCESS_DETACH)
  27. {
  28. _Module.Term();
  29. HeapCleanup();
  30. }
  31. return TRUE; // ok
  32. }
  33. /////////////////////////////////////////////////////////////////////////////
  34. // Used to determine whether the DLL can be unloaded by OLE
  35. STDAPI DllCanUnloadNow(void)
  36. {
  37. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Returns a class factory to create an object of the requested type
  41. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  42. {
  43. return _Module.GetClassObject(rclsid, riid, ppv);
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // DllRegisterServer - Adds entries to the system registry
  47. STDAPI DllRegisterServer(void)
  48. {
  49. // registers object, typelib and all interfaces in typelib
  50. return _Module.RegisterServer(TRUE);
  51. }
  52. /////////////////////////////////////////////////////////////////////////////
  53. // DllUnregisterServer - Removes entries from the system registry
  54. STDAPI DllUnregisterServer(void)
  55. {
  56. return _Module.UnregisterServer(TRUE);
  57. }