Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0994b850
Commit
0994b850
authored
Feb 02, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Feb 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly implement DllCanUnload ref counting.
parent
1727eb48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
234 additions
and
140 deletions
+234
-140
dmscript_main.c
dlls/dmscript/dmscript_main.c
+218
-140
dmscript_private.h
dlls/dmscript/dmscript_private.h
+6
-0
script.c
dlls/dmscript/script.c
+5
-0
scripttrack.c
dlls/dmscript/scripttrack.c
+5
-0
No files found.
dlls/dmscript/dmscript_main.c
View file @
0994b850
...
...
@@ -21,43 +21,51 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dmscript
);
LONG
DMSCRIPT_refCount
=
0
;
typedef
struct
{
/* IUnknown fields */
IClassFactoryVtbl
*
lpVtbl
;
DWORD
ref
;
}
IClassFactoryImpl
;
/******************************************************************
* DirectMusicScriptAutoImplSegment ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplSegmentCF_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
ScriptAutoImplSegmentCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptAutoImplSegmentCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplSegmentCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplSegmentCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -69,37 +77,44 @@ static IClassFactoryVtbl ScriptAutoImplSegmentCF_Vtbl = {
ScriptAutoImplSegmentCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplSegment_CF
=
{
&
ScriptAutoImplSegmentCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplSegment_CF
=
{
&
ScriptAutoImplSegmentCF_Vtbl
};
/******************************************************************
* DirectMusicScriptTrack ClassFactory
*/
static
HRESULT
WINAPI
ScriptTrackCF_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
ScriptTrackCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptTrackCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptTrackCF_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_CreateDirectMusicScriptTrack
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
ScriptTrackCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -111,39 +126,47 @@ static IClassFactoryVtbl ScriptTrackCF_Vtbl = {
ScriptTrackCF_LockServer
};
static
IClassFactoryImpl
ScriptTrack_CF
=
{
&
ScriptTrackCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptTrack_CF
=
{
&
ScriptTrackCF_Vtbl
};
/******************************************************************
* DirectMusicAudioVBScript ClassFactory
*/
static
HRESULT
WINAPI
AudioVBScriptCF_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
AudioVBScriptCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
AudioVBScriptCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
AudioVBScriptCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
AudioVBScriptCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -155,37 +178,45 @@ static IClassFactoryVtbl AudioVBScriptCF_Vtbl = {
AudioVBScriptCF_LockServer
};
static
IClassFactoryImpl
AudioVBScript_CF
=
{
&
AudioVBScriptCF_Vtbl
,
1
};
static
IClassFactoryImpl
AudioVBScript_CF
=
{
&
AudioVBScriptCF_Vtbl
};
/******************************************************************
* DirectMusicScript ClassFactory
*/
static
HRESULT
WINAPI
ScriptCF_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
ScriptCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptCF_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_CreateDirectMusicScriptImpl
(
riid
,
ppobj
,
pOuter
);
}
static
HRESULT
WINAPI
ScriptCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -197,39 +228,47 @@ static IClassFactoryVtbl ScriptCF_Vtbl = {
ScriptCF_LockServer
};
static
IClassFactoryImpl
Script_CF
=
{
&
ScriptCF_Vtbl
,
1
};
static
IClassFactoryImpl
Script_CF
=
{
&
ScriptCF_Vtbl
};
/******************************************************************
* DirectMusicScriptAutoImplPerformance ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplPerformanceCF_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
ScriptAutoImplPerformanceCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptAutoImplPerformanceCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplPerformanceCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplPerformanceCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -241,39 +280,47 @@ static IClassFactoryVtbl ScriptAutoImplPerformanceCF_Vtbl = {
ScriptAutoImplPerformanceCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplPerformance_CF
=
{
&
ScriptAutoImplPerformanceCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplPerformance_CF
=
{
&
ScriptAutoImplPerformanceCF_Vtbl
};
/******************************************************************
* DirectMusicScriptSourceCodeLoader ClassFactory
*/
static
HRESULT
WINAPI
ScriptSourceCodeLoaderCF_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
ScriptSourceCodeLoaderCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptSourceCodeLoaderCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptSourceCodeLoaderCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptSourceCodeLoaderCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -285,39 +332,47 @@ static IClassFactoryVtbl ScriptSourceCodeLoaderCF_Vtbl = {
ScriptSourceCodeLoaderCF_LockServer
};
static
IClassFactoryImpl
ScriptSourceCodeLoader_CF
=
{
&
ScriptSourceCodeLoaderCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptSourceCodeLoader_CF
=
{
&
ScriptSourceCodeLoaderCF_Vtbl
};
/******************************************************************
* DirectMusicScriptAutoImplSegmentState ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplSegmentStateCF_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
ScriptAutoImplSegmentStateCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptAutoImplSegmentStateCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplSegmentStateCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplSegmentStateCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -329,39 +384,47 @@ static IClassFactoryVtbl ScriptAutoImplSegmentStateCF_Vtbl = {
ScriptAutoImplSegmentStateCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplSegmentState_CF
=
{
&
ScriptAutoImplSegmentStateCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplSegmentState_CF
=
{
&
ScriptAutoImplSegmentStateCF_Vtbl
};
/******************************************************************
* DirectMusicScriptAutoImplAudioPathConfig ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplAudioPathConfigCF_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
ScriptAutoImplAudioPathConfigCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptAutoImplAudioPathConfigCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplAudioPathConfigCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplAudioPathConfigCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -373,39 +436,47 @@ static IClassFactoryVtbl ScriptAutoImplAudioPathConfigCF_Vtbl = {
ScriptAutoImplAudioPathConfigCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplAudioPathConfig_CF
=
{
&
ScriptAutoImplAudioPathConfigCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplAudioPathConfig_CF
=
{
&
ScriptAutoImplAudioPathConfigCF_Vtbl
};
/******************************************************************
* DirectMusicScriptAutoImplAudioPath ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplAudioPathCF_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
ScriptAutoImplAudioPathCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
ScriptAutoImplAudioPathCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplAudioPathCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplAudioPathCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -417,39 +488,47 @@ static IClassFactoryVtbl ScriptAutoImplAudioPathCF_Vtbl = {
ScriptAutoImplAudioPathCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplAudioPath_CF
=
{
&
ScriptAutoImplAudioPathCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplAudioPath_CF
=
{
&
ScriptAutoImplAudioPathCF_Vtbl
};
/******************************************************************
* DirectMusicScriptAutoImplSong ClassFactory
*/
static
HRESULT
WINAPI
ScriptAutoImplSongCF_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
ScriptAutoImplSongCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
DMSCRIPT_LockModule
();
return
2
;
/* non-heap based */
}
static
ULONG
WINAPI
ScriptAutoImplSongCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
InterlockedDecrement
(
&
This
->
ref
);
DMSCRIPT_UnlockModule
()
;
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
ScriptAutoImplSongCF_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
);
/* nothing here yet */
WARN
(
"(%p, %s, %p): not found
\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
HRESULT
WINAPI
ScriptAutoImplSongCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p, %d): stub
\n
"
,
This
,
dolock
);
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
DMSCRIPT_LockModule
();
else
DMSCRIPT_UnlockModule
();
return
S_OK
;
}
...
...
@@ -461,7 +540,7 @@ static IClassFactoryVtbl ScriptAutoImplSongCF_Vtbl = {
ScriptAutoImplSongCF_LockServer
};
static
IClassFactoryImpl
ScriptAutoImplSong_CF
=
{
&
ScriptAutoImplSongCF_Vtbl
,
1
};
static
IClassFactoryImpl
ScriptAutoImplSong_CF
=
{
&
ScriptAutoImplSongCF_Vtbl
};
/******************************************************************
* DllMain
...
...
@@ -486,8 +565,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
*
*/
HRESULT
WINAPI
DMSCRIPT_DllCanUnloadNow
(
void
)
{
FIXME
(
"(void): stub
\n
"
);
return
S_FALSE
;
return
DMSCRIPT_refCount
!=
0
?
S_FALSE
:
S_OK
;
}
...
...
dlls/dmscript/dmscript_private.h
View file @
0994b850
...
...
@@ -170,6 +170,12 @@ extern HRESULT WINAPI IDirectMusicScriptTrack_IPersistStream_Load (LPPERSISTSTRE
extern
HRESULT
WINAPI
IDirectMusicScriptTrack_IPersistStream_Save
(
LPPERSISTSTREAM
iface
,
IStream
*
pStm
,
BOOL
fClearDirty
);
extern
HRESULT
WINAPI
IDirectMusicScriptTrack_IPersistStream_GetSizeMax
(
LPPERSISTSTREAM
iface
,
ULARGE_INTEGER
*
pcbSize
);
/**********************************************************************
* Dll lifetime tracking declaration for dmscript.dll
*/
extern
LONG
DMSCRIPT_refCount
;
static
inline
void
DMSCRIPT_LockModule
()
{
InterlockedIncrement
(
&
DMSCRIPT_refCount
);
}
static
inline
void
DMSCRIPT_UnlockModule
()
{
InterlockedDecrement
(
&
DMSCRIPT_refCount
);
}
/*****************************************************************************
* Misc.
...
...
dlls/dmscript/script.c
View file @
0994b850
...
...
@@ -67,6 +67,8 @@ ULONG WINAPI IDirectMusicScriptImpl_IUnknown_AddRef (LPUNKNOWN iface) {
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
ref
-
1
);
DMSCRIPT_LockModule
();
return
ref
;
}
...
...
@@ -83,6 +85,9 @@ ULONG WINAPI IDirectMusicScriptImpl_IUnknown_Release (LPUNKNOWN iface) {
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pwzSource
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMSCRIPT_UnlockModule
();
return
ref
;
}
...
...
dlls/dmscript/scripttrack.c
View file @
0994b850
...
...
@@ -55,6 +55,8 @@ ULONG WINAPI IDirectMusicScriptTrack_IUnknown_AddRef (LPUNKNOWN iface) {
TRACE
(
"(%p): AddRef from %ld
\n
"
,
This
,
ref
-
1
);
DMSCRIPT_LockModule
();
return
ref
;
}
...
...
@@ -67,6 +69,9 @@ ULONG WINAPI IDirectMusicScriptTrack_IUnknown_Release (LPUNKNOWN iface) {
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
DMSCRIPT_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