Commit 2c655f5e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed some bogus error detection for RegEnumValue[AW] and

RegQueryValueEx[AW].
parent 88a2954a
...@@ -64,7 +64,7 @@ static DWORD copy_data( void *data, const void *src, DWORD len, DWORD *count ) ...@@ -64,7 +64,7 @@ static DWORD copy_data( void *data, const void *src, DWORD len, DWORD *count )
if (*count < len) ret = ERROR_MORE_DATA; if (*count < len) ret = ERROR_MORE_DATA;
else memcpy( data, src, len ); else memcpy( data, src, len );
} }
*count = len; if (count) *count = len;
return ret; return ret;
} }
...@@ -87,7 +87,7 @@ static DWORD copy_data_WtoA( void *data, const void *src, DWORD len, DWORD *coun ...@@ -87,7 +87,7 @@ static DWORD copy_data_WtoA( void *data, const void *src, DWORD len, DWORD *coun
if (*count < len) ret = ERROR_MORE_DATA; if (*count < len) ret = ERROR_MORE_DATA;
else memcpy( data, src, len ); else memcpy( data, src, len );
} }
*count = len; if (count) *count = len;
return ret; return ret;
} }
...@@ -728,7 +728,7 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR ...@@ -728,7 +728,7 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR
TRACE("(0x%x,%s,%p,%p,%p,%p=%ld)\n", TRACE("(0x%x,%s,%p,%p,%p,%p=%ld)\n",
hkey, debugstr_w(name), reserved, type, data, count, count ? *count : 0 ); hkey, debugstr_w(name), reserved, type, data, count, count ? *count : 0 );
if (!count || reserved) return ERROR_INVALID_PARAMETER; if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
req->hkey = hkey; req->hkey = hkey;
if ((ret = copy_nameW( req->name, name )) != ERROR_SUCCESS) return ret; if ((ret = copy_nameW( req->name, name )) != ERROR_SUCCESS) return ret;
...@@ -756,7 +756,7 @@ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD ...@@ -756,7 +756,7 @@ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD
TRACE("(0x%x,%s,%p,%p,%p,%p=%ld)\n", TRACE("(0x%x,%s,%p,%p,%p,%p=%ld)\n",
hkey, debugstr_a(name), reserved, type, data, count, count ? *count : 0 ); hkey, debugstr_a(name), reserved, type, data, count, count ? *count : 0 );
if (!count || reserved) return ERROR_INVALID_PARAMETER; if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
req->hkey = hkey; req->hkey = hkey;
if ((ret = copy_nameAtoW( req->name, name )) != ERROR_SUCCESS) return ret; if ((ret = copy_nameAtoW( req->name, name )) != ERROR_SUCCESS) return ret;
...@@ -847,7 +847,7 @@ DWORD WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_co ...@@ -847,7 +847,7 @@ DWORD WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_co
hkey, index, value, val_count, reserved, type, data, count ); hkey, index, value, val_count, reserved, type, data, count );
/* NT only checks count, not val_count */ /* NT only checks count, not val_count */
if (!count || reserved) return ERROR_INVALID_PARAMETER; if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
req->hkey = hkey; req->hkey = hkey;
req->index = index; req->index = index;
...@@ -876,7 +876,7 @@ DWORD WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_cou ...@@ -876,7 +876,7 @@ DWORD WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_cou
hkey, index, value, val_count, reserved, type, data, count ); hkey, index, value, val_count, reserved, type, data, count );
/* NT only checks count, not val_count */ /* NT only checks count, not val_count */
if (!count || reserved) return ERROR_INVALID_PARAMETER; if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
req->hkey = hkey; req->hkey = hkey;
req->index = index; req->index = index;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment