* PROGRAMMER: Hervé Poussineau (hpoussin@reactos.org)
*/
-#include "usetup.h"
+#include <usetup.h>
#define NDEBUG
#include <debug.h>
-#define INITGUID
-#include <guiddef.h>
-#include <libs/umpnpmgr/sysguid.h>
-
BOOLEAN
ResetDevice(
IN LPCWSTR DeviceId)
ULONG Disposition;
NTSTATUS Status;
BOOLEAN deviceInstalled = FALSE;
+ UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
+ LPWSTR keyboardClass = L"kbdclass\0";
+ BOOLEAN keyboardDevice = FALSE;
/* Check if we know the hardware */
if (!SetupFindFirstLineW(hInf, L"HardwareIdsDatabase", HardwareId, &Context))
/* Find associated driver name */
/* FIXME: check in other sections too! */
if (!SetupFindFirstLineW(hInf, L"BootBusExtenders.Load", Driver, &Context)
- && !SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
- return FALSE;
+ && !SetupFindFirstLineW(hInf, L"BusExtenders.Load", Driver, &Context)
+ && !SetupFindFirstLineW(hInf, L"SCSI.Load", Driver, &Context)
+ && !SetupFindFirstLineW(hInf, L"InputDevicesSupport.Load", Driver, &Context))
+ {
+ if (!SetupFindFirstLineW(hInf, L"Keyboard.Load", Driver, &Context))
+ return FALSE;
+
+ keyboardDevice = TRUE;
+ }
+
if (!INF_GetDataField(&Context, 1, &ImagePath))
return FALSE;
RtlCopyMemory(FullImagePath, PathPrefix.Buffer, PathPrefix.MaximumLength);
wcscat(FullImagePath, ImagePath);
- DPRINT("Using driver '%S' for device '%S'\n", ImagePath, DeviceId);
+ DPRINT1("Using driver '%S' for device '%S'\n", ImagePath, DeviceId);
/* Create service key */
RtlInitUnicodeString(&StringU, Driver);
ImagePath,
(wcslen(ImagePath) + 1) * sizeof(WCHAR));
+ if (keyboardDevice)
+ {
+ DPRINT1("Installing keyboard class driver for '%S'\n", DeviceId);
+ NtSetValueKey(hDeviceKey,
+ &UpperFiltersU,
+ 0,
+ REG_MULTI_SZ,
+ keyboardClass,
+ (wcslen(keyboardClass) + 2) * sizeof(WCHAR));
+ }
+
/* Associate device with the service we just filled */
Status = NtSetValueKey(
hDeviceKey,