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
f01c1c42
Commit
f01c1c42
authored
Aug 01, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix a couple of race conditions with the local server pipe.
parent
0359b30b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
20 deletions
+24
-20
rpc.c
dlls/ole32/rpc.c
+24
-20
No files found.
dlls/ole32/rpc.c
View file @
f01c1c42
...
...
@@ -1890,7 +1890,7 @@ static DWORD WINAPI local_server_thread(LPVOID param)
ULONG
res
;
BOOL
multi_use
=
lsp
->
multi_use
;
OVERLAPPED
ovl
;
HANDLE
pipe_event
;
HANDLE
pipe_event
,
hPipe
,
new_pipe
;
DWORD
bytes
;
TRACE
(
"Starting threader for %s.
\n
"
,
debugstr_guid
(
&
lsp
->
clsid
));
...
...
@@ -1899,22 +1899,19 @@ static DWORD WINAPI local_server_thread(LPVOID param)
get_localserver_pipe_name
(
pipefn
,
&
lsp
->
clsid
);
ovl
.
hEvent
=
pipe_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hPipe
=
CreateNamedPipeW
(
pipefn
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_UNLIMITED_INSTANCES
,
4096
,
4096
,
500
/* 0.5 second timeout */
,
NULL
);
if
(
hPipe
==
INVALID_HANDLE_VALUE
)
{
FIXME
(
"pipe creation failed for %s, le is %u
\n
"
,
debugstr_w
(
pipefn
),
GetLastError
());
CloseHandle
(
pipe_event
);
return
1
;
}
SetEvent
(
lsp
->
ready_event
);
/* Clients trying to connect between now and CreateNamedPipeW() will
* fail and will have to retry. See also the end of the loop.
*/
while
(
1
)
{
HANDLE
hPipe
;
hPipe
=
CreateNamedPipeW
(
pipefn
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_UNLIMITED_INSTANCES
,
4096
,
4096
,
500
/* 0.5 second timeout */
,
NULL
);
if
(
hPipe
==
INVALID_HANDLE_VALUE
)
{
FIXME
(
"pipe creation failed for %s, le is %u
\n
"
,
debugstr_w
(
pipefn
),
GetLastError
());
CloseHandle
(
pipe_event
);
return
1
;
}
while
(
1
)
{
if
(
!
ConnectNamedPipe
(
hPipe
,
&
ovl
))
{
DWORD
error
=
GetLastError
();
...
...
@@ -1976,18 +1973,25 @@ static DWORD WINAPI local_server_thread(LPVOID param)
FlushFileBuffers
(
hPipe
);
DisconnectNamedPipe
(
hPipe
);
CloseHandle
(
hPipe
);
/* Clients trying to connect between now and CreateNamedPipeW() will
* fail and will have to retry.
*/
TRACE
(
"done marshalling IClassFactory
\n
"
);
if
(
!
multi_use
)
{
TRACE
(
"single use object, shutting down pipe %s
\n
"
,
debugstr_w
(
pipefn
));
CloseHandle
(
hPipe
);
break
;
}
new_pipe
=
CreateNamedPipeW
(
pipefn
,
PIPE_ACCESS_DUPLEX
|
FILE_FLAG_OVERLAPPED
,
PIPE_TYPE_BYTE
|
PIPE_WAIT
,
PIPE_UNLIMITED_INSTANCES
,
4096
,
4096
,
500
/* 0.5 second timeout */
,
NULL
);
CloseHandle
(
hPipe
);
if
(
new_pipe
==
INVALID_HANDLE_VALUE
)
{
FIXME
(
"pipe creation failed for %s, le is %u
\n
"
,
debugstr_w
(
pipefn
),
GetLastError
());
CloseHandle
(
pipe_event
);
return
1
;
}
hPipe
=
new_pipe
;
}
CloseHandle
(
pipe_event
);
return
0
;
...
...
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