- return error code when there is a timeout

- improve error check in PcNewInterruptSync
- write an error log entry when a device fails to start

svn path=/trunk/; revision=41149
This commit is contained in:
Johannes Anderwald 2009-05-27 18:42:56 +00:00
parent 7e126c8427
commit e57f479b22
4 changed files with 30 additions and 13 deletions

View file

@ -455,9 +455,10 @@ IDmaChannelInit_fnWaitForTC(
}while(RetryCount-- >= 1);
//FIXME
// return error code on timeout
//
if (BytesRemaining)
{
return STATUS_UNSUCCESSFUL;
}
return STATUS_SUCCESS;

View file

@ -347,7 +347,7 @@ PcNewInterruptSync(
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))

View file

@ -43,6 +43,9 @@ PortClsPnp(
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 @@ PortClsPnp(
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 @@ PortClsPnp(
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;

View file

@ -18,10 +18,6 @@ typedef struct
}IRegistryKeyImpl;
static IRegistryKeyVtbl vt_IRegistryKey;
ULONG
NTAPI
IRegistryKey_fnAddRef(
@ -187,7 +183,7 @@ IRegistryKey_fnNewSubKey(
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,9 +239,9 @@ IRegistryKey_fnQueryValueKey(
IN ULONG Length,
OUT PULONG ResultLength)
{
NTSTATUS Status;
IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
DPRINT("IRegistryKey_fnQueryValueKey entered %p value %wZ\n", This, ValueName);
ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
if (This->Deleted)
@ -253,7 +249,9 @@ IRegistryKey_fnQueryValueKey(
return STATUS_INVALID_HANDLE;
}
return ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass, KeyValueInformation, Length, ResultLength);
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