ReactOS  0.4.15-dev-4914-g2220e56
drm_port.cpp
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel Streaming
4  * FILE: drivers/wdm/audio/backpln/portcls/drm_port.cpp
5  * PURPOSE: portcls drm port object
6  * PROGRAMMER: Johannes Anderwald
7  */
8 
9 #include "private.hpp"
10 
11 #ifndef YDEBUG
12 #define NDEBUG
13 #endif
14 
15 #include <debug.h>
16 
17 class CDrmPort2 : public CUnknownImpl<IDrmPort2>
18 {
19 public:
21 
23  CDrmPort2(IUnknown *OuterUnknown){}
24  virtual ~CDrmPort2(){}
25 };
26 
28 NTAPI
30  IN REFIID refiid,
31  OUT PVOID* Output)
32 {
34 
35  if (IsEqualGUIDAligned(refiid, IID_IDrmPort) ||
36  IsEqualGUIDAligned(refiid, IID_IDrmPort2) ||
38  {
39  *Output = PVOID(PUNKNOWN(this));
40  PUNKNOWN(*Output)->AddRef();
41  return STATUS_SUCCESS;
42  }
43 
45  {
46  DPRINT("IDrmPort2_QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
48  }
49  return STATUS_UNSUCCESSFUL;
50 }
51 
53 NTAPI
54 CDrmPort2::CreateContentMixed(
55  IN PULONG paContentId,
58 {
60  return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
61 }
62 
64 NTAPI
65 CDrmPort2::DestroyContent(
66  IN ULONG ContentId)
67 {
69  return DrmDestroyContent(ContentId);
70 }
71 
73 NTAPI
74 CDrmPort2::ForwardContentToFileObject(
75  IN ULONG ContentId,
77 {
78  return DrmForwardContentToFileObject(ContentId, FileObject);
79 }
80 
82 NTAPI
83 CDrmPort2::ForwardContentToInterface(
84  IN ULONG ContentId,
87 {
90 }
91 
93 NTAPI
94 CDrmPort2::GetContentRights(
95  IN ULONG ContentId,
97 {
99  return DrmGetContentRights(ContentId, DrmRights);
100 }
101 
102 NTSTATUS
103 NTAPI
104 CDrmPort2::AddContentHandlers(
105  IN ULONG ContentId,
106  IN PVOID * paHandlers,
108 {
110  return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
111 }
112 
113 NTSTATUS
114 NTAPI
115 CDrmPort2::ForwardContentToDeviceObject(
116  IN ULONG ContentId,
117  IN PVOID Reserved,
118  IN PCDRMFORWARD DrmForward)
119 {
121  return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
122 }
123 
124 NTSTATUS
126  OUT PDRMPORT2 *OutPort)
127 {
129  if (!This)
131 
132  This->AddRef();
133 
134  *OutPort = (PDRMPORT2)This;
135  return STATUS_SUCCESS;
136 }
137 
138 
static PWSTR GuidString
Definition: apphelp.c:93
#define IN
Definition: typedefs.h:39
Definition: drmk.h:18
CDrmPort2(IUnknown *OuterUnknown)
Definition: drm_port.cpp:23
#define REFIID
Definition: guiddef.h:118
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSTATUS NTAPI DrmGetContentRights(IN ULONG ContentId, OUT PDRMRIGHTS DrmRights)
Definition: stubs.cpp:133
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define TAG_PORTCLASS
Definition: private.hpp:24
NTSTATUS NTAPI DrmDestroyContent(IN ULONG ContentId)
Definition: stubs.cpp:64
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI DrmForwardContentToFileObject(IN ULONG ContentId, IN PFILE_OBJECT FileObject)
Definition: stubs.cpp:99
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS NTAPI DrmForwardContentToInterface(IN ULONG ContentId, IN PUNKNOWN pUnknown, IN ULONG NumMethods)
Definition: stubs.cpp:116
NTSTATUS NTAPI DrmForwardContentToDeviceObject(IN ULONG ContentId, IN PVOID Reserved, IN PCDRMFORWARD DrmForward)
Definition: stubs.cpp:80
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: drm_port.cpp:29
#define STDMETHODIMP
Definition: basetyps.h:43
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
void * PVOID
Definition: retypes.h:9
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
IDrmPort2 * PDRMPORT2
Definition: portcls.h:2226
const GUID IID_IUnknown
NTSTATUS NTAPI DrmAddContentHandlers(IN ULONG ContentId, IN PVOID *paHandlers, IN ULONG NumHandlers)
Definition: stubs.cpp:29
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define PC_ASSERT_IRQL_EQUAL(x)
Definition: private.hpp:31
* PFILE_OBJECT
Definition: iotypes.h:1998
ULONG AddRef()
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Definition: arc.h:85
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
virtual ~CDrmPort2()
Definition: drm_port.cpp:24
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
_In_ ULONG cContentId
Definition: drmk.h:48
NTSTATUS NTAPI DrmCreateContentMixed(IN PULONG paContentId, IN ULONG cContentId, OUT PULONG pMixedContentId)
Definition: stubs.cpp:47
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
_In_ ULONG _Out_ PULONG pMixedContentId
Definition: drmk.h:48
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
_Out_ PDRMRIGHTS DrmRights
Definition: drmk.h:84
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
NTSTATUS NewIDrmPort(OUT PDRMPORT2 *OutPort)
Definition: drm_port.cpp:125
_In_ ULONG NumHandlers
Definition: drmk.h:41