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.

72 lines
1.9 KiB

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