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.

77 lines
2.0 KiB

  1. //
  2. // Microsoft Windows Media Technologies
  3. // Copyright (C) Microsoft Corporation, 1999 - 2001. All rights reserved.
  4. //
  5. //
  6. // ProgHelp.cpp : Implementation of DLL Exports.
  7. //
  8. #include "progPCH.h"
  9. #include "progRC.h"
  10. #include <initguid.h>
  11. #include "ProgHelp.h"
  12. #include "ProgHelp_i.c"
  13. #include "ProgressHelper.h"
  14. #include "OperationHelper.h"
  15. CComModule _Module;
  16. BEGIN_OBJECT_MAP(ObjectMap)
  17. OBJECT_ENTRY(CLSID_ProgressHelper, CProgressHelper)
  18. OBJECT_ENTRY(CLSID_OperationHelper, COperationHelper)
  19. END_OBJECT_MAP()
  20. /////////////////////////////////////////////////////////////////////////////
  21. // DLL Entry Point
  22. extern "C"
  23. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  24. {
  25. if (dwReason == DLL_PROCESS_ATTACH)
  26. {
  27. _Module.Init(ObjectMap, hInstance, &LIBID_PROGHELPLib);
  28. DisableThreadLibraryCalls(hInstance);
  29. }
  30. else if (dwReason == DLL_PROCESS_DETACH)
  31. _Module.Term();
  32. return TRUE; // ok
  33. }
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Used to determine whether the DLL can be unloaded by OLE
  36. STDAPI DllCanUnloadNow(void)
  37. {
  38. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  39. }
  40. /////////////////////////////////////////////////////////////////////////////
  41. // Returns a class factory to create an object of the requested type
  42. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  43. {
  44. return _Module.GetClassObject(rclsid, riid, ppv);
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // DllRegisterServer - Adds entries to the system registry
  48. STDAPI DllRegisterServer(void)
  49. {
  50. // registers object, typelib and all interfaces in typelib
  51. return _Module.RegisterServer(TRUE);
  52. }
  53. /////////////////////////////////////////////////////////////////////////////
  54. // DllUnregisterServer - Removes entries from the system registry
  55. STDAPI DllUnregisterServer(void)
  56. {
  57. return _Module.UnregisterServer(TRUE);
  58. }