OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING SubKeyName;
- RtlInitUnicodeString(&SubKeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyName,
LONG Ret;
if (lpSubKey != NULL &&
- !RtlCreateUnicodeStringFromAsciiz(&SubKeyName,
- (LPSTR)lpSubKey))
+ !RtlCreateUnicodeStringFromAsciiz(&SubKeyName, lpSubKey))
{
return ERROR_NOT_ENOUGH_MEMORY;
}
LONG Ret;
if (lpMachineName != NULL &&
- !RtlCreateUnicodeStringFromAsciiz(&MachineName,
- (LPSTR)lpMachineName))
+ !RtlCreateUnicodeStringFromAsciiz(&MachineName, lpMachineName))
{
return ERROR_NOT_ENOUGH_MEMORY;
}
ERR("Wow64 not yet supported!\n");
- RtlInitUnicodeString(&SubKeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyName,
OBJ_CASE_INSENSITIVE,
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING SubKeyName;
- RtlInitUnicodeString(&SubKeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyName,
else
CurKey = KeyHandle;
- RtlInitUnicodeString(&ValueName,
- (LPWSTR)lpValueName);
+ RtlInitUnicodeString(&ValueName, lpValueName);
Status = NtDeleteValueKey(CurKey,
&ValueName);
LONG Ret;
if (lpSubKey != NULL &&
- !RtlCreateUnicodeStringFromAsciiz(&SubKey,
- (LPSTR)lpSubKey))
+ !RtlCreateUnicodeStringFromAsciiz(&SubKey, lpSubKey))
{
return ERROR_NOT_ENOUGH_MEMORY;
}
if (lpValueName != NULL &&
- !RtlCreateUnicodeStringFromAsciiz(&ValueName,
- (LPSTR)lpValueName))
+ !RtlCreateUnicodeStringFromAsciiz(&ValueName, lpValueName))
{
RtlFreeUnicodeString(&SubKey);
return ERROR_NOT_ENOUGH_MEMORY;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING SubKeyName;
- RtlInitUnicodeString(&SubKeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyName,
LONG Ret;
if (lpSubKey != NULL &&
- !RtlCreateUnicodeStringFromAsciiz(&SubKeyName,
- (LPSTR)lpSubKey))
+ !RtlCreateUnicodeStringFromAsciiz(&SubKeyName, lpSubKey))
{
return ERROR_NOT_ENOUGH_MEMORY;
}
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING SubKeyName;
- RtlInitUnicodeString(&SubKeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyName,
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING SubKeyName;
- if (!RtlCreateUnicodeStringFromAsciiz(&SubKeyName,
- (LPSTR)lpSubKey))
+ if (!RtlCreateUnicodeStringFromAsciiz(&SubKeyName, lpSubKey))
{
Ret = ERROR_NOT_ENOUGH_MEMORY;
goto Cleanup;
return RtlNtStatusToDosError(Status);
}
- RtlCreateUnicodeStringFromAsciiz(&ValueName,
- (LPSTR)lpValueName);
+ RtlCreateUnicodeStringFromAsciiz(&ValueName, lpValueName);
Status = NtDeleteValueKey(KeyHandle,
&ValueName);
RtlFreeUnicodeString (&ValueName);
return RtlNtStatusToDosError(Status);
}
- RtlInitUnicodeString(&ValueName,
- (LPWSTR)lpValueName);
+ RtlInitUnicodeString(&ValueName, lpValueName);
Status = NtDeleteValueKey(KeyHandle,
&ValueName);
/* Convert the name string */
RtlUnicodeToMultiByteN(lpName, *lpcbName, lpcbName, NameBuffer, NameBufferSize * sizeof(WCHAR));
- ((PSTR)lpName)[*lpcbName] = '\0';
+ lpName[*lpcbName] = ANSI_NULL;
Exit:
if (NameBuffer)
NULL,
NULL);
- RtlInitUnicodeString(&KeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&KeyName, lpSubKey);
InitializeObjectAttributes(&KeyObjectAttributes,
&KeyName,
if (ulOptions & REG_OPTION_OPEN_LINK)
Attributes |= OBJ_OPENLINK;
- if (lpSubKey != NULL)
- RtlInitUnicodeString(&SubKeyString, (LPWSTR)lpSubKey);
- else
- RtlInitUnicodeString(&SubKeyString, (LPWSTR)L"");
+ RtlInitUnicodeString(&SubKeyString, lpSubKey ? lpSubKey : L"");
InitializeObjectAttributes(&ObjectAttributes,
&SubKeyString,
{
ULONG i;
DWORD maxBytes = *ldwTotsize;
- LPSTR bufptr = (LPSTR)lpValueBuf;
+ LPSTR bufptr = lpValueBuf;
LONG ErrorCode;
if (maxBytes >= (1024*1024))
/* Open the real key */
if (lpSubKey != NULL && *lpSubKey != (WCHAR)0)
{
- RtlInitUnicodeString(&SubKeyName,
- (PWSTR)lpSubKey);
+ RtlInitUnicodeString(&SubKeyName, lpSubKey);
InitializeObjectAttributes(&KeyObjectAttributes,
&SubKeyName,
OBJ_CASE_INSENSITIVE,
/* Convert SubKey name to Unicode */
if (lpValueName != NULL && lpValueName[0] != '\0')
{
- if (!RtlCreateUnicodeStringFromAsciiz(&ValueName, (PSTR)lpValueName))
+ if (!RtlCreateUnicodeStringFromAsciiz(&ValueName, lpValueName))
return ERROR_NOT_ENOUGH_MEMORY;
}
else
return RtlNtStatusToDosError(Status);
}
- RtlInitUnicodeString(&KeyName,
- (LPWSTR)lpSubKey);
+ RtlInitUnicodeString(&KeyName, lpSubKey);
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,