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.

74 lines
2.0 KiB

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