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.

105 lines
2.9 KiB

  1. // DomMigSI.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f DomMigSIps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include <locale.h>
  9. #include "DomMigSI.h"
  10. #include "DomMigSI_i.c"
  11. #include "DomMigr.h"
  12. CComModule _Module;
  13. BEGIN_OBJECT_MAP(ObjectMap)
  14. OBJECT_ENTRY(CLSID_DomMigrator, CDomMigrator)
  15. OBJECT_ENTRY(CLSID_DomMigratorAbout, CDomMigratorAbout)
  16. END_OBJECT_MAP()
  17. class CDomMigSIApp : public CWinApp
  18. {
  19. public:
  20. // Overrides
  21. // ClassWizard generated virtual function overrides
  22. //{{AFX_VIRTUAL(CDomMigSIApp)
  23. public:
  24. virtual BOOL InitInstance();
  25. virtual int ExitInstance();
  26. //}}AFX_VIRTUAL
  27. //{{AFX_MSG(CDomMigSIApp)
  28. // NOTE - the ClassWizard will add and remove member functions here.
  29. // DO NOT EDIT what you see in these blocks of generated code !
  30. //}}AFX_MSG
  31. DECLARE_MESSAGE_MAP()
  32. };
  33. BEGIN_MESSAGE_MAP(CDomMigSIApp, CWinApp)
  34. //{{AFX_MSG_MAP(CDomMigSIApp)
  35. // NOTE - the ClassWizard will add and remove mapping macros here.
  36. // DO NOT EDIT what you see in these blocks of generated code!
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. CDomMigSIApp theApp;
  40. BOOL CDomMigSIApp::InitInstance()
  41. {
  42. ATLTRACE(_T("{DomMigSI.dll}CDomMigSIApp::InitInstance() : m_hInstance=0x%08lX\n"), m_hInstance);
  43. _wsetlocale( LC_ALL, L".ACP" );
  44. _Module.Init(ObjectMap, m_hInstance, &LIBID_DOMMIGSILib);
  45. BOOL bInit = CWinApp::InitInstance();
  46. _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF);
  47. return bInit;
  48. }
  49. int CDomMigSIApp::ExitInstance()
  50. {
  51. ATLTRACE(_T("{DomMigSI.dll}CDomMigSIApp::ExitInstance() : m_hInstance=0x%08lX\n"), m_hInstance);
  52. _Module.Term();
  53. return CWinApp::ExitInstance();
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // Used to determine whether the DLL can be unloaded by OLE
  57. STDAPI DllCanUnloadNow(void)
  58. {
  59. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  60. return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // Returns a class factory to create an object of the requested type
  64. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  65. {
  66. return _Module.GetClassObject(rclsid, riid, ppv);
  67. }
  68. /////////////////////////////////////////////////////////////////////////////
  69. // DllRegisterServer - Adds entries to the system registry
  70. STDAPI DllRegisterServer(void)
  71. {
  72. // registers object, typelib and all interfaces in typelib
  73. return _Module.RegisterServer(TRUE);
  74. }
  75. /////////////////////////////////////////////////////////////////////////////
  76. // DllUnregisterServer - Removes entries from the system registry
  77. STDAPI DllUnregisterServer(void)
  78. {
  79. return _Module.UnregisterServer(TRUE);
  80. }