Used the given registry path from DriverEntry to query the registry.
[reactos.git] / reactos / drivers / input / i8042prt / registry.c
index 09abbd6..8c25872 100644 (file)
@@ -30,9 +30,6 @@ VOID STDCALL I8042ReadRegistry(PDRIVER_OBJECT DriverObject,
 
 {
        RTL_QUERY_REGISTRY_TABLE Parameters[19];
-       UNICODE_STRING ParametersPath;
-
-       PWSTR RegistryPath = L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\i8042Prt\\Parameters";
 
        NTSTATUS Status;
 
@@ -55,23 +52,6 @@ VOID STDCALL I8042ReadRegistry(PDRIVER_OBJECT DriverObject,
        ULONG DefaultNumberOfButtons = 2;
        ULONG DefaultEnableWheelDetection = 1;
 
-       RtlInitUnicodeString(&ParametersPath, NULL);
-       ParametersPath.MaximumLength = (wcslen(RegistryPath) *
-                                               sizeof(WCHAR)) +
-                                      sizeof(UNICODE_NULL);
-
-       ParametersPath.Buffer = ExAllocatePoolWithTag(PagedPool,
-                                             ParametersPath.MaximumLength,
-                                             TAG_I8042);
-
-       if (!ParametersPath.Buffer) {
-               DPRINT1("No buffer space for reading registry\n");
-               return;
-       }
-
-       RtlZeroMemory(ParametersPath.Buffer, ParametersPath.MaximumLength);
-       RtlAppendUnicodeToString(&ParametersPath, RegistryPath);
-
        RtlZeroMemory(Parameters, sizeof(Parameters));
 
        Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
@@ -202,9 +182,8 @@ VOID STDCALL I8042ReadRegistry(PDRIVER_OBJECT DriverObject,
        Parameters[17].DefaultData = &DefaultEnableWheelDetection;
        Parameters[17].DefaultLength = sizeof(ULONG);
 
-       Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE |
-                                               RTL_REGISTRY_OPTIONAL,
-                                       ParametersPath.Buffer,
+       Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL,
+                                       I8042RegistryPath.Buffer,
                                        Parameters,
                                        NULL,
                                        NULL);
@@ -224,7 +203,6 @@ VOID STDCALL I8042ReadRegistry(PDRIVER_OBJECT DriverObject,
                DPRINT1 ("Manually set defaults\n");
 
        }
-       ExFreePoolWithTag(ParametersPath.Buffer, TAG_I8042);
 
        if (DevExt->Settings.MouseResolution > 3)
                DevExt->Settings.MouseResolution = 3;