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