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
b84f2f22
Commit
b84f2f22
authored
Jan 04, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jan 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmsystem.dll16: Correctly map the MCI_SYSINFO_PARMS structure when MCI_SYSINFO_QUANTITY is set.
parent
41e64610
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
23 deletions
+38
-23
mci16.c
dlls/mmsystem.dll16/mci16.c
+38
-23
No files found.
dlls/mmsystem.dll16/mci16.c
View file @
b84f2f22
...
...
@@ -269,23 +269,30 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l
}
return
MMSYSTEM_MAP_OKMEM
;
case
MCI_SYSINFO
:
{
LPMCI_SYSINFO_PARMSW
msip32w
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPMCI_OPEN_PARMS16
)
+
sizeof
(
MCI_SYSINFO_PARMSW
));
LPMCI_SYSINFO_PARMS16
msip16
=
MapSL
(
*
lParam
);
if
(
msip32w
)
{
*
(
LPMCI_SYSINFO_PARMS16
*
)(
msip32w
)
=
msip16
;
msip32w
=
(
LPMCI_SYSINFO_PARMSW
)((
char
*
)
msip32w
+
sizeof
(
LPMCI_OPEN_PARMS16
));
msip32w
->
dwCallback
=
msip16
->
dwCallback
;
msip32w
->
lpstrReturn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
msip16
->
dwRetSize
*
sizeof
(
WCHAR
));
msip32w
->
dwRetSize
=
msip16
->
dwRetSize
;
msip32w
->
dwNumber
=
msip16
->
dwNumber
;
msip32w
->
wDeviceType
=
msip16
->
wDeviceType
;
}
else
{
return
MMSYSTEM_MAP_NOMEM
;
}
*
lParam
=
(
DWORD
)
msip32w
;
}
{
MCI_SYSINFO_PARMSW
*
msip32w
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MCI_OPEN_PARMS16
*
)
+
sizeof
(
MCI_SYSINFO_PARMSW
));
MCI_SYSINFO_PARMS16
*
msip16
=
MapSL
(
*
lParam
);
if
(
!
msip32w
)
return
MMSYSTEM_MAP_NOMEM
;
*
(
MCI_SYSINFO_PARMS16
**
)
msip32w
=
msip16
;
msip32w
=
(
MCI_SYSINFO_PARMSW
*
)((
char
*
)
msip32w
+
sizeof
(
MCI_OPEN_PARMS16
*
));
msip32w
->
dwCallback
=
msip16
->
dwCallback
;
msip32w
->
lpstrReturn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
dwFlags
&
MCI_SYSINFO_QUANTITY
)
?
sizeof
(
DWORD
)
:
msip16
->
dwRetSize
*
sizeof
(
WCHAR
));
if
(
!
msip32w
->
lpstrReturn
)
{
HeapFree
(
GetProcessHeap
(),
0
,
msip32w
);
return
MMSYSTEM_MAP_NOMEM
;
}
msip32w
->
dwRetSize
=
(
dwFlags
&
MCI_SYSINFO_QUANTITY
)
?
sizeof
(
DWORD
)
:
msip16
->
dwRetSize
;
msip32w
->
dwNumber
=
msip16
->
dwNumber
;
msip32w
->
wDeviceType
=
msip16
->
wDeviceType
;
*
lParam
=
(
DWORD
)
msip32w
;
}
return
MMSYSTEM_MAP_OKMEM
;
case
MCI_SOUND
:
{
...
...
@@ -391,13 +398,21 @@ static MMSYSTEM_MapType MCI_UnMapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR
return
MMSYSTEM_MAP_OK
;
case
MCI_SYSINFO
:
if
(
lParam
)
{
LPMCI_SYSINFO_PARMSW
msip32w
=
(
LPMCI_SYSINFO_PARMSW
)
lParam
;
LPMCI_SYSINFO_PARMS16
msip16
=
*
(
LPMCI_SYSINFO_PARMS16
*
)((
char
*
)
msip32w
-
sizeof
(
LPMCI_SYSINFO_PARMS16
));
MCI_SYSINFO_PARMSW
*
msip32w
=
(
MCI_SYSINFO_PARMSW
*
)
lParam
;
MCI_SYSINFO_PARMS16
*
msip16
=
*
(
MCI_SYSINFO_PARMS16
**
)((
char
*
)
msip32w
-
sizeof
(
MCI_SYSINFO_PARMS16
*
));
if
(
dwFlags
&
MCI_SYSINFO_QUANTITY
)
{
DWORD
*
quantity
=
MapSL
(
msip16
->
lpstrReturn
);
*
quantity
=
*
(
DWORD
*
)
msip32w
->
lpstrReturn
;
}
else
{
WideCharToMultiByte
(
CP_ACP
,
0
,
msip32w
->
lpstrReturn
,
msip32w
->
dwRetSize
,
MapSL
(
msip16
->
lpstrReturn
),
msip16
->
dwRetSize
,
NULL
,
NULL
);
}
WideCharToMultiByte
(
CP_ACP
,
0
,
msip32w
->
lpstrReturn
,
msip32w
->
dwRetSize
,
MapSL
(
msip16
->
lpstrReturn
),
msip16
->
dwRetSize
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
msip32w
->
lpstrReturn
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
lParam
);
}
...
...
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