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
47332210
Commit
47332210
authored
May 10, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
May 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Don't call MMDevAPI during process exit.
parent
7508a5d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
42 deletions
+71
-42
waveform.c
dlls/winmm/waveform.c
+62
-18
winmm.c
dlls/winmm/winmm.c
+9
-24
No files found.
dlls/winmm/waveform.c
View file @
47332210
...
...
@@ -139,6 +139,8 @@ static UINT g_inmmdevices_count;
static
IMMDeviceEnumerator
*
g_devenum
;
#define WINMM_WM_QUIT WM_USER
static
CRITICAL_SECTION
g_devthread_lock
;
static
CRITICAL_SECTION_DEBUG
g_devthread_lock_debug
=
{
...
...
@@ -185,25 +187,64 @@ void WINMM_DeleteWaveform(void)
{
UINT
i
,
j
;
for
(
i
=
0
;
i
<
g_outmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_out_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
if
(
device
->
open
)
if
(
g_devices_hwnd
){
for
(
i
=
0
;
i
<
g_outmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_out_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
SendMessageW
(
g_devices_hwnd
,
WODM_CLOSE
,
(
WPARAM
)
device
->
handle
,
0
);
}
}
}
for
(
i
=
0
;
i
<
g_inmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_in_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
if
(
device
->
open
)
for
(
i
=
0
;
i
<
g_inmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_in_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
SendMessageW
(
g_devices_hwnd
,
WIDM_CLOSE
,
(
WPARAM
)
device
->
handle
,
0
);
}
}
SendMessageW
(
g_devices_hwnd
,
WINMM_WM_QUIT
,
0
,
0
);
for
(
i
=
0
;
i
<
g_outmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_out_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
if
(
device
->
handle
)
CloseHandle
(
device
->
handle
);
DeleteCriticalSection
(
&
device
->
lock
);
}
if
(
mmdevice
->
volume
)
ISimpleAudioVolume_Release
(
mmdevice
->
volume
);
CoTaskMemFree
(
mmdevice
->
dev_id
);
DeleteCriticalSection
(
&
mmdevice
->
lock
);
}
for
(
i
=
0
;
i
<
g_inmmdevices_count
;
++
i
){
WINMM_MMDevice
*
mmdevice
=
&
g_in_mmdevices
[
i
];
for
(
j
=
0
;
j
<
MAX_DEVICES
&&
mmdevice
->
devices
[
j
];
++
j
){
WINMM_Device
*
device
=
mmdevice
->
devices
[
j
];
if
(
device
->
handle
)
CloseHandle
(
device
->
handle
);
DeleteCriticalSection
(
&
device
->
lock
);
}
if
(
mmdevice
->
volume
)
ISimpleAudioVolume_Release
(
mmdevice
->
volume
);
CoTaskMemFree
(
mmdevice
->
dev_id
);
DeleteCriticalSection
(
&
mmdevice
->
lock
);
}
HeapFree
(
GetProcessHeap
(),
0
,
g_out_mmdevices
);
HeapFree
(
GetProcessHeap
(),
0
,
g_in_mmdevices
);
HeapFree
(
GetProcessHeap
(),
0
,
g_device_handles
);
HeapFree
(
GetProcessHeap
(),
0
,
g_handle_devices
);
}
/* FIXME: Free g_(in,out)_mmdevices? */
DeleteCriticalSection
(
&
g_devthread_lock
);
}
...
...
@@ -2146,6 +2187,13 @@ static LRESULT CALLBACK WINMM_DevicesMsgProc(HWND hwnd, UINT msg, WPARAM wparam,
case
DRV_QUERYDEVICEINTERFACESIZE
:
case
DRV_QUERYDEVICEINTERFACE
:
return
DRV_QueryDeviceInterface
((
WINMM_QueryInterfaceInfo
*
)
wparam
);
case
WINMM_WM_QUIT
:
TRACE
(
"QUIT message received
\n
"
);
DestroyWindow
(
g_devices_hwnd
);
g_devices_hwnd
=
NULL
;
IMMDeviceEnumerator_Release
(
g_devenum
);
CoUninitialize
();
return
0
;
}
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
...
...
@@ -2200,6 +2248,8 @@ static DWORD WINAPI WINMM_DevicesThreadProc(void *arg)
MSG
msg
;
if
(
PeekMessageW
(
&
msg
,
g_devices_hwnd
,
0
,
0
,
PM_REMOVE
))
WARN
(
"Unexpected message: 0x%x
\n
"
,
msg
.
message
);
if
(
!
g_devices_hwnd
)
break
;
}
else
if
(
wait
<
g_devhandle_count
+
WAIT_OBJECT_0
){
WINMM_Device
*
device
=
g_handle_devices
[
wait
-
WAIT_OBJECT_0
];
if
(
device
->
render
)
...
...
@@ -2211,12 +2261,6 @@ static DWORD WINAPI WINMM_DevicesThreadProc(void *arg)
GetLastError
());
}
DestroyWindow
(
g_devices_hwnd
);
IMMDeviceEnumerator_Release
(
g_devenum
);
CoUninitialize
();
return
0
;
}
...
...
dlls/winmm/winmm.c
View file @
47332210
...
...
@@ -82,18 +82,6 @@ static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
return
TRUE
;
}
/**************************************************************************
* WINMM_DeleteIData [internal]
*/
static
void
WINMM_DeleteIData
(
void
)
{
TIME_MMTimeStop
();
WINMM_DeleteWaveform
();
CloseHandle
(
psLastEvent
);
DeleteCriticalSection
(
&
WINMM_cs
);
}
/******************************************************************
* WINMM_ErrorToString
*/
...
...
@@ -153,20 +141,17 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
return
FALSE
;
break
;
case
DLL_PROCESS_DETACH
:
/* close all opened MCI drivers */
if
(
fImpLoad
)
break
;
MCI_SendCommand
(
MCI_ALL_DEVICE_ID
,
MCI_CLOSE
,
MCI_WAIT
,
0L
);
MMDRV_Exit
();
/* There's no guarantee the drivers haven't already been unloaded on
* process shutdown.
*/
if
(
!
fImpLoad
)
{
/* now unload all remaining drivers... */
DRIVER_UnloadAll
();
}
WINMM_DeleteIData
();
break
;
DRIVER_UnloadAll
();
WINMM_DeleteWaveform
();
TIME_MMTimeStop
();
CloseHandle
(
psLastEvent
);
DeleteCriticalSection
(
&
WINMM_cs
);
break
;
}
return
TRUE
;
}
...
...
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