[USETUP] Remove one special case for keyboard devices

Keyboard devices must have an upperfilter (kdbclass) to work correctly. Detect these
devices using the Keyboard GUID class instead of using the inf section name.

svn path=/trunk/; revision=75532
This commit is contained in:
Hervé Poussineau 2017-08-13 13:11:43 +00:00
parent 9e84082a45
commit 9748e8bde3
2 changed files with 11 additions and 10 deletions

View file

@ -50,14 +50,13 @@ InstallDriver(
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE hService; HANDLE hService;
INFCONTEXT Context; INFCONTEXT Context;
LPWSTR Driver, ImagePath, FullImagePath; LPWSTR Driver, ClassGuid, ImagePath, FullImagePath;
ULONG dwValue; ULONG dwValue;
ULONG Disposition; ULONG Disposition;
NTSTATUS Status; NTSTATUS Status;
BOOLEAN deviceInstalled = FALSE; BOOLEAN deviceInstalled = FALSE;
UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters"); UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
LPWSTR keyboardClass = L"kbdclass\0"; LPWSTR keyboardClass = L"kbdclass\0";
BOOLEAN keyboardDevice = FALSE;
/* Check if we know the hardware */ /* Check if we know the hardware */
if (!SetupFindFirstLineW(hInf, L"HardwareIdsDatabase", HardwareId, &Context)) if (!SetupFindFirstLineW(hInf, L"HardwareIdsDatabase", HardwareId, &Context))
@ -65,17 +64,19 @@ InstallDriver(
if (!INF_GetDataField(&Context, 1, &Driver)) if (!INF_GetDataField(&Context, 1, &Driver))
return FALSE; return FALSE;
/* Get associated class GUID (if any) */
if (!INF_GetDataField(&Context, 2, &ClassGuid))
ClassGuid = NULL;
/* Find associated driver name */ /* Find associated driver name */
/* FIXME: check in other sections too! */ /* FIXME: check in other sections too! */
if (!SetupFindFirstLineW(hInf, L"BootBusExtenders.Load", Driver, &Context) if (!SetupFindFirstLineW(hInf, L"BootBusExtenders.Load", Driver, &Context)
&& !SetupFindFirstLineW(hInf, L"BusExtenders.Load", Driver, &Context) && !SetupFindFirstLineW(hInf, L"BusExtenders.Load", Driver, &Context)
&& !SetupFindFirstLineW(hInf, L"SCSI.Load", Driver, &Context) && !SetupFindFirstLineW(hInf, L"SCSI.Load", Driver, &Context)
&& !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, &Context)) && !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, &Context)
&& !SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
{ {
if (!SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context)) return FALSE;
return FALSE;
keyboardDevice = TRUE;
} }
if (!INF_GetDataField(&Context, 1, &ImagePath)) if (!INF_GetDataField(&Context, 1, &ImagePath))
@ -142,7 +143,7 @@ InstallDriver(
ImagePath, ImagePath,
(wcslen(ImagePath) + 1) * sizeof(WCHAR)); (wcslen(ImagePath) + 1) * sizeof(WCHAR));
if (keyboardDevice) if (ClassGuid &&_wcsicmp(ClassGuid, L"{4D36E96B-E325-11CE-BFC1-08002BE10318}") == 0)
{ {
DPRINT1("Installing keyboard class driver for '%S'\n", DeviceId); DPRINT1("Installing keyboard class driver for '%S'\n", DeviceId);
NtSetValueKey(hDeviceKey, NtSetValueKey(hDeviceKey,

View file

@ -94,12 +94,12 @@ PCI\CC_0C0300 = usbuhci
PCI\CC_0C0310 = usbohci PCI\CC_0C0310 = usbohci
PCI\CC_0C0320 = usbehci PCI\CC_0C0320 = usbehci
USB\Class_08&SubClass_06&Prot_50 = usbstor USB\Class_08&SubClass_06&Prot_50 = usbstor
HID_DEVICE_SYSTEM_KEYBOARD = kbdhid HID_DEVICE_SYSTEM_KEYBOARD = kbdhid,{4D36E96B-E325-11CE-BFC1-08002BE10318}
USB\COMPOSITE = usbccgp USB\COMPOSITE = usbccgp
GenDisk = disk GenDisk = disk
USB\Class_03 = hidusb USB\Class_03 = hidusb
GENERIC_HID_DEVICE = hidusb GENERIC_HID_DEVICE = hidusb
*PNP0303 = i8042prt *PNP0303 = i8042prt,{4D36E96B-E325-11CE-BFC1-08002BE10318}
ROOT\SWENUM = swenum ROOT\SWENUM = swenum
[BootBusExtenders.Load] [BootBusExtenders.Load]