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
7a07a5e3
Commit
7a07a5e3
authored
Mar 07, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Return a non-empty username from GetNamedPipeHandleState.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e5bed7c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
sync.c
dlls/kernel32/sync.c
+22
-13
No files found.
dlls/kernel32/sync.c
View file @
7a07a5e3
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#include "winioctl.h"
#include "winioctl.h"
#include "ddk/wdm.h"
#include "ddk/wdm.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "kernel_private.h"
#include "kernel_private.h"
...
@@ -1784,16 +1785,22 @@ BOOL WINAPI GetNamedPipeHandleStateA(
...
@@ -1784,16 +1785,22 @@ BOOL WINAPI GetNamedPipeHandleStateA(
LPDWORD
lpMaxCollectionCount
,
LPDWORD
lpCollectDataTimeout
,
LPDWORD
lpMaxCollectionCount
,
LPDWORD
lpCollectDataTimeout
,
LPSTR
lpUsername
,
DWORD
nUsernameMaxSize
)
LPSTR
lpUsername
,
DWORD
nUsernameMaxSize
)
{
{
WARN
(
"%p %p %p %p %p %p %d: semi-stub
\n
"
,
WCHAR
*
username
=
NULL
;
hNamedPipe
,
lpState
,
lpCurInstances
,
BOOL
ret
;
lpMaxCollectionCount
,
lpCollectDataTimeout
,
lpUsername
,
nUsernameMaxSize
);
if
(
lpUsername
&&
nUsernameMaxSize
)
WARN
(
"%p %p %p %p %p %p %d: semi-stub
\n
"
,
hNamedPipe
,
lpState
,
lpCurInstances
,
*
lpUsername
=
0
;
lpMaxCollectionCount
,
lpCollectDataTimeout
,
lpUsername
,
nUsernameMaxSize
);
if
(
lpUsername
&&
nUsernameMaxSize
&&
!
(
username
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nUsernameMaxSize
*
sizeof
(
WCHAR
))))
return
FALSE
;
ret
=
GetNamedPipeHandleStateW
(
hNamedPipe
,
lpState
,
lpCurInstances
,
lpMaxCollectionCount
,
lpCollectDataTimeout
,
username
,
nUsernameMaxSize
);
if
(
ret
&&
username
)
WideCharToMultiByte
(
CP_ACP
,
0
,
username
,
-
1
,
lpUsername
,
nUsernameMaxSize
,
NULL
,
NULL
);
return
GetNamedPipeHandleStateW
(
hNamedPipe
,
lpState
,
lpCurInstances
,
HeapFree
(
GetProcessHeap
(),
0
,
username
);
lpMaxCollectionCount
,
lpCollectDataTimeout
,
NULL
,
0
)
;
return
ret
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -1807,10 +1814,8 @@ BOOL WINAPI GetNamedPipeHandleStateW(
...
@@ -1807,10 +1814,8 @@ BOOL WINAPI GetNamedPipeHandleStateW(
IO_STATUS_BLOCK
iosb
;
IO_STATUS_BLOCK
iosb
;
NTSTATUS
status
;
NTSTATUS
status
;
FIXME
(
"%p %p %p %p %p %p %d: semi-stub
\n
"
,
FIXME
(
"%p %p %p %p %p %p %d: semi-stub
\n
"
,
hNamedPipe
,
lpState
,
lpCurInstances
,
hNamedPipe
,
lpState
,
lpCurInstances
,
lpMaxCollectionCount
,
lpCollectDataTimeout
,
lpUsername
,
nUsernameMaxSize
);
lpMaxCollectionCount
,
lpCollectDataTimeout
,
lpUsername
,
nUsernameMaxSize
);
if
(
lpMaxCollectionCount
)
if
(
lpMaxCollectionCount
)
*
lpMaxCollectionCount
=
0
;
*
lpMaxCollectionCount
=
0
;
...
@@ -1819,7 +1824,11 @@ BOOL WINAPI GetNamedPipeHandleStateW(
...
@@ -1819,7 +1824,11 @@ BOOL WINAPI GetNamedPipeHandleStateW(
*
lpCollectDataTimeout
=
0
;
*
lpCollectDataTimeout
=
0
;
if
(
lpUsername
&&
nUsernameMaxSize
)
if
(
lpUsername
&&
nUsernameMaxSize
)
*
lpUsername
=
0
;
{
const
char
*
username
=
wine_get_user_name
();
int
len
=
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
username
,
-
1
,
lpUsername
,
nUsernameMaxSize
);
if
(
!
len
)
*
lpUsername
=
0
;
}
if
(
lpState
)
if
(
lpState
)
{
{
...
...
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