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.

72 lines
2.2 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (C) Microsoft Corporation, 1992 - 1997 All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // amkspin.cpp
  13. //
  14. #include <streams.h> // quartz, includes windows
  15. #include <measure.h> // performance measurement (MSR_)
  16. #include <winbase.h>
  17. #include <initguid.h>
  18. #include <olectl.h>
  19. #include <ks.h>
  20. #include <ksmedia.h>
  21. #include <ksproxy.h>
  22. #include "amkspin.h"
  23. STDMETHODIMP
  24. AMKsQueryMediums(
  25. PKSMULTIPLE_ITEM* MediumList,
  26. KSPIN_MEDIUM * MediumSet
  27. )
  28. {
  29. PKSPIN_MEDIUM Medium;
  30. *MediumList = reinterpret_cast<PKSMULTIPLE_ITEM>(CoTaskMemAlloc(sizeof(**MediumList) + sizeof(*Medium)));
  31. if (!*MediumList) {
  32. return E_OUTOFMEMORY;
  33. }
  34. (*MediumList)->Count = 1;
  35. (*MediumList)->Size = sizeof(**MediumList) + sizeof(*Medium);
  36. Medium = reinterpret_cast<PKSPIN_MEDIUM>(*MediumList + 1);
  37. Medium->Set = MediumSet->Set;
  38. Medium->Id = MediumSet->Id;
  39. Medium->Flags = MediumSet->Flags;
  40. // The following special return code notifies the proxy that this pin is
  41. // not available as a kernel mode connection
  42. return S_FALSE;
  43. }
  44. STDMETHODIMP
  45. AMKsQueryInterfaces(
  46. PKSMULTIPLE_ITEM* InterfaceList
  47. )
  48. {
  49. PKSPIN_INTERFACE Interface;
  50. *InterfaceList = reinterpret_cast<PKSMULTIPLE_ITEM>(CoTaskMemAlloc(sizeof(**InterfaceList) + sizeof(*Interface)));
  51. if (!*InterfaceList) {
  52. return E_OUTOFMEMORY;
  53. }
  54. (*InterfaceList)->Count = 1;
  55. (*InterfaceList)->Size = sizeof(**InterfaceList) + sizeof(*Interface);
  56. Interface = reinterpret_cast<PKSPIN_INTERFACE>(*InterfaceList + 1);
  57. Interface->Set = KSINTERFACESETID_Standard;
  58. Interface->Id = KSINTERFACE_STANDARD_STREAMING;
  59. Interface->Flags = 0;
  60. return NOERROR;
  61. }