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.

109 lines
2.2 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: WiaVideo.cpp
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: OrenR
  10. *
  11. * DATE: 2000/10/25
  12. *
  13. * DESCRIPTION:
  14. *
  15. *****************************************************************************/
  16. #include <precomp.h>
  17. #pragma hdrstop
  18. #include "WiaVideo_i.c"
  19. CComModule _Module;
  20. BEGIN_OBJECT_MAP(ObjectMap)
  21. OBJECT_ENTRY(CLSID_WiaVideo, CWiaVideo)
  22. END_OBJECT_MAP()
  23. ///////////////////////////////
  24. // DllMain
  25. //
  26. extern "C"
  27. BOOL WINAPI DllMain(HINSTANCE hInstance,
  28. DWORD dwReason,
  29. LPVOID lpReserved)
  30. {
  31. lpReserved;
  32. if (dwReason == DLL_PROCESS_ATTACH)
  33. {
  34. _Module.Init(ObjectMap, hInstance, &LIBID_WIAVIDEOLib);
  35. DisableThreadLibraryCalls(hInstance);
  36. DBG_INIT(hInstance);
  37. DBG_FN("DllMain - ProcessAttach");
  38. }
  39. else if (dwReason == DLL_PROCESS_DETACH)
  40. {
  41. DBG_TERM();
  42. _Module.Term();
  43. }
  44. return TRUE; // ok
  45. }
  46. ///////////////////////////////
  47. // DllCanUnloadNow
  48. //
  49. // Used to determine whether the
  50. // DLL can be unloaded by OLE
  51. STDAPI DllCanUnloadNow(void)
  52. {
  53. DBG_FN("DllCanUnloadNow");
  54. DBG_TRC(("DllCanUnloadNow - Lock Count = '%lu'", _Module.GetLockCount()));
  55. return(_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  56. }
  57. ///////////////////////////////
  58. // DllGetClassObject
  59. //
  60. // Returns a class factory to
  61. // create an object of the
  62. // requested type
  63. STDAPI DllGetClassObject(REFCLSID rclsid,
  64. REFIID riid,
  65. LPVOID *ppv)
  66. {
  67. return _Module.GetClassObject(rclsid, riid, ppv);
  68. }
  69. ///////////////////////////////
  70. // DllRegisterServer
  71. //
  72. // Adds entries to the system
  73. // registry
  74. STDAPI DllRegisterServer(void)
  75. {
  76. // registers object, typelib and all interfaces in typelib
  77. return _Module.RegisterServer(TRUE);
  78. }
  79. ///////////////////////////////
  80. // DllUnregisterServer
  81. //
  82. // Removes entries from the
  83. // system registry
  84. STDAPI DllUnregisterServer(void)
  85. {
  86. return _Module.UnregisterServer(TRUE);
  87. }