Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
83f67ff9
Commit
83f67ff9
authored
May 14, 2012
by
Owen Rudge
Committed by
Alexandre Julliard
May 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Correct return value when buffer too short in GetUserObjectInformation.
parent
f443f291
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
winstation.c
dlls/user32/tests/winstation.c
+4
-4
winstation.c
dlls/user32/winstation.c
+3
-3
No files found.
dlls/user32/tests/winstation.c
View file @
83f67ff9
...
...
@@ -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) */
...
...
dlls/user32/winstation.c
View file @
83f67ff9
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment