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.

83 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: dsuiwiz.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "pch.h"
  11. #include "util.h"
  12. #include "resource.h"
  13. //#include "initguid.h"
  14. #include "dsuiwiz.h"
  15. #include "ShellExt.h"
  16. // {6BA3F852-23C6-11D1-B91F-00A0C9A06D2D}
  17. static const CLSID CLSID_OuDelegWizExt =
  18. { 0x6BA3F852, 0x23C6, 0x11D1, {0xB9, 0x1F, 0x00, 0xA0, 0xC9, 0xA0, 0x6D, 0x2D } };
  19. COuDelegComModule _Module;
  20. BEGIN_OBJECT_MAP(ObjectMap)
  21. OBJECT_ENTRY(CLSID_OuDelegWizExt, CShellExt)
  22. END_OBJECT_MAP()
  23. /////////////////////////////////////////////////////////////////////////////
  24. // DLL Entry Point
  25. extern "C"
  26. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  27. {
  28. if (dwReason == DLL_PROCESS_ATTACH)
  29. {
  30. _Module.Init(ObjectMap, hInstance);
  31. DisableThreadLibraryCalls(hInstance);
  32. if (!_Module.InitClipboardFormats())
  33. return FALSE;
  34. }
  35. else if (dwReason == DLL_PROCESS_DETACH)
  36. _Module.Term();
  37. return TRUE; // ok
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Used to determine whether the DLL can be unloaded by OLE
  41. STDAPI DllCanUnloadNow(void)
  42. {
  43. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // Returns a class factory to create an object of the requested type
  47. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  48. {
  49. return _Module.GetClassObject(rclsid, riid, ppv);
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // DllRegisterServer - Adds entries to the system registry
  53. STDAPI DllRegisterServer(void)
  54. {
  55. return _Module.RegisterServer(FALSE);
  56. }
  57. /////////////////////////////////////////////////////////////////////////////
  58. // DllUnregisterServer - Removes entries from the system registry
  59. STDAPI DllUnregisterServer(void)
  60. {
  61. return _Module.UnregisterServer();
  62. }