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.

78 lines
2.2 KiB

  1. // Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
  2. // MSWebDVD.cpp : Implementation of DLL Exports.
  3. // Note: Proxy/Stub Information
  4. // To build a separate proxy/stub DLL,
  5. // run nmake -f MSWebDVDps.mk in the project directory.
  6. #include "stdafx.h"
  7. #include "resource.h"
  8. #include <initguid.h>
  9. #include "MSWebDVD.h"
  10. #include "MSWebDVD_i.c"
  11. #include "MSDVD.h"
  12. #include "DVDRect.h"
  13. #include "MSDVDAdm.h"
  14. #include "ddrawobj.h"
  15. CComModule _Module;
  16. BEGIN_OBJECT_MAP(ObjectMap)
  17. OBJECT_ENTRY(CLSID_MSWebDVD, CMSWebDVD)
  18. OBJECT_ENTRY(CLSID_DVDRect, CDVDRect)
  19. OBJECT_ENTRY(CLSID_MSDVDAdm, CMSDVDAdm)
  20. OBJECT_ENTRY(CLSID_OverlayCallback, COverlayCallback)
  21. END_OBJECT_MAP()
  22. /////////////////////////////////////////////////////////////////////////////
  23. // DLL Entry Point
  24. extern "C"
  25. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  26. {
  27. if (dwReason == DLL_PROCESS_ATTACH)
  28. {
  29. _Module.Init(ObjectMap, hInstance, &LIBID_MSWEBDVDLib);
  30. DisableThreadLibraryCalls(hInstance);
  31. }
  32. else if (dwReason == DLL_PROCESS_DETACH)
  33. _Module.Term();
  34. return TRUE; // ok
  35. }
  36. /////////////////////////////////////////////////////////////////////////////
  37. // Used to determine whether the DLL can be unloaded by OLE
  38. STDAPI DllCanUnloadNow(void)
  39. {
  40. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  41. }
  42. /////////////////////////////////////////////////////////////////////////////
  43. // Returns a class factory to create an object of the requested type
  44. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  45. {
  46. return _Module.GetClassObject(rclsid, riid, ppv);
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. // DllRegisterServer - Adds entries to the system registry
  50. STDAPI DllRegisterServer(void)
  51. {
  52. // registers object, typelib and all interfaces in typelib
  53. return _Module.RegisterServer(TRUE);
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // DllUnregisterServer - Removes entries from the system registry
  57. STDAPI DllUnregisterServer(void)
  58. {
  59. return _Module.UnregisterServer(TRUE);
  60. }