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
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
mci16.c
dlls/mmsystem.dll16/mci16.c
+27
-12
No files found.
dlls/mmsystem.dll16/mci16.c
View file @
b84f2f22
...
@@ -270,20 +270,27 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l
...
@@ -270,20 +270,27 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* l
return
MMSYSTEM_MAP_OKMEM
;
return
MMSYSTEM_MAP_OKMEM
;
case
MCI_SYSINFO
:
case
MCI_SYSINFO
:
{
{
LPMCI_SYSINFO_PARMSW
msip32w
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPMCI_OPEN_PARMS16
)
+
sizeof
(
MCI_SYSINFO_PARMSW
));
MCI_SYSINFO_PARMSW
*
msip32w
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MCI_OPEN_PARMS16
*
)
+
sizeof
(
MCI_SYSINFO_PARMSW
));
LPMCI_SYSINFO_PARMS16
msip16
=
MapSL
(
*
lParam
);
MCI_SYSINFO_PARMS16
*
msip16
=
MapSL
(
*
lParam
);
if
(
msip32w
)
{
if
(
!
msip32w
)
*
(
LPMCI_SYSINFO_PARMS16
*
)(
msip32w
)
=
msip16
;
return
MMSYSTEM_MAP_NOMEM
;
msip32w
=
(
LPMCI_SYSINFO_PARMSW
)((
char
*
)
msip32w
+
sizeof
(
LPMCI_OPEN_PARMS16
));
*
(
MCI_SYSINFO_PARMS16
**
)
msip32w
=
msip16
;
msip32w
=
(
MCI_SYSINFO_PARMSW
*
)((
char
*
)
msip32w
+
sizeof
(
MCI_OPEN_PARMS16
*
));
msip32w
->
dwCallback
=
msip16
->
dwCallback
;
msip32w
->
dwCallback
=
msip16
->
dwCallback
;
msip32w
->
lpstrReturn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
msip16
->
dwRetSize
*
sizeof
(
WCHAR
));
msip32w
->
lpstrReturn
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
dwFlags
&
MCI_SYSINFO_QUANTITY
)
?
msip32w
->
dwRetSize
=
msip16
->
dwRetSize
;
sizeof
(
DWORD
)
:
msip32w
->
dwNumber
=
msip16
->
dwNumber
;
msip16
->
dwRetSize
*
sizeof
(
WCHAR
));
msip32w
->
wDeviceType
=
msip16
->
wDeviceType
;
if
(
!
msip32w
->
lpstrReturn
)
}
else
{
{
HeapFree
(
GetProcessHeap
(),
0
,
msip32w
);
return
MMSYSTEM_MAP_NOMEM
;
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
;
*
lParam
=
(
DWORD
)
msip32w
;
}
}
return
MMSYSTEM_MAP_OKMEM
;
return
MMSYSTEM_MAP_OKMEM
;
...
@@ -391,13 +398,21 @@ static MMSYSTEM_MapType MCI_UnMapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR
...
@@ -391,13 +398,21 @@ static MMSYSTEM_MapType MCI_UnMapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR
return
MMSYSTEM_MAP_OK
;
return
MMSYSTEM_MAP_OK
;
case
MCI_SYSINFO
:
case
MCI_SYSINFO
:
if
(
lParam
)
{
if
(
lParam
)
{
LPMCI_SYSINFO_PARMSW
msip32w
=
(
LPMCI_SYSINFO_PARMSW
)
lParam
;
MCI_SYSINFO_PARMSW
*
msip32w
=
(
MCI_SYSINFO_PARMSW
*
)
lParam
;
LPMCI_SYSINFO_PARMS16
msip16
=
*
(
LPMCI_SYSINFO_PARMS16
*
)((
char
*
)
msip32w
-
sizeof
(
LPMCI_SYSINFO_PARMS16
));
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
,
WideCharToMultiByte
(
CP_ACP
,
0
,
msip32w
->
lpstrReturn
,
msip32w
->
dwRetSize
,
msip32w
->
lpstrReturn
,
msip32w
->
dwRetSize
,
MapSL
(
msip16
->
lpstrReturn
),
msip16
->
dwRetSize
,
MapSL
(
msip16
->
lpstrReturn
),
msip16
->
dwRetSize
,
NULL
,
NULL
);
NULL
,
NULL
);
}
HeapFree
(
GetProcessHeap
(),
0
,
msip32w
->
lpstrReturn
);
HeapFree
(
GetProcessHeap
(),
0
,
msip32w
->
lpstrReturn
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
lParam
);
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