if (Type == REG_DWORD)
{
- ULONG dw = Str ? wcstol (Str, NULL, 0) : 0;
+ ULONG dw = Str ? wcstoul (Str, NULL, 0) : 0;
DPRINT("setting dword %wZ to %lx\n", ValueName, dw);
UNICODE_STRING LocalKeyName;
ULONG Disposition;
NTSTATUS Status;
- ULONG FullNameLength;
- ULONG Length;
+ USHORT FullNameLength;
PWCHAR Ptr;
HANDLE LocalKeyHandle;
RtlCreateUnicodeString (&LocalKeyName,
ObjectAttributes->ObjectName->Buffer);
LocalObjectAttributes.ObjectName = &LocalKeyName;
- FullNameLength = LocalKeyName.Length / sizeof(WCHAR);
+ FullNameLength = LocalKeyName.Length;
/* Remove the last part of the key name and try to create the key again. */
while (Status == STATUS_OBJECT_NAME_NOT_FOUND)
}
/* Add removed parts of the key name and create them too. */
- Length = wcslen (LocalKeyName.Buffer);
while (TRUE)
{
- if (Length == FullNameLength)
+ if (LocalKeyName.Length == FullNameLength)
{
Status = STATUS_SUCCESS;
*KeyHandle = LocalKeyHandle;
}
NtClose (LocalKeyHandle);
- LocalKeyName.Buffer[Length] = L'\\';
- Length = wcslen (LocalKeyName.Buffer);
- LocalKeyName.Length = Length * sizeof(WCHAR);
+ LocalKeyName.Buffer[LocalKeyName.Length / sizeof(WCHAR)] = L'\\';
+ LocalKeyName.Length = wcslen (LocalKeyName.Buffer) * sizeof(WCHAR);
Status = NtCreateKey (&LocalKeyHandle,
KEY_ALL_ACCESS,
BOOLEAN
ImportRegistryFile(PWSTR Filename,
PWSTR Section,
+ LCID LocaleId,
BOOLEAN Delete)
{
WCHAR FileNameBuffer[MAX_PATH];
FileNameBuffer,
NULL,
INF_STYLE_WIN4,
+ LocaleId,
&ErrorLine);
if (hInf == INVALID_HANDLE_VALUE)
{
DPRINT1("registry_callback() failed\n");
}
- SetupCloseInfFile (hInf);
+ InfCloseFile (hInf);
return TRUE;
}