Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9f426df0
Commit
9f426df0
authored
Jan 05, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix race on apartment creation.
- Display errors in decimal to make searching for the meaning in winerror.h easier.
parent
a6a416cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
7 deletions
+38
-7
rpc.c
dlls/ole32/rpc.c
+38
-7
No files found.
dlls/ole32/rpc.c
View file @
9f426df0
...
@@ -125,7 +125,7 @@ static HRESULT WINAPI
...
@@ -125,7 +125,7 @@ static HRESULT WINAPI
read_pipe
(
HANDLE
hf
,
LPVOID
ptr
,
DWORD
size
)
{
read_pipe
(
HANDLE
hf
,
LPVOID
ptr
,
DWORD
size
)
{
DWORD
res
;
DWORD
res
;
if
(
!
ReadFile
(
hf
,
ptr
,
size
,
&
res
,
NULL
))
{
if
(
!
ReadFile
(
hf
,
ptr
,
size
,
&
res
,
NULL
))
{
FIXME
(
"Failed to read from %p, le is %l
x
\n
"
,
hf
,
GetLastError
());
FIXME
(
"Failed to read from %p, le is %l
d
\n
"
,
hf
,
GetLastError
());
return
E_FAIL
;
return
E_FAIL
;
}
}
if
(
res
!=
size
)
{
if
(
res
!=
size
)
{
...
@@ -165,7 +165,7 @@ static HRESULT WINAPI
...
@@ -165,7 +165,7 @@ static HRESULT WINAPI
write_pipe
(
HANDLE
hf
,
LPVOID
ptr
,
DWORD
size
)
{
write_pipe
(
HANDLE
hf
,
LPVOID
ptr
,
DWORD
size
)
{
DWORD
res
;
DWORD
res
;
if
(
!
WriteFile
(
hf
,
ptr
,
size
,
&
res
,
NULL
))
{
if
(
!
WriteFile
(
hf
,
ptr
,
size
,
&
res
,
NULL
))
{
FIXME
(
"Failed to write to %p, le is %l
x
\n
"
,
hf
,
GetLastError
());
FIXME
(
"Failed to write to %p, le is %l
d
\n
"
,
hf
,
GetLastError
());
return
E_FAIL
;
return
E_FAIL
;
}
}
if
(
res
!=
size
)
{
if
(
res
!=
size
)
{
...
@@ -877,6 +877,12 @@ static DWORD WINAPI stub_dispatch_thread(LPVOID param)
...
@@ -877,6 +877,12 @@ static DWORD WINAPI stub_dispatch_thread(LPVOID param)
return
0
;
return
0
;
}
}
struct
apartment_listener_params
{
APARTMENT
*
apt
;
HANDLE
event
;
};
/* This thread listens on a named pipe for each apartment that exports
/* This thread listens on a named pipe for each apartment that exports
* objects. It deals with incoming connection requests. Each time a
* objects. It deals with incoming connection requests. Each time a
* client connects a separate thread is spawned for that particular
* client connects a separate thread is spawned for that particular
...
@@ -884,11 +890,15 @@ static DWORD WINAPI stub_dispatch_thread(LPVOID param)
...
@@ -884,11 +890,15 @@ static DWORD WINAPI stub_dispatch_thread(LPVOID param)
*
*
* This architecture is different in native DCOM.
* This architecture is different in native DCOM.
*/
*/
static
DWORD
WINAPI
apartment_listener_thread
(
LPVOID
p
aram
)
static
DWORD
WINAPI
apartment_listener_thread
(
LPVOID
p
)
{
{
char
pipefn
[
200
];
char
pipefn
[
200
];
HANDLE
listenPipe
;
HANDLE
listenPipe
;
APARTMENT
*
apt
=
(
APARTMENT
*
)
param
;
struct
apartment_listener_params
*
params
=
(
struct
apartment_listener_params
*
)
p
;
APARTMENT
*
apt
=
params
->
apt
;
HANDLE
event
=
params
->
event
;
HeapFree
(
GetProcessHeap
(),
0
,
params
);
/* we must join the marshalling threads apartment. we already have a ref here */
/* we must join the marshalling threads apartment. we already have a ref here */
NtCurrentTeb
()
->
ReservedForOle
=
apt
;
NtCurrentTeb
()
->
ReservedForOle
=
apt
;
...
@@ -907,15 +917,25 @@ static DWORD WINAPI apartment_listener_thread(LPVOID param)
...
@@ -907,15 +917,25 @@ static DWORD WINAPI apartment_listener_thread(LPVOID param)
NMPWAIT_USE_DEFAULT_WAIT
,
NMPWAIT_USE_DEFAULT_WAIT
,
NULL
NULL
);
);
/* tell function that started this thread that we have attempted to created the
* named pipe. */
if
(
event
)
{
SetEvent
(
event
);
event
=
NULL
;
}
if
(
listenPipe
==
INVALID_HANDLE_VALUE
)
{
if
(
listenPipe
==
INVALID_HANDLE_VALUE
)
{
FIXME
(
"pipe creation failed for %s, error %l
x
\n
"
,
pipefn
,
GetLastError
());
FIXME
(
"pipe creation failed for %s, error %l
d
\n
"
,
pipefn
,
GetLastError
());
return
1
;
/* permanent failure, so quit stubmgr thread */
return
1
;
/* permanent failure, so quit stubmgr thread */
}
}
if
(
!
ConnectNamedPipe
(
listenPipe
,
NULL
))
{
if
(
!
ConnectNamedPipe
(
listenPipe
,
NULL
))
{
ERR
(
"Failure during ConnectNamedPipe %l
x
!
\n
"
,
GetLastError
());
ERR
(
"Failure during ConnectNamedPipe %l
d
!
\n
"
,
GetLastError
());
CloseHandle
(
listenPipe
);
CloseHandle
(
listenPipe
);
continue
;
continue
;
}
}
PIPE_StartRequestThread
(
listenPipe
);
PIPE_StartRequestThread
(
listenPipe
);
}
}
return
0
;
return
0
;
...
@@ -939,7 +959,18 @@ void start_apartment_listener_thread()
...
@@ -939,7 +959,18 @@ void start_apartment_listener_thread()
if
(
!
apt
->
listenertid
)
if
(
!
apt
->
listenertid
)
{
{
CreateThread
(
NULL
,
0
,
apartment_listener_thread
,
apt
,
0
,
&
apt
->
listenertid
);
HANDLE
thread
;
HANDLE
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
struct
apartment_listener_params
*
params
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
params
));
params
->
apt
=
apt
;
params
->
event
=
event
;
thread
=
CreateThread
(
NULL
,
0
,
apartment_listener_thread
,
params
,
0
,
&
apt
->
listenertid
);
CloseHandle
(
thread
);
/* wait for pipe to be created before returning, otherwise we
* might try to use it and fail */
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
}
}
}
}
...
...
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