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
f238cd88
Commit
f238cd88
authored
Dec 09, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Dec 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly implement DllCanUnloadNow ref counting.
parent
7a03fd67
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
65 deletions
+138
-65
chordmap.c
dlls/dmcompos/chordmap.c
+7
-0
chordmaptrack.c
dlls/dmcompos/chordmaptrack.c
+7
-0
composer.c
dlls/dmcompos/composer.c
+7
-0
dmcompos_main.c
dlls/dmcompos/dmcompos_main.c
+104
-65
dmcompos_private.h
dlls/dmcompos/dmcompos_private.h
+6
-0
signposttrack.c
dlls/dmcompos/signposttrack.c
+7
-0
No files found.
dlls/dmcompos/chordmap.c
View file @
f238cd88
...
...
@@ -55,6 +55,9 @@ HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOWN iface
ULONG
WINAPI
IDirectMusicChordMapImpl_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicChordMapImpl
,
UnknownVtbl
,
iface
);
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
This
->
ref
);
DMCOMPOS_LockModule
();
return
++
(
This
->
ref
);
}
...
...
@@ -62,9 +65,13 @@ ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI
(
IDirectMusicChordMapImpl
,
UnknownVtbl
,
iface
);
ULONG
ref
=
--
This
->
ref
;
TRACE
(
"(%p): ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMCOMPOS_UnlockModule
();
return
ref
;
}
...
...
dlls/dmcompos/chordmaptrack.c
View file @
f238cd88
...
...
@@ -52,6 +52,9 @@ HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN ifac
ULONG
WINAPI
IDirectMusicChordMapTrack_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicChordMapTrack
,
UnknownVtbl
,
iface
);
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
This
->
ref
);
DMCOMPOS_LockModule
();
return
++
(
This
->
ref
);
}
...
...
@@ -59,9 +62,13 @@ ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI
(
IDirectMusicChordMapTrack
,
UnknownVtbl
,
iface
);
ULONG
ref
=
--
This
->
ref
;
TRACE
(
"(%p): ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMCOMPOS_UnlockModule
();
return
ref
;
}
...
...
dlls/dmcompos/composer.c
View file @
f238cd88
...
...
@@ -39,6 +39,9 @@ HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER if
ULONG
WINAPI
IDirectMusicComposerImpl_AddRef
(
LPDIRECTMUSICCOMPOSER
iface
)
{
IDirectMusicComposerImpl
*
This
=
(
IDirectMusicComposerImpl
*
)
iface
;
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
This
->
ref
);
DMCOMPOS_LockModule
();
return
++
(
This
->
ref
);
}
...
...
@@ -46,9 +49,13 @@ ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface) {
IDirectMusicComposerImpl
*
This
=
(
IDirectMusicComposerImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
TRACE
(
"(%p): ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMCOMPOS_UnlockModule
();
return
ref
;
}
...
...
dlls/dmcompos/dmcompos_main.c
View file @
f238cd88
...
...
@@ -21,41 +21,49 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmcompos
);
LONG
DMCOMPOS_refCount
=
0
;
typedef
struct
{
/* IUnknown fields */
IClassFactoryVtbl
*
lpVtbl
;
DWORD
ref
;
}
IClassFactoryImpl
;
/******************************************************************
* DirectMusicChordMap ClassFactory
*/
static
HRESULT
WINAPI
ChordMapCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %s, %p): stub
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ChordMapCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
DMCOMPOS_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ChordMapCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
DMCOMPOS_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ChordMapCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
)
;
return
DMUSIC_CreateDirectMusicChordMapImpl
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
ChordMapCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMCOMPOS_LockModule
();
else
DMCOMPOS_UnlockModule
();
return
S_OK
;
}
...
...
@@ -67,37 +75,45 @@ static IClassFactoryVtbl ChordMapCF_Vtbl = {
ChordMapCF_LockServer
};
static
IClassFactoryImpl
ChordMap_CF
=
{
&
ChordMapCF_Vtbl
,
1
};
static
IClassFactoryImpl
ChordMap_CF
=
{
&
ChordMapCF_Vtbl
};
/******************************************************************
* DirectMusicComposer ClassFactory
*/
static
HRESULT
WINAPI
ComposerCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %s, %p): stub
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ComposerCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
DMCOMPOS_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ComposerCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
DMCOMPOS_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ComposerCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
)
;
return
DMUSIC_CreateDirectMusicComposerImpl
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
ComposerCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMCOMPOS_LockModule
();
else
DMCOMPOS_UnlockModule
();
return
S_OK
;
}
...
...
@@ -109,37 +125,45 @@ static IClassFactoryVtbl ComposerCF_Vtbl = {
ComposerCF_LockServer
};
static
IClassFactoryImpl
Composer_CF
=
{
&
ComposerCF_Vtbl
,
1
};
static
IClassFactoryImpl
Composer_CF
=
{
&
ComposerCF_Vtbl
};
/******************************************************************
* DirectMusicChordMapTrack ClassFactory
*/
static
HRESULT
WINAPI
ChordMapTrackCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %s, %p): stub
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ChordMapTrackCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
DMCOMPOS_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ChordMapTrackCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
DMCOMPOS_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ChordMapTrackCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
)
;
return
DMUSIC_CreateDirectMusicChordMapTrack
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
ChordMapTrackCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMCOMPOS_LockModule
();
else
DMCOMPOS_UnlockModule
();
return
S_OK
;
}
...
...
@@ -151,39 +175,47 @@ static IClassFactoryVtbl ChordMapTrackCF_Vtbl = {
ChordMapTrackCF_LockServer
};
static
IClassFactoryImpl
ChordMapTrack_CF
=
{
&
ChordMapTrackCF_Vtbl
,
1
};
static
IClassFactoryImpl
ChordMapTrack_CF
=
{
&
ChordMapTrackCF_Vtbl
};
/******************************************************************
* DirectMusicTemplate ClassFactory
*/
static
HRESULT
WINAPI
TemplateCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %s, %p): stub
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
TemplateCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
DMCOMPOS_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
TemplateCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
DMCOMPOS_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
TemplateCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
/* nothing yet */
WARN
(
"(%p, %s,%p): not found
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
WARN
(
"(%s,%p): not found
\n
"
,
debugstr_dmguid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
TemplateCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMCOMPOS_LockModule
();
else
DMCOMPOS_UnlockModule
();
return
S_OK
;
}
...
...
@@ -195,37 +227,45 @@ static IClassFactoryVtbl TemplateCF_Vtbl = {
TemplateCF_LockServer
};
static
IClassFactoryImpl
Template_CF
=
{
&
TemplateCF_Vtbl
,
1
};
static
IClassFactoryImpl
Template_CF
=
{
&
TemplateCF_Vtbl
};
/******************************************************************
* DirectMusicSignPostTrack ClassFactory
*/
static
HRESULT
WINAPI
SignPostTrackCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %s, %p): stub
\n
"
,
This
,
debugstr_dmguid
(
riid
),
ppobj
);
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
ppobj
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
SignPostTrackCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
DMCOMPOS_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
SignPostTrackCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
DMCOMPOS_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
SignPostTrackCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p, %p, %s, %p)
\n
"
,
This
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
);
TRACE
(
"(%p, %s, %p)
\n
"
,
pOuter
,
debugstr_dmguid
(
riid
),
ppobj
)
;
return
DMUSIC_CreateDirectMusicSignPostTrack
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
SignPostTrackCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMCOMPOS_LockModule
();
else
DMCOMPOS_UnlockModule
();
return
S_OK
;
}
...
...
@@ -237,7 +277,7 @@ static IClassFactoryVtbl SignPostTrackCF_Vtbl = {
SignPostTrackCF_LockServer
};
static
IClassFactoryImpl
SignPostTrack_CF
=
{
&
SignPostTrackCF_Vtbl
,
1
};
static
IClassFactoryImpl
SignPostTrack_CF
=
{
&
SignPostTrackCF_Vtbl
};
/******************************************************************
* DllMain
...
...
@@ -263,8 +303,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
*
*/
HRESULT
WINAPI
DMCOMPOS_DllCanUnloadNow
(
void
)
{
FIXME
(
"(void): stub
\n
"
);
return
S_FALSE
;
return
DMCOMPOS_refCount
!=
0
?
S_FALSE
:
S_OK
;
}
...
...
dlls/dmcompos/dmcompos_private.h
View file @
f238cd88
...
...
@@ -237,6 +237,12 @@ extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Load (LPPERSISTST
extern
HRESULT
WINAPI
IDirectMusicSignPostTrack_IPersistStream_Save
(
LPPERSISTSTREAM
iface
,
IStream
*
pStm
,
BOOL
fClearDirty
);
extern
HRESULT
WINAPI
IDirectMusicSignPostTrack_IPersistStream_GetSizeMax
(
LPPERSISTSTREAM
iface
,
ULARGE_INTEGER
*
pcbSize
);
/**********************************************************************
* Dll lifetime tracking declaration for dmcompos.dll
*/
extern
LONG
DMCOMPOS_refCount
;
static
inline
void
DMCOMPOS_LockModule
()
{
InterlockedIncrement
(
&
DMCOMPOS_refCount
);
}
static
inline
void
DMCOMPOS_UnlockModule
()
{
InterlockedDecrement
(
&
DMCOMPOS_refCount
);
}
/*****************************************************************************
* Misc.
...
...
dlls/dmcompos/signposttrack.c
View file @
f238cd88
...
...
@@ -52,6 +52,9 @@ HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNOWN ifac
ULONG
WINAPI
IDirectMusicSignPostTrack_IUnknown_AddRef
(
LPUNKNOWN
iface
)
{
ICOM_THIS_MULTI
(
IDirectMusicSignPostTrack
,
UnknownVtbl
,
iface
);
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
This
->
ref
);
DMCOMPOS_LockModule
();
return
++
(
This
->
ref
);
}
...
...
@@ -59,9 +62,13 @@ ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_Release (LPUNKNOWN iface) {
ICOM_THIS_MULTI
(
IDirectMusicSignPostTrack
,
UnknownVtbl
,
iface
);
ULONG
ref
=
--
This
->
ref
;
TRACE
(
"(%p): ReleaseRef to %ld
\n
"
,
This
,
This
->
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMCOMPOS_UnlockModule
();
return
ref
;
}
...
...
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