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
433f72f8
Commit
433f72f8
authored
Jun 20, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In MCI_(Un)MapMsg16To32W with wMsg == MCI_OPEN(_DRIVER) only do
strdupAtoW on those parameters that are flagged to be a string.
parent
4c5f9c09
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
24 deletions
+36
-24
mci.c
dlls/winmm/mci.c
+14
-14
message16.c
dlls/winmm/message16.c
+20
-8
winemm.h
dlls/winmm/winemm.h
+2
-2
No files found.
dlls/winmm/mci.c
View file @
433f72f8
...
...
@@ -68,8 +68,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mci
);
WINMM_MapType
(
*
pFnMciMapMsg16To32W
)
(
WORD
,
WORD
,
DWORD
*
)
/* = NULL */
;
WINMM_MapType
(
*
pFnMciUnMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
)
/* = NULL */
;
WINMM_MapType
(
*
pFnMciMapMsg16To32W
)
(
WORD
,
WORD
,
DWORD
,
DWORD
*
)
/* = NULL */
;
WINMM_MapType
(
*
pFnMciUnMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
,
DWORD
)
/* = NULL */
;
WINMM_MapType
(
*
pFnMciMapMsg32WTo16
)
(
WORD
,
WORD
,
DWORD
,
DWORD
*
)
/* = NULL */
;
WINMM_MapType
(
*
pFnMciUnMapMsg32WTo16
)(
WORD
,
WORD
,
DWORD
,
DWORD
)
/* = NULL */
;
...
...
@@ -1595,7 +1595,7 @@ DWORD MCI_SendCommandFrom16(MCIDEVICEID wDevID, UINT16 wMsg, DWORD_PTR dwParam1,
if
(
wmd
->
bIs32
&&
pFnMciMapMsg16To32W
)
{
WINMM_MapType
res
;
switch
(
res
=
pFnMciMapMsg16To32W
(
wmd
->
wType
,
wMsg
,
&
dwParam2
))
{
switch
(
res
=
pFnMciMapMsg16To32W
(
wmd
->
wType
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_MSGERROR
:
TRACE
(
"Not handled yet (%s)
\n
"
,
MCI_MessageToString
(
wMsg
));
dwRet
=
MCIERR_DRIVER_INTERNAL
;
...
...
@@ -1608,7 +1608,7 @@ DWORD MCI_SendCommandFrom16(MCIDEVICEID wDevID, UINT16 wMsg, DWORD_PTR dwParam1,
case
WINMM_MAP_OKMEM
:
dwRet
=
SendDriverMessage
(
wmd
->
hDriver
,
wMsg
,
dwParam1
,
dwParam2
);
if
(
res
==
WINMM_MAP_OKMEM
)
pFnMciUnMapMsg16To32W
(
wmd
->
wType
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
wmd
->
wType
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
}
}
else
{
...
...
@@ -1966,11 +1966,11 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
if
(
bFrom32
)
{
dwRet
=
MCI_Open
(
dwParam1
,
(
LPMCI_OPEN_PARMSW
)
dwParam2
);
}
else
if
(
pFnMciMapMsg16To32W
)
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
&
dwParam2
))
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_OK
:
case
WINMM_MAP_OKMEM
:
dwRet
=
MCI_Open
(
dwParam1
,
(
LPMCI_OPEN_PARMSW
)
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
default:
break
;
/* so that gcc does not bark */
}
...
...
@@ -1980,11 +1980,11 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
if
(
bFrom32
)
{
dwRet
=
MCI_Close
(
wDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
}
else
if
(
pFnMciMapMsg16To32W
)
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
&
dwParam2
))
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_OK
:
case
WINMM_MAP_OKMEM
:
dwRet
=
MCI_Close
(
wDevID
,
dwParam1
,
(
LPMCI_GENERIC_PARMS
)
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
default:
break
;
/* so that gcc does not bark */
}
...
...
@@ -1994,11 +1994,11 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
if
(
bFrom32
)
{
dwRet
=
MCI_SysInfo
(
wDevID
,
dwParam1
,
(
LPMCI_SYSINFO_PARMSW
)
dwParam2
);
}
else
if
(
pFnMciMapMsg16To32W
)
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
&
dwParam2
))
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_OK
:
case
WINMM_MAP_OKMEM
:
dwRet
=
MCI_SysInfo
(
wDevID
,
dwParam1
,
(
LPMCI_SYSINFO_PARMSW
)
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
default:
break
;
/* so that gcc does not bark */
}
...
...
@@ -2008,11 +2008,11 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
if
(
bFrom32
)
{
dwRet
=
MCI_Break
(
wDevID
,
dwParam1
,
(
LPMCI_BREAK_PARMS
)
dwParam2
);
}
else
if
(
pFnMciMapMsg16To32W
)
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
&
dwParam2
))
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_OK
:
case
WINMM_MAP_OKMEM
:
dwRet
=
MCI_Break
(
wDevID
,
dwParam1
,
(
LPMCI_BREAK_PARMS
)
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
default:
break
;
/* so that gcc does not bark */
}
...
...
@@ -2022,11 +2022,11 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1,
if
(
bFrom32
)
{
dwRet
=
MCI_Sound
(
wDevID
,
dwParam1
,
(
LPMCI_SOUND_PARMSW
)
dwParam2
);
}
else
if
(
pFnMciMapMsg16To32W
)
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
&
dwParam2
))
{
switch
(
pFnMciMapMsg16To32W
(
0
,
wMsg
,
dwParam1
,
&
dwParam2
))
{
case
WINMM_MAP_OK
:
case
WINMM_MAP_OKMEM
:
dwRet
=
MCI_Sound
(
wDevID
,
dwParam1
,
(
LPMCI_SOUND_PARMSW
)
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam2
);
pFnMciUnMapMsg16To32W
(
0
,
wMsg
,
dwParam
1
,
dwParam
2
);
break
;
default:
break
;
/* so that gcc does not bark */
}
...
...
dlls/winmm/message16.c
View file @
433f72f8
...
...
@@ -2522,7 +2522,7 @@ static WINMM_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlag
/**************************************************************************
* MCI_MapMsg16To32W [internal]
*/
static
WINMM_MapType
MCI_MapMsg16To32W
(
WORD
uDevType
,
WORD
wMsg
,
DWORD
*
lParam
)
static
WINMM_MapType
MCI_MapMsg16To32W
(
WORD
uDevType
,
WORD
wMsg
,
DWORD
dwFlags
,
DWORD
*
lParam
)
{
if
(
*
lParam
==
0
)
return
WINMM_MAP_OK
;
...
...
@@ -2632,9 +2632,18 @@ static WINMM_MapType MCI_MapMsg16To32W(WORD uDevType, WORD wMsg, DWORD* lParam)
mop32w
=
(
LPMCI_OPEN_PARMSW
)((
char
*
)
mop32w
+
sizeof
(
LPMCI_OPEN_PARMS16
));
mop32w
->
dwCallback
=
mop16
->
dwCallback
;
mop32w
->
wDeviceID
=
mop16
->
wDeviceID
;
mop32w
->
lpstrDeviceType
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrDeviceType
));
mop32w
->
lpstrElementName
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrElementName
));
mop32w
->
lpstrAlias
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrAlias
));
if
(
(
dwFlags
&
(
MCI_OPEN_TYPE
|
MCI_OPEN_TYPE_ID
))
==
MCI_OPEN_TYPE
)
mop32w
->
lpstrDeviceType
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrDeviceType
));
else
mop32w
->
lpstrDeviceType
=
(
LPWSTR
)
mop16
->
lpstrDeviceType
;
if
(
(
dwFlags
&
(
MCI_OPEN_ELEMENT
|
MCI_OPEN_ELEMENT_ID
))
==
MCI_OPEN_ELEMENT
)
mop32w
->
lpstrElementName
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrElementName
));
else
mop32w
->
lpstrElementName
=
(
LPWSTR
)
mop16
->
lpstrElementName
;
if
(
(
dwFlags
&
MCI_OPEN_ALIAS
))
mop32w
->
lpstrAlias
=
MCI_strdupAtoW
(
MapSL
(
mop16
->
lpstrAlias
));
else
mop32w
->
lpstrAlias
=
(
LPWSTR
)
mop16
->
lpstrAlias
;
/* copy extended information if any...
* FIXME: this may seg fault if initial structure does not contain them and
* the reads after msip16 fail under LDT limits...
...
...
@@ -2707,7 +2716,7 @@ static WINMM_MapType MCI_MapMsg16To32W(WORD uDevType, WORD wMsg, DWORD* lParam)
/**************************************************************************
* MCI_UnMapMsg16To32W [internal]
*/
static
WINMM_MapType
MCI_UnMapMsg16To32W
(
WORD
uDevType
,
WORD
wMsg
,
DWORD
lParam
)
static
WINMM_MapType
MCI_UnMapMsg16To32W
(
WORD
uDevType
,
WORD
wMsg
,
DWORD
dwFlags
,
DWORD
lParam
)
{
switch
(
wMsg
)
{
/* case MCI_CAPTURE */
...
...
@@ -2798,9 +2807,12 @@ static WINMM_MapType MCI_UnMapMsg16To32W(WORD uDevType, WORD wMsg, DWORD lParam
LPMCI_OPEN_PARMS16
mop16
=
*
(
LPMCI_OPEN_PARMS16
*
)((
char
*
)
mop32w
-
sizeof
(
LPMCI_OPEN_PARMS16
));
mop16
->
wDeviceID
=
mop32w
->
wDeviceID
;
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrDeviceType
);
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrElementName
);
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrAlias
);
if
(
(
dwFlags
&
(
MCI_OPEN_TYPE
|
MCI_OPEN_TYPE_ID
))
==
MCI_OPEN_TYPE
)
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrDeviceType
);
if
(
(
dwFlags
&
(
MCI_OPEN_ELEMENT
|
MCI_OPEN_ELEMENT_ID
))
==
MCI_OPEN_ELEMENT
)
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrElementName
);
if
(
(
dwFlags
&
MCI_OPEN_ALIAS
))
HeapFree
(
GetProcessHeap
(),
0
,
mop32w
->
lpstrAlias
);
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)(
lParam
-
sizeof
(
LPMCI_OPEN_PARMS16
))))
FIXME
(
"bad free line=%d
\n
"
,
__LINE__
);
}
...
...
dlls/winmm/winemm.h
View file @
433f72f8
...
...
@@ -300,8 +300,8 @@ extern WINE_MMTHREAD* (*pFnGetMMThread16)(UINT16);
extern
LPWINE_DRIVER
(
*
pFnOpenDriver16
)(
LPCWSTR
,
LPCWSTR
,
LPARAM
);
extern
LRESULT
(
*
pFnCloseDriver16
)(
UINT16
,
LPARAM
,
LPARAM
);
extern
LRESULT
(
*
pFnSendMessage16
)(
UINT16
,
UINT
,
LPARAM
,
LPARAM
);
extern
WINMM_MapType
(
*
pFnMciMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
*
);
extern
WINMM_MapType
(
*
pFnMciUnMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
);
extern
WINMM_MapType
(
*
pFnMciMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
,
DWORD
*
);
extern
WINMM_MapType
(
*
pFnMciUnMapMsg16To32W
)(
WORD
,
WORD
,
DWORD
,
DWORD
);
extern
WINMM_MapType
(
*
pFnMciMapMsg32WTo16
)(
WORD
,
WORD
,
DWORD
,
DWORD
*
);
extern
WINMM_MapType
(
*
pFnMciUnMapMsg32WTo16
)(
WORD
,
WORD
,
DWORD
,
DWORD
);
extern
LRESULT
(
*
pFnCallMMDrvFunc16
)(
DWORD
/* in fact FARPROC16 */
,
WORD
,
WORD
,
LONG
,
LONG
,
LONG
);
...
...
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