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.

107 lines
2.0 KiB

  1. /* - - - - - - - - */
  2. /*
  3. ** Copyright (C) Microsoft Corporation 1993. All rights reserved.
  4. */
  5. /* - - - - - - - - */
  6. #include <win32.h>
  7. #include <shellapi.h>
  8. #include <compobj.h>
  9. #define INITGUID // make DECLARE_GUILD()
  10. #include <initguid.h>
  11. #ifdef WIN32
  12. //
  13. // !!!for some reason we can't link to GUID's in Win32!!!
  14. //
  15. #include <coguid.h>
  16. #endif
  17. #include <avifmt.h>
  18. #include "avifile.h"
  19. #include "avifilei.h"
  20. #include "avicmprs.h"
  21. #include "avifps.h"
  22. #include "editstrm.h"
  23. #include "debug.h"
  24. extern "C" HINSTANCE ghMod;
  25. HINSTANCE ghMod;
  26. /* - - - - - - - - */
  27. EXTERN_C int CALLBACK LibMain(
  28. HINSTANCE hInstance,
  29. UINT uDataSeg,
  30. UINT cbHeapSize,
  31. LPCSTR pszCmdLine)
  32. {
  33. // save our module handle
  34. ghMod = hInstance;
  35. return TRUE;
  36. }
  37. EXTERN_C int CALLBACK WEP(BOOL fSystemExit)
  38. {
  39. return TRUE;
  40. }
  41. /* - - - - - - - - */
  42. STDAPI DllGetClassObject(
  43. const CLSID FAR& rclsid,
  44. const IID FAR& riid,
  45. void FAR* FAR* ppv)
  46. {
  47. HRESULT hresult;
  48. DPF("DllGetClassObject\n");
  49. if (rclsid == CLSID_AVIFile ||
  50. #if 0
  51. rclsid == CLSID_AVISimpleUnMarshal ||
  52. #endif
  53. rclsid == CLSID_AVICmprsStream) {
  54. hresult = CAVIFileCF::Create(rclsid, riid, ppv);
  55. return hresult;
  56. } else if (rclsid == CLSID_AVIStreamPS) {
  57. return (*ppv = (LPVOID)new CPSFactory()) != NULL
  58. ? NOERROR : ResultFromScode(E_OUTOFMEMORY);
  59. } else {
  60. return ResultFromScode(E_UNEXPECTED);
  61. }
  62. }
  63. /* - - - - - - - - */
  64. #ifdef WIN32
  65. EXTERN_C BOOL WINAPI DLLEntryPoint(HINSTANCE hModule, ULONG Reason, LPVOID pv)
  66. {
  67. switch (Reason)
  68. {
  69. case DLL_PROCESS_ATTACH:
  70. LibMain(hModule, 0, 0, NULL);
  71. break;
  72. case DLL_PROCESS_DETACH:
  73. WEP(FALSE);
  74. break;
  75. case DLL_THREAD_DETACH:
  76. break;
  77. case DLL_THREAD_ATTACH:
  78. break;
  79. }
  80. return TRUE;
  81. }
  82. #endif
  83.