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
fecde1ea
Commit
fecde1ea
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: Return Unicode length instead of ANSI in GetUserObjectInformationA.
parent
83f67ff9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
winstation.c
dlls/user32/tests/winstation.c
+2
-2
winstation.c
dlls/user32/winstation.c
+6
-2
No files found.
dlls/user32/tests/winstation.c
View file @
fecde1ea
...
...
@@ -397,7 +397,7 @@ static void test_getuserobjectinformation(void)
ok
(
!
ret
,
"GetUserObjectInformationA returned %x"
,
ret
);
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) */
ok
(
size
==
22
,
"size is set to %d
\n
"
,
size
);
/* Windows returns Unicode length (11*2) */
/* Get string */
SetLastError
(
0xdeadbeef
);
...
...
@@ -439,7 +439,7 @@ static void test_getuserobjectinformation(void)
ok
(
!
ret
,
"GetUserObjectInformationA returned %x"
,
ret
);
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) */
ok
(
size
==
16
,
"size is set to %d
\n
"
,
size
);
/* Windows returns Unicode length (8*2) */
/* Get string */
SetLastError
(
0xdeadbeef
);
...
...
dlls/user32/winstation.c
View file @
fecde1ea
...
...
@@ -477,13 +477,17 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW
if
(
index
==
UOI_TYPE
||
index
==
UOI_NAME
)
{
WCHAR
buffer
[
MAX_PATH
];
DWORD
lenA
;
DWORD
lenA
,
lenW
;
if
(
!
GetUserObjectInformationW
(
handle
,
index
,
buffer
,
sizeof
(
buffer
),
NULL
))
return
FALSE
;
if
(
!
GetUserObjectInformationW
(
handle
,
index
,
buffer
,
sizeof
(
buffer
),
&
lenW
))
return
FALSE
;
lenA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buffer
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
needed
)
*
needed
=
lenA
;
if
(
lenA
>
len
)
{
/* If the buffer length supplied by the caller is insufficient, Windows returns a
'needed' length based upon the Unicode byte length, so we should do similarly. */
if
(
needed
)
*
needed
=
lenW
;
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
...
...
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