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.

113 lines
2.5 KiB

  1. /* - - - - - - - - */
  2. /*
  3. ** Copyright (C) Microsoft Corporation 1993 - 1995. All rights reserved.
  4. */
  5. /* - - - - - - - - */
  6. #define INITGUID
  7. #include <win32.h>
  8. #include <vfw.h>
  9. #include "avifilei.h"
  10. #include "avicmprs.h"
  11. #include "avifps.h"
  12. #include "editstrm.h"
  13. #include "wavefile.h"
  14. #include "debug.h"
  15. #ifndef _WIN32
  16. DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0);
  17. DEFINE_OLEGUID(IID_IClassFactory, 0x00000001L, 0, 0);
  18. DEFINE_OLEGUID(IID_IMalloc, 0x00000002L, 0, 0);
  19. DEFINE_OLEGUID(IID_IMarshal, 0x00000003L, 0, 0);
  20. #endif
  21. extern "C" HINSTANCE ghMod;
  22. HINSTANCE ghMod;
  23. /* - - - - - - - - */
  24. EXTERN_C int CALLBACK LibMain(
  25. HINSTANCE hInstance,
  26. UINT uDataSeg,
  27. UINT cbHeapSize,
  28. LPCTSTR pszCmdLine)
  29. {
  30. // save our module handle
  31. ghMod = hInstance;
  32. return TRUE;
  33. }
  34. EXTERN_C int CALLBACK WEP(BOOL fSystemExit)
  35. {
  36. return TRUE;
  37. }
  38. /* - - - - - - - - */
  39. STDAPI DllGetClassObject(
  40. const CLSID FAR& rclsid,
  41. const IID FAR& riid,
  42. void FAR* FAR* ppv)
  43. {
  44. HRESULT hresult;
  45. DPF("DllGetClassObject\n");
  46. *ppv = NULL;
  47. if (rclsid == CLSID_AVIFile ||
  48. rclsid == CLSID_ACMCmprs ||
  49. #ifdef CHICAGO
  50. rclsid == CLSID_AVISimpleUnMarshal ||
  51. #endif
  52. rclsid == CLSID_AVIWaveFileReader ||
  53. rclsid == CLSID_AVICmprsStream) {
  54. hresult = CAVIFileCF::Create(rclsid, riid, ppv);
  55. return hresult;
  56. } else if (rclsid == CLSID_AVIStreamPS) {
  57. CPSFactory *cps = new CPSFactory();
  58. if (cps) {
  59. hresult = cps->QueryInterface(riid, ppv);
  60. cps->Release();
  61. } else {
  62. hresult = E_OUTOFMEMORY;
  63. }
  64. return hresult;
  65. } else {
  66. return ResultFromScode(E_UNEXPECTED);
  67. }
  68. }
  69. /* - - - - - - - - */
  70. #ifdef _WIN32
  71. EXTERN_C BOOL WINAPI DLLEntryPoint(HINSTANCE hModule, ULONG Reason, LPVOID pv)
  72. {
  73. switch (Reason)
  74. {
  75. case DLL_PROCESS_ATTACH:
  76. LibMain(hModule, 0, 0, NULL);
  77. DisableThreadLibraryCalls(hModule);
  78. break;
  79. case DLL_PROCESS_DETACH:
  80. WEP(FALSE);
  81. break;
  82. //case DLL_THREAD_DETACH:
  83. // break;
  84. //case DLL_THREAD_ATTACH:
  85. // break;
  86. }
  87. return TRUE;
  88. }
  89. #endif