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
5169f3c5
Commit
5169f3c5
authored
Jul 29, 2004
by
Mike Hearn
Committed by
Alexandre Julliard
Jul 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement disconnect for proxies so that stubs are properly
destroyed.
parent
fd233e22
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
4 deletions
+70
-4
compobj_private.h
dlls/ole32/compobj_private.h
+1
-0
marshal.c
dlls/ole32/marshal.c
+15
-0
rpc.c
dlls/ole32/rpc.c
+54
-4
No files found.
dlls/ole32/compobj_private.h
View file @
5169f3c5
...
@@ -147,6 +147,7 @@ MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) {
...
@@ -147,6 +147,7 @@ MARSHAL_Compare_Mids_NoInterface(wine_marshal_id *mid1, wine_marshal_id *mid2) {
}
}
HRESULT
MARSHAL_Find_Stub_Buffer
(
wine_marshal_id
*
mid
,
IRpcStubBuffer
**
stub
);
HRESULT
MARSHAL_Find_Stub_Buffer
(
wine_marshal_id
*
mid
,
IRpcStubBuffer
**
stub
);
void
MARSHAL_Invalidate_Stub_From_MID
(
wine_marshal_id
*
mid
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
...
...
dlls/ole32/marshal.c
View file @
5169f3c5
...
@@ -91,6 +91,21 @@ static int nrofstubs = 0;
...
@@ -91,6 +91,21 @@ static int nrofstubs = 0;
static
mid2unknown
*
proxies
=
NULL
;
static
mid2unknown
*
proxies
=
NULL
;
static
int
nrofproxies
=
0
;
static
int
nrofproxies
=
0
;
void
MARSHAL_Invalidate_Stub_From_MID
(
wine_marshal_id
*
mid
)
{
int
i
;
for
(
i
=
0
;
i
<
nrofstubs
;
i
++
)
{
if
(
!
stubs
[
i
].
valid
)
continue
;
if
(
MARSHAL_Compare_Mids
(
mid
,
&
(
stubs
[
i
].
mid
)))
{
stubs
[
i
].
valid
=
FALSE
;
return
;
}
}
return
;
}
HRESULT
HRESULT
MARSHAL_Find_Stub_Server
(
wine_marshal_id
*
mid
,
LPUNKNOWN
*
punk
)
{
MARSHAL_Find_Stub_Server
(
wine_marshal_id
*
mid
,
LPUNKNOWN
*
punk
)
{
int
i
;
int
i
;
...
...
dlls/ole32/rpc.c
View file @
5169f3c5
...
@@ -65,6 +65,14 @@ typedef struct _wine_rpc_response_header {
...
@@ -65,6 +65,14 @@ typedef struct _wine_rpc_response_header {
DWORD
retval
;
DWORD
retval
;
}
wine_rpc_response_header
;
}
wine_rpc_response_header
;
/* used when shutting down a pipe, e.g. at the end of a process */
#define REQTYPE_DISCONNECT 2
typedef
struct
_wine_rpc_disconnect_header
{
DWORD
reqid
;
wine_marshal_id
mid
;
/* mid of stub to delete */
}
wine_rpc_disconnect_header
;
#define REQSTATE_START 0
#define REQSTATE_START 0
#define REQSTATE_REQ_QUEUED 1
#define REQSTATE_REQ_QUEUED 1
#define REQSTATE_REQ_WAITING_FOR_REPLY 2
#define REQSTATE_REQ_WAITING_FOR_REPLY 2
...
@@ -285,10 +293,25 @@ PipeBuf_AddRef(LPRPCCHANNELBUFFER iface) {
...
@@ -285,10 +293,25 @@ PipeBuf_AddRef(LPRPCCHANNELBUFFER iface) {
static
ULONG
WINAPI
static
ULONG
WINAPI
PipeBuf_Release
(
LPRPCCHANNELBUFFER
iface
)
{
PipeBuf_Release
(
LPRPCCHANNELBUFFER
iface
)
{
ICOM_THIS
(
PipeBuf
,
iface
);
ICOM_THIS
(
PipeBuf
,
iface
);
wine_rpc_disconnect_header
header
;
HANDLE
pipe
;
DWORD
reqtype
=
REQTYPE_DISCONNECT
;
This
->
ref
--
;
This
->
ref
--
;
if
(
This
->
ref
)
if
(
This
->
ref
)
return
This
->
ref
;
return
This
->
ref
;
ERR
(
"Free all stuff.
\n
"
);
FIXME
(
"Free all stuff
\n
"
);
memcpy
(
&
header
.
mid
,
&
This
->
mid
,
sizeof
(
wine_marshal_id
));
pipe
=
PIPE_FindByMID
(
&
This
->
mid
);
_xwrite
(
pipe
,
&
reqtype
,
sizeof
(
reqtype
));
_xwrite
(
pipe
,
&
header
,
sizeof
(
wine_rpc_disconnect_header
));
TRACE
(
"written disconnect packet
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
0
;
}
}
...
@@ -631,7 +654,35 @@ _read_one(wine_pipe *xpipe) {
...
@@ -631,7 +654,35 @@ _read_one(wine_pipe *xpipe) {
EnterCriticalSection
(
&
(
xpipe
->
crit
));
EnterCriticalSection
(
&
(
xpipe
->
crit
));
/*FIXME("%lx got reqtype %ld\n",GetCurrentProcessId(),reqtype);*/
/*FIXME("%lx got reqtype %ld\n",GetCurrentProcessId(),reqtype);*/
if
(
reqtype
==
REQTYPE_REQUEST
)
{
if
(
reqtype
==
REQTYPE_DISCONNECT
)
{
/* only received by servers */
wine_rpc_disconnect_header
header
;
IRpcStubBuffer
*
stub
;
ULONG
ret
;
hres
=
_xread
(
xhPipe
,
&
header
,
sizeof
(
header
));
if
(
hres
)
{
ERR
(
"could not read disconnect header
\n
"
);
goto
end
;
}
TRACE
(
"read disconnect header
\n
"
);
hres
=
MARSHAL_Find_Stub_Buffer
(
&
header
.
mid
,
&
stub
);
if
(
hres
)
{
ERR
(
"could not locate stub to disconnect, mid.objectid=%p
\n
"
,
(
void
*
)
header
.
mid
.
objectid
);
goto
end
;
}
/* release reference added by MARSHAL_Find_Stub_Buffer call */
IRpcStubBuffer_Release
(
stub
);
/* release it for real */
ret
=
IRpcStubBuffer_Release
(
stub
);
/* FIXME: race */
if
(
ret
==
0
)
MARSHAL_Invalidate_Stub_From_MID
(
&
header
.
mid
);
goto
end
;
}
else
if
(
reqtype
==
REQTYPE_REQUEST
)
{
wine_rpc_request
*
xreq
;
wine_rpc_request
*
xreq
;
RPC_GetRequest
(
&
xreq
);
RPC_GetRequest
(
&
xreq
);
xreq
->
hPipe
=
xhPipe
;
xreq
->
hPipe
=
xhPipe
;
...
@@ -643,8 +694,7 @@ _read_one(wine_pipe *xpipe) {
...
@@ -643,8 +694,7 @@ _read_one(wine_pipe *xpipe) {
if
(
hres
)
goto
end
;
if
(
hres
)
goto
end
;
xreq
->
state
=
REQSTATE_REQ_GOT
;
xreq
->
state
=
REQSTATE_REQ_GOT
;
goto
end
;
goto
end
;
}
}
else
if
(
reqtype
==
REQTYPE_RESPONSE
)
{
if
(
reqtype
==
REQTYPE_RESPONSE
)
{
wine_rpc_response_header
resph
;
wine_rpc_response_header
resph
;
int
i
;
int
i
;
...
...
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