mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
various bugfixes to IoQueryDeviceDescription and friends. The floppy driver now loads and finds the drive properly.
svn path=/trunk/; revision=9741
This commit is contained in:
parent
0064a17a7c
commit
aeb397b5ab
1 changed files with 15 additions and 10 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: resource.c,v 1.15 2004/05/30 18:30:03 navaraf Exp $
|
/* $Id: resource.c,v 1.16 2004/06/20 04:50:02 vizzini Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/io/resource.c
|
* FILE: ntoskrnl/io/resource.c
|
||||||
|
@ -132,7 +132,7 @@ IopQueryDeviceDescription(
|
||||||
UNICODE_STRING ControllerRootRegName = RootKey;
|
UNICODE_STRING ControllerRootRegName = RootKey;
|
||||||
UNICODE_STRING ControllerRegName;
|
UNICODE_STRING ControllerRegName;
|
||||||
HANDLE ControllerKeyHandle;
|
HANDLE ControllerKeyHandle;
|
||||||
PKEY_FULL_INFORMATION ControllerFullInformation;
|
PKEY_FULL_INFORMATION ControllerFullInformation = NULL;
|
||||||
PKEY_VALUE_FULL_INFORMATION ControllerInformation[3] = {NULL, NULL, NULL};
|
PKEY_VALUE_FULL_INFORMATION ControllerInformation[3] = {NULL, NULL, NULL};
|
||||||
ULONG ControllerNumber;
|
ULONG ControllerNumber;
|
||||||
ULONG ControllerLoop;
|
ULONG ControllerLoop;
|
||||||
|
@ -252,7 +252,10 @@ IopQueryDeviceDescription(
|
||||||
RtlInitUnicodeString(&ControllerString, Strings[ControllerLoop]);
|
RtlInitUnicodeString(&ControllerString, Strings[ControllerLoop]);
|
||||||
|
|
||||||
/* How much buffer space */
|
/* How much buffer space */
|
||||||
ZwQueryValueKey(ControllerKeyHandle, &ControllerString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation);
|
Status = ZwQueryValueKey(ControllerKeyHandle, &ControllerString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation);
|
||||||
|
|
||||||
|
if(!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Allocate it */
|
/* Allocate it */
|
||||||
ControllerInformation[ControllerLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE);
|
ControllerInformation[ControllerLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE);
|
||||||
|
@ -378,7 +381,10 @@ IopQueryDeviceDescription(
|
||||||
RtlInitUnicodeString(&PeripheralString, Strings[PeripheralLoop]);
|
RtlInitUnicodeString(&PeripheralString, Strings[PeripheralLoop]);
|
||||||
|
|
||||||
/* How much buffer space */
|
/* How much buffer space */
|
||||||
ZwQueryValueKey(PeripheralKeyHandle, &PeripheralString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation);
|
Status = ZwQueryValueKey(PeripheralKeyHandle, &PeripheralString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation);
|
||||||
|
|
||||||
|
if(!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Allocate it */
|
/* Allocate it */
|
||||||
PeripheralInformation[PeripheralLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE);
|
PeripheralInformation[PeripheralLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE);
|
||||||
|
@ -394,7 +400,6 @@ IopQueryDeviceDescription(
|
||||||
/* We now have everything the caller could possibly want */
|
/* We now have everything the caller could possibly want */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
Status = Query->CalloutRoutine(
|
Status = Query->CalloutRoutine(
|
||||||
Query->Context,
|
Query->Context,
|
||||||
&ControllerRootRegName,
|
&ControllerRootRegName,
|
||||||
|
@ -407,9 +412,6 @@ IopQueryDeviceDescription(
|
||||||
*Query->PeripheralType,
|
*Query->PeripheralType,
|
||||||
PeripheralNumber,
|
PeripheralNumber,
|
||||||
PeripheralInformation);
|
PeripheralInformation);
|
||||||
#else
|
|
||||||
Status = STATUS_SUCCESS;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the allocated memory */
|
/* Free the allocated memory */
|
||||||
|
@ -492,12 +494,15 @@ IopQueryBusDescription(
|
||||||
/* How much buffer space */
|
/* How much buffer space */
|
||||||
Status = ZwQueryKey(RootKeyHandle, KeyFullInformation, NULL, 0, &LenFullInformation);
|
Status = ZwQueryKey(RootKeyHandle, KeyFullInformation, NULL, 0, &LenFullInformation);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW)
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
/* Allocate it */
|
/* Allocate it */
|
||||||
FullInformation = ExAllocatePoolWithTag(PagedPool, LenFullInformation, TAG_IO_RESOURCE);
|
FullInformation = ExAllocatePoolWithTag(PagedPool, LenFullInformation, TAG_IO_RESOURCE);
|
||||||
|
|
||||||
|
if(!FullInformation)
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
/* Get the Information */
|
/* Get the Information */
|
||||||
Status = ZwQueryKey(RootKeyHandle, KeyFullInformation, FullInformation, LenFullInformation, &LenFullInformation);
|
Status = ZwQueryKey(RootKeyHandle, KeyFullInformation, FullInformation, LenFullInformation, &LenFullInformation);
|
||||||
|
|
||||||
|
@ -764,7 +769,7 @@ IoQueryDeviceDescription(PINTERFACE_TYPE BusType,
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING RootRegKey;
|
UNICODE_STRING RootRegKey;
|
||||||
HANDLE RootRegHandle;
|
HANDLE RootRegHandle;
|
||||||
WCHAR RootRegString[] = L"\\REGISTRY\\MACHINE\\HARDWARE\\DESCRIPTION\\SYSTEM\\";
|
WCHAR RootRegString[] = L"\\REGISTRY\\MACHINE\\HARDWARE\\DESCRIPTION\\SYSTEM";
|
||||||
IO_QUERY Query;
|
IO_QUERY Query;
|
||||||
|
|
||||||
/* Set up the String */
|
/* Set up the String */
|
||||||
|
|
Loading…
Reference in a new issue