mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
- Add tons of ASSERT_IRQL / ASSERT_IRQL_EQUAL
- Queue a dpc when IServiceGroup::RequestService is called above dispatch level - As a result writing to common buffer and completing irps can be done at the same time - Start the stream at PASSIVE_LEVEL - Check if key has been deleted in IRegistryKey object function - Implement IRegistryKey::QueryRegistryValues svn path=/trunk/; revision=40672
This commit is contained in:
parent
61eca830d1
commit
0f406bf6b8
23 changed files with 261 additions and 118 deletions
|
@ -46,6 +46,7 @@ PcInitializeAdapterDriver(
|
||||||
//ULONG i;
|
//ULONG i;
|
||||||
|
|
||||||
DPRINT1("PcInitializeAdapterDriver\n");
|
DPRINT1("PcInitializeAdapterDriver\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
/* Our IRP handlers */
|
/* Our IRP handlers */
|
||||||
DPRINT1("Setting IRP handlers\n");
|
DPRINT1("Setting IRP handlers\n");
|
||||||
|
@ -94,6 +95,7 @@ PcAddAdapterDevice(
|
||||||
PPCLASS_DEVICE_EXTENSION portcls_ext = NULL;
|
PPCLASS_DEVICE_EXTENSION portcls_ext = NULL;
|
||||||
|
|
||||||
DPRINT1("PcAddAdapterDevice called\n");
|
DPRINT1("PcAddAdapterDevice called\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DriverObject || !PhysicalDeviceObject || !StartDevice)
|
if (!DriverObject || !PhysicalDeviceObject || !StartDevice)
|
||||||
{
|
{
|
||||||
|
@ -223,6 +225,7 @@ PcRegisterSubdevice(
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
|
|
||||||
DPRINT1("PcRegisterSubdevice DeviceObject %p Name %S Unknown %p\n", DeviceObject, Name, Unknown);
|
DPRINT1("PcRegisterSubdevice DeviceObject %p Name %S Unknown %p\n", DeviceObject, Name, Unknown);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
/* check if all parameters are valid */
|
/* check if all parameters are valid */
|
||||||
if (!DeviceObject || !Name || !Unknown)
|
if (!DeviceObject || !Name || !Unknown)
|
||||||
|
|
|
@ -20,6 +20,7 @@ PcGetDeviceProperty(
|
||||||
OUT PVOID PropertyBuffer,
|
OUT PVOID PropertyBuffer,
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return IoGetDeviceProperty(DeviceObject, DeviceProperty, BufferLength, PropertyBuffer, ResultLength);
|
return IoGetDeviceProperty(DeviceObject, DeviceProperty, BufferLength, PropertyBuffer, ResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ PcRegisterIoTimeout(
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
/* FIXME
|
/* FIXME
|
||||||
* check if timer is already used
|
* check if timer is already used
|
||||||
|
@ -74,6 +76,8 @@ PcUnregisterIoTimeout(
|
||||||
IN PIO_TIMER_ROUTINE pTimerRoutine,
|
IN PIO_TIMER_ROUTINE pTimerRoutine,
|
||||||
IN PVOID pContext)
|
IN PVOID pContext)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
/* FIXME
|
/* FIXME
|
||||||
* check if timer is already used
|
* check if timer is already used
|
||||||
*/
|
*/
|
||||||
|
@ -93,6 +97,7 @@ PcCompletePendingPropertyRequest(
|
||||||
IN NTSTATUS NtStatus)
|
IN NTSTATUS NtStatus)
|
||||||
{
|
{
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
if (!PropertyRequest)
|
if (!PropertyRequest)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
|
@ -114,8 +114,8 @@ PcRegisterPhysicalConnection(
|
||||||
IN PUNKNOWN ToUnknown,
|
IN PUNKNOWN ToUnknown,
|
||||||
IN ULONG ToPin)
|
IN ULONG ToPin)
|
||||||
{
|
{
|
||||||
|
|
||||||
DPRINT("PcRegisterPhysicalConnection\n");
|
DPRINT("PcRegisterPhysicalConnection\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DeviceObject || !FromUnknown || !ToUnknown)
|
if (!DeviceObject || !FromUnknown || !ToUnknown)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
@ -134,6 +134,8 @@ PcRegisterPhysicalConnectionFromExternal(
|
||||||
IN PUNKNOWN ToUnknown,
|
IN PUNKNOWN ToUnknown,
|
||||||
IN ULONG ToPin)
|
IN ULONG ToPin)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DeviceObject || !FromString || !ToUnknown)
|
if (!DeviceObject || !FromString || !ToUnknown)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
@ -151,6 +153,8 @@ PcRegisterPhysicalConnectionToExternal(
|
||||||
IN PUNICODE_STRING ToString,
|
IN PUNICODE_STRING ToString,
|
||||||
IN ULONG ToPin)
|
IN ULONG ToPin)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DeviceObject || !FromUnknown || !ToString)
|
if (!DeviceObject || !FromUnknown || !ToString)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ PcAddContentHandlers(
|
||||||
IN PVOID *paHandlers,
|
IN PVOID *paHandlers,
|
||||||
IN ULONG NumHandlers)
|
IN ULONG NumHandlers)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
|
return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ PcCreateContentMixed(
|
||||||
IN ULONG cContentId,
|
IN ULONG cContentId,
|
||||||
OUT PULONG pMixedContentId)
|
OUT PULONG pMixedContentId)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
|
return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +44,7 @@ NTAPI
|
||||||
PcDestroyContent(
|
PcDestroyContent(
|
||||||
IN ULONG ContentId)
|
IN ULONG ContentId)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmDestroyContent(ContentId);
|
return DrmDestroyContent(ContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +58,7 @@ PcForwardContentToDeviceObject(
|
||||||
IN PVOID Reserved,
|
IN PVOID Reserved,
|
||||||
IN PCDRMFORWARD DrmForward)
|
IN PCDRMFORWARD DrmForward)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
|
return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +71,7 @@ PcForwardContentToFileObject(
|
||||||
IN ULONG ContentId,
|
IN ULONG ContentId,
|
||||||
IN PFILE_OBJECT FileObject)
|
IN PFILE_OBJECT FileObject)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmForwardContentToFileObject(ContentId, FileObject);
|
return DrmForwardContentToFileObject(ContentId, FileObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,5 +97,6 @@ PcGetContentRights(
|
||||||
IN ULONG ContentId,
|
IN ULONG ContentId,
|
||||||
OUT PDRMRIGHTS DrmRights)
|
OUT PDRMRIGHTS DrmRights)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmGetContentRights(ContentId, DrmRights);
|
return DrmGetContentRights(ContentId, DrmRights);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,7 @@ IDrmPort2_fnCreateContentMixed(
|
||||||
IN ULONG cContentId,
|
IN ULONG cContentId,
|
||||||
OUT PULONG pMixedContentId)
|
OUT PULONG pMixedContentId)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
|
return DrmCreateContentMixed(paContentId, cContentId, pMixedContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +89,7 @@ IDrmPort2_fnDestroyContent(
|
||||||
IN IDrmPort2 * iface,
|
IN IDrmPort2 * iface,
|
||||||
IN ULONG ContentId)
|
IN ULONG ContentId)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmDestroyContent(ContentId);
|
return DrmDestroyContent(ContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +111,7 @@ IDrmPort2_fnForwardContentToInterface(
|
||||||
IN PUNKNOWN pUnknown,
|
IN PUNKNOWN pUnknown,
|
||||||
IN ULONG NumMethods)
|
IN ULONG NumMethods)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmForwardContentToInterface(ContentId, pUnknown, NumMethods);
|
return DrmForwardContentToInterface(ContentId, pUnknown, NumMethods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +122,7 @@ IDrmPort2_fnGetContentRights(
|
||||||
IN ULONG ContentId,
|
IN ULONG ContentId,
|
||||||
OUT PDRMRIGHTS DrmRights)
|
OUT PDRMRIGHTS DrmRights)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmGetContentRights(ContentId, DrmRights);
|
return DrmGetContentRights(ContentId, DrmRights);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +134,7 @@ IDrmPort2_fnAddContentHandlers(
|
||||||
IN PVOID * paHandlers,
|
IN PVOID * paHandlers,
|
||||||
IN ULONG NumHandlers)
|
IN ULONG NumHandlers)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
|
return DrmAddContentHandlers(ContentId, paHandlers, NumHandlers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +146,7 @@ IDrmPort2_fnForwardContentToDeviceObject(
|
||||||
IN PVOID Reserved,
|
IN PVOID Reserved,
|
||||||
IN PCDRMFORWARD DrmForward)
|
IN PCDRMFORWARD DrmForward)
|
||||||
{
|
{
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
|
return DrmForwardContentToDeviceObject(ContentId, Reserved, DrmForward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,7 @@ IInterruptSync_fnConnect(
|
||||||
PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor;
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor;
|
||||||
|
|
||||||
DPRINT("IInterruptSync_fnConnect\n");
|
DPRINT("IInterruptSync_fnConnect\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
Descriptor = This->ResourceList->lpVtbl->FindTranslatedEntry(This->ResourceList, CmResourceTypeInterrupt, This->ResourceIndex);
|
Descriptor = This->ResourceList->lpVtbl->FindTranslatedEntry(This->ResourceList, CmResourceTypeInterrupt, This->ResourceIndex);
|
||||||
if (!Descriptor)
|
if (!Descriptor)
|
||||||
|
@ -273,7 +274,9 @@ IInterruptSync_fnDisconnect(
|
||||||
IN IInterruptSync * iface)
|
IN IInterruptSync * iface)
|
||||||
{
|
{
|
||||||
IInterruptSyncImpl * This = (IInterruptSyncImpl*)iface;
|
IInterruptSyncImpl * This = (IInterruptSyncImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IInterruptSync_fnDisconnect\n");
|
DPRINT("IInterruptSync_fnDisconnect\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->Interrupt)
|
if (!This->Interrupt)
|
||||||
{
|
{
|
||||||
|
@ -297,6 +300,7 @@ IInterruptSync_fnRegisterServiceRoutine(
|
||||||
IInterruptSyncImpl * This = (IInterruptSyncImpl*)iface;
|
IInterruptSyncImpl * This = (IInterruptSyncImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IInterruptSync_fnRegisterServiceRoutine\n");
|
DPRINT("IInterruptSync_fnRegisterServiceRoutine\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
NewEntry = AllocateItem(NonPagedPool, sizeof(SYNC_ENTRY), TAG_PORTCLASS);
|
NewEntry = AllocateItem(NonPagedPool, sizeof(SYNC_ENTRY), TAG_PORTCLASS);
|
||||||
if (!NewEntry)
|
if (!NewEntry)
|
||||||
|
|
|
@ -291,6 +291,8 @@ PcForwardIrpSynchronous(
|
||||||
PPCLASS_DEVICE_EXTENSION DeviceExt;
|
PPCLASS_DEVICE_EXTENSION DeviceExt;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
DeviceExt = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExt = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
/* initialize the notification event */
|
/* initialize the notification event */
|
||||||
|
|
|
@ -13,7 +13,6 @@ typedef struct _IRP_MAPPING_
|
||||||
LIST_ENTRY Entry;
|
LIST_ENTRY Entry;
|
||||||
KSSTREAM_HEADER *Header;
|
KSSTREAM_HEADER *Header;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
KDPC Dpc;
|
|
||||||
|
|
||||||
ULONG NumTags;
|
ULONG NumTags;
|
||||||
PVOID * Tag;
|
PVOID * Tag;
|
||||||
|
@ -48,15 +47,9 @@ typedef struct
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
DpcRoutine(
|
FreeMappingRoutine(
|
||||||
IN struct _KDPC *Dpc,
|
PIRP_MAPPING CurMapping)
|
||||||
IN PVOID DeferredContext,
|
|
||||||
IN PVOID SystemArgument1,
|
|
||||||
IN PVOID SystemArgument2)
|
|
||||||
{
|
{
|
||||||
PIRP_MAPPING CurMapping;
|
|
||||||
|
|
||||||
CurMapping = (PIRP_MAPPING)SystemArgument1;
|
|
||||||
ASSERT(CurMapping);
|
ASSERT(CurMapping);
|
||||||
|
|
||||||
if (CurMapping->Irp)
|
if (CurMapping->Irp)
|
||||||
|
@ -159,8 +152,6 @@ IIrpQueue_fnAddMapping(
|
||||||
|
|
||||||
Mapping->Header = (KSSTREAM_HEADER*)Buffer;
|
Mapping->Header = (KSSTREAM_HEADER*)Buffer;
|
||||||
Mapping->Irp = Irp;
|
Mapping->Irp = Irp;
|
||||||
KeInitializeDpc(&Mapping->Dpc, DpcRoutine, (PVOID)Mapping);
|
|
||||||
KeSetImportanceDpc(&Mapping->Dpc, HighImportance);
|
|
||||||
|
|
||||||
if (This->MaxFrameSize)
|
if (This->MaxFrameSize)
|
||||||
{
|
{
|
||||||
|
@ -215,7 +206,7 @@ IIrpQueue_fnUpdateMapping(
|
||||||
IN ULONG BytesWritten)
|
IN ULONG BytesWritten)
|
||||||
{
|
{
|
||||||
IIrpQueueImpl * This = (IIrpQueueImpl*)iface;
|
IIrpQueueImpl * This = (IIrpQueueImpl*)iface;
|
||||||
PIRP_MAPPING Mapping;
|
PIRP_MAPPING Mapping, CurMapping;
|
||||||
|
|
||||||
This->CurrentOffset += BytesWritten;
|
This->CurrentOffset += BytesWritten;
|
||||||
This->NumDataAvailable -= BytesWritten;
|
This->NumDataAvailable -= BytesWritten;
|
||||||
|
@ -224,11 +215,12 @@ IIrpQueue_fnUpdateMapping(
|
||||||
{
|
{
|
||||||
This->CurrentOffset = 0;
|
This->CurrentOffset = 0;
|
||||||
Mapping = (PIRP_MAPPING)ExInterlockedRemoveHeadList(&This->ListHead, &This->Lock);
|
Mapping = (PIRP_MAPPING)ExInterlockedRemoveHeadList(&This->ListHead, &This->Lock);
|
||||||
|
CurMapping = This->FirstMap;
|
||||||
|
|
||||||
|
(void)InterlockedExchangePointer((PVOID volatile*)&This->FirstMap, (PVOID)Mapping);
|
||||||
InterlockedDecrement(&This->NumMappings);
|
InterlockedDecrement(&This->NumMappings);
|
||||||
|
|
||||||
KeInsertQueueDpc(&This->FirstMap->Dpc, (PVOID)This->FirstMap, NULL);
|
FreeMappingRoutine(CurMapping);
|
||||||
(void)InterlockedExchangePointer((PVOID volatile*)&This->FirstMap, (PVOID)Mapping);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -279,6 +271,9 @@ NTAPI
|
||||||
IIrpQueue_fnCancelBuffers(
|
IIrpQueue_fnCancelBuffers(
|
||||||
IN IIrpQueue *iface)
|
IN IIrpQueue *iface)
|
||||||
{
|
{
|
||||||
|
IIrpQueueImpl * This = (IIrpQueueImpl*)iface;
|
||||||
|
|
||||||
|
This->StartStream = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ PcNewMiniport(
|
||||||
NTSTATUS Status = STATUS_INVALID_PARAMETER;
|
NTSTATUS Status = STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
DPRINT("PcNewMiniport entered\n");
|
DPRINT("PcNewMiniport entered\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!OutMiniport)
|
if (!OutMiniport)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ typedef struct
|
||||||
/* IUnknown methods */
|
/* IUnknown methods */
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IMiniportDMus_fnQueryInterface(
|
IMiniportDMus_fnQueryInterface(
|
||||||
IMiniportDMus* iface,
|
IMiniportDMus* iface,
|
||||||
IN REFIID refiid,
|
IN REFIID refiid,
|
||||||
|
@ -39,7 +39,7 @@ IMiniportDMus_fnQueryInterface(
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IMiniportDMus_fnAddRef(
|
IMiniportDMus_fnAddRef(
|
||||||
IMiniportDMus* iface)
|
IMiniportDMus* iface)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ IMiniportDMus_fnAddRef(
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IMiniportDMust_fnRelease(
|
IMiniportDMust_fnRelease(
|
||||||
IMiniportDMus* iface)
|
IMiniportDMus* iface)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,6 @@ typedef struct
|
||||||
KSSTATE State;
|
KSSTATE State;
|
||||||
PKSDATAFORMAT Format;
|
PKSDATAFORMAT Format;
|
||||||
KSPIN_CONNECT * ConnectDetails;
|
KSPIN_CONNECT * ConnectDetails;
|
||||||
KDPC Dpc;
|
|
||||||
|
|
||||||
PVOID CommonBuffer;
|
PVOID CommonBuffer;
|
||||||
ULONG CommonBufferSize;
|
ULONG CommonBufferSize;
|
||||||
|
@ -35,12 +34,19 @@ typedef struct
|
||||||
PUCHAR ActiveIrpBuffer;
|
PUCHAR ActiveIrpBuffer;
|
||||||
ULONG ActiveIrpBufferSize;
|
ULONG ActiveIrpBufferSize;
|
||||||
ULONG ActiveIrpOffset;
|
ULONG ActiveIrpOffset;
|
||||||
ULONG DelayedRequestInProgress;
|
|
||||||
ULONG FrameSize;
|
ULONG FrameSize;
|
||||||
BOOL Capture;
|
BOOL Capture;
|
||||||
|
|
||||||
}IPortPinWaveCyclicImpl;
|
}IPortPinWaveCyclicImpl;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
IPortPinWaveCyclicImpl *Pin;
|
||||||
|
PIO_WORKITEM WorkItem;
|
||||||
|
KSSTATE State;
|
||||||
|
}SETSTREAM_CONTEXT, *PSETSTREAM_CONTEXT;
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
IPortWaveCyclic_fnProcessNewIrp(
|
IPortWaveCyclic_fnProcessNewIrp(
|
||||||
|
@ -194,57 +200,64 @@ UpdateCommonBufferOverlap(
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
StopStreamWorkerRoutine(
|
SetStreamWorkerRoutine(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PVOID Context)
|
IN PVOID Context)
|
||||||
{
|
{
|
||||||
IPortPinWaveCyclicImpl * This;
|
IPortPinWaveCyclicImpl * This;
|
||||||
PSTOPSTREAM_CONTEXT Ctx = (PSTOPSTREAM_CONTEXT)Context;
|
PSETSTREAM_CONTEXT Ctx = (PSETSTREAM_CONTEXT)Context;
|
||||||
|
KSSTATE State;
|
||||||
|
|
||||||
This = (IPortPinWaveCyclicImpl*)Ctx->Pin;
|
This = Ctx->Pin;
|
||||||
|
State = Ctx->State;
|
||||||
|
|
||||||
IoFreeWorkItem(Ctx->WorkItem);
|
IoFreeWorkItem(Ctx->WorkItem);
|
||||||
FreeItem(Ctx, TAG_PORTCLASS);
|
FreeItem(Ctx, TAG_PORTCLASS);
|
||||||
|
|
||||||
if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue))
|
/* Has the audio stream resumed? */
|
||||||
|
if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue) && State == KSSTATE_STOP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Set the state to stop */
|
/* Set the state */
|
||||||
This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP);
|
if (NT_SUCCESS(This->Stream->lpVtbl->SetState(This->Stream, State)))
|
||||||
/* Set internal state to stop */
|
{
|
||||||
This->State = KSSTATE_STOP;
|
/* Set internal state to stop */
|
||||||
|
This->State = State;
|
||||||
|
|
||||||
DPRINT1("Stopping %p %u Irql %u\n", This, This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql());
|
if (This->State == KSSTATE_STOP)
|
||||||
|
{
|
||||||
|
/* reset start stream */
|
||||||
|
This->IrpQueue->lpVtbl->CancelBuffers(This->IrpQueue); //FIX function name
|
||||||
|
DPRINT1("Stopping %u Irql %u\n", This, This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), KeGetCurrentIrql());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
StopStreamRoutine(
|
SetStreamState(
|
||||||
IN PKDPC Dpc,
|
IN IPortPinWaveCyclicImpl * This,
|
||||||
IN PVOID DeferredContext,
|
IN KSSTATE State)
|
||||||
IN PVOID SystemArgument1,
|
|
||||||
IN PVOID SystemArgument2)
|
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)DeferredContext;
|
PIO_WORKITEM WorkItem;
|
||||||
PIO_WORKITEM WorkItem;
|
PSETSTREAM_CONTEXT Context;
|
||||||
PSTOPSTREAM_CONTEXT Context;
|
|
||||||
|
|
||||||
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
|
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
|
||||||
|
|
||||||
/* Has the audio stream resumed? */
|
/* Has the audio stream resumed? */
|
||||||
if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue))
|
if (This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue) && State == KSSTATE_STOP)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Has the audio stream already stopped */
|
/* Has the audio state already been set? */
|
||||||
if (This->State == KSSTATE_STOP)
|
if (This->State == State)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get device object */
|
/* Get device object */
|
||||||
DeviceObject = GetDeviceObject(This->Port);
|
DeviceObject = GetDeviceObject(This->Port);
|
||||||
|
|
||||||
/* allocate stop context */
|
/* allocate set state context */
|
||||||
Context = AllocateItem(NonPagedPool, sizeof(STOPSTREAM_CONTEXT), TAG_PORTCLASS);
|
Context = AllocateItem(NonPagedPool, sizeof(SETSTREAM_CONTEXT), TAG_PORTCLASS);
|
||||||
|
|
||||||
if (!Context)
|
if (!Context)
|
||||||
return;
|
return;
|
||||||
|
@ -260,9 +273,10 @@ StopStreamRoutine(
|
||||||
|
|
||||||
Context->Pin = (PVOID)This;
|
Context->Pin = (PVOID)This;
|
||||||
Context->WorkItem = WorkItem;
|
Context->WorkItem = WorkItem;
|
||||||
|
Context->State = State;
|
||||||
|
|
||||||
/* queue the work item */
|
/* queue the work item */
|
||||||
IoQueueWorkItem(WorkItem, StopStreamWorkerRoutine, DelayedWorkQueue, (PVOID)Context);
|
IoQueueWorkItem(WorkItem, SetStreamWorkerRoutine, DelayedWorkQueue, (PVOID)Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -277,10 +291,12 @@ IServiceSink_fnRequestService(
|
||||||
ULONG BufferSize;
|
ULONG BufferSize;
|
||||||
IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortPinWaveCyclicImpl, lpVtblServiceSink);
|
IPortPinWaveCyclicImpl * This = (IPortPinWaveCyclicImpl*)CONTAINING_RECORD(iface, IPortPinWaveCyclicImpl, lpVtblServiceSink);
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize);
|
Status = This->IrpQueue->lpVtbl->GetMapping(This->IrpQueue, &Buffer, &BufferSize);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
KeInsertQueueDpc(&This->Dpc, NULL, NULL);
|
SetStreamState(This, KSSTATE_STOP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,9 +497,7 @@ IPortPinWaveCyclic_HandleKsProperty(
|
||||||
ASSERT(IsEqualGUIDAligned(&((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.SubFormat, &KSDATAFORMAT_SUBTYPE_PCM));
|
ASSERT(IsEqualGUIDAligned(&((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.SubFormat, &KSDATAFORMAT_SUBTYPE_PCM));
|
||||||
ASSERT(IsEqualGUIDAligned(&((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, &KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
ASSERT(IsEqualGUIDAligned(&((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->DataFormat.Specifier, &KSDATAFORMAT_SPECIFIER_WAVEFORMATEX));
|
||||||
|
|
||||||
Status = This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP);
|
ASSERT(This->State == KSSTATE_STOP);
|
||||||
ASSERT(Status == STATUS_SUCCESS);
|
|
||||||
This->State = KSSTATE_STOP;
|
|
||||||
DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
DPRINT1("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
|
||||||
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
|
||||||
|
@ -501,7 +515,6 @@ IPortPinWaveCyclic_HandleKsProperty(
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
DPRINT1("Failed to set format\n");
|
DPRINT1("Failed to set format\n");
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
@ -921,11 +934,9 @@ IPortPinWaveCyclic_fnFastWrite(
|
||||||
|
|
||||||
if (This->IrpQueue->lpVtbl->MinimumDataAvailable(This->IrpQueue) == TRUE && This->State != KSSTATE_RUN)
|
if (This->IrpQueue->lpVtbl->MinimumDataAvailable(This->IrpQueue) == TRUE && This->State != KSSTATE_RUN)
|
||||||
{
|
{
|
||||||
|
SetStreamState(This, KSSTATE_RUN);
|
||||||
/* some should initiate a state request but didnt do it */
|
/* some should initiate a state request but didnt do it */
|
||||||
DPRINT1("Starting stream with %lu\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue));
|
DPRINT1("Starting stream with %lu mappings Status %x\n", This->IrpQueue->lpVtbl->NumMappings(This->IrpQueue), Status);
|
||||||
|
|
||||||
This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_RUN);
|
|
||||||
This->State = KSSTATE_RUN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -958,7 +969,6 @@ IPortPinWaveCyclic_fnInit(
|
||||||
This->KsPinDescriptor = KsPinDescriptor;
|
This->KsPinDescriptor = KsPinDescriptor;
|
||||||
This->ConnectDetails = ConnectDetails;
|
This->ConnectDetails = ConnectDetails;
|
||||||
This->Miniport = GetWaveCyclicMiniport(Port);
|
This->Miniport = GetWaveCyclicMiniport(Port);
|
||||||
KeInitializeDpc(&This->Dpc, StopStreamRoutine, (PVOID)This);
|
|
||||||
|
|
||||||
DeviceObject = GetDeviceObject(Port);
|
DeviceObject = GetDeviceObject(Port);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ PcNewPort(
|
||||||
|
|
||||||
DPRINT("PcNewPort entered\n");
|
DPRINT("PcNewPort entered\n");
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!OutPort)
|
if (!OutPort)
|
||||||
{
|
{
|
||||||
DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
|
DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
|
||||||
|
|
|
@ -97,6 +97,8 @@ IPortDMus_fnGetDeviceProperty(
|
||||||
{
|
{
|
||||||
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortDMus_fnNewRegistryKey called w/o initiazed\n");
|
DPRINT("IPortDMus_fnNewRegistryKey called w/o initiazed\n");
|
||||||
|
@ -120,6 +122,8 @@ IPortDMus_fnInit(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (This->bInitialized)
|
if (This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortDMus_Init called again\n");
|
DPRINT("IPortDMus_Init called again\n");
|
||||||
|
@ -166,6 +170,8 @@ IPortDMus_fnNewRegistryKey(
|
||||||
{
|
{
|
||||||
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
IPortDMusImpl * This = (IPortDMusImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortDMus_fnNewRegistryKey called w/o initialized\n");
|
DPRINT("IPortDMus_fnNewRegistryKey called w/o initialized\n");
|
||||||
|
@ -174,13 +180,6 @@ IPortDMus_fnNewRegistryKey(
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NewPortDMus(
|
NewPortDMus(
|
||||||
OUT PPORT* OutPort)
|
OUT PPORT* OutPort)
|
||||||
|
|
|
@ -134,6 +134,8 @@ IPortMidi_fnGetDeviceProperty(
|
||||||
{
|
{
|
||||||
IPortMidiImpl * This = (IPortMidiImpl*)iface;
|
IPortMidiImpl * This = (IPortMidiImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortMidi_fnNewRegistryKey called w/o initiazed\n");
|
DPRINT("IPortMidi_fnNewRegistryKey called w/o initiazed\n");
|
||||||
|
@ -160,6 +162,7 @@ IPortMidi_fnInit(
|
||||||
|
|
||||||
DPRINT("IPortMidi_fnInit entered This %p DeviceObject %p Irp %p UnknownMiniport %p UnknownAdapter %p ResourceList %p\n",
|
DPRINT("IPortMidi_fnInit entered This %p DeviceObject %p Irp %p UnknownMiniport %p UnknownAdapter %p ResourceList %p\n",
|
||||||
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (This->bInitialized)
|
if (This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +242,8 @@ IPortMidi_fnNewRegistryKey(
|
||||||
{
|
{
|
||||||
IPortMidiImpl * This = (IPortMidiImpl*)iface;
|
IPortMidiImpl * This = (IPortMidiImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortMidi_fnNewRegistryKey called w/o initialized\n");
|
DPRINT("IPortMidi_fnNewRegistryKey called w/o initialized\n");
|
||||||
|
@ -272,6 +277,7 @@ IPortMidi_fnRegisterServiceGroup(
|
||||||
IN PSERVICEGROUP ServiceGroup)
|
IN PSERVICEGROUP ServiceGroup)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,7 @@ IPortTopology_fnGetDeviceProperty(
|
||||||
OUT PULONG ReturnLength)
|
OUT PULONG ReturnLength)
|
||||||
{
|
{
|
||||||
IPortTopologyImpl * This = (IPortTopologyImpl*)iface;
|
IPortTopologyImpl * This = (IPortTopologyImpl*)iface;
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -179,6 +180,7 @@ IPortTopology_fnInit(
|
||||||
|
|
||||||
DPRINT("IPortTopology_fnInit entered This %p DeviceObject %p Irp %p UnknownMiniport %p UnknownAdapter %p ResourceList %p\n",
|
DPRINT("IPortTopology_fnInit entered This %p DeviceObject %p Irp %p UnknownMiniport %p UnknownAdapter %p ResourceList %p\n",
|
||||||
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (This->bInitialized)
|
if (This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -255,6 +257,7 @@ IPortTopology_fnNewRegistryKey(
|
||||||
OUT PULONG Disposition OPTIONAL)
|
OUT PULONG Disposition OPTIONAL)
|
||||||
{
|
{
|
||||||
IPortTopologyImpl * This = (IPortTopologyImpl*)iface;
|
IPortTopologyImpl * This = (IPortTopologyImpl*)iface;
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -506,7 +509,7 @@ PcCreateItemDispatch(
|
||||||
PKSOBJECT_CREATE_ITEM CreateItem;
|
PKSOBJECT_CREATE_ITEM CreateItem;
|
||||||
PPIN_WORKER_CONTEXT Context;
|
PPIN_WORKER_CONTEXT Context;
|
||||||
|
|
||||||
DPRINT("PcCreateItemDispatch called DeviceObject %p\n", DeviceObject);
|
DPRINT1("PcCreateItemDispatch called DeviceObject %p\n", DeviceObject);
|
||||||
|
|
||||||
/* access the create item */
|
/* access the create item */
|
||||||
CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
|
CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
|
||||||
|
@ -570,7 +573,7 @@ PcCreateItemDispatch(
|
||||||
NULL);
|
NULL);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("Failed to get filter object\n");
|
DPRINT1("Failed to get filter object\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,7 +583,7 @@ PcCreateItemDispatch(
|
||||||
/* create the dispatch object */
|
/* create the dispatch object */
|
||||||
Status = NewDispatchObject(Irp, Filter);
|
Status = NewDispatchObject(Irp, Filter);
|
||||||
|
|
||||||
DPRINT("Filter %p\n", Filter);
|
DPRINT1("Filter %p\n", Filter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -287,6 +287,7 @@ IPortWaveCyclic_fnGetDeviceProperty(
|
||||||
OUT PULONG ReturnLength)
|
OUT PULONG ReturnLength)
|
||||||
{
|
{
|
||||||
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -314,6 +315,7 @@ IPortWaveCyclic_fnInit(
|
||||||
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IPortWaveCyclic_Init entered %p\n", This);
|
DPRINT("IPortWaveCyclic_Init entered %p\n", This);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (This->bInitialized)
|
if (This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -420,6 +422,8 @@ IPortWaveCyclic_fnNewRegistryKey(
|
||||||
{
|
{
|
||||||
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
|
DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
|
||||||
|
@ -450,6 +454,8 @@ IPortWaveCyclic_fnNewMasterDmaChannel(
|
||||||
DEVICE_DESCRIPTION DeviceDescription;
|
DEVICE_DESCRIPTION DeviceDescription;
|
||||||
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
|
DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
|
||||||
|
@ -480,9 +486,10 @@ IPortWaveCyclic_fnNewSlaveDmaChannel(
|
||||||
DEVICE_DESCRIPTION DeviceDescription;
|
DEVICE_DESCRIPTION DeviceDescription;
|
||||||
PDMACHANNEL DmaChannel;
|
PDMACHANNEL DmaChannel;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
|
DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
|
||||||
|
|
|
@ -114,6 +114,7 @@ IPortEvents_fnAddEventToEventList(
|
||||||
IN PKSEVENT_ENTRY EventEntry)
|
IN PKSEVENT_ENTRY EventEntry)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -348,6 +349,7 @@ IPortWavePci_fnInit(
|
||||||
|
|
||||||
DPRINT("IPortWavePci_fnInit entered with This %p, DeviceObject %p Irp %p UnknownMiniport %p, UnknownAdapter %p ResourceList %p\n",
|
DPRINT("IPortWavePci_fnInit entered with This %p, DeviceObject %p Irp %p UnknownMiniport %p, UnknownAdapter %p ResourceList %p\n",
|
||||||
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
This, DeviceObject, Irp, UnknownMiniport, UnknownAdapter, ResourceList);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (This->bInitialized)
|
if (This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -471,6 +473,7 @@ IPortWavePci_fnNewRegistryKey(
|
||||||
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IPortWavePci_fnNewRegistryKey entered\n");
|
DPRINT("IPortWavePci_fnNewRegistryKey entered\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -501,6 +504,7 @@ IPortWavePci_fnGetDeviceProperty(
|
||||||
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IPortWavePci_fnGetDeviceProperty entered\n");
|
DPRINT("IPortWavePci_fnGetDeviceProperty entered\n");
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!This->bInitialized)
|
if (!This->bInitialized)
|
||||||
{
|
{
|
||||||
|
@ -533,6 +537,7 @@ IPortWavePci_fnNewMasterDmaChannel(
|
||||||
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IPortWavePci_fnNewMasterDmaChannel This %p entered\n", This);
|
DPRINT("IPortWavePci_fnNewMasterDmaChannel This %p entered\n", This);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
Status = PcDmaMasterDescription(ResourceList, ScatterGather, Dma32BitAddresses, IgnoreCount, Dma64BitAddresses, DmaWidth, DmaSpeed, MaximumLength, DmaPort, &DeviceDescription);
|
Status = PcDmaMasterDescription(ResourceList, ScatterGather, Dma32BitAddresses, IgnoreCount, Dma64BitAddresses, DmaWidth, DmaSpeed, MaximumLength, DmaPort, &DeviceDescription);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
|
|
@ -86,6 +86,8 @@ IPortWavePciStream_fnGetMapping(
|
||||||
{
|
{
|
||||||
IPortWavePciStreamImpl * This = (IPortWavePciStreamImpl*)iface;
|
IPortWavePciStreamImpl * This = (IPortWavePciStreamImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
return This->Queue->lpVtbl->GetMappingWithTag(This->Queue, Tag, PhysicalAddress, VirtualAddress, ByteCount, Flags);
|
return This->Queue->lpVtbl->GetMappingWithTag(This->Queue, Tag, PhysicalAddress, VirtualAddress, ByteCount, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +99,9 @@ IPortWavePciStream_fnReleaseMapping(
|
||||||
IN PVOID Tag)
|
IN PVOID Tag)
|
||||||
{
|
{
|
||||||
IPortWavePciStreamImpl * This = (IPortWavePciStreamImpl*)iface;
|
IPortWavePciStreamImpl * This = (IPortWavePciStreamImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
This->Queue->lpVtbl->ReleaseMappingWithTag(This->Queue, Tag);
|
This->Queue->lpVtbl->ReleaseMappingWithTag(This->Queue, Tag);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -108,6 +113,7 @@ IPortWavePciStream_fnTerminatePacket(
|
||||||
IN IPortWavePciStream *iface)
|
IN IPortWavePciStream *iface)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ PcRegisterAdapterPowerManagement(
|
||||||
IAdapterPowerManagement * pPower;
|
IAdapterPowerManagement * pPower;
|
||||||
|
|
||||||
DPRINT("PcRegisterAdapterPowerManagement pUnknown %p pvContext %p\n", pUnknown, pvContext);
|
DPRINT("PcRegisterAdapterPowerManagement pUnknown %p pvContext %p\n", pUnknown, pvContext);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!pUnknown || !pvContext)
|
if (!pUnknown || !pvContext)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
@ -72,6 +73,8 @@ PcRequestNewPowerState(
|
||||||
POWER_STATE PowerState;
|
POWER_STATE PowerState;
|
||||||
PPCLASS_DEVICE_EXTENSION DeviceExt;
|
PPCLASS_DEVICE_EXTENSION DeviceExt;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (!DeviceObject || !RequestedNewState)
|
if (!DeviceObject || !RequestedNewState)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#define DDKAPI
|
#define DDKAPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
PortClsCreate(
|
PortClsCreate(
|
||||||
|
@ -182,12 +184,6 @@ typedef struct
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
}CONTEXT_WRITE, *PCONTEXT_WRITE;
|
}CONTEXT_WRITE, *PCONTEXT_WRITE;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
PVOID Pin;
|
|
||||||
PIO_WORKITEM WorkItem;
|
|
||||||
}STOPSTREAM_CONTEXT, *PSTOPSTREAM_CONTEXT;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
PVOID Pin;
|
PVOID Pin;
|
||||||
|
|
|
@ -14,6 +14,7 @@ typedef struct
|
||||||
|
|
||||||
LONG ref;
|
LONG ref;
|
||||||
HANDLE hKey;
|
HANDLE hKey;
|
||||||
|
BOOL Deleted;
|
||||||
|
|
||||||
}IRegistryKeyImpl;
|
}IRegistryKeyImpl;
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ static IRegistryKeyVtbl vt_IRegistryKey;
|
||||||
|
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnAddRef(
|
IRegistryKey_fnAddRef(
|
||||||
IN IRegistryKey* iface)
|
IN IRegistryKey* iface)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +35,7 @@ IRegistryKey_fnAddRef(
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnRelease(
|
IRegistryKey_fnRelease(
|
||||||
IN IRegistryKey* iface)
|
IN IRegistryKey* iface)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +57,7 @@ IRegistryKey_fnRelease(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnQueryInterface(
|
IRegistryKey_fnQueryInterface(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN REFIID refiid,
|
IN REFIID refiid,
|
||||||
|
@ -77,17 +78,29 @@ IRegistryKey_fnQueryInterface(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnDeleteKey(
|
IRegistryKey_fnDeleteKey(
|
||||||
IN IRegistryKey* iface)
|
IN IRegistryKey* iface)
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
DPRINT("IRegistryKey_fnDeleteKey entered\n");
|
NTSTATUS Status;
|
||||||
return ZwDeleteKey(This->hKey);
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = ZwDeleteKey(This->hKey);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
This->Deleted = TRUE;
|
||||||
|
}
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnEnumerateKey(
|
IRegistryKey_fnEnumerateKey(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN ULONG Index,
|
IN ULONG Index,
|
||||||
|
@ -97,12 +110,18 @@ IRegistryKey_fnEnumerateKey(
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
DPRINT("IRegistryKey_fnEnumerateKey entered\n");
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
return ZwEnumerateKey(This->hKey, Index, KeyInformationClass, KeyInformation, Length, ResultLength);
|
return ZwEnumerateKey(This->hKey, Index, KeyInformationClass, KeyInformation, Length, ResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnEnumerateKeyValue(
|
IRegistryKey_fnEnumerateKeyValue(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN ULONG Index,
|
IN ULONG Index,
|
||||||
|
@ -112,12 +131,18 @@ IRegistryKey_fnEnumerateKeyValue(
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
DPRINT("IRegistryKey_fnEnumerateKeyValue entered\n");
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
return ZwEnumerateValueKey(This->hKey, Index, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
|
return ZwEnumerateValueKey(This->hKey, Index, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnNewSubKey(
|
IRegistryKey_fnNewSubKey(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
OUT PREGISTRYKEY *RegistrySubKey,
|
OUT PREGISTRYKEY *RegistrySubKey,
|
||||||
|
@ -132,8 +157,15 @@ IRegistryKey_fnNewSubKey(
|
||||||
HANDLE hKey;
|
HANDLE hKey;
|
||||||
IRegistryKeyImpl * NewThis, *This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * NewThis, *This = (IRegistryKeyImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
DPRINT("IRegistryKey_fnNewSubKey entered %S\n", SubKeyName);
|
DPRINT("IRegistryKey_fnNewSubKey entered %S\n", SubKeyName);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
InitializeObjectAttributes(&Attributes, SubKeyName, 0, This->hKey, NULL);
|
InitializeObjectAttributes(&Attributes, SubKeyName, 0, This->hKey, NULL);
|
||||||
Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
|
Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0, Disposition);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -164,7 +196,7 @@ IRegistryKey_fnNewSubKey(
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnQueryKey(
|
IRegistryKey_fnQueryKey(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN KEY_INFORMATION_CLASS KeyInformationClass,
|
IN KEY_INFORMATION_CLASS KeyInformationClass,
|
||||||
|
@ -173,25 +205,36 @@ IRegistryKey_fnQueryKey(
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
DPRINT("IRegistryKey_fnQueryKey entered\n");
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
return ZwQueryKey(This->hKey, KeyInformationClass, KeyInformation, Length, ResultLength);
|
return ZwQueryKey(This->hKey, KeyInformationClass, KeyInformation, Length, ResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnQueryRegistryValues(
|
IRegistryKey_fnQueryRegistryValues(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
IN PVOID Context OPTIONAL)
|
IN PVOID Context OPTIONAL)
|
||||||
{
|
{
|
||||||
//IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
UNIMPLEMENTED
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
DbgBreakPoint();
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, (PCWSTR)This->hKey, QueryTable, Context, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnQueryValueKey(
|
IRegistryKey_fnQueryValueKey(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN PUNICODE_STRING ValueName,
|
IN PUNICODE_STRING ValueName,
|
||||||
|
@ -201,12 +244,20 @@ IRegistryKey_fnQueryValueKey(
|
||||||
OUT PULONG ResultLength)
|
OUT PULONG ResultLength)
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
|
|
||||||
DPRINT("IRegistryKey_fnQueryValueKey entered %p value %wZ\n", This, ValueName);
|
DPRINT("IRegistryKey_fnQueryValueKey entered %p value %wZ\n", This, ValueName);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
return ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
|
return ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IRegistryKey_fnSetValueKey(
|
IRegistryKey_fnSetValueKey(
|
||||||
IN IRegistryKey* iface,
|
IN IRegistryKey* iface,
|
||||||
IN PUNICODE_STRING ValueName OPTIONAL,
|
IN PUNICODE_STRING ValueName OPTIONAL,
|
||||||
|
@ -217,6 +268,13 @@ IRegistryKey_fnSetValueKey(
|
||||||
{
|
{
|
||||||
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
|
||||||
DPRINT("IRegistryKey_fnSetValueKey entered %S\n", ValueName->Buffer);
|
DPRINT("IRegistryKey_fnSetValueKey entered %S\n", ValueName->Buffer);
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
if (This->Deleted)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
return ZwSetValueKey(This->hKey, ValueName, 0, Type, Data, DataSize);
|
return ZwSetValueKey(This->hKey, ValueName, 0, Type, Data, DataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,8 @@ IResourceList_fnNumberOfEntries(IResourceList* iface)
|
||||||
{
|
{
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
return This->TranslatedResourceList->List[0].PartialResourceList.Count;
|
return This->TranslatedResourceList->List[0].PartialResourceList.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,12 +109,13 @@ IResourceList_fnNumberOfEntriesOfType(
|
||||||
IResourceList* iface,
|
IResourceList* iface,
|
||||||
IN CM_RESOURCE_TYPE Type)
|
IN CM_RESOURCE_TYPE Type)
|
||||||
{
|
{
|
||||||
/* I guess the translated and untranslated lists will be same length? */
|
|
||||||
|
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
ULONG Index, Count = 0;
|
ULONG Index, Count = 0;
|
||||||
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
/* I guess the translated and untranslated lists will be same length? */
|
||||||
for (Index = 0; Index < This->TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ )
|
for (Index = 0; Index < This->TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ )
|
||||||
{
|
{
|
||||||
PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
|
||||||
|
@ -139,6 +142,8 @@ IResourceList_fnFindTranslatedEntry(
|
||||||
ULONG DescIndex, Count = 0;
|
ULONG DescIndex, Count = 0;
|
||||||
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
for (DescIndex = 0; DescIndex < This->TranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
|
for (DescIndex = 0; DescIndex < This->TranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
|
||||||
{
|
{
|
||||||
PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
|
PartialDescriptor = &This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
|
||||||
|
@ -168,6 +173,8 @@ IResourceList_fnFindUntranslatedEntry(
|
||||||
ULONG DescIndex, Count = 0;
|
ULONG DescIndex, Count = 0;
|
||||||
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
for (DescIndex = 0; DescIndex < This->UntranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
|
for (DescIndex = 0; DescIndex < This->UntranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
|
||||||
{
|
{
|
||||||
PartialDescriptor = &This->UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
|
PartialDescriptor = &This->UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
|
||||||
|
@ -196,6 +203,8 @@ IResourceList_fnAddEntry(
|
||||||
ULONG NewTranslatedSize, NewUntranslatedSize;
|
ULONG NewTranslatedSize, NewUntranslatedSize;
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
NewTranslatedSize = sizeof(CM_RESOURCE_LIST) + This->TranslatedResourceList[0].List->PartialResourceList.Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
NewTranslatedSize = sizeof(CM_RESOURCE_LIST) + This->TranslatedResourceList[0].List->PartialResourceList.Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
||||||
NewTranslatedResources = AllocateItem(This->PoolType, NewTranslatedSize, TAG_PORTCLASS);
|
NewTranslatedResources = AllocateItem(This->PoolType, NewTranslatedSize, TAG_PORTCLASS);
|
||||||
if (!NewTranslatedResources)
|
if (!NewTranslatedResources)
|
||||||
|
@ -254,6 +263,8 @@ IResourceList_fnAddEntryFromParent(
|
||||||
ULONG NewTranslatedSize;
|
ULONG NewTranslatedSize;
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
Translated = Parent->lpVtbl->FindTranslatedEntry(Parent, Type, Index);
|
Translated = Parent->lpVtbl->FindTranslatedEntry(Parent, Type, Index);
|
||||||
if (!Translated)
|
if (!Translated)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
@ -287,6 +298,8 @@ IResourceList_fnTranslatedList(
|
||||||
{
|
{
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
return This->TranslatedResourceList;
|
return This->TranslatedResourceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,6 +310,8 @@ IResourceList_fnUntranslatedList(
|
||||||
{
|
{
|
||||||
IResourceListImpl * This = (IResourceListImpl*)iface;
|
IResourceListImpl * This = (IResourceListImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
return This->UntranslatedResourceList;
|
return This->UntranslatedResourceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,7 @@ typedef struct
|
||||||
BOOL Initialized;
|
BOOL Initialized;
|
||||||
BOOL TimerActive;
|
BOOL TimerActive;
|
||||||
KTIMER Timer;
|
KTIMER Timer;
|
||||||
KEVENT DpcEvent;
|
|
||||||
KDPC Dpc;
|
KDPC Dpc;
|
||||||
|
|
||||||
}IServiceGroupImpl;
|
}IServiceGroupImpl;
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +36,7 @@ typedef struct
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IServiceGroup_fnQueryInterface(
|
IServiceGroup_fnQueryInterface(
|
||||||
IServiceGroup* iface,
|
IServiceGroup* iface,
|
||||||
IN REFIID refiid,
|
IN REFIID refiid,
|
||||||
|
@ -66,7 +64,7 @@ IServiceGroup_fnQueryInterface(
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IServiceGroup_fnAddRef(
|
IServiceGroup_fnAddRef(
|
||||||
IServiceGroup* iface)
|
IServiceGroup* iface)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +74,7 @@ IServiceGroup_fnAddRef(
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
STDMETHODCALLTYPE
|
NTAPI
|
||||||
IServiceGroup_fnRelease(
|
IServiceGroup_fnRelease(
|
||||||
IServiceGroup* iface)
|
IServiceGroup* iface)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +93,6 @@ IServiceGroup_fnRelease(
|
||||||
Entry->pServiceSink->lpVtbl->Release(Entry->pServiceSink);
|
Entry->pServiceSink->lpVtbl->Release(Entry->pServiceSink);
|
||||||
FreeItem(Entry, TAG_PORTCLASS);
|
FreeItem(Entry, TAG_PORTCLASS);
|
||||||
}
|
}
|
||||||
KeWaitForSingleObject(&This->DpcEvent, Executive, KernelMode, FALSE, NULL);
|
|
||||||
KeCancelTimer(&This->Timer);
|
KeCancelTimer(&This->Timer);
|
||||||
FreeItem(This, TAG_PORTCLASS);
|
FreeItem(This, TAG_PORTCLASS);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -115,17 +112,18 @@ NTAPI
|
||||||
IServiceGroup_fnRequestService(
|
IServiceGroup_fnRequestService(
|
||||||
IN IServiceGroup * iface)
|
IN IServiceGroup * iface)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY CurEntry;
|
KIRQL OldIrql;
|
||||||
PGROUP_ENTRY Entry;
|
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
CurEntry = This->ServiceSinkHead.Flink;
|
if (KeGetCurrentIrql() > DISPATCH_LEVEL)
|
||||||
while (CurEntry != &This->ServiceSinkHead)
|
|
||||||
{
|
{
|
||||||
Entry = CONTAINING_RECORD(CurEntry, GROUP_ENTRY, Entry);
|
KeInsertQueueDpc(&This->Dpc, NULL, NULL);
|
||||||
Entry->pServiceSink->lpVtbl->RequestService(Entry->pServiceSink);
|
return;
|
||||||
CurEntry = CurEntry->Flink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
||||||
|
KeInsertQueueDpc(&This->Dpc, NULL, NULL);
|
||||||
|
KeLowerIrql(OldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
|
@ -141,6 +139,8 @@ IServiceGroup_fnAddMember(
|
||||||
PGROUP_ENTRY Entry;
|
PGROUP_ENTRY Entry;
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
Entry = AllocateItem(NonPagedPool, sizeof(GROUP_ENTRY), TAG_PORTCLASS);
|
Entry = AllocateItem(NonPagedPool, sizeof(GROUP_ENTRY), TAG_PORTCLASS);
|
||||||
if (!Entry)
|
if (!Entry)
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
@ -148,8 +148,6 @@ IServiceGroup_fnAddMember(
|
||||||
Entry->pServiceSink = pServiceSink;
|
Entry->pServiceSink = pServiceSink;
|
||||||
pServiceSink->lpVtbl->AddRef(pServiceSink);
|
pServiceSink->lpVtbl->AddRef(pServiceSink);
|
||||||
|
|
||||||
//FIXME
|
|
||||||
//check if Dpc is active
|
|
||||||
InsertTailList(&This->ServiceSinkHead, &Entry->Entry);
|
InsertTailList(&This->ServiceSinkHead, &Entry->Entry);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -165,9 +163,7 @@ IServiceGroup_fnRemoveMember(
|
||||||
PGROUP_ENTRY Entry;
|
PGROUP_ENTRY Entry;
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
//FIXME
|
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
|
||||||
//check if Dpc is active
|
|
||||||
//
|
|
||||||
|
|
||||||
CurEntry = This->ServiceSinkHead.Flink;
|
CurEntry = This->ServiceSinkHead.Flink;
|
||||||
while (CurEntry != &This->ServiceSinkHead)
|
while (CurEntry != &This->ServiceSinkHead)
|
||||||
|
@ -194,11 +190,18 @@ IServiceGroupDpc(
|
||||||
IN PVOID SystemArgument2
|
IN PVOID SystemArgument2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
PLIST_ENTRY CurEntry;
|
||||||
|
PGROUP_ENTRY Entry;
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)DeferredContext;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)DeferredContext;
|
||||||
IServiceGroup_fnRequestService((IServiceGroup*)DeferredContext);
|
|
||||||
KeSetEvent(&This->DpcEvent, IO_SOUND_INCREMENT, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
CurEntry = This->ServiceSinkHead.Flink;
|
||||||
|
while (CurEntry != &This->ServiceSinkHead)
|
||||||
|
{
|
||||||
|
Entry = CONTAINING_RECORD(CurEntry, GROUP_ENTRY, Entry);
|
||||||
|
Entry->pServiceSink->lpVtbl->RequestService(Entry->pServiceSink);
|
||||||
|
CurEntry = CurEntry->Flink;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -207,11 +210,11 @@ IServiceGroup_fnSupportDelayedService(
|
||||||
{
|
{
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
if (!This->Initialized)
|
if (!This->Initialized)
|
||||||
{
|
{
|
||||||
KeInitializeEvent(&This->DpcEvent, SynchronizationEvent, FALSE);
|
|
||||||
KeInitializeTimerEx(&This->Timer, NotificationTimer);
|
KeInitializeTimerEx(&This->Timer, NotificationTimer);
|
||||||
KeInitializeDpc(&This->Dpc, IServiceGroupDpc, (PVOID)This);
|
|
||||||
This->Initialized = TRUE;
|
This->Initialized = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,6 +228,8 @@ IServiceGroup_fnRequestDelayedService(
|
||||||
LARGE_INTEGER DueTime;
|
LARGE_INTEGER DueTime;
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
DueTime.QuadPart = ullDelay;
|
DueTime.QuadPart = ullDelay;
|
||||||
|
|
||||||
if (This->Initialized)
|
if (This->Initialized)
|
||||||
|
@ -233,8 +238,6 @@ IServiceGroup_fnRequestDelayedService(
|
||||||
KeSetTimer(&This->Timer, DueTime, &This->Dpc);
|
KeSetTimer(&This->Timer, DueTime, &This->Dpc);
|
||||||
else
|
else
|
||||||
KeInsertQueueDpc(&This->Dpc, NULL, NULL);
|
KeInsertQueueDpc(&This->Dpc, NULL, NULL);
|
||||||
|
|
||||||
KeClearEvent(&This->DpcEvent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,6 +248,8 @@ IServiceGroup_fnCancelDelayedService(
|
||||||
{
|
{
|
||||||
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
IServiceGroupImpl * This = (IServiceGroupImpl*)iface;
|
||||||
|
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
if (This->Initialized)
|
if (This->Initialized)
|
||||||
{
|
{
|
||||||
KeCancelTimer(&This->Timer);
|
KeCancelTimer(&This->Timer);
|
||||||
|
@ -283,6 +288,8 @@ PcNewServiceGroup(
|
||||||
|
|
||||||
This->lpVtbl = &vt_IServiceGroup;
|
This->lpVtbl = &vt_IServiceGroup;
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
|
KeInitializeDpc(&This->Dpc, IServiceGroupDpc, (PVOID)This);
|
||||||
|
KeSetImportanceDpc(&This->Dpc, HighImportance);
|
||||||
InitializeListHead(&This->ServiceSinkHead);
|
InitializeListHead(&This->ServiceSinkHead);
|
||||||
*OutServiceGroup = (PSERVICEGROUP)&This->lpVtbl;
|
*OutServiceGroup = (PSERVICEGROUP)&This->lpVtbl;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue