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
a174713f
Commit
a174713f
authored
Apr 11, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Apr 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: DriverCallback returns TRUE iff there is notification.
parent
e6a501bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
driver.c
dlls/winmm/driver.c
+16
-9
midi.c
dlls/winmm/tests/midi.c
+13
-0
No files found.
dlls/winmm/driver.c
View file @
a174713f
...
...
@@ -129,7 +129,7 @@ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr)
static
inline
LRESULT
DRIVER_SendMessage
(
LPWINE_DRIVER
lpDrv
,
UINT
msg
,
LPARAM
lParam1
,
LPARAM
lParam2
)
{
LRESULT
ret
=
0
;
LRESULT
ret
;
TRACE
(
"Before call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx
\n
"
,
lpDrv
->
lpDrvProc
,
lpDrv
->
dwDriverID
,
lpDrv
,
msg
,
lParam1
,
lParam2
);
...
...
@@ -552,24 +552,28 @@ BOOL WINAPI DriverCallback(DWORD_PTR dwCallBack, DWORD uFlags, HDRVR hDev,
DWORD
wMsg
,
DWORD_PTR
dwUser
,
DWORD_PTR
dwParam1
,
DWORD_PTR
dwParam2
)
{
BOOL
ret
=
FALSE
;
TRACE
(
"(%08lX, %s %04X, %p, %04X, %08lX, %08lX, %08lX)
\n
"
,
dwCallBack
,
DRIVER_getCallback
(
uFlags
),
uFlags
,
hDev
,
wMsg
,
dwUser
,
dwParam1
,
dwParam2
);
if
(
!
dwCallBack
)
return
ret
;
switch
(
uFlags
&
DCB_TYPEMASK
)
{
case
DCB_NULL
:
break
;
/* Native returns FALSE = no notification, not TRUE */
return
ret
;
case
DCB_WINDOW
:
PostMessageA
((
HWND
)
dwCallBack
,
wMsg
,
(
WPARAM
)
hDev
,
dwParam1
);
ret
=
PostMessageA
((
HWND
)
dwCallBack
,
wMsg
,
(
WPARAM
)
hDev
,
dwParam1
);
break
;
case
DCB_TASK
:
/* aka DCB_THREAD */
PostThreadMessageA
(
dwCallBack
,
wMsg
,
(
WPARAM
)
hDev
,
dwParam1
);
ret
=
PostThreadMessageA
(
dwCallBack
,
wMsg
,
(
WPARAM
)
hDev
,
dwParam1
);
break
;
case
DCB_FUNCTION
:
if
(
dwCallBack
)
((
LPDRVCALLBACK
)
dwCallBack
)(
hDev
,
wMsg
,
dwUser
,
dwParam1
,
dwParam2
)
;
((
LPDRVCALLBACK
)
dwCallBack
)(
hDev
,
wMsg
,
dwUser
,
dwParam1
,
dwParam2
);
ret
=
TRUE
;
break
;
case
DCB_EVENT
:
SetEvent
((
HANDLE
)
dwCallBack
);
ret
=
SetEvent
((
HANDLE
)
dwCallBack
);
break
;
#if 0
/* FIXME: for now only usable in mmsystem.dll16
...
...
@@ -601,8 +605,11 @@ BOOL WINAPI DriverCallback(DWORD_PTR dwCallBack, DWORD uFlags, HDRVR hDev,
WARN
(
"Unknown callback type %d
\n
"
,
uFlags
&
DCB_TYPEMASK
);
return
FALSE
;
}
TRACE
(
"Done
\n
"
);
return
TRUE
;
if
(
ret
)
TRACE
(
"Done
\n
"
);
else
WARN
(
"Notification failure
\n
"
);
return
ret
;
}
/******************************************************************
...
...
dlls/winmm/tests/midi.c
View file @
a174713f
...
...
@@ -325,6 +325,19 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
rc
=
midiOutClose
(
hm
);
ok
(
!
rc
,
"midiOutClose rc=%s
\n
"
,
mmsys_error
(
rc
));
test_notification
(
hwnd
,
"midiOutClose"
,
MOM_CLOSE
,
0
);
rc
=
midiOutOpen
(
&
hm
,
udev
,
0
,
(
DWORD_PTR
)
MYCBINST
,
CALLBACK_WINDOW
);
ok
(
!
rc
,
"midiOutOpen(dev=%d) 0 CALLBACK_WINDOW rc=%s
\n
"
,
udev
,
mmsys_error
(
rc
));
/* PostMessage(hwnd=0) redirects to PostThreadMessage(GetCurrentThreadId())
* which PeekMessage((HWND)-1) queries. */
test_notification
((
HWND
)
-
1
,
"midiOutOpen WINDOW->THREAD"
,
0
,
WHATEVER
);
test_notification
(
hwnd
,
"midiOutOpen WINDOW"
,
0
,
WHATEVER
);
if
(
!
rc
)
{
rc
=
midiOutClose
(
hm
);
ok
(
!
rc
,
"midiOutClose rc=%s
\n
"
,
mmsys_error
(
rc
));
test_notification
((
HWND
)
-
1
,
"midiOutClose WINDOW->THREAD"
,
0
,
WHATEVER
);
test_notification
(
hwnd
,
"midiOutClose"
,
0
,
WHATEVER
);
}
test_notification
(
hwnd
,
"midiOut over"
,
0
,
WHATEVER
);
}
...
...
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