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
9b913076
Commit
9b913076
authored
Aug 30, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Tests on NdrCStdStubBuffer_Release to show that we shouldn't call Disconnect.
Also call IPSFactoryBuffer_Release on the 2nd arg, rather than on This->pPSFactory.
parent
86aa95fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
cstub.c
dlls/rpcrt4/cstub.c
+4
-2
cstub.c
dlls/rpcrt4/tests/cstub.c
+46
-0
No files found.
dlls/rpcrt4/cstub.c
View file @
9b913076
...
...
@@ -121,9 +121,11 @@ ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface,
refs
=
InterlockedDecrement
(
&
This
->
RefCount
);
if
(
!
refs
)
{
/* test_Release shows that native doesn't call Disconnect here.
We'll leave it in for the time being. */
IRpcStubBuffer_Disconnect
(
iface
);
if
(
This
->
pPSFactory
)
IPSFactoryBuffer_Release
(
This
->
pPSFactory
);
IPSFactoryBuffer_Release
(
pPSF
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
refs
;
...
...
dlls/rpcrt4/tests/cstub.c
View file @
9b913076
...
...
@@ -765,6 +765,51 @@ static void test_Disconnect(IPSFactoryBuffer *ppsf)
ok
(
cstd_stub
->
pvServerObject
==
NULL
,
"pvServerObject %p
\n
"
,
cstd_stub
->
pvServerObject
);
}
static
int
release_test_psfacbuf_release_called
;
static
ULONG
WINAPI
release_test_pretend_psfacbuf_release
(
IUnknown
*
pUnk
)
{
release_test_psfacbuf_release_called
++
;
return
1
;
}
static
IUnknownVtbl
release_test_pretend_psfacbuf_vtbl
=
{
NULL
,
NULL
,
release_test_pretend_psfacbuf_release
};
static
void
test_Release
(
IPSFactoryBuffer
*
ppsf
)
{
LONG
facbuf_refs
;
IUnknownVtbl
*
orig_vtbl
=
&
connect_test_orig_vtbl
;
IUnknown
*
obj
=
(
IUnknown
*
)
&
orig_vtbl
;
IUnknownVtbl
*
pretend_psfacbuf_vtbl
=
&
release_test_pretend_psfacbuf_vtbl
;
IUnknown
*
pretend_psfacbuf
=
(
IUnknown
*
)
&
pretend_psfacbuf_vtbl
;
IRpcStubBuffer
*
pstub
=
create_stub
(
ppsf
,
&
IID_if1
,
obj
,
S_OK
);
CStdStubBuffer
*
cstd_stub
=
(
CStdStubBuffer
*
)
pstub
;
facbuf_refs
=
PSFactoryBuffer
.
RefCount
;
/* This shows that NdrCStdStubBuffer_Release doesn't call Disconnect */
ok
(
cstd_stub
->
RefCount
==
1
,
"ref count %ld
\n
"
,
cstd_stub
->
RefCount
);
connect_test_orig_release_called
=
0
;
IRpcStubBuffer_Release
(
pstub
);
todo_wine
{
ok
(
connect_test_orig_release_called
==
0
,
"release called %d
\n
"
,
connect_test_orig_release_called
);
}
ok
(
PSFactoryBuffer
.
RefCount
==
facbuf_refs
-
1
,
"factory buffer refs %ld orig %ld
\n
"
,
PSFactoryBuffer
.
RefCount
,
facbuf_refs
);
/* This shows that NdrCStdStubBuffer_Release calls Release on its 2nd arg, rather than on This->pPSFactory
(which are usually the same and indeed it's odd that _Release requires this 2nd arg). */
pstub
=
create_stub
(
ppsf
,
&
IID_if1
,
obj
,
S_OK
);
ok
(
PSFactoryBuffer
.
RefCount
==
facbuf_refs
,
"factory buffer refs %ld orig %ld
\n
"
,
PSFactoryBuffer
.
RefCount
,
facbuf_refs
);
NdrCStdStubBuffer_Release
(
pstub
,
(
IPSFactoryBuffer
*
)
pretend_psfacbuf
);
ok
(
release_test_psfacbuf_release_called
==
1
,
"pretend_psfacbuf_release called %d
\n
"
,
release_test_psfacbuf_release_called
);
ok
(
PSFactoryBuffer
.
RefCount
==
facbuf_refs
,
"factory buffer refs %ld orig %ld
\n
"
,
PSFactoryBuffer
.
RefCount
,
facbuf_refs
);
}
START_TEST
(
cstub
)
{
IPSFactoryBuffer
*
ppsf
;
...
...
@@ -776,6 +821,7 @@ START_TEST( cstub )
test_CreateStub
(
ppsf
);
test_Connect
(
ppsf
);
test_Disconnect
(
ppsf
);
test_Release
(
ppsf
);
OleUninitialize
();
}
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