advapi32: Remove always-true if statements from RegEnumValue[AW].
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
This commit is contained in:
parent
1eef1299f5
commit
18b7ec9479
|
@ -1940,10 +1940,7 @@ LSTATUS WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_
|
||||||
|
|
||||||
status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation,
|
status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation,
|
||||||
buffer, total_size, &total_size );
|
buffer, total_size, &total_size );
|
||||||
if (status && status != STATUS_BUFFER_OVERFLOW) goto done;
|
|
||||||
|
|
||||||
if (value || data)
|
|
||||||
{
|
|
||||||
/* retry with a dynamically allocated buffer */
|
/* retry with a dynamically allocated buffer */
|
||||||
while (status == STATUS_BUFFER_OVERFLOW)
|
while (status == STATUS_BUFFER_OVERFLOW)
|
||||||
{
|
{
|
||||||
|
@ -1957,8 +1954,6 @@ LSTATUS WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_
|
||||||
|
|
||||||
if (status) goto done;
|
if (status) goto done;
|
||||||
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
if (info->NameLength/sizeof(WCHAR) >= *val_count)
|
if (info->NameLength/sizeof(WCHAR) >= *val_count)
|
||||||
{
|
{
|
||||||
status = STATUS_BUFFER_OVERFLOW;
|
status = STATUS_BUFFER_OVERFLOW;
|
||||||
|
@ -1967,7 +1962,6 @@ LSTATUS WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_
|
||||||
memcpy( value, info->Name, info->NameLength );
|
memcpy( value, info->Name, info->NameLength );
|
||||||
*val_count = info->NameLength / sizeof(WCHAR);
|
*val_count = info->NameLength / sizeof(WCHAR);
|
||||||
value[*val_count] = 0;
|
value[*val_count] = 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
|
@ -1985,8 +1979,6 @@ LSTATUS WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_
|
||||||
if (ptr > (WCHAR *)data && ptr[-1]) *ptr = 0;
|
if (ptr > (WCHAR *)data && ptr[-1]) *ptr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else status = STATUS_SUCCESS;
|
|
||||||
|
|
||||||
overflow:
|
overflow:
|
||||||
if (type) *type = info->Type;
|
if (type) *type = info->Type;
|
||||||
|
@ -2025,12 +2017,10 @@ LSTATUS WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_c
|
||||||
|
|
||||||
status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation,
|
status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation,
|
||||||
buffer, total_size, &total_size );
|
buffer, total_size, &total_size );
|
||||||
if (status && status != STATUS_BUFFER_OVERFLOW) goto done;
|
|
||||||
|
|
||||||
/* we need to fetch the contents for a string type even if not requested,
|
/* we need to fetch the contents for a string type even if not requested,
|
||||||
* because we need to compute the length of the ASCII string. */
|
* because we need to compute the length of the ASCII string. */
|
||||||
if (value || data || is_string(info->Type))
|
|
||||||
{
|
|
||||||
/* retry with a dynamically allocated buffer */
|
/* retry with a dynamically allocated buffer */
|
||||||
while (status == STATUS_BUFFER_OVERFLOW)
|
while (status == STATUS_BUFFER_OVERFLOW)
|
||||||
{
|
{
|
||||||
|
@ -2069,7 +2059,7 @@ LSTATUS WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_c
|
||||||
else memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset );
|
else memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value && !status)
|
if (!status)
|
||||||
{
|
{
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
|
@ -2091,8 +2081,6 @@ LSTATUS WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_c
|
||||||
*val_count = len;
|
*val_count = len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else status = STATUS_SUCCESS;
|
|
||||||
|
|
||||||
if (type) *type = info->Type;
|
if (type) *type = info->Type;
|
||||||
if (count) *count = info->DataLength;
|
if (count) *count = info->DataLength;
|
||||||
|
|
Loading…
Reference in New Issue