Author: janderwald
Date: Mon Jan 12 12:40:08 2009
New Revision: 38732
URL:
http://svn.reactos.org/svn/reactos?rev=38732&view=rev
Log:
- fix me (add missing file)
Added:
trunk/reactos/drivers/wdm/audio/backpln/portcls/connection.c (with props)
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/connection.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/connection.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/connection.c [iso-8859-1] Mon Jan 12
12:40:08 2009
@@ -1,0 +1,148 @@
+#include "private.h"
+
+
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlCreateUnicodeString(
+ PUNICODE_STRING DestinationString,
+ PCWSTR SourceString
+);
+
+static
+NTSTATUS
+RegisterConnection(
+ IN OUT PDEVICE_OBJECT DeviceObject,
+ IN PUNKNOWN FromUnknown,
+ IN PUNICODE_STRING FromString,
+ IN ULONG FromPin,
+ IN PUNKNOWN ToUnknown,
+ IN PUNICODE_STRING ToString,
+ IN ULONG ToPin)
+{
+ PHYSICAL_CONNECTION *NewConnection;
+ UNICODE_STRING FromUnicodeString = {0, 0, 0};
+ UNICODE_STRING ToUnicodeString = {0, 0, 0};
+ ISubdevice * FromSubDevice = NULL;
+ ISubdevice * ToSubDevice = NULL;
+ PCExtension* DeviceExt;
+
+ DeviceExt = (PCExtension*)DeviceObject->DeviceExtension;
+
+
+ NTSTATUS Status = STATUS_SUCCESS;
+
+ if (FromUnknown)
+ {
+ Status = FromUnknown->lpVtbl->QueryInterface(FromUnknown,
&IID_ISubdevice, (PVOID*)&FromSubDevice);
+ if (!NT_SUCCESS(Status))
+ return STATUS_INVALID_PARAMETER;
+ }
+ else
+ {
+ if (!RtlCreateUnicodeString(&FromUnicodeString, (PCWSTR)FromString))
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ if (ToUnknown)
+ {
+ Status = ToUnknown->lpVtbl->QueryInterface(ToUnknown, &IID_ISubdevice,
(PVOID*)&ToSubDevice);
+ }
+ else
+ {
+ if (!RtlCreateUnicodeString(&ToUnicodeString, (PCWSTR)ToString))
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ if (!NT_SUCCESS(Status))
+ {
+ goto cleanup;
+ }
+
+ NewConnection = ExAllocatePoolWithTag(NonPagedPool, sizeof(PHYSICAL_CONNECTION),
TAG_PORTCLASS);
+ if (!NewConnection)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ goto cleanup;
+ }
+
+ NewConnection->FromPin = FromPin;
+ NewConnection->FromSubDevice = FromSubDevice;
+ NewConnection->FromUnicodeString = FromUnicodeString.Buffer;
+ NewConnection->ToPin = ToPin;
+ NewConnection->ToSubDevice = ToSubDevice;
+ NewConnection->ToUnicodeString = ToUnicodeString.Buffer;
+
+
+ InsertTailList(&DeviceExt->PhysicalConnectionList,
&NewConnection->Entry);
+ return STATUS_SUCCESS;
+
+cleanup:
+
+ if (FromSubDevice)
+ FromSubDevice->lpVtbl->Release(FromSubDevice);
+
+ if (ToSubDevice)
+ ToSubDevice->lpVtbl->Release(ToSubDevice);
+
+ if (FromUnicodeString.Buffer)
+ RtlFreeUnicodeString(&FromUnicodeString);
+
+ if (ToUnicodeString.Buffer)
+ RtlFreeUnicodeString(&ToUnicodeString);
+
+ return Status;
+}
+
+
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcRegisterPhysicalConnection(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PUNKNOWN FromUnknown,
+ IN ULONG FromPin,
+ IN PUNKNOWN ToUnknown,
+ IN ULONG ToPin)
+{
+ if (!DeviceObject || !FromUnknown || !ToUnknown)
+ return STATUS_INVALID_PARAMETER;
+
+ return RegisterConnection(DeviceObject, FromUnknown, NULL, FromPin, ToUnknown, NULL,
ToPin);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcRegisterPhysicalConnectionFromExternal(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PUNICODE_STRING FromString,
+ IN ULONG FromPin,
+ IN PUNKNOWN ToUnknown,
+ IN ULONG ToPin)
+{
+ if (!DeviceObject || !FromString || !ToUnknown)
+ return STATUS_INVALID_PARAMETER;
+
+ return RegisterConnection(DeviceObject, NULL, FromString, FromPin, ToUnknown, NULL,
ToPin);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcRegisterPhysicalConnectionToExternal(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PUNKNOWN FromUnknown,
+ IN ULONG FromPin,
+ IN PUNICODE_STRING ToString,
+ IN ULONG ToPin)
+{
+ if (!DeviceObject || !FromUnknown || !ToString)
+ return STATUS_INVALID_PARAMETER;
+
+ return RegisterConnection(DeviceObject, FromUnknown, NULL, FromPin, NULL, ToString,
ToPin);
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/connection.c
------------------------------------------------------------------------------
svn:eol-style = native