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 #define NDEBUG 12 #include <debug.h> 13 14 class CPortClsVersion : public CUnknownImpl<IPortClsVersion> 15 { 16 public: 17 STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); 18 19 IMP_IPortClsVersion; 20 CPortClsVersion(IUnknown * OuterUnknown)21 CPortClsVersion(IUnknown *OuterUnknown) 22 { 23 } ~CPortClsVersion()24 virtual ~CPortClsVersion() 25 { 26 27 } 28 }; 29 30 //--------------------------------------------------------------- 31 // IPortClsVersion interface functions 32 // 33 34 NTSTATUS 35 NTAPI QueryInterface(IN REFIID refiid,OUT PVOID * Output)36CPortClsVersion::QueryInterface( 37 IN REFIID refiid, 38 OUT PVOID* Output) 39 { 40 UNICODE_STRING GuidString; 41 42 if (IsEqualGUIDAligned(refiid, IID_IPortClsVersion) || 43 IsEqualGUIDAligned(refiid, IID_IUnknown)) 44 { 45 *Output = PVOID(PPORTCLSVERSION(this)); 46 PUNKNOWN(*Output)->AddRef(); 47 return STATUS_SUCCESS; 48 } 49 50 if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS) 51 { 52 DPRINT1("CPortClsVersion::QueryInterface no interface!!! iface %S\n", GuidString.Buffer); 53 RtlFreeUnicodeString(&GuidString); 54 } 55 56 return STATUS_UNSUCCESSFUL; 57 } 58 59 DWORD 60 NTAPI GetVersion()61CPortClsVersion::GetVersion() 62 { 63 return kVersionWinXP_UAAQFE; 64 } 65 NewPortClsVersion(OUT PPORTCLSVERSION * OutVersion)66NTSTATUS NewPortClsVersion( 67 OUT PPORTCLSVERSION * OutVersion) 68 { 69 CPortClsVersion * This = new(NonPagedPool, TAG_PORTCLASS) CPortClsVersion(NULL); 70 71 if (!This) 72 return STATUS_INSUFFICIENT_RESOURCES; 73 74 This->AddRef(); 75 76 *OutVersion = (PPORTCLSVERSION)This; 77 78 return STATUS_SUCCESS; 79 } 80