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

Definition at line 653 of file registry.c.

Referenced by RegistryPage().

{
  OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\HARDWARE");
  UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"InstallPath");
  HANDLE KeyHandle;
  NTSTATUS Status;

  /* Create the 'secret' InstallPath key */
  InitializeObjectAttributes (&ObjectAttributes,
                              &KeyName,
                              OBJ_CASE_INSENSITIVE,
                              NULL,
                              NULL);
  Status =  NtOpenKey (&KeyHandle,
                       KEY_ALL_ACCESS,
                       &ObjectAttributes);
  if (!NT_SUCCESS(Status))
    {
      DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
      return FALSE;
    }

  Status = NtSetValueKey (KeyHandle,
                          &ValueName,
                          0,
                          REG_SZ,
                          (PVOID)InstallPath->Buffer,
                          InstallPath->Length + sizeof(WCHAR));
  NtClose(KeyHandle);
  if (!NT_SUCCESS(Status))
    {
      DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
      return FALSE;
    }

  return TRUE;
}

Generated on Sun May 27 2012 04:41:58 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.