ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static NTSTATUS ReadRegistryEntries ( IN PUNICODE_STRING  RegistryPath,
IN PSERMOUSE_DRIVER_EXTENSION  DriverExtension 
) [static]

Definition at line 34 of file sermouse.c.

{
    UNICODE_STRING ParametersRegistryKey;
    RTL_QUERY_REGISTRY_TABLE Parameters[2];
    NTSTATUS Status;

    ULONG DefaultNumberOfButtons = 2;

    ParametersRegistryKey.Length = 0;
    ParametersRegistryKey.MaximumLength = RegistryPath->Length + sizeof(L"\\Parameters") + sizeof(UNICODE_NULL);
    ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool, ParametersRegistryKey.MaximumLength, SERMOUSE_TAG);
    if (!ParametersRegistryKey.Buffer)
    {
        WARN_(SERMOUSE, "ExAllocatePoolWithTag() failed\n");
        return STATUS_NO_MEMORY;
    }
    RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
    RtlAppendUnicodeToString(&ParametersRegistryKey, L"\\Parameters");
    ParametersRegistryKey.Buffer[ParametersRegistryKey.Length / sizeof(WCHAR)] = UNICODE_NULL;

    RtlZeroMemory(Parameters, sizeof(Parameters));

    Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
    Parameters[0].Name = L"NumberOfButtons";
    Parameters[0].EntryContext = &DriverExtension->NumberOfButtons;
    Parameters[0].DefaultType = REG_DWORD;
    Parameters[0].DefaultData = &DefaultNumberOfButtons;
    Parameters[0].DefaultLength = sizeof(ULONG);

    Status = RtlQueryRegistryValues(
        RTL_REGISTRY_ABSOLUTE,
        ParametersRegistryKey.Buffer,
        Parameters,
        NULL,
        NULL);

    if (NT_SUCCESS(Status))
    {
        /* Check values */
    }
    else if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
    {
        /* Registry path doesn't exist. Set defaults */
        DriverExtension->NumberOfButtons = (USHORT)DefaultNumberOfButtons;
        Status = STATUS_SUCCESS;
    }

    ExFreePoolWithTag(ParametersRegistryKey.Buffer, SERMOUSE_TAG);
    return Status;
}

Generated on Sat May 26 2012 05:23:09 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.