ReactOS  0.4.13-dev-563-g0561610
version.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/version.cpp
5  * PURPOSE: Implements IPortClsVersion interface
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 CPortClsVersion : public IPortClsVersion
18 {
19 public:
21 
23  {
25  return m_Ref;
26  }
28  {
30 
31  if (!m_Ref)
32  {
33  delete this;
34  return 0;
35  }
36  return m_Ref;
37  }
38 
40 
41  CPortClsVersion(IUnknown *OuterUnknown)
42  {
43  m_Ref = 0;
44  }
45  virtual ~CPortClsVersion()
46  {
47 
48  }
49 
50 protected:
52 
53 };
54 
55 
56 
57 //---------------------------------------------------------------
58 // IPortClsVersion interface functions
59 //
60 
62 NTAPI
64  IN REFIID refiid,
65  OUT PVOID* Output)
66 {
68 
69  if (IsEqualGUIDAligned(refiid, IID_IPortClsVersion) ||
71  {
72  *Output = PVOID(PPORTCLSVERSION(this));
73  PUNKNOWN(*Output)->AddRef();
74  return STATUS_SUCCESS;
75  }
76 
78  {
79  DPRINT1("CPortClsVersion::QueryInterface no interface!!! iface %S\n", GuidString.Buffer);
81  }
82 
83  return STATUS_UNSUCCESSFUL;
84 }
85 
86 DWORD
87 NTAPI
89 {
90  return kVersionWinXP_UAAQFE;
91 }
92 
94  OUT PPORTCLSVERSION * OutVersion)
95 {
97 
98  if (!This)
100 
101  This->AddRef();
102 
103  *OutVersion = (PPORTCLSVERSION)This;
104 
105  return STATUS_SUCCESS;
106 }
static PWSTR GuidString
Definition: apphelp.c:91
#define IN
Definition: typedefs.h:38
#define REFIID
Definition: guiddef.h:113
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ BOOLEAN Release
Definition: classpnp.h:929
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define TAG_PORTCLASS
Definition: private.hpp:24
LONG NTSTATUS
Definition: precomp.h:26
virtual ~CPortClsVersion()
Definition: version.cpp:45
STDMETHODIMP_(ULONG) AddRef()
Definition: version.cpp:22
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
CPortClsVersion(IUnknown *OuterUnknown)
Definition: version.cpp:41
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
#define STDMETHODIMP
Definition: basetyps.h:43
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
NTSTATUS NewPortClsVersion(OUT PPORTCLSVERSION *OutVersion)
Definition: version.cpp:93
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
Definition: version.cpp:63
const GUID IID_IUnknown
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
ULONG AddRef()
STDMETHODIMP_(ULONG) Release()
Definition: version.cpp:27
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
#define InterlockedIncrement
Definition: armddk.h:53
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
#define DPRINT1
Definition: precomp.h:8
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2777
IPortClsVersion * PPORTCLSVERSION
Definition: portcls.h:2209