advapi32: Cast-qual warning fix.

This commit is contained in:
Alexandre Julliard 2006-10-18 14:08:13 +02:00
parent 90b1d7abe6
commit e852f195a0
1 changed files with 11 additions and 11 deletions

View File

@ -73,18 +73,16 @@ static const WCHAR name_CURRENT_CONFIG[] =
static const WCHAR name_DYN_DATA[] = static const WCHAR name_DYN_DATA[] =
{'D','y','n','D','a','t','a',0}; {'D','y','n','D','a','t','a',0};
#define DECL_STR(key) { sizeof(name_##key)-sizeof(WCHAR), sizeof(name_##key), (LPWSTR)name_##key } static const WCHAR *root_key_names[NB_SPECIAL_ROOT_KEYS] =
static UNICODE_STRING root_key_names[NB_SPECIAL_ROOT_KEYS] =
{ {
DECL_STR(CLASSES_ROOT), name_CLASSES_ROOT,
{ 0, 0, NULL }, /* HKEY_CURRENT_USER is determined dynamically */ NULL, /* HKEY_CURRENT_USER is determined dynamically */
DECL_STR(LOCAL_MACHINE), name_LOCAL_MACHINE,
DECL_STR(USERS), name_USERS,
DECL_STR(PERFORMANCE_DATA), name_PERFORMANCE_DATA,
DECL_STR(CURRENT_CONFIG), name_CURRENT_CONFIG,
DECL_STR(DYN_DATA) name_DYN_DATA
}; };
#undef DECL_STR
/* check if value type needs string conversion (Ansi<->Unicode) */ /* check if value type needs string conversion (Ansi<->Unicode) */
@ -117,13 +115,15 @@ static HKEY create_special_root_hkey( HANDLE hkey, DWORD access )
else else
{ {
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
UNICODE_STRING name;
attr.Length = sizeof(attr); attr.Length = sizeof(attr);
attr.RootDirectory = 0; attr.RootDirectory = 0;
attr.ObjectName = &root_key_names[idx]; attr.ObjectName = &name;
attr.Attributes = 0; attr.Attributes = 0;
attr.SecurityDescriptor = NULL; attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL; attr.SecurityQualityOfService = NULL;
RtlInitUnicodeString( &name, root_key_names[idx] );
if (NtCreateKey( &hkey, access, &attr, 0, NULL, 0, NULL )) return 0; if (NtCreateKey( &hkey, access, &attr, 0, NULL, 0, NULL )) return 0;
TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey ); TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey );
} }