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.

94 lines
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: cic.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // cic.cpp : Implementation of DLL Exports.
  11. // Note: Proxy/Stub Information
  12. // To build a separate proxy/stub DLL,
  13. // run nmake -f cicps.mk in the project directory.
  14. #include "stdafx.h"
  15. #include "resource.h"
  16. #include "initguid.h"
  17. #include "cic.h"
  18. #include "cic_i.c"
  19. #include "MMCCtrl.h"
  20. #include "MMCTask.h"
  21. #include "MMClpi.h"
  22. #include "ListPad.h"
  23. #include "SysColorCtrl.h"
  24. CComModule _Module;
  25. BEGIN_OBJECT_MAP(ObjectMap)
  26. OBJECT_ENTRY(CLSID_MMCCtrl, CMMCCtrl)
  27. OBJECT_ENTRY(CLSID_MMCTask, CMMCTask)
  28. OBJECT_ENTRY(CLSID_MMCListPadInfo, CMMCListPadInfo)
  29. OBJECT_ENTRY(CLSID_ListPad, CListPad)
  30. OBJECT_ENTRY(CLSID_SysColorCtrl, CSysColorCtrl)
  31. END_OBJECT_MAP()
  32. // cut from ndmgr_i.c (yuck) !!!
  33. const IID IID_ITaskPadHost = {0x4f7606d0,0x5568,0x11d1,{0x9f,0xea,0x00,0x60,0x08,0x32,0xdb,0x4a}};
  34. /////////////////////////////////////////////////////////////////////////////
  35. // DLL Entry Point
  36. extern "C"
  37. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  38. {
  39. if (dwReason == DLL_PROCESS_ATTACH)
  40. {
  41. _Module.Init(ObjectMap, hInstance);
  42. DisableThreadLibraryCalls(hInstance);
  43. }
  44. else if (dwReason == DLL_PROCESS_DETACH)
  45. _Module.Term();
  46. return TRUE; // ok
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. // Used to determine whether the DLL can be unloaded by OLE
  50. STDAPI DllCanUnloadNow(void)
  51. {
  52. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  53. }
  54. /////////////////////////////////////////////////////////////////////////////
  55. // Returns a class factory to create an object of the requested type
  56. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  57. {
  58. return _Module.GetClassObject(rclsid, riid, ppv);
  59. }
  60. /////////////////////////////////////////////////////////////////////////////
  61. // DllRegisterServer - Adds entries to the system registry
  62. STDAPI DllRegisterServer(void)
  63. {
  64. // registers object, typelib and all interfaces in typelib
  65. return _Module.RegisterServer(TRUE);
  66. }
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DllUnregisterServer - Removes entries from the system registry
  69. STDAPI DllUnregisterServer(void)
  70. {
  71. _Module.UnregisterServer();
  72. return S_OK;
  73. }