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
a8d9c87c
Commit
a8d9c87c
authored
Jan 03, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented DllCanUnloadNow.
parent
76d4edf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
24 deletions
+47
-24
itss.c
dlls/itss/itss.c
+15
-8
moniker.c
dlls/itss/moniker.c
+16
-8
storage.c
dlls/itss/storage.c
+16
-8
No files found.
dlls/itss/itss.c
View file @
a8d9c87c
...
...
@@ -53,6 +53,8 @@ DEFINE_GUID(IID_IITStorage, 0x88cc31de, 0x27ab, 0x11d0, 0x9d, 0xf9, 0x0, 0xa0, 0
static
HRESULT
ITSS_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
);
ULONG
dll_count
=
0
;
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDLL
,
DWORD
fdwReason
,
LPVOID
lpv
)
{
switch
(
fdwReason
)
{
...
...
@@ -117,8 +119,10 @@ static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface)
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
}
...
...
@@ -193,6 +197,7 @@ HRESULT WINAPI ITSS_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
factory
->
pfnCreateInstance
=
object_creation
[
i
].
pfnCreateInstance
;
*
ppv
=
&
(
factory
->
ITF_IClassFactory
);
InterlockedIncrement
(
&
dll_count
);
TRACE
(
"(%p) <- %p
\n
"
,
ppv
,
&
(
factory
->
ITF_IClassFactory
)
);
...
...
@@ -239,8 +244,10 @@ ULONG WINAPI ITStorageImpl_Release(
ITStorageImpl
*
This
=
(
ITStorageImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
}
...
...
@@ -393,6 +400,7 @@ static HRESULT ITSS_create(IUnknown *pUnkOuter, LPVOID *ppObj)
TRACE
(
"-> %p
\n
"
,
its
);
*
ppObj
=
(
LPVOID
)
its
;
InterlockedIncrement
(
&
dll_count
);
return
S_OK
;
}
...
...
@@ -405,9 +413,8 @@ HRESULT WINAPI ITSS_DllRegisterServer(void)
return
S_OK
;
}
BOOL
WINAPI
ITSS_DllCanUnloadNow
(
void
)
HRESULT
WINAPI
ITSS_DllCanUnloadNow
(
void
)
{
FIXME
(
"
\n
"
);
return
FALSE
;
TRACE
(
"dll_count = %lu
\n
"
,
dll_count
);
return
dll_count
?
S_FALSE
:
S_OK
;
}
dlls/itss/moniker.c
View file @
a8d9c87c
...
...
@@ -44,6 +44,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
itss
);
extern
ULONG
dll_count
;
/*****************************************************************************/
typedef
struct
{
...
...
@@ -78,17 +80,19 @@ static ULONG WINAPI ITS_IMonikerImpl_AddRef(
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
TRACE
(
"%p
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
ITS_IMonikerImpl_Release
(
IMoniker
*
iface
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
}
...
...
@@ -365,6 +369,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPWSTR name, DWORD n )
TRACE
(
"-> %p %s %s
\n
"
,
itsmon
,
debugstr_w
(
itsmon
->
szFile
),
debugstr_w
(
itsmon
->
szHtml
)
);
*
ppObj
=
(
IMoniker
*
)
itsmon
;
InterlockedIncrement
(
&
dll_count
);
return
S_OK
;
}
...
...
@@ -400,17 +405,19 @@ static ULONG WINAPI ITS_IParseDisplayNameImpl_AddRef(
{
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
TRACE
(
"%p
\n
"
,
This
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
ITS_IParseDisplayNameImpl_Release
(
IParseDisplayName
*
iface
)
{
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
}
...
...
@@ -470,6 +477,7 @@ HRESULT ITS_IParseDisplayName_create(IUnknown *pUnkOuter, LPVOID *ppObj)
TRACE
(
"-> %p
\n
"
,
its
);
*
ppObj
=
(
LPVOID
)
its
;
InterlockedIncrement
(
&
dll_count
);
return
S_OK
;
}
dlls/itss/storage.c
View file @
a8d9c87c
...
...
@@ -45,6 +45,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
itss
);
extern
ULONG
dll_count
;
/************************************************************************/
typedef
struct
_ITSS_IStorageImpl
...
...
@@ -107,7 +109,7 @@ static ULONG WINAPI ITSS_IEnumSTATSTG_AddRef(
IEnumSTATSTG
*
iface
)
{
IEnumSTATSTG_Impl
*
This
=
(
IEnumSTATSTG_Impl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
ITSS_IEnumSTATSTG_Release
(
...
...
@@ -115,7 +117,7 @@ static ULONG WINAPI ITSS_IEnumSTATSTG_Release(
{
IEnumSTATSTG_Impl
*
This
=
(
IEnumSTATSTG_Impl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
{
...
...
@@ -125,7 +127,8 @@ static ULONG WINAPI ITSS_IEnumSTATSTG_Release(
HeapFree
(
GetProcessHeap
(),
0
,
This
->
first
);
This
->
first
=
t
;
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
...
...
@@ -251,6 +254,7 @@ static IEnumSTATSTG_Impl *ITSS_create_enum( void )
stgenum
->
first
=
NULL
;
stgenum
->
last
=
NULL
;
stgenum
->
current
=
NULL
;
InterlockedIncrement
(
&
dll_count
);
TRACE
(
" -> %p
\n
"
,
stgenum
);
...
...
@@ -282,7 +286,7 @@ ULONG WINAPI ITSS_IStorageImpl_AddRef(
IStorage
*
iface
)
{
ITSS_IStorageImpl
*
This
=
(
ITSS_IStorageImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
ULONG
WINAPI
ITSS_IStorageImpl_Release
(
...
...
@@ -290,11 +294,12 @@ ULONG WINAPI ITSS_IStorageImpl_Release(
{
ITSS_IStorageImpl
*
This
=
(
ITSS_IStorageImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
...
...
@@ -569,6 +574,7 @@ static HRESULT ITSS_create_chm_storage(
strcpyW
(
stg
->
dir
,
dir
);
*
ppstgOpen
=
(
IStorage
*
)
stg
;
InterlockedIncrement
(
&
dll_count
);
return
S_OK
;
}
...
...
@@ -619,7 +625,7 @@ static ULONG WINAPI ITSS_IStream_AddRef(
IStream
*
iface
)
{
IStream_Impl
*
This
=
(
IStream_Impl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
ITSS_IStream_Release
(
...
...
@@ -627,12 +633,13 @@ static ULONG WINAPI ITSS_IStream_Release(
{
IStream_Impl
*
This
=
(
IStream_Impl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
{
IStorage_Release
(
(
IStorage
*
)
This
->
stg
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
InterlockedDecrement
(
&
dll_count
);
}
return
ref
;
...
...
@@ -818,6 +825,7 @@ static IStream_Impl *ITSS_create_stream(
memcpy
(
&
stm
->
ui
,
ui
,
sizeof
stm
->
ui
);
stm
->
stg
=
stg
;
IStorage_AddRef
(
(
IStorage
*
)
stg
);
InterlockedIncrement
(
&
dll_count
);
TRACE
(
" -> %p
\n
"
,
stm
);
...
...
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