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.

97 lines
2.4 KiB

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