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.

82 lines
2.0 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. dllmain.cpp
  5. Abstract:
  6. Implementation of DLL Exports.
  7. Revision History:
  8. Davide Massarenti (Dmassare) 04/15/2000
  9. created
  10. ******************************************************************************/
  11. #include "stdafx.h"
  12. #include <initguid.h>
  13. #include <HelpCenterTypeLib_i.c>
  14. #include <HCApi_i.c>
  15. CComModule _Module;
  16. BEGIN_OBJECT_MAP(ObjectMap)
  17. OBJECT_ENTRY(CLSID_PCHLaunch, CPCHLaunch)
  18. END_OBJECT_MAP()
  19. /////////////////////////////////////////////////////////////////////////////
  20. // DLL Entry Point
  21. extern "C"
  22. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  23. {
  24. if(dwReason == DLL_PROCESS_ATTACH)
  25. {
  26. _Module.Init(ObjectMap, hInstance, &LIBID_HCLaunchLIB);
  27. DisableThreadLibraryCalls( hInstance );
  28. }
  29. else if(dwReason == DLL_PROCESS_DETACH)
  30. {
  31. _Module.Term();
  32. }
  33. return TRUE; // ok
  34. }
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Used to determine whether the DLL can be unloaded by OLE
  37. STDAPI DllCanUnloadNow(void)
  38. {
  39. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  40. }
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Returns a class factory to create an object of the requested type
  43. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  44. {
  45. return _Module.GetClassObject(rclsid, riid, ppv);
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DllRegisterServer - Adds entries to the system registry
  49. STDAPI DllRegisterServer(void)
  50. {
  51. // registers object, typelib and all interfaces in typelib
  52. return _Module.RegisterServer(TRUE);
  53. }
  54. /////////////////////////////////////////////////////////////////////////////
  55. // DllUnregisterServer - Removes entries from the system registry
  56. STDAPI DllUnregisterServer(void)
  57. {
  58. return _Module.UnregisterServer(TRUE);
  59. }