user32: Correct return value when buffer too short in GetUserObjectInformation.

This commit is contained in:
Owen Rudge 2012-05-14 15:23:29 +01:00 committed by Alexandre Julliard
parent f443f29150
commit 83f67ff998
2 changed files with 7 additions and 7 deletions

View File

@ -396,7 +396,7 @@ static void test_getuserobjectinformation(void)
ret = GetUserObjectInformationA(desk, UOI_NAME, NULL, 0, &size);
ok(!ret, "GetUserObjectInformationA returned %x", ret);
todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
todo_wine ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode length (11*2) */
/* Get string */
@ -416,7 +416,7 @@ static void test_getuserobjectinformation(void)
ret = GetUserObjectInformationW(desk, UOI_NAME, NULL, 0, &size);
ok(!ret, "GetUserObjectInformationW returned %x", ret);
todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(size == 22, "size is set to %d\n", size); /* 22 bytes in 'foobarTest\0' in Unicode */
/* Get string (Unicode) */
@ -438,7 +438,7 @@ static void test_getuserobjectinformation(void)
ret = GetUserObjectInformationA(desk, UOI_TYPE, NULL, 0, &size);
ok(!ret, "GetUserObjectInformationA returned %x", ret);
todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
todo_wine ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode length (8*2) */
/* Get string */
@ -458,7 +458,7 @@ static void test_getuserobjectinformation(void)
ret = GetUserObjectInformationW(desk, UOI_TYPE, NULL, 0, &size);
ok(!ret, "GetUserObjectInformationW returned %x", ret);
todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError());
ok(size == 16, "size is set to %d\n", size); /* 16 bytes in 'Desktop\0' in Unicode */
/* Get string (Unicode) */

View File

@ -484,7 +484,7 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW
if (needed) *needed = lenA;
if (lenA > len)
{
SetLastError( ERROR_MORE_DATA );
SetLastError( ERROR_INSUFFICIENT_BUFFER );
return FALSE;
}
if (info) WideCharToMultiByte( CP_ACP, 0, buffer, -1, info, len, NULL, NULL );
@ -541,7 +541,7 @@ BOOL WINAPI GetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DW
if (needed) *needed = size;
if (len < size)
{
SetLastError( ERROR_MORE_DATA );
SetLastError( ERROR_INSUFFICIENT_BUFFER );
ret = FALSE;
}
else memcpy( info, reply->is_desktop ? desktopW : winstationW, size );
@ -567,7 +567,7 @@ BOOL WINAPI GetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DW
if (needed) *needed = size;
if (len < size)
{
SetLastError( ERROR_MORE_DATA );
SetLastError( ERROR_INSUFFICIENT_BUFFER );
ret = FALSE;
}
else memcpy( info, buffer, size );