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.

62 lines
1.4 KiB

  1. #include "wmsdkidl.h"
  2. #include "wmwrap.h"
  3. // Some wmvcore.dll exports (eg: WMCreateReader) are not callable via LoadLibrary/GetProcAddress,
  4. // so we can't use our regular dllload macros. Instead, we'll wrap these calls in try-except
  5. // blocks.
  6. // These may be removed once the window media player is part of the build, although the linker's
  7. // delayload stubs will still throw exceptions in low memory situations.
  8. HRESULT WMCreateEditorWrap(IWMMetadataEditor** ppEditor)
  9. {
  10. HRESULT hr;
  11. // WMSDK suports only x86
  12. #ifdef _X86_
  13. __try
  14. {
  15. hr = WMCreateEditor(ppEditor);
  16. }
  17. __except(EXCEPTION_EXECUTE_HANDLER)
  18. #endif
  19. {
  20. hr = E_FAIL;
  21. *ppEditor = NULL;
  22. }
  23. return hr;
  24. }
  25. HRESULT WMCreateReaderWrap(IUnknown* pUnkReserved, DWORD dwRights, IWMReader** ppReader)
  26. {
  27. HRESULT hr;
  28. // WMSDK suports only x86
  29. #ifdef _X86_
  30. __try
  31. {
  32. hr = WMCreateReader(pUnkReserved, dwRights, ppReader);
  33. }
  34. __except(EXCEPTION_EXECUTE_HANDLER)
  35. #endif
  36. {
  37. hr = E_FAIL;
  38. *ppReader = NULL;
  39. }
  40. return hr;
  41. }
  42. HRESULT WMCreateCertificateWrap(IUnknown** ppUnkCert)
  43. {
  44. HRESULT hr;
  45. #ifdef _X86_
  46. __try
  47. {
  48. hr = WMCreateCertificate(ppUnkCert);
  49. }
  50. __except(EXCEPTION_EXECUTE_HANDLER)
  51. #endif
  52. {
  53. hr = E_FAIL;
  54. *ppUnkCert = NULL;
  55. }
  56. return hr;
  57. }