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.

87 lines
2.2 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 "shfusion.h"
  16. #include "ShellExt.h"
  17. // {6BA3F852-23C6-11D1-B91F-00A0C9A06D2D}
  18. static const CLSID CLSID_OuDelegWizExt =
  19. { 0x6BA3F852, 0x23C6, 0x11D1, {0xB9, 0x1F, 0x00, 0xA0, 0xC9, 0xA0, 0x6D, 0x2D } };
  20. COuDelegComModule _Module;
  21. BEGIN_OBJECT_MAP(ObjectMap)
  22. OBJECT_ENTRY(CLSID_OuDelegWizExt, CShellExt)
  23. END_OBJECT_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // DLL Entry Point
  26. extern "C"
  27. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  28. {
  29. if (dwReason == DLL_PROCESS_ATTACH)
  30. {
  31. SHFusionInitialize(0);
  32. _Module.Init(ObjectMap, hInstance);
  33. DisableThreadLibraryCalls(hInstance);
  34. if (!_Module.InitClipboardFormats())
  35. return FALSE;
  36. }
  37. else if (dwReason == DLL_PROCESS_DETACH)
  38. {
  39. SHFusionUninitialize();
  40. _Module.Term();
  41. }
  42. return TRUE; // ok
  43. }
  44. /////////////////////////////////////////////////////////////////////////////
  45. // Used to determine whether the DLL can be unloaded by OLE
  46. STDAPI DllCanUnloadNow(void)
  47. {
  48. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  49. }
  50. /////////////////////////////////////////////////////////////////////////////
  51. // Returns a class factory to create an object of the requested type
  52. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  53. {
  54. return _Module.GetClassObject(rclsid, riid, ppv);
  55. }
  56. /////////////////////////////////////////////////////////////////////////////
  57. // DllRegisterServer - Adds entries to the system registry
  58. STDAPI DllRegisterServer(void)
  59. {
  60. return _Module.RegisterServer(FALSE);
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // DllUnregisterServer - Removes entries from the system registry
  64. STDAPI DllUnregisterServer(void)
  65. {
  66. return _Module.UnregisterServer();
  67. }