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
814c854f
Commit
814c854f
authored
Nov 15, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Give a name to the critical sections, make them static and delete them…
winmm: Give a name to the critical sections, make them static and delete them when unloading the dll.
parent
b6117b68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
waveform.c
dlls/winmm/waveform.c
+13
-3
winemm.h
dlls/winmm/winemm.h
+1
-1
winmm.c
dlls/winmm/winmm.c
+2
-3
No files found.
dlls/winmm/waveform.c
View file @
814c854f
...
...
@@ -140,6 +140,13 @@ static UINT g_inmmdevices_count;
static
IMMDeviceEnumerator
*
g_devenum
;
static
CRITICAL_SECTION
g_devthread_lock
;
static
CRITICAL_SECTION_DEBUG
g_devthread_lock_debug
=
{
0
,
0
,
&
g_devthread_lock
,
{
&
g_devthread_lock_debug
.
ProcessLocksList
,
&
g_devthread_lock_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": g_devthread_lock"
)
}
};
static
CRITICAL_SECTION
g_devthread_lock
=
{
&
g_devthread_lock_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
HANDLE
g_devices_thread
;
static
HWND
g_devices_hwnd
;
...
...
@@ -167,10 +174,10 @@ static LRESULT WOD_Close(HWAVEOUT hwave);
static
LRESULT
WID_Open
(
WINMM_OpenInfo
*
info
);
static
LRESULT
WID_Close
(
HWAVEIN
hwave
);
BOOL
WINMM_Init
Waveform
(
void
)
void
WINMM_Delete
Waveform
(
void
)
{
InitializeCriticalSection
(
&
g_devthread_lock
);
return
TRUE
;
/* FIXME: Free g_(in,out)_mmdevices? */
DeleteCriticalSection
(
&
g_devthread_lock
)
;
}
static
inline
HWAVE
WINMM_MakeHWAVE
(
UINT
mmdevice
,
BOOL
is_out
,
UINT
device
)
...
...
@@ -193,6 +200,8 @@ static void WINMM_InitDevice(WINMM_Device *device,
WINMM_MMDevice
*
parent
,
HWAVE
hwave
)
{
InitializeCriticalSection
(
&
device
->
lock
);
device
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": WINMM_Device.lock"
);
device
->
handle
=
hwave
;
device
->
parent
=
parent
;
}
...
...
@@ -449,6 +458,7 @@ static HRESULT WINMM_InitMMDevice(EDataFlow flow, IMMDevice *device,
CoCreateGuid
(
&
dev
->
session
);
InitializeCriticalSection
(
&
dev
->
lock
);
dev
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": WINMM_Device.lock"
);
return
S_OK
;
}
...
...
dlls/winmm/winemm.h
View file @
814c854f
...
...
@@ -152,7 +152,7 @@ void TIME_MMTimeStop(void) DECLSPEC_HIDDEN;
MMRESULT
WINMM_CheckCallback
(
DWORD_PTR
dwCallback
,
DWORD
fdwOpen
,
BOOL
mixer
)
DECLSPEC_HIDDEN
;
BOOL
WINMM_Init
Waveform
(
void
)
DECLSPEC_HIDDEN
;
void
WINMM_Delete
Waveform
(
void
)
DECLSPEC_HIDDEN
;
/* Global variables */
extern
CRITICAL_SECTION
WINMM_cs
DECLSPEC_HIDDEN
;
...
...
dlls/winmm/winmm.c
View file @
814c854f
...
...
@@ -79,7 +79,7 @@ static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
{
hWinMM32Instance
=
hInstDLL
;
psLastEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
return
WINMM_InitWaveform
()
;
return
TRUE
;
}
/**************************************************************************
...
...
@@ -89,8 +89,7 @@ static void WINMM_DeleteIData(void)
{
TIME_MMTimeStop
();
/* FIXME: should also free content and resources allocated
* inside WINMM_IData */
WINMM_DeleteWaveform
();
CloseHandle
(
psLastEvent
);
DeleteCriticalSection
(
&
WINMM_cs
);
}
...
...
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