Commit 83f67ff9 authored by Owen Rudge's avatar Owen Rudge Committed by Alexandre Julliard

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

parent f443f291
......@@ -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) */
......
......@@ -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 );
......
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