Source code of Windows XP (NT5)
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.

76 lines
2.0 KiB

  1. // RAssistance.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f RAssistanceps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "RAssistance.h"
  9. #include "RAssistance_i.c"
  10. #include "RASettingProperty.h"
  11. #include "RARegSetting.h"
  12. CComModule _Module;
  13. HINSTANCE g_hInst = NULL;
  14. BEGIN_OBJECT_MAP(ObjectMap)
  15. OBJECT_ENTRY(CLSID_RASettingProperty, CRASettingProperty)
  16. OBJECT_ENTRY(CLSID_RARegSetting, CRARegSetting)
  17. END_OBJECT_MAP()
  18. /////////////////////////////////////////////////////////////////////////////
  19. // DLL Entry Point
  20. extern "C"
  21. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  22. {
  23. if (dwReason == DLL_PROCESS_ATTACH)
  24. {
  25. g_hInst = hInstance;
  26. _Module.Init(ObjectMap, hInstance, &LIBID_RASSISTANCELib);
  27. DisableThreadLibraryCalls(hInstance);
  28. }
  29. else if (dwReason == DLL_PROCESS_DETACH)
  30. _Module.Term();
  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. }