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
6698e9e0
Commit
6698e9e0
authored
Sep 06, 2006
by
Jan Zerebecki
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Prevent NULL dereference in MCI_Close and add testcase for it.
parent
0ad5638b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
2 deletions
+55
-2
mci.c
dlls/winmm/mci.c
+3
-2
Makefile.in
dlls/winmm/tests/Makefile.in
+1
-0
mci.c
dlls/winmm/tests/mci.c
+51
-0
No files found.
dlls/winmm/mci.c
View file @
6698e9e0
...
...
@@ -1797,8 +1797,9 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms
MCI_UnLoadMciDriver
(
wmd
);
if
(
dwParam
&
MCI_NOTIFY
)
mciDriverNotify
((
HWND
)
lpParms
->
dwCallback
,
wDevID
,
(
dwRet
==
0
)
?
MCI_NOTIFY_SUCCESSFUL
:
MCI_NOTIFY_FAILURE
);
mciDriverNotify
(
lpParms
?
(
HWND
)
lpParms
->
dwCallback
:
0
,
wDevID
,
dwRet
?
MCI_NOTIFY_FAILURE
:
MCI_NOTIFY_SUCCESSFUL
);
return
dwRet
;
}
...
...
dlls/winmm/tests/Makefile.in
View file @
6698e9e0
...
...
@@ -7,6 +7,7 @@ IMPORTS = winmm user32 kernel32
CTESTS
=
\
capture.c
\
mci.c
\
mixer.c
\
mmio.c
\
timer.c
\
...
...
dlls/winmm/tests/mci.c
0 → 100644
View file @
6698e9e0
/*
* Test winmm mci
*
* Copyright 2006 Jan Zerebecki
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/test.h"
#include "winuser.h"
#include "mmsystem.h"
START_TEST
(
mci
)
{
int
err
;
const
char
command_open
[]
=
"open new type waveaudio alias mysound"
;
const
char
command_close_my
[]
=
"close mysound notify"
;
const
char
command_close_all
[]
=
"close all notify"
;
MSG
msg
;
err
=
mciSendString
(
command_open
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mciSendString(%s, NULL, 0 , NULL) returned error: %d
\n
"
,
command_open
,
err
);
err
=
mciSendString
(
command_close_my
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mciSendString(%s, NULL, 0 , NULL) returned error: %d
\n
"
,
command_close_my
,
err
);
ok
(
PeekMessageW
(
&
msg
,
(
HWND
)
-
1
,
0
,
0
,
PM_REMOVE
),
"PeekMessage should succeed
\n
"
);
ok
(
msg
.
hwnd
==
NULL
,
"got %p instead of NULL
\n
"
,
msg
.
hwnd
);
ok
(
msg
.
message
==
MM_MCINOTIFY
,
"got %04x instead of MM_MCINOTIFY
\n
"
,
msg
.
message
);
ok
(
msg
.
wParam
==
MCI_NOTIFY_SUCCESSFUL
,
"got %08x instead of MCI_NOTIFY_SUCCESSFUL
\n
"
,
msg
.
wParam
);
err
=
mciSendString
(
command_close_all
,
NULL
,
0
,
NULL
);
todo_wine
ok
(
!
err
,
"mciSendString(%s, NULL, 0 , NULL) returned error: %d
\n
"
,
command_close_all
,
err
);
err
=
mciSendCommand
(
MCI_ALL_DEVICE_ID
,
MCI_CLOSE
,
MCI_NOTIFY
,
0
);
todo_wine
ok
(
err
==
MCIERR_INVALID_DEVICE_ID
,
"mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_NOTIFY, NULL) returned %d instead of %d
\n
"
,
err
,
MCIERR_INVALID_DEVICE_ID
);
}
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