Author: janderwald
Date: Wed May 27 22:42:56 2009
New Revision: 41149
URL:
http://svn.reactos.org/svn/reactos?rev=41149&view=rev
Log:
- return error code when there is a timeout
- improve error check in PcNewInterruptSync
- write an error log entry when a device fails to start
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/interrupt.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c [iso-8859-1] Wed May 27
22:42:56 2009
@@ -455,9 +455,10 @@
}while(RetryCount-- >= 1);
- //FIXME
- // return error code on timeout
- //
+ if (BytesRemaining)
+ {
+ return STATUS_UNSUCCESSFUL;
+ }
return STATUS_SUCCESS;
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interrupt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/interrupt.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interrupt.c [iso-8859-1] Wed May 27
22:42:56 2009
@@ -347,7 +347,7 @@
DPRINT("PcNewInterruptSync entered OutInterruptSync %p OuterUnknown %p
ResourceList %p ResourceIndex %u Mode %d\n",
OutInterruptSync, OuterUnknown, ResourceList, ResourceIndex, Mode);
- if (!OutInterruptSync || !ResourceList || Mode > InterruptSyncModeRepeat || Mode
< 0)
+ if (!OutInterruptSync || !ResourceList || Mode > InterruptSyncModeRepeat || Mode
< InterruptSyncModeNormal || Mode > InterruptSyncModeRepeat)
return STATUS_INVALID_PARAMETER;
if (ResourceIndex >
ResourceList->lpVtbl->NumberOfEntriesOfType(ResourceList, CmResourceTypeInterrupt))
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.c [iso-8859-1] Wed May 27 22:42:56
2009
@@ -43,6 +43,9 @@
PPCLASS_DEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION IoStack;
IResourceList* resource_list = NULL;
+ ULONG Length;
+ WCHAR szMsg[100];
+ PIO_ERROR_LOG_PACKET EventEntry;
DPRINT("PortClsPnp called\n");
@@ -97,7 +100,22 @@
if (!NT_SUCCESS(Status))
{
DPRINT("StartDevice returned a failure code [0x%8x]\n",
Status);
-
+ swprintf(szMsg, L"%%1 failed to start with %x", Status);
+ Length = (wcslen(szMsg) + 1) * sizeof(WCHAR) +
sizeof(IO_ERROR_LOG_PACKET);
+ if (Length < ERROR_LOG_MAXIMUM_SIZE)
+ {
+ EventEntry =
(PIO_ERROR_LOG_PACKET)IoAllocateErrorLogEntry(DeviceExt->PhysicalDeviceObject,
Length);
+ if (EventEntry)
+ {
+ RtlZeroMemory(EventEntry, Length);
+ EventEntry->MajorFunctionCode = IRP_MJ_PNP;
+ EventEntry->NumberOfStrings = 1;
+ EventEntry->StringOffset = sizeof(IO_ERROR_LOG_PACKET);
+ EventEntry->ErrorCode = Status;
+ wcscpy((LPWSTR)(EventEntry + 1), szMsg);
+ IoWriteErrorLogEntry(EventEntry);
+ }
+ }
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
@@ -133,7 +151,7 @@
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_SUPPORTED;
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
- DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
+ DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS Status %x Information
%p\n", Irp->IoStatus.Status, Irp->IoStatus.Information);
Status = Irp->IoStatus.Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
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 May 27
22:42:56 2009
@@ -18,10 +18,6 @@
}IRegistryKeyImpl;
-
-static IRegistryKeyVtbl vt_IRegistryKey;
-
-
ULONG
NTAPI
IRegistryKey_fnAddRef(
@@ -187,7 +183,7 @@
NewThis->hKey = hKey;
NewThis->ref = 1;
- NewThis->lpVtbl = &vt_IRegistryKey;
+ NewThis->lpVtbl = This->lpVtbl;
*RegistrySubKey = (PREGISTRYKEY)&NewThis->lpVtbl;
DPRINT("IRegistryKey_fnNewSubKey RESULT %p\n", *RegistrySubKey );
@@ -243,17 +239,19 @@
IN ULONG Length,
OUT PULONG ResultLength)
{
- IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
-
- 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);
+ NTSTATUS Status;
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+ ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
+
+ if (This->Deleted)
+ {
+ return STATUS_INVALID_HANDLE;
+ }
+
+ Status = ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass,
KeyValueInformation, Length, ResultLength);
+ DPRINT("IRegistryKey_fnQueryValueKey entered %p value %wZ Status %x\n",
This, ValueName, Status);
+ return Status;
}
NTSTATUS