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
689312b1
Commit
689312b1
authored
Nov 11, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now properly unloading multimedia drivers when winmm unloads.
parent
46c80c88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
2 deletions
+96
-2
driver.c
dlls/winmm/driver.c
+20
-0
lolvldrv.c
dlls/winmm/lolvldrv.c
+67
-0
winemm.h
dlls/winmm/winemm.h
+3
-2
winmm.c
dlls/winmm/winmm.c
+6
-0
No files found.
dlls/winmm/driver.c
View file @
689312b1
...
...
@@ -507,3 +507,23 @@ BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev,
TRACE
(
"Done
\n
"
);
return
TRUE
;
}
/******************************************************************
* DRIVER_UnloadAll
*
*
*/
void
DRIVER_UnloadAll
(
void
)
{
LPWINE_DRIVER
lpDrv
;
LPWINE_DRIVER
lpNextDrv
=
NULL
;
unsigned
count
=
0
;
for
(
lpDrv
=
lpDrvItemList
;
lpDrv
!=
NULL
;
lpDrv
=
lpNextDrv
)
{
lpNextDrv
=
lpDrv
->
lpNextItem
;
CloseDriver
((
HDRVR
)
lpDrv
,
0
,
0
);
count
++
;
}
TRACE
(
"Unloaded %u drivers
\n
"
,
count
);
}
dlls/winmm/lolvldrv.c
View file @
689312b1
...
...
@@ -733,3 +733,70 @@ BOOL MMDRV_Init(void)
/* FIXME: MMDRV_InitFromRegistry shall be MMDRV_Init in a near future */
return
MMDRV_InitFromRegistry
()
||
MMDRV_InitHardcoded
();
}
/******************************************************************
* ExitPerType
*
*
*/
static
BOOL
MMDRV_ExitPerType
(
LPWINE_MM_DRIVER
lpDrv
,
UINT
type
)
{
WINE_MM_DRIVER_PART
*
part
=
&
lpDrv
->
parts
[
type
];
DWORD
ret
;
if
(
lpDrv
->
bIs32
&&
part
->
u
.
fnMessage32
)
{
#if 0
ret = part->u.fnMessage32(0, DRVM_DISABLE, 0L, 0L, 0L);
TRACE("DRVM_DISABLE => %08lx\n", ret);
#endif
ret
=
part
->
u
.
fnMessage32
(
0
,
DRVM_EXIT
,
0L
,
0L
,
0L
);
TRACE
(
"DRVM_EXIT => %08lx
\n
"
,
ret
);
}
else
if
(
!
lpDrv
->
bIs32
&&
part
->
u
.
fnMessage16
&&
pFnCallMMDrvFunc16
)
{
#if 0
ret = pFnCallMMDrvFunc16((FARPROC16)part->u.fnMessage16,
0, DRVM_DISABLE, 0L, 0L, 0L);
TRACE("DRVM_DISABLE => %08lx\n", ret);
#endif
ret
=
pFnCallMMDrvFunc16
((
FARPROC16
)
part
->
u
.
fnMessage16
,
0
,
DRVM_EXIT
,
0L
,
0L
,
0L
);
TRACE
(
"DRVM_EXIT => %08lx
\n
"
,
ret
);
}
else
{
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************
* Exit
*
*
*/
void
MMDRV_Exit
(
void
)
{
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
MM_MLDrvs
)
/
sizeof
(
MM_MLDrvs
[
0
]);
i
++
)
{
if
(
MM_MLDrvs
[
i
]
!=
NULL
)
{
FIXME
(
"Closing while ll-driver open
\n
"
);
#if 0
/* FIXME: should generate a message depending on type */
MMDRV_Free((HANDLE)(i | 0x8000), MM_MLDrvs[i]);
#endif
}
}
/* unload driver, in reverse order of loading */
for
(
i
=
sizeof
(
MMDrvs
)
/
sizeof
(
MMDrvs
[
0
])
-
1
;
i
>=
0
;
i
--
)
{
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_AUX
);
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_MIXER
);
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_MIDIIN
);
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_MIDIOUT
);
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_WAVEIN
);
MMDRV_ExitPerType
(
&
MMDrvs
[
i
],
MMDRV_WAVEOUT
);
CloseDriver
(
MMDrvs
[
i
].
hDriver
,
0
,
0
);
}
}
dlls/winmm/winemm.h
View file @
689312b1
...
...
@@ -90,8 +90,6 @@ typedef struct tagWINE_MM_DRIVER {
WINE_MM_DRIVER_PART
parts
[
MMDRV_MAX
];
/* Information for all known types */
}
WINE_MM_DRIVER
,
*
LPWINE_MM_DRIVER
;
typedef
WINMM_MapType
(
*
MMDRV_MAPFUNC
)(
UINT
wMsg
,
LPDWORD
lpdwUser
,
LPDWORD
lpParam1
,
LPDWORD
lpParam2
);
typedef
struct
tagWINE_MLD
{
/* EPP struct tagWINE_MLD* lpNext; */
/* not used so far */
UINT
uDeviceID
;
...
...
@@ -226,12 +224,15 @@ typedef struct tagWINE_MM_IDATA {
typedef
LONG
(
*
MCIPROC16
)(
DWORD
,
HDRVR16
,
WORD
,
DWORD
,
DWORD
);
typedef
LONG
(
*
MCIPROC
)(
DWORD
,
HDRVR
,
DWORD
,
DWORD
,
DWORD
);
typedef
WINMM_MapType
(
*
MMDRV_MAPFUNC
)(
UINT
wMsg
,
LPDWORD
lpdwUser
,
LPDWORD
lpParam1
,
LPDWORD
lpParam2
);
LPWINE_DRIVER
DRIVER_FindFromHDrvr
(
HDRVR
hDrvr
);
BOOL
DRIVER_GetLibName
(
LPCSTR
keyName
,
LPCSTR
sectName
,
LPSTR
buf
,
int
sz
);
LPWINE_DRIVER
DRIVER_TryOpenDriver32
(
LPCSTR
fn
,
LPARAM
lParam2
);
void
DRIVER_UnloadAll
(
void
);
BOOL
MMDRV_Init
(
void
);
void
MMDRV_Exit
(
void
);
UINT
MMDRV_GetNum
(
UINT
);
LPWINE_MLD
MMDRV_Alloc
(
UINT
size
,
UINT
type
,
LPHANDLE
hndl
,
DWORD
*
dwFlags
,
DWORD
*
dwCallback
,
DWORD
*
dwInstance
,
BOOL
bFrom32
);
...
...
dlls/winmm/winmm.c
View file @
689312b1
...
...
@@ -127,6 +127,12 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
}
break
;
case
DLL_PROCESS_DETACH
:
/* close all opened MCI drivers */
MCI_SendCommand
(
MCI_ALL_DEVICE_ID
,
MCI_CLOSE
,
MCI_WAIT
,
0L
,
TRUE
);
MMDRV_Exit
();
/* now unload all remaining drivers... */
DRIVER_UnloadAll
();
WINMM_DeleteIData
();
break
;
case
DLL_THREAD_ATTACH
:
...
...
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