Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenversion.cpp
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS Kernel Streaming 00004 * FILE: drivers/wdm/audio/backpln/portcls/version.cpp 00005 * PURPOSE: Implements IPortClsVersion interface 00006 * PROGRAMMER: Johannes Anderwald 00007 */ 00008 00009 00010 #include "private.hpp" 00011 00012 00013 class CPortClsVersion : public IPortClsVersion 00014 { 00015 public: 00016 STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); 00017 00018 STDMETHODIMP_(ULONG) AddRef() 00019 { 00020 InterlockedIncrement(&m_Ref); 00021 return m_Ref; 00022 } 00023 STDMETHODIMP_(ULONG) Release() 00024 { 00025 InterlockedDecrement(&m_Ref); 00026 00027 if (!m_Ref) 00028 { 00029 delete this; 00030 return 0; 00031 } 00032 return m_Ref; 00033 } 00034 00035 IMP_IPortClsVersion; 00036 00037 CPortClsVersion(IUnknown *OuterUnknown) 00038 { 00039 m_Ref = 0; 00040 } 00041 virtual ~CPortClsVersion() 00042 { 00043 00044 } 00045 00046 protected: 00047 LONG m_Ref; 00048 00049 }; 00050 00051 00052 00053 //--------------------------------------------------------------- 00054 // IPortClsVersion interface functions 00055 // 00056 00057 NTSTATUS 00058 NTAPI 00059 CPortClsVersion::QueryInterface( 00060 IN REFIID refiid, 00061 OUT PVOID* Output) 00062 { 00063 UNICODE_STRING GuidString; 00064 00065 if (IsEqualGUIDAligned(refiid, IID_IPortClsVersion) || 00066 IsEqualGUIDAligned(refiid, IID_IUnknown)) 00067 { 00068 *Output = PVOID(PPORTCLSVERSION(this)); 00069 PUNKNOWN(*Output)->AddRef(); 00070 return STATUS_SUCCESS; 00071 } 00072 00073 if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS) 00074 { 00075 DPRINT1("CPortClsVersion::QueryInterface no interface!!! iface %S\n", GuidString.Buffer); 00076 RtlFreeUnicodeString(&GuidString); 00077 } 00078 00079 return STATUS_UNSUCCESSFUL; 00080 } 00081 00082 DWORD 00083 NTAPI 00084 CPortClsVersion::GetVersion() 00085 { 00086 return kVersionWinXP_UAAQFE; 00087 } 00088 00089 NTSTATUS NewPortClsVersion( 00090 OUT PPORTCLSVERSION * OutVersion) 00091 { 00092 CPortClsVersion * This = new(NonPagedPool, TAG_PORTCLASS) CPortClsVersion(NULL); 00093 00094 if (!This) 00095 return STATUS_INSUFFICIENT_RESOURCES; 00096 00097 This->AddRef(); 00098 00099 *OutVersion = (PPORTCLSVERSION)This; 00100 00101 return STATUS_SUCCESS; 00102 } Generated on Sat May 26 2012 04:27:12 for ReactOS by
1.7.6.1
|