Author: janderwald
Date: Wed Dec 17 10:01:32 2008
New Revision: 38156
URL:
http://svn.reactos.org/svn/reactos?rev=38156&view=rev
Log:
- Handle PcNewRegistryKey for DeviceRegistryKey, DriverRegistryKey, HwProfileRegistryKey
- Implement IPortClsVersion interface
Added:
trunk/reactos/drivers/wdm/audio/backpln/portcls/version.c (with props)
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild [iso-8859-1] Wed Dec 17
10:01:32 2008
@@ -33,5 +33,6 @@
<file>miniport.c</file>
<file>miniport_dmus.c</file>
<file>miniport_fmsynth.c</file>
+ <file>version.c</file>
<file>portcls.rc</file>
</module>
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c [iso-8859-1] Wed Dec 17
10:01:32 2008
@@ -253,6 +253,22 @@
Status = ZwOpenKey(&hHandle, DesiredAccess, ObjectAttributes);
}
+ else if (RegistryKeyType == DeviceRegistryKey ||
+ RegistryKeyType == DriverRegistryKey ||
+ RegistryKeyType == HwProfileRegistryKey)
+ {
+ if (RegistryKeyType == HwProfileRegistryKey)
+ {
+ /* IoOpenDeviceRegistryKey used different constant */
+ RegistryKeyType = PLUGPLAY_REGKEY_CURRENT_HWPROFILE;
+ }
+
+ Status = IoOpenDeviceRegistryKey(DeviceObject, RegistryKeyType, DesiredAccess,
&hHandle);
+ }
+ else if (RegistryKeyType == DeviceInterfaceRegistryKey)
+ {
+ /* FIXME */
+ }
if (!NT_SUCCESS(Status))
{
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/version.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/version.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/version.c [iso-8859-1] Wed Dec 17
10:01:32 2008
@@ -1,0 +1,96 @@
+#include "private.h"
+
+
+typedef struct CResourceList
+{
+ IPortClsVersionVtbl *lpVtbl;
+ LONG ref;
+}IPortClsVersionImpl;
+
+const GUID IID_IPortClsVersion;
+
+//---------------------------------------------------------------
+// IPortClsVersion interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortClsVersion_fnQueryInterface(
+ IPortClsVersion * iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IPortClsVersionImpl * This = (IPortClsVersionImpl*)iface;
+
+ if (IsEqualGUIDAligned(refiid, &IID_IPortClsVersion) ||
+ IsEqualGUIDAligned(refiid, &IID_IUnknown))
+ {
+ *Output = &This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IPortClsVersion_fnAddRef(
+ IPortClsVersion * iface)
+{
+ IPortClsVersionImpl * This = (IPortClsVersionImpl*)iface;
+
+ return InterlockedIncrement(&This->ref);
+}
+
+ULONG
+NTAPI
+IPortClsVersion_fnRelease(
+ IPortClsVersion * iface)
+{
+ IPortClsVersionImpl * This = (IPortClsVersionImpl*)iface;
+
+ InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+DWORD
+NTAPI
+IPortClsVersion_fnGetVersion(
+ IPortClsVersion * iface)
+{
+ return kVersionWinXP_UAAQFE;
+}
+
+static IPortClsVersionVtbl vt_PortClsVersion =
+{
+ /* IUnknown methods */
+ IPortClsVersion_fnQueryInterface,
+ IPortClsVersion_fnAddRef,
+ IPortClsVersion_fnRelease,
+ IPortClsVersion_fnGetVersion
+};
+
+NTSTATUS NewPortClsVersion(
+ OUT PPORTCLSVERSION * OutVersion)
+{
+ IPortClsVersionImpl * This = ExAllocatePoolWithTag(NonPagedPool,
sizeof(IPortClsVersionImpl), TAG_PORTCLASS);
+
+ if (!This)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ This->lpVtbl = &vt_PortClsVersion;
+ This->ref = 1;
+ *OutVersion = (PPORTCLSVERSION)&This->lpVtbl;
+
+ return STATUS_SUCCESS;
+
+}
+
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/version.c
------------------------------------------------------------------------------
svn:eol-style = native