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
2b95cacc
Commit
2b95cacc
authored
Jul 21, 2004
by
Filip Navara
Committed by
Alexandre Julliard
Jul 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implementation of mmTaskCreate. Based on patch by Eric Pouech.
- Fallback implementation in waveOut[Un]PrepareHeader.
parent
ebf2ad27
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
4 deletions
+80
-4
winmm.c
dlls/winmm/winmm.c
+69
-4
winmm.spec
dlls/winmm/winmm.spec
+1
-0
mmddk.h
include/mmddk.h
+10
-0
No files found.
dlls/winmm/winmm.c
View file @
2b95cacc
...
...
@@ -83,7 +83,7 @@ static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
return
FALSE
;
WINMM_IData
->
hWinMM32Instance
=
hInstDLL
;
InitializeCriticalSection
(
&
WINMM_IData
->
cs
);
WINMM_IData
->
cs
.
DebugInfo
=
(
void
*
)
__FILE__
": WinMM
"
;
WINMM_IData
->
cs
.
DebugInfo
->
Spare
[
1
]
=
(
DWORD
)
"WINMM_IData
"
;
WINMM_IData
->
psStopEvent
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
WINMM_IData
->
psLastEvent
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
NULL
);
TRACE
(
"Created IData (%p)
\n
"
,
WINMM_IData
);
...
...
@@ -103,7 +103,7 @@ static void WINMM_DeleteIData(void)
CloseHandle
(
WINMM_IData
->
psStopEvent
);
CloseHandle
(
WINMM_IData
->
psLastEvent
);
DeleteCriticalSection
(
&
WINMM_IData
->
cs
);
HeapFree
(
GetProcessHeap
(),
0
,
WINMM_IData
);
HeapFree
(
GetProcessHeap
(),
0
,
WINMM_IData
);
WINMM_IData
=
NULL
;
}
}
...
...
@@ -2658,6 +2658,7 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
WAVEHDR
*
lpWaveOutHdr
,
UINT
uSize
)
{
LPWINE_MLD
wmld
;
UINT
result
;
TRACE
(
"(%p, %p, %u);
\n
"
,
hWaveOut
,
lpWaveOutHdr
,
uSize
);
...
...
@@ -2667,7 +2668,17 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
if
((
wmld
=
MMDRV_Get
(
hWaveOut
,
MMDRV_WAVEOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
return
MMDRV_Message
(
wmld
,
WODM_PREPARE
,
(
DWORD_PTR
)
lpWaveOutHdr
,
uSize
,
TRUE
);
if
((
result
=
MMDRV_Message
(
wmld
,
WODM_PREPARE
,
(
DWORD_PTR
)
lpWaveOutHdr
,
uSize
,
TRUE
))
!=
MMSYSERR_NOTSUPPORTED
)
return
result
;
if
(
lpWaveOutHdr
->
dwFlags
&
WHDR_INQUEUE
)
return
WAVERR_STILLPLAYING
;
lpWaveOutHdr
->
dwFlags
|=
WHDR_PREPARED
;
lpWaveOutHdr
->
dwFlags
&=
~
WHDR_DONE
;
return
MMSYSERR_NOERROR
;
}
/**************************************************************************
...
...
@@ -2677,6 +2688,7 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
LPWAVEHDR
lpWaveOutHdr
,
UINT
uSize
)
{
LPWINE_MLD
wmld
;
UINT
result
;
TRACE
(
"(%p, %p, %u);
\n
"
,
hWaveOut
,
lpWaveOutHdr
,
uSize
);
...
...
@@ -2690,7 +2702,17 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
if
((
wmld
=
MMDRV_Get
(
hWaveOut
,
MMDRV_WAVEOUT
,
FALSE
))
==
NULL
)
return
MMSYSERR_INVALHANDLE
;
return
MMDRV_Message
(
wmld
,
WODM_UNPREPARE
,
(
DWORD_PTR
)
lpWaveOutHdr
,
uSize
,
TRUE
);
if
((
result
=
MMDRV_Message
(
wmld
,
WODM_UNPREPARE
,
(
DWORD_PTR
)
lpWaveOutHdr
,
uSize
,
TRUE
))
!=
MMSYSERR_NOTSUPPORTED
)
return
result
;
if
(
lpWaveOutHdr
->
dwFlags
&
WHDR_INQUEUE
)
return
WAVERR_STILLPLAYING
;
lpWaveOutHdr
->
dwFlags
&=
~
WHDR_PREPARED
;
lpWaveOutHdr
->
dwFlags
|=
WHDR_DONE
;
return
MMSYSERR_NOERROR
;
}
/**************************************************************************
...
...
@@ -3174,3 +3196,46 @@ UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage,
return
MMDRV_Message
(
wmld
,
uMessage
,
dwParam1
,
dwParam2
,
TRUE
);
}
struct
mm_starter
{
LPTASKCALLBACK
cb
;
DWORD
client
;
HANDLE
event
;
};
DWORD
WINAPI
mmTaskRun
(
void
*
pmt
)
{
struct
mm_starter
mms
;
memcpy
(
&
mms
,
pmt
,
sizeof
(
struct
mm_starter
));
HeapFree
(
GetProcessHeap
(),
0
,
pmt
);
mms
.
cb
(
mms
.
client
);
if
(
mms
.
event
)
SetEvent
(
mms
.
event
);
return
0
;
}
MMRESULT
WINAPI
mmTaskCreate
(
LPTASKCALLBACK
cb
,
HANDLE
*
ph
,
DWORD
client
)
{
HANDLE
hThread
;
HANDLE
hEvent
=
0
;
struct
mm_starter
*
mms
;
mms
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
mm_starter
));
if
(
mms
==
NULL
)
{
return
TASKERR_OUTOFMEMORY
;
}
mms
->
cb
=
cb
;
mms
->
client
=
client
;
if
(
ph
)
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
mms
->
event
=
hEvent
;
hThread
=
CreateThread
(
0
,
0
,
mmTaskRun
,
mms
,
0
,
NULL
);
if
(
!
hThread
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mms
);
if
(
hEvent
)
CloseHandle
(
hEvent
);
return
TASKERR_OUTOFMEMORY
;
}
if
(
ph
)
*
ph
=
hEvent
;
CloseHandle
(
hThread
);
return
0
;
}
dlls/winmm/winmm.spec
View file @
2b95cacc
...
...
@@ -135,6 +135,7 @@
@ stdcall mmioStringToFOURCCW(wstr long)
@ stdcall mmioWrite(long ptr long)
@ stdcall mmsystemGetVersion()
@ stdcall mmTaskCreate(ptr ptr long)
@ stdcall sndPlaySoundA(ptr long)
@ stdcall sndPlaySoundW(ptr long)
@ stdcall timeBeginPeriod(long)
...
...
include/mmddk.h
View file @
2b95cacc
...
...
@@ -451,6 +451,16 @@ BOOL WINAPI mciFreeCommandResource(UINT uTable);
BOOL
WINAPI
DriverCallback
(
DWORD
dwCallBack
,
UINT
uFlags
,
HDRVR
hDev
,
UINT
wMsg
,
DWORD
dwUser
,
DWORD
dwParam1
,
DWORD
dwParam2
);
typedef
void
(
*
LPTASKCALLBACK
)(
DWORD
dwInst
);
#define TASKERR_NOTASKSUPPORT 1
#define TASKERR_OUTOFMEMORY 2
MMRESULT
WINAPI
mmTaskCreate
(
LPTASKCALLBACK
,
HANDLE
*
,
DWORD
);
void
WINAPI
mmTaskBlock
(
HANDLE
);
BOOL
WINAPI
mmTaskSignal
(
HANDLE
);
void
WINAPI
mmTaskYield
(
void
);
HANDLE
WINAPI
mmGetCurrentTask
(
void
);
#ifdef __WINESRC__
#define WAVE_DIRECTSOUND 0x0080
#endif
...
...
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