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