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
35a8ee93
Commit
35a8ee93
authored
Apr 13, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Apr 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Implement CALLBACK_WINDOW.
parent
8a5b6df4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
5 deletions
+57
-5
mixer.c
dlls/winmm/tests/mixer.c
+22
-1
winmm.c
dlls/winmm/winmm.c
+35
-4
No files found.
dlls/winmm/tests/mixer.c
View file @
35a8ee93
...
...
@@ -378,8 +378,18 @@ static void mixer_test_deviceA(int device)
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mixerOpen: MMSYSERR_
BADDEVICEID
expected, got %s
\n
"
,
mmsys_error
(
rc
));
"mixerOpen: MMSYSERR_
NOERROR
expected, got %s
\n
"
,
mmsys_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
CALLBACK_FUNCTION
);
ok
(
rc
==
MMSYSERR_INVALFLAG
,
"mixerOpen: MMSYSERR_INVALFLAG expected, got %s
\n
"
,
mmsys_error
(
rc
));
/* Shouldn't open without a valid HWND */
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
CALLBACK_WINDOW
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"mixerOpen: MMSYSERR_INVALPARAM expected, got %s
\n
"
,
mmsys_error
(
rc
));
for
(
d
=
0
;
d
<
capsA
.
cDestinations
;
d
++
)
{
MIXERLINEA
mixerlineA
;
mixerlineA
.
cbStruct
=
0
;
...
...
@@ -757,10 +767,21 @@ static void mixer_test_deviceW(int device)
szPname
,
capsW
.
vDriverVersion
>>
8
,
capsW
.
vDriverVersion
&
0xff
,
capsW
.
wMid
,
capsW
.
wPid
);
}
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mixerOpen: MMSYSERR_BADDEVICEID expected, got %s
\n
"
,
mmsys_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
CALLBACK_FUNCTION
);
ok
(
rc
==
MMSYSERR_INVALFLAG
,
"mixerOpen: MMSYSERR_INVALFLAG expected, got %s
\n
"
,
mmsys_error
(
rc
));
/* Shouldn't open without a valid HWND */
rc
=
mixerOpen
(
&
mix
,
device
,
0
,
0
,
CALLBACK_WINDOW
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"mixerOpen: MMSYSERR_INVALPARAM expected, got %s
\n
"
,
mmsys_error
(
rc
));
for
(
d
=
0
;
d
<
capsW
.
cDestinations
;
d
++
)
{
MIXERLINEW
mixerlineW
;
mixerlineW
.
cbStruct
=
0
;
...
...
dlls/winmm/winmm.c
View file @
35a8ee93
...
...
@@ -306,6 +306,16 @@ UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize
return
MMDRV_Message
(
wmld
,
MXDM_GETDEVCAPS
,
(
DWORD_PTR
)
lpCaps
,
uSize
,
TRUE
);
}
static
void
CALLBACK
MIXER_WCallback
(
HMIXEROBJ
hmx
,
UINT
uMsg
,
DWORD_PTR
dwInstance
,
DWORD_PTR
dwParam
,
DWORD_PTR
param2
)
{
HWND
hWnd
=
(
HWND
)
dwInstance
;
if
(
!
dwInstance
)
return
;
PostMessageW
(
hWnd
,
MM_MIXM_CONTROL_CHANGE
,
(
WPARAM
)
hmx
,
(
LPARAM
)
dwParam
);
}
UINT
MIXER_Open
(
LPHMIXER
lphMix
,
UINT
uDeviceID
,
DWORD_PTR
dwCallback
,
DWORD_PTR
dwInstance
,
DWORD
fdwOpen
,
BOOL
bFrom32
)
{
...
...
@@ -317,15 +327,36 @@ UINT MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
TRACE
(
"(%p, %d, %08lx, %08lx, %08x)
\n
"
,
lphMix
,
uDeviceID
,
dwCallback
,
dwInstance
,
fdwOpen
);
mod
.
dwCallback
=
(
DWORD_PTR
)
MIXER_WCallback
;
mod
.
dwInstance
=
0
;
/* If callback is a function,
* dwCallback contains function pointer
* dwInstance private data
*
* if callback is a window
* dwCallback contains a window handle
*/
switch
(
fdwOpen
&
CALLBACK_TYPEMASK
)
{
default:
return
MMSYSERR_INVALFLAG
;
case
CALLBACK_NULL
:
break
;
case
CALLBACK_WINDOW
:
mod
.
dwInstance
=
dwCallback
;
if
(
!
IsWindow
((
HWND
)
dwCallback
))
return
MMSYSERR_INVALPARAM
;
break
;
}
wmld
=
MMDRV_Alloc
(
sizeof
(
WINE_MIXER
),
MMDRV_MIXER
,
&
hMix
,
&
fdwOpen
,
&
dwCallback
,
&
dwInstance
,
bFrom32
);
wmld
->
uDeviceID
=
uDeviceID
;
mod
.
hmx
=
(
HMIXEROBJ
)
hMix
;
mod
.
dwCallback
=
dwCallback
;
mod
.
dwInstance
=
dwInstance
;
dwRet
=
MMDRV_Open
(
wmld
,
MXDM_OPEN
,
(
DWORD
)
&
mod
,
fdwOpen
);
dwRet
=
MMDRV_Open
(
wmld
,
MXDM_OPEN
,
(
DWORD
)
&
mod
,
CALLBACK_FUNCTION
);
if
(
dwRet
!=
MMSYSERR_NOERROR
)
{
MMDRV_Free
(
hMix
,
wmld
);
...
...
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