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
98f3ecc3
Commit
98f3ecc3
authored
Aug 23, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: GIT can be released on process detach only.
parent
05528ea0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
27 deletions
+36
-27
compobj.c
dlls/ole32/compobj.c
+1
-0
compobj_private.h
dlls/ole32/compobj_private.h
+1
-0
git.c
dlls/ole32/git.c
+23
-27
marshal.c
dlls/ole32/tests/marshal.c
+11
-0
No files found.
dlls/ole32/compobj.c
View file @
98f3ecc3
...
...
@@ -4590,6 +4590,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved)
case
DLL_PROCESS_DETACH
:
if
(
reserved
)
break
;
release_std_git
();
COMPOBJ_UninitProcess
();
RPC_UnregisterAllChannelHooks
();
COMPOBJ_DllList_Free
();
...
...
dlls/ole32/compobj_private.h
View file @
98f3ecc3
...
...
@@ -174,6 +174,7 @@ struct oletls
/* Global Interface Table Functions */
extern
IGlobalInterfaceTable
*
get_std_git
(
void
)
DECLSPEC_HIDDEN
;
extern
void
release_std_git
(
void
)
DECLSPEC_HIDDEN
;
extern
HRESULT
StdGlobalInterfaceTable_GetFactory
(
LPVOID
*
ppv
)
DECLSPEC_HIDDEN
;
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
)
DECLSPEC_HIDDEN
;
...
...
dlls/ole32/git.c
View file @
98f3ecc3
...
...
@@ -66,7 +66,6 @@ typedef struct StdGlobalInterfaceTableImpl
{
IGlobalInterfaceTable
IGlobalInterfaceTable_iface
;
ULONG
ref
;
struct
list
list
;
ULONG
nextCookie
;
...
...
@@ -89,16 +88,6 @@ static inline StdGlobalInterfaceTableImpl *impl_from_IGlobalInterfaceTable(IGlob
return
CONTAINING_RECORD
(
iface
,
StdGlobalInterfaceTableImpl
,
IGlobalInterfaceTable_iface
);
}
/** This destroys it again. It should revoke all the held interfaces first **/
static
void
StdGlobalInterfaceTable_Destroy
(
void
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
FIXME
(
"Revoke held interfaces here
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
std_git
=
NULL
;
}
/***
* A helper function to traverse the list and find the entry that matches the cookie.
* Returns NULL if not found. Must be called inside git_section critical section.
...
...
@@ -147,25 +136,13 @@ StdGlobalInterfaceTable_QueryInterface(IGlobalInterfaceTable* iface,
static
ULONG
WINAPI
StdGlobalInterfaceTable_AddRef
(
IGlobalInterfaceTable
*
iface
)
{
StdGlobalInterfaceTableImpl
*
const
This
=
impl_from_IGlobalInterfaceTable
(
iface
);
/* InterlockedIncrement(&This->ref); */
return
This
->
ref
;
return
1
;
}
static
ULONG
WINAPI
StdGlobalInterfaceTable_Release
(
IGlobalInterfaceTable
*
iface
)
{
StdGlobalInterfaceTableImpl
*
const
This
=
impl_from_IGlobalInterfaceTable
(
iface
);
/* InterlockedDecrement(&This->ref); */
if
(
This
->
ref
==
0
)
{
/* Hey ho, it's time to go, so long again 'till next weeks show! */
StdGlobalInterfaceTable_Destroy
(
This
);
return
0
;
}
return
This
->
ref
;
return
1
;
}
/***
...
...
@@ -387,13 +364,12 @@ IGlobalInterfaceTable* get_std_git(void)
if
(
!
newGIT
)
return
NULL
;
newGIT
->
IGlobalInterfaceTable_iface
.
lpVtbl
=
&
StdGlobalInterfaceTableImpl_Vtbl
;
newGIT
->
ref
=
1
;
list_init
(
&
newGIT
->
list
);
newGIT
->
nextCookie
=
0xf100
;
/* that's where windows starts, so that's where we start */
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
std_git
,
&
newGIT
->
IGlobalInterfaceTable_iface
,
NULL
))
{
StdGlobalInterfaceTable_Destroy
(
newGIT
);
HeapFree
(
GetProcessHeap
(),
0
,
newGIT
);
}
else
TRACE
(
"Created the GIT at %p
\n
"
,
newGIT
);
...
...
@@ -401,3 +377,23 @@ IGlobalInterfaceTable* get_std_git(void)
return
std_git
;
}
void
release_std_git
(
void
)
{
StdGlobalInterfaceTableImpl
*
git
;
StdGITEntry
*
entry
,
*
entry2
;
if
(
!
std_git
)
return
;
git
=
impl_from_IGlobalInterfaceTable
(
std_git
);
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
git
->
list
,
StdGITEntry
,
entry
)
{
list_remove
(
&
entry
->
entry
);
CoReleaseMarshalData
(
entry
->
stream
);
IStream_Release
(
entry
->
stream
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
}
HeapFree
(
GetProcessHeap
(),
0
,
git
);
}
dlls/ole32/tests/marshal.c
View file @
98f3ecc3
...
...
@@ -2806,6 +2806,7 @@ static void test_globalinterfacetable(void)
DWORD
ret
;
IUnknown
*
object
;
IClassFactory
*
cf
;
ULONG
ref
;
trace
(
"test_globalinterfacetable
\n
"
);
cLocks
=
0
;
...
...
@@ -2821,6 +2822,16 @@ static void test_globalinterfacetable(void)
hr
=
CoCreateInstance
(
&
CLSID_StdGlobalInterfaceTable
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IGlobalInterfaceTable
,
(
void
**
)
&
git
);
ok_ole_success
(
hr
,
CoCreateInstance
);
ref
=
IGlobalInterfaceTable_AddRef
(
git
);
ok
(
ref
==
1
,
"ref=%d
\n
"
,
ref
);
ref
=
IGlobalInterfaceTable_AddRef
(
git
);
ok
(
ref
==
1
,
"ref=%d
\n
"
,
ref
);
ref
=
IGlobalInterfaceTable_Release
(
git
);
ok
(
ref
==
1
,
"ref=%d
\n
"
,
ref
);
ref
=
IGlobalInterfaceTable_Release
(
git
);
ok
(
ref
==
1
,
"ref=%d
\n
"
,
ref
);
hr
=
IGlobalInterfaceTable_RegisterInterfaceInGlobal
(
git
,
(
IUnknown
*
)
&
Test_ClassFactory
,
&
IID_IClassFactory
,
&
cookie
);
ok_ole_success
(
hr
,
IGlobalInterfaceTable_RegisterInterfaceInGlobal
);
...
...
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