Ignore:
Timestamp:
Aug 20, 2000, 5:17:00 PM (25 years ago)
Author:
phaller
Message:

Fix of broken build due to WINE sync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/NTDLL/reg.cpp

    r484 r4059  
    1 /* $Id: reg.cpp,v 1.3 1999-08-11 22:23:47 phaller Exp $ */
     1/* $Id: reg.cpp,v 1.4 2000-08-20 15:16:58 phaller Exp $ */
    22
    33/*
     
    1616#include <winreg.h>
    1717
     18#include <heapstring.h>
     19#include "debugtools.h"
    1820#include "ntdll.h"
     21
     22
     23/* translates predefined paths to HKEY_ constants */
     24static BOOLEAN _NtKeyToWinKey(
     25                              IN POBJECT_ATTRIBUTES ObjectAttributes,
     26                              OUT UINT * Offset,/* offset within ObjectName */
     27                              OUT HKEY * KeyHandle)/* translated handle */
     28{
     29  static const WCHAR KeyPath_HKLM[] = {
     30    '\\','R','E','G','I','S','T','R','Y',
     31      '\\','M','A','C','H','I','N','E',0};
     32  static const WCHAR KeyPath_HKU [] = {
     33    '\\','R','E','G','I','S','T','R','Y',
     34      '\\','U','S','E','R',0};
     35  static const WCHAR KeyPath_HCC [] = {
     36    '\\','R','E','G','I','S','T','R','Y',
     37      '\\','M','A','C','H','I','N','E',
     38      '\\','S','Y','S','T','E','M',
     39      '\\','C','U','R','R','E','N','T','C','O','N','T','R','O','L','S','E','T',
     40      '\\','H','A','R','D','W','A','R','E','P','R','O','F','I','L','E','S',
     41      '\\','C','U','R','R','E','N','T',0};
     42  static const WCHAR KeyPath_HCR [] = {
     43    '\\','R','E','G','I','S','T','R','Y',
     44      '\\','M','A','C','H','I','N','E',
     45      '\\','S','O','F','T','W','A','R','E',
     46      '\\','C','L','A','S','S','E','S',0};
     47  int len;
     48  PUNICODE_STRING ObjectName = ObjectAttributes->ObjectName;
     49 
     50  if(ObjectAttributes->RootDirectory)
     51  {
     52    len = 0;
     53    *KeyHandle = ObjectAttributes->RootDirectory;
     54  }
     55  else if((ObjectName->Length > (len=lstrlenW(KeyPath_HKLM)))
     56          && (0==lstrncmpiW(ObjectName->Buffer,KeyPath_HKLM,len)))
     57  {  *KeyHandle = HKEY_LOCAL_MACHINE;
     58  }
     59  else if((ObjectName->Length > (len=lstrlenW(KeyPath_HKU)))
     60          && (0==lstrncmpiW(ObjectName->Buffer,KeyPath_HKU,len)))
     61  {  *KeyHandle = HKEY_USERS;
     62  }
     63  else if((ObjectName->Length > (len=lstrlenW(KeyPath_HCR)))
     64          && (0==lstrncmpiW(ObjectName->Buffer,KeyPath_HCR,len)))
     65  {  *KeyHandle = HKEY_CLASSES_ROOT;
     66  }
     67  else if((ObjectName->Length > (len=lstrlenW(KeyPath_HCC)))
     68          && (0==lstrncmpiW(ObjectName->Buffer,KeyPath_HCC,len)))
     69  {  *KeyHandle = HKEY_CURRENT_CONFIG;
     70  }
     71  else
     72  {
     73    *KeyHandle = 0;
     74    *Offset = 0;
     75    return FALSE;
     76  }
     77 
     78  if (len > 0 && ObjectName->Buffer[len] == (WCHAR)'\\') len++;
     79  *Offset = len;
     80 
     81  TRACE("off=%u hkey=0x%08x\n", *Offset, *KeyHandle);
     82  return TRUE;
     83}
     84
    1985
    2086
Note: See TracChangeset for help on using the changeset viewer.