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.

95 lines
2.7 KiB

  1. // WizChain.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f WizChainps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "WizChain.h"
  9. #include "WizChain_i.c"
  10. #include "PropItem.h"
  11. #include "ChainWiz.h"
  12. #include "WzScrEng.h"
  13. #include "PropSht.h"
  14. #include "StatsDlg.h"
  15. #include "StatusProgress.h"
  16. CComModule _Module;
  17. BEGIN_OBJECT_MAP(ObjectMap)
  18. OBJECT_ENTRY(CLSID_ChainWiz, CChainWiz)
  19. OBJECT_ENTRY(CLSID_PropertyPagePropertyBag, CPropertyPagePropertyBag)
  20. OBJECT_ENTRY(CLSID_WizardScriptingEngine, CWizardScriptingEngine)
  21. OBJECT_ENTRY(CLSID_StatusDlg, CStatusDlg)
  22. OBJECT_ENTRY(CLSID_StatusProgress, CStatusProgress)
  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. _Module.Init(ObjectMap, hInstance, &LIBID_WIZCHAINLib);
  32. DisableThreadLibraryCalls(hInstance);
  33. }
  34. else if (dwReason == DLL_PROCESS_DETACH)
  35. _Module.Term();
  36. return TRUE; // ok
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Used to determine whether the DLL can be unloaded by OLE
  40. STDAPI DllCanUnloadNow(void)
  41. {
  42. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  43. }
  44. /////////////////////////////////////////////////////////////////////////////
  45. // Returns a class factory to create an object of the requested type
  46. #include <commctrl.h>
  47. #include "StatusProgress.h"
  48. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  49. {
  50. AtlAxWinInit(); // init ATL control containment code
  51. // init common controls
  52. INITCOMMONCONTROLSEX icce;
  53. ZeroMemory (&icce, sizeof(icce));
  54. icce.dwSize = sizeof(icce);
  55. icce.dwICC = ICC_LISTVIEW_CLASSES | ICC_LINK_CLASS;
  56. if (!InitCommonControlsEx (&icce))
  57. {
  58. icce.dwICC = ICC_LISTVIEW_CLASSES;
  59. InitCommonControlsEx (&icce);
  60. }
  61. return _Module.GetClassObject(rclsid, riid, ppv);
  62. }
  63. /////////////////////////////////////////////////////////////////////////////
  64. // DllRegisterServer - Adds entries to the system registry
  65. STDAPI DllRegisterServer(void)
  66. {
  67. // registers object, typelib and all interfaces in typelib
  68. return _Module.RegisterServer(TRUE);
  69. }
  70. /////////////////////////////////////////////////////////////////////////////
  71. // DllUnregisterServer - Removes entries from the system registry
  72. STDAPI DllUnregisterServer(void)
  73. {
  74. return _Module.UnregisterServer(TRUE);
  75. }