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
1b7d346d
Commit
1b7d346d
authored
Jan 20, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole: Verify that the proxy is being used in the correct thread.
parent
8c55c6f0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
+33
-6
rpc.c
dlls/ole32/rpc.c
+33
-4
marshal.c
dlls/ole32/tests/marshal.c
+0
-2
No files found.
dlls/ole32/rpc.c
View file @
1b7d346d
...
...
@@ -98,6 +98,7 @@ typedef struct
RpcChannelBuffer
super
;
/* superclass */
RPC_BINDING_HANDLE
bind
;
/* handle to the remote server */
OXID
oxid
;
/* apartment in which the channel is valid */
}
ClientRpcChannelBuffer
;
struct
dispatch_params
...
...
@@ -206,6 +207,12 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
return
HRESULT_FROM_WIN32
(
status
);
}
static
HRESULT
WINAPI
ServerRpcChannelBuffer_SendReceive
(
LPRPCCHANNELBUFFER
iface
,
RPCOLEMESSAGE
*
olemsg
,
ULONG
*
pstatus
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
}
/* this thread runs an outgoing RPC */
static
DWORD
WINAPI
rpc_sendreceive_thread
(
LPVOID
param
)
{
...
...
@@ -219,9 +226,22 @@ static DWORD WINAPI rpc_sendreceive_thread(LPVOID param)
return
0
;
}
static
HRESULT
WINAPI
RpcChannelBuffer_SendReceive
(
LPRPCCHANNELBUFFER
iface
,
RPCOLEMESSAGE
*
olemsg
,
ULONG
*
pstatus
)
static
inline
HRESULT
ClientRpcChannelBuffer_IsCorrectApartment
(
ClientRpcChannelBuffer
*
This
,
APARTMENT
*
apt
)
{
HRESULT
hr
=
S_OK
;
OXID
oxid
;
if
(
!
apt
)
return
S_FALSE
;
if
(
apartment_getoxid
(
apt
,
&
oxid
)
!=
S_OK
)
return
S_FALSE
;
if
(
This
->
oxid
!=
oxid
)
return
S_FALSE
;
return
S_OK
;
}
static
HRESULT
WINAPI
ClientRpcChannelBuffer_SendReceive
(
LPRPCCHANNELBUFFER
iface
,
RPCOLEMESSAGE
*
olemsg
,
ULONG
*
pstatus
)
{
ClientRpcChannelBuffer
*
This
=
(
ClientRpcChannelBuffer
*
)
iface
;
HRESULT
hr
;
RPC_MESSAGE
*
msg
=
(
RPC_MESSAGE
*
)
olemsg
;
RPC_STATUS
status
;
DWORD
index
;
...
...
@@ -232,6 +252,14 @@ static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPC
TRACE
(
"(%p) iMethod=%ld
\n
"
,
olemsg
,
olemsg
->
iMethod
);
hr
=
ClientRpcChannelBuffer_IsCorrectApartment
(
This
,
COM_CurrentApt
());
if
(
hr
!=
S_OK
)
{
ERR
(
"called from wrong apartment, should have been 0x%s
\n
"
,
wine_dbgstr_longlong
(
This
->
oxid
));
return
RPC_E_WRONG_THREAD
;
}
params
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
params
));
if
(
!
params
)
return
E_OUTOFMEMORY
;
...
...
@@ -369,7 +397,7 @@ static const IRpcChannelBufferVtbl ClientRpcChannelBufferVtbl =
RpcChannelBuffer_AddRef
,
ClientRpcChannelBuffer_Release
,
ClientRpcChannelBuffer_GetBuffer
,
RpcChannelBuffer_SendReceive
,
Client
RpcChannelBuffer_SendReceive
,
ClientRpcChannelBuffer_FreeBuffer
,
RpcChannelBuffer_GetDestCtx
,
RpcChannelBuffer_IsConnected
...
...
@@ -381,7 +409,7 @@ static const IRpcChannelBufferVtbl ServerRpcChannelBufferVtbl =
RpcChannelBuffer_AddRef
,
ServerRpcChannelBuffer_Release
,
ServerRpcChannelBuffer_GetBuffer
,
RpcChannelBuffer_SendReceive
,
Server
RpcChannelBuffer_SendReceive
,
ServerRpcChannelBuffer_FreeBuffer
,
RpcChannelBuffer_GetDestCtx
,
RpcChannelBuffer_IsConnected
...
...
@@ -440,6 +468,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, IRpcChannelB
This
->
super
.
lpVtbl
=
&
ClientRpcChannelBufferVtbl
;
This
->
super
.
refs
=
1
;
This
->
bind
=
bind
;
apartment_getoxid
(
COM_CurrentApt
(),
&
This
->
oxid
);
*
chan
=
(
IRpcChannelBuffer
*
)
This
;
...
...
dlls/ole32/tests/marshal.c
View file @
1b7d346d
...
...
@@ -1024,11 +1024,9 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
hr
=
IClassFactory_CreateInstance
(
cf
,
NULL
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
proxy
);
if
(
proxy
)
IUnknown_Release
(
proxy
);
todo_wine
{
ok
(
hr
==
RPC_E_WRONG_THREAD
,
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08lx
\n
"
,
hr
);
}
CoUninitialize
();
...
...
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