Rebase against 4853f65c844de8277b8b0420df1a2cdb1c5b17c8.

mfplat-streaming-support disabled once again.
This commit is contained in:
Alistair Leslie-Hughes
2022-02-23 14:27:11 +11:00
parent bcfed21ea1
commit 05ea40b936
11 changed files with 182 additions and 1512 deletions

View File

@@ -1,18 +1,18 @@
From 851ba662c66ef27b8fa87417829d3e134d349542 Mon Sep 17 00:00:00 2001
From f32d9d5f3b9b4b3e54037211f5d561681ed589fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 4 Mar 2016 16:15:50 +0100
Subject: winmm: Do not crash in Win 9X mode when an invalid device ptr is
passed to MCI_OPEN.
Subject: [PATCH] winmm: Do not crash in Win 9X mode when an invalid device ptr
is passed to MCI_OPEN.
---
dlls/winmm/mci.c | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
dlls/winmm/mci.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c
index b3c1882..3e58063 100644
index 2aa74fd4127..5b8463286e5 100644
--- a/dlls/winmm/mci.c
+++ b/dlls/winmm/mci.c
@@ -218,7 +218,7 @@ static LPWSTR MCI_strdupAtoW( LPCSTR str )
@@ -209,7 +209,7 @@ static LPWSTR MCI_strdupAtoW( LPCSTR str )
return ret;
}
@@ -21,7 +21,7 @@ index b3c1882..3e58063 100644
{
if (msg < DRV_RESERVED) return 0;
@@ -261,8 +261,12 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -252,8 +252,12 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
MCI_ANIM_OPEN_PARMSW *mci_openW;
DWORD_PTR *ptr;
@@ -35,7 +35,7 @@ index b3c1882..3e58063 100644
*ptr++ = *dwParam2; /* save the previous pointer */
*dwParam2 = (DWORD_PTR)ptr;
@@ -292,7 +296,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -283,7 +287,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
if (HIWORD(dwParam1))
memcpy(&mci_openW->dwStyle, &mci_openA->dwStyle, sizeof(MCI_ANIM_OPEN_PARMSW) - sizeof(MCI_OPEN_PARMSW));
}
@@ -44,7 +44,7 @@ index b3c1882..3e58063 100644
case MCI_WINDOW:
if (dwParam1 & MCI_ANIM_WINDOW_TEXT)
@@ -301,7 +305,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -292,7 +296,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
MCI_ANIM_WINDOW_PARMSW *mci_windowW;
mci_windowW = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_windowW));
@@ -53,7 +53,7 @@ index b3c1882..3e58063 100644
*dwParam2 = (DWORD_PTR)mci_windowW;
@@ -313,8 +317,6 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -304,8 +308,6 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
mci_windowW->hWnd = mci_windowA->hWnd;
if (dwParam1 & MCI_ANIM_WINDOW_STATE)
mci_windowW->nCmdShow = mci_windowA->nCmdShow;
@@ -62,7 +62,7 @@ index b3c1882..3e58063 100644
}
return 0;
@@ -326,7 +328,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -317,7 +319,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
DWORD_PTR *ptr;
ptr = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_sysinfoW) + sizeof(DWORD_PTR));
@@ -71,7 +71,7 @@ index b3c1882..3e58063 100644
*ptr++ = *dwParam2; /* save the previous pointer */
*dwParam2 = (DWORD_PTR)ptr;
@@ -340,7 +342,6 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -331,7 +333,6 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
mci_sysinfoW->lpstrReturn = HeapAlloc(GetProcessHeap(), 0, mci_sysinfoW->dwRetSize * sizeof(WCHAR));
mci_sysinfoW->dwNumber = mci_sysinfoA->dwNumber;
mci_sysinfoW->wDeviceType = mci_sysinfoA->wDeviceType;
@@ -79,7 +79,7 @@ index b3c1882..3e58063 100644
}
return 0;
case MCI_INFO:
@@ -350,7 +351,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -341,7 +342,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
DWORD_PTR *ptr;
ptr = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_infoW) + sizeof(DWORD_PTR));
@@ -88,7 +88,7 @@ index b3c1882..3e58063 100644
*ptr++ = *dwParam2; /* save the previous pointer */
*dwParam2 = (DWORD_PTR)ptr;
@@ -364,8 +365,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -355,8 +356,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
mci_infoW->lpstrReturn = HeapAlloc(GetProcessHeap(), 0, mci_infoW->dwRetSize * sizeof(WCHAR));
if (dwParam1 & MCI_DGV_INFO_ITEM)
mci_infoW->dwItem = mci_infoA->dwItem;
@@ -98,7 +98,7 @@ index b3c1882..3e58063 100644
case MCI_SAVE:
case MCI_LOAD:
case MCI_CAPTURE:
@@ -375,7 +376,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -366,7 +367,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
MCI_OVLY_LOAD_PARMSW *mci_loadW;
mci_loadW = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_loadW));
@@ -107,7 +107,7 @@ index b3c1882..3e58063 100644
*dwParam2 = (DWORD_PTR)mci_loadW;
if (dwParam1 & MCI_NOTIFY)
@@ -386,8 +387,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -377,8 +378,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
(MCI_CAPTURE == msg && dwParam1 & MCI_DGV_CAPTURE_AT) ||
(MCI_RESTORE == msg && dwParam1 & MCI_DGV_RESTORE_AT))
mci_loadW->rc = mci_loadA->rc;
@@ -117,7 +117,7 @@ index b3c1882..3e58063 100644
case MCI_SOUND:
case MCI_ESCAPE:
{ /* All these commands have the same layout: callback + string */
@@ -395,14 +396,14 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
@@ -386,14 +387,14 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2)
MCI_VD_ESCAPE_PARMSW *mci_vd_escapeW;
mci_vd_escapeW = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_vd_escapeW));
@@ -134,7 +134,7 @@ index b3c1882..3e58063 100644
case MCI_SETAUDIO:
case MCI_SETVIDEO:
if (!(dwParam1 & (MCI_DGV_SETVIDEO_QUALITY | MCI_DGV_SETVIDEO_ALG
@@ -515,7 +516,6 @@ static void MCI_UnmapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR dwParam2,
@@ -506,7 +507,6 @@ static void MCI_UnmapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR dwParam2,
break;
default:
@@ -142,13 +142,13 @@ index b3c1882..3e58063 100644
break;
}
}
@@ -2304,20 +2304,18 @@ DWORD WINAPI mciSendCommandW(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1,
@@ -2289,20 +2289,18 @@ DWORD WINAPI mciSendCommandW(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1,
DWORD WINAPI mciSendCommandA(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
DWORD ret;
- int mapped;
TRACE("(%08x, %s, %08lx, %08lx)\n",
TRACE("(%08x, %s, %08Ix, %08Ix)\n",
wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2);
- mapped = MCI_MapMsgAtoW(wMsg, dwParam1, &dwParam2);
@@ -160,13 +160,14 @@ index b3c1882..3e58063 100644
- return MCIERR_OUT_OF_MEMORY;
+ return ret;
}
ret = mciSendCommandW(wDevID, wMsg, dwParam1, dwParam2);
- ret = mciSendCommandW(wDevID, wMsg, dwParam1, dwParam2);
- if (mapped)
- MCI_UnmapMsgAtoW(wMsg, dwParam1, dwParam2, ret);
+ ret = mciSendCommandW(wDevID, wMsg, dwParam1, dwParam2);
+ MCI_UnmapMsgAtoW(wMsg, dwParam1, dwParam2, ret);
return ret;
}
--
2.7.1
2.34.1