- Use InterlockedIncrement, InterlockedDecrement over intrinsics

- Fix ordering of IDmaChannelSlaveVtbl which led to an infinite loop
- Add a few guids
- Fix parameter for KeWaitForSingleObject (spotted by Christoph)
- Also check for IID_IPort in IPortTopology 
- Fix priority boost IServiceGroup

svn path=/trunk/; revision=39115
This commit is contained in:
Johannes Anderwald 2009-01-26 17:38:22 +00:00
parent c93503ebd7
commit 1c203e354e
7 changed files with 28 additions and 9 deletions

View file

@ -68,7 +68,7 @@ IDmaChannelSlave_fnAddRef(
DPRINT("IDmaChannelSlave_AddRef: This %p\n", This);
return _InterlockedIncrement(&This->ref);
return InterlockedIncrement(&This->ref);
}
ULONG
@ -78,7 +78,7 @@ IDmaChannelSlave_fnRelease(
{
IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
_InterlockedDecrement(&This->ref);
InterlockedDecrement(&This->ref);
DPRINT("IDmaChannelSlave_Release: This %p new ref %u\n", This, This->ref);
@ -102,7 +102,7 @@ NTAPI
IDmaChannelSlave_fnAllocateBuffer(
IN IDmaChannelSlave * iface,
IN ULONG BufferSize,
IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL)
IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL)
{
IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
@ -125,6 +125,8 @@ IDmaChannelSlave_fnAllocateBuffer(
This->BufferSize = BufferSize;
This->AllocatedBufferSize = BufferSize;
DPRINT1("IDmaChannelSlave_fnAllocateBuffer Success Buffer %u Address %ull\n", BufferSize, This->Address);
return STATUS_SUCCESS;
}
@ -185,7 +187,7 @@ IDmaChannelSlave_fnFreeBuffer(
return;
}
This->pAdapter->DmaOperations->FreeCommonBuffer(This->pAdapter, This->AllocatedBufferSize, This->Address, This->Buffer, TRUE);
This->pAdapter->DmaOperations->FreeCommonBuffer(This->pAdapter, This->AllocatedBufferSize, This->Address, This->Buffer, FALSE);
This->Buffer = NULL;
This->AllocatedBufferSize = 0;
This->Address.QuadPart = 0LL;
@ -458,8 +460,8 @@ IDmaChannelSlaveVtbl vt_IDmaChannelSlaveVtbl =
IDmaChannelSlave_fnSystemAddress,
IDmaChannelSlave_fnPhysicalAdress,
IDmaChannelSlave_fnGetAdapterObject,
IDmaChannelSlave_fnCopyFrom,
IDmaChannelSlave_fnCopyTo,
IDmaChannelSlave_fnCopyFrom,
/* IDmaChannelSlave methods */
IDmaChannelSlave_fnStart,
IDmaChannelSlave_fnStop,

View file

@ -19,6 +19,7 @@ const GUID CLSID_MiniportDriverDMusUARTCapture;
const GUID CLSID_MiniportDriverFmSynth;
const GUID CLSID_MiniportDriverFmSynthWithVol;
const GUID IID_IPort = {0xb4c90a25L, 0x5791, 0x11d0, {0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44}};
const GUID IID_IDrmPort = {0x286D3DF8L, 0xCA22, 0x4E2E, {0xB9, 0xBC, 0x20, 0xB4, 0xF0, 0xE2, 0x01, 0xCE}};
const GUID IID_IDrmPort2 = {0x1ACCE59CL, 0x7311, 0x4B6B, {0x9F, 0xBA, 0xCC, 0x3B, 0xA5, 0x9A, 0xCD, 0xCE}};
const GUID IID_IInterruptSync = {0x22C6AC63L, 0x851B, 0x11D0, {0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE}};
@ -26,7 +27,6 @@ const GUID IID_IPortWavePci = {0xb4c90a50L, 0x5791, 0x11d0, {0x86, 0xf9, 0x00, 0
const GUID IID_IMiniportWavePci = {0xb4c90a52L, 0x5791, 0x11d0, {0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44}};
const GUID IID_IAdapterPowerManagement = {0x793417D0L, 0x35FE, 0x11D1, {0xAD, 0x08, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0xB0}};
const GUID IID_IMiniportWaveCyclic = {0xb4c90a27L, 0x5791, 0x11d0, {0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44}};
const GUID IID_IPortWaveCyclic = {0xb4c90a26L, 0x5791, 0x11d0, {0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44}};
const GUID IID_IResourceList = {0x22C6AC60L, 0x851B, 0x11D0, {0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE}};
@ -41,6 +41,18 @@ const GUID IID_IPortClsVersion = {0x7D89A7BBL, 0x869B, 0x4567, {0x8D, 0xBE, 0x1E
const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46}};
const GUID IID_IPortEvents = {0xA80F29C4L, 0x5498, 0x11D2, {0x95, 0xD9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}};
//FIXME
//
const GUID KS_CATEGORY_AUDIO = {0x6994AD04, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
const GUID KS_CATEGORY_RENDER = {0x65E8773E, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
const GUID KS_CATEGORY_CAPTURE = {0x65E8773D, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
const GUID KS_CATEGORY_TOPOLOGY = {0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}};
const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
///
/// undocumented guids

View file

@ -322,7 +322,7 @@ return STATUS_SUCCESS;
if (Status == STATUS_PENDING)
{
/* not yet, lets wait a bit */
KeWaitForSingleObject(&Event, Executive, FALSE, FALSE, NULL);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = STATUS_SUCCESS;
}
DPRINT1("Returning status %x\n", Status);

View file

@ -70,6 +70,7 @@ IPortTopology_fnQueryInterface(
DPRINT1("IPortTopology_fnQueryInterface\n");
if (IsEqualGUIDAligned(refiid, &IID_IPortTopology) ||
IsEqualGUIDAligned(refiid, &IID_IPort) ||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
{
*Output = &This->lpVtbl;

View file

@ -10,6 +10,7 @@
<library>drmk</library>
<library>rtl</library>
<library>hal</library>
<library>libcntpr</library>
<file>api.c</file>
<file>connection.c</file>
<file>dll.c</file>

View file

@ -17,7 +17,10 @@
#include "interfaces.h"
#include <ks.h>
#include <ksmedia.h>
#include <stdio.h>
#include <math.h>
#include <intrin.h>
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#define TAG_PORTCLASS TAG('P', 'C', 'L', 'S')

View file

@ -177,7 +177,7 @@ IServiceGroupDpc(
{
IServiceGroupImpl * This = (IServiceGroupImpl*)DeferredContext;
IServiceGroup_fnRequestService((IServiceGroup*)DeferredContext);
KeSetEvent(&This->DpcEvent, 0, FALSE);
KeSetEvent(&This->DpcEvent, IO_SOUND_INCREMENT, FALSE);
}
@ -243,7 +243,7 @@ static IServiceGroupVtbl vt_IServiceGroup =
};
/*
* @unimplemented
* @implemented
*/
NTSTATUS NTAPI
PcNewServiceGroup(