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.

118 lines
4.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: displ2.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // displ2.cpp : Implementation of DLL Exports.
  11. // Note: Proxy/Stub Information
  12. // To build a separate proxy/stub DLL,
  13. // run nmake -f displ2ps.mk in the project directory.
  14. #include "stdafx.h"
  15. #include "resource.h"
  16. #include "initguid.h"
  17. #include "displ2.h"
  18. #include "DsplMgr2.h"
  19. #include <atlimpl.cpp>
  20. using namespace ATL;
  21. CComModule _Module;
  22. const CLSID CLSID_DsplMgr2 = {0x885B3BAE,0x43F9,0x11D1,{0x9F,0xD4,0x00,0x60,0x08,0x32,0xDB,0x4A}};
  23. // cut from mmc_i.c (yuck) !!!
  24. const IID IID_IComponentData = {0x955AB28A,0x5218,0x11D0,{0xA9,0x85,0x00,0xC0,0x4F,0xD8,0xD5,0x65}};
  25. const IID IID_IComponent = {0x43136EB2,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  26. const IID IID_IResultDataCompare = {0xE8315A52,0x7A1A,0x11D0,{0xA2,0xD2,0x00,0xC0,0x4F,0xD9,0x09,0xDD}};
  27. const IID IID_IResultOwnerData = {0x9CB396D8,0xEA83,0x11d0,{0xAE,0xF1,0x00,0xC0,0x4F,0xB6,0xDD,0x2C}};
  28. const IID IID_IConsole = {0x43136EB1,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  29. const IID IID_IHeaderCtrl = {0x43136EB3,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  30. const IID IID_IContextMenuCallback = {0x43136EB7,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  31. const IID IID_IContextMenuProvider = {0x43136EB6,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  32. const IID IID_IExtendContextMenu = {0x4F3B7A4F,0xCFAC,0x11CF,{0xB8,0xE3,0x00,0xC0,0x4F,0xD8,0xD5,0xB0}};
  33. const IID IID_IImageList = {0x43136EB8,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  34. const IID IID_IResultData = {0x31DA5FA0,0xE0EB,0x11cf,{0x9F,0x21,0x00,0xAA,0x00,0x3C,0xA9,0xF6}};
  35. const IID IID_IQuickFilter = {0x9757abb8,0x1b32,0x11d1,{0xa7,0xce,0x00,0xc0,0x4f,0xd8,0xd5,0x65}};
  36. const IID IID_IConsoleNameSpace = {0xBEDEB620,0xF24D,0x11cf,{0x8A,0xFC,0x00,0xAA,0x00,0x3C,0xA9,0xF6}};
  37. const IID IID_IPropertySheetCallback = {0x85DE64DD,0xEF21,0x11cf,{0xA2,0x85,0x00,0xC0,0x4F,0xD8,0xDB,0xE6}};
  38. const IID IID_IPropertySheetProvider = {0x85DE64DE,0xEF21,0x11cf,{0xA2,0x85,0x00,0xC0,0x4F,0xD8,0xDB,0xE6}};
  39. const IID IID_IExtendPropertySheet = {0x85DE64DC,0xEF21,0x11cf,{0xA2,0x85,0x00,0xC0,0x4F,0xD8,0xDB,0xE6}};
  40. const IID IID_IControlbar = {0x69FB811E,0x6C1C,0x11D0,{0xA2,0xCB,0x00,0xC0,0x4F,0xD9,0x09,0xDD}};
  41. const IID IID_IExtendControlbar = {0x49506520,0x6F40,0x11D0,{0xA9,0x8B,0x00,0xC0,0x4F,0xD8,0xD5,0x65}};
  42. const IID IID_IToolbar = {0x43136EB9,0xD36C,0x11CF,{0xAD,0xBC,0x00,0xAA,0x00,0xA8,0x00,0x33}};
  43. const IID IID_IConsoleVerb = {0xE49F7A60,0x74AF,0x11D0,{0xA2,0x86,0x00,0xC0,0x4F,0xD8,0xFE,0x93}};
  44. const IID IID_ISnapinAbout = {0x1245208C,0xA151,0x11D0,{0xA7,0xD7,0x00,0xC0,0x4F,0xD9,0x09,0xDD}};
  45. const IID IID_IMenuButton = {0x951ED750,0xD080,0x11d0,{0xB1,0x97,0x00,0x00,0x00,0x00,0x00,0x00}};
  46. const IID IID_ISnapinHelp = {0xA6B15ACE,0xDF59,0x11D0,{0xA7,0xDD,0x00,0xC0,0x4F,0xD9,0x09,0xDD}};
  47. const IID IID_IExtendTaskPad = {0x8dee6511,0x554d,0x11d1,{0x9f,0xea,0x00,0x60,0x08,0x32,0xdb,0x4a}};
  48. const IID IID_IEnumTASK = {0x338698b1,0x5a02,0x11d1,{0x9f,0xec,0x00,0x60,0x08,0x32,0xdb,0x4a}};
  49. BEGIN_OBJECT_MAP(ObjectMap)
  50. OBJECT_ENTRY(CLSID_DsplMgr2, CDsplMgr2)
  51. END_OBJECT_MAP()
  52. /////////////////////////////////////////////////////////////////////////////
  53. // DLL Entry Point
  54. long g_ref_DataObject = 0; // used in DataObj.cpp
  55. HINSTANCE g_hinst = 0; // used in DsplMgr2.cpp
  56. extern "C"
  57. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  58. {
  59. if (dwReason == DLL_PROCESS_ATTACH)
  60. {
  61. g_hinst = hInstance;
  62. _Module.Init(ObjectMap, hInstance);
  63. DisableThreadLibraryCalls(hInstance);
  64. }
  65. else if (dwReason == DLL_PROCESS_DETACH)
  66. _Module.Term();
  67. return TRUE; // ok
  68. }
  69. /////////////////////////////////////////////////////////////////////////////
  70. // Used to determine whether the DLL can be unloaded by OLE
  71. STDAPI DllCanUnloadNow(void)
  72. {
  73. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  74. }
  75. /////////////////////////////////////////////////////////////////////////////
  76. // Returns a class factory to create an object of the requested type
  77. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  78. {
  79. return _Module.GetClassObject(rclsid, riid, ppv);
  80. }
  81. /////////////////////////////////////////////////////////////////////////////
  82. // DllRegisterServer - Adds entries to the system registry
  83. STDAPI DllRegisterServer(void)
  84. {
  85. // registers object
  86. return _Module.RegisterServer();
  87. }
  88. /////////////////////////////////////////////////////////////////////////////
  89. // DllUnregisterServer - Removes entries from the system registry
  90. STDAPI DllUnregisterServer(void)
  91. {
  92. _Module.UnregisterServer();
  93. return S_OK;
  94. }