- Fix registered guids for IPortMidi
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 27 Jan 2009 17:54:46 +0000 (17:54 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 27 Jan 2009 17:54:46 +0000 (17:54 +0000)
- Fix InterfaceGuids array in IPortTopology
- Add a hack to prevent es1371 driver from crashing

svn path=/trunk/; revision=39143

reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
reactos/drivers/wdm/audio/backpln/portcls/port_midi.c
reactos/drivers/wdm/audio/backpln/portcls/port_topology.c

index f1f0780..0bf5314 100644 (file)
@@ -116,7 +116,7 @@ IDmaChannelSlave_fnAllocateBuffer(
     //FIXME
     // retry with different size on failure
 
-    This->Buffer = This->pAdapter->DmaOperations->AllocateCommonBuffer(This->pAdapter, BufferSize, &This->Address, TRUE);
+    This->Buffer = This->pAdapter->DmaOperations->AllocateCommonBuffer(This->pAdapter, BufferSize, &This->Address, FALSE);
     if (!This->Buffer)
     {
         DPRINT1("IDmaChannelSlave_AllocateBuffer fAllocateCommonBuffer failed \n");
@@ -125,7 +125,7 @@ IDmaChannelSlave_fnAllocateBuffer(
 
     This->BufferSize = BufferSize;
     This->AllocatedBufferSize = BufferSize;
-    DPRINT1("IDmaChannelSlave_fnAllocateBuffer Success Buffer %u Address %ull\n", BufferSize, This->Address);
+    DPRINT1("IDmaChannelSlave_fnAllocateBuffer Success Buffer %u Address %x %p\n", BufferSize, This->Address, PhysicalAddressConstraint);
 
     return STATUS_SUCCESS;
 }
@@ -226,10 +226,19 @@ NTAPI
 IDmaChannelSlave_fnPhysicalAdress(
     IN IDmaChannelSlave * iface)
 {
+    PHYSICAL_ADDRESS Address;
     IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+    DPRINT("IDmaChannelSlave_PhysicalAdress: This %p Virtuell %p Physical High %x Low %x%\n", This, This->Buffer, This->Address.HighPart, This->Address.LowPart);
+
+#if 1
 
-    DPRINT("IDmaChannelSlave_PhysicalAdress: This %p\n", This);
-    return This->Address;
+    /// HACK
+    /// Prevent ES1371 driver from crashing by returning the vaddr instead of physical address
+    Address.QuadPart = (ULONG_PTR)This->Buffer;
+#else
+    Address.QuadPart = This->Address.QuadPart;
+#endif
+    return Address;
 }
 
 VOID
index fad286c..2d72ecb 100644 (file)
@@ -18,16 +18,19 @@ typedef struct
     PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor;
 }IPortMidiImpl;
 
-
 static GUID InterfaceGuids[3] = 
 {
-    {
-        /// KS_CATEGORY_TOPOLOGY
-        0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}
-    },
     {
         /// KS_CATEGORY_AUDIO
         0x6994AD04, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
+    },
+    {
+        /// KS_CATEGORY_RENDER
+        0x65E8773E, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
+    },
+    {
+        /// KS_CATEGORY_CAPTURE
+        0x65E8773D, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
     }
 };
 
@@ -65,6 +68,11 @@ IPortMidi_fnQueryInterface(
     {
         return NewPortClsVersion((PPORTCLSVERSION*)Output);
     }
+    else if (IsEqualGUIDAligned(refiid, &IID_IDrmPort) ||
+             IsEqualGUIDAligned(refiid, &IID_IDrmPort2))
+    {
+        return NewIDrmPort((PDRMPORT2*)Output);
+    }
 
     StringFromCLSID(refiid, Buffer);
     DPRINT1("IPortMidi_fnQueryInterface no iface %S\n", Buffer);
@@ -190,7 +198,7 @@ IPortMidi_fnInit(
 
     /* create the subdevice descriptor */
     Status = PcCreateSubdeviceDescriptor(&This->SubDeviceDescriptor, 
-                                         2,
+                                         3,
                                          InterfaceGuids, 
                                          0, 
                                          NULL,
index 1fb9e3b..2741a98 100644 (file)
@@ -18,7 +18,7 @@ typedef struct
 }IPortTopologyImpl;
 
 
-static GUID InterfaceGuids[3] = 
+static GUID InterfaceGuids[2] = 
 {
     {
         /// KS_CATEGORY_TOPOLOGY