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.

101 lines
2.6 KiB

  1. // vssui.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f vssps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "vssui.h"
  9. #include "vssui_i.c"
  10. #include "vsspage.h"
  11. #include "snapext.h"
  12. #include "ShlExt.h"
  13. #include <shfusion.h>
  14. CComModule _Module;
  15. BEGIN_OBJECT_MAP(ObjectMap)
  16. OBJECT_ENTRY(CLSID_VSSUI, CVSSUI)
  17. OBJECT_ENTRY(CLSID_VSSShellExt, CVSSShellExt)
  18. END_OBJECT_MAP()
  19. /////////////////////////////////////////////////////////////////////////////
  20. // DLL Entry Point
  21. CVssPageApp theApp;
  22. BOOL CVssPageApp::InitInstance()
  23. {
  24. // _Module.Init(ObjectMap, m_hInstance, &LIBID_VSSUILib);
  25. _Module.Init(ObjectMap, m_hInstance);
  26. SHFusionInitializeFromModuleID (m_hInstance, 2);
  27. DisableThreadLibraryCalls(m_hInstance);
  28. return CWinApp::InitInstance();
  29. }
  30. int CVssPageApp::ExitInstance()
  31. {
  32. // MFC's class factories registration is
  33. // automatically revoked by MFC itself.
  34. if (m_bRun)
  35. _Module.RevokeClassObjects();
  36. SHFusionUninitialize();
  37. _Module.Term();
  38. return 0;
  39. }
  40. /*
  41. extern "C"
  42. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  43. {
  44. if (dwReason == DLL_PROCESS_ATTACH)
  45. {
  46. _Module.Init(ObjectMap, hInstance, &LIBID_VSSUILib);
  47. DisableThreadLibraryCalls(hInstance);
  48. }
  49. else if (dwReason == DLL_PROCESS_DETACH)
  50. _Module.Term();
  51. return TRUE; // ok
  52. }
  53. */
  54. /////////////////////////////////////////////////////////////////////////////
  55. // Used to determine whether the DLL can be unloaded by OLE
  56. STDAPI DllCanUnloadNow(void)
  57. {
  58. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  59. }
  60. /////////////////////////////////////////////////////////////////////////////
  61. // Returns a class factory to create an object of the requested type
  62. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  63. {
  64. return _Module.GetClassObject(rclsid, riid, ppv);
  65. }
  66. /////////////////////////////////////////////////////////////////////////////
  67. // DllRegisterServer - Adds entries to the system registry
  68. STDAPI DllRegisterServer(void)
  69. {
  70. // registers object, typelib and all interfaces in typelib
  71. return _Module.RegisterServer(TRUE);
  72. }
  73. /////////////////////////////////////////////////////////////////////////////
  74. // DllUnregisterServer - Removes entries from the system registry
  75. STDAPI DllUnregisterServer(void)
  76. {
  77. return _Module.UnregisterServer(TRUE);
  78. }