From 70161bc134ce8e7198d41c65ff147630a397f095 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 11 Sep 2015 12:27:54 +0800 Subject: [PATCH] msvideo: Add support for 16-bit MCIWndProc. --- dlls/msvideo.dll16/Makefile.in | 2 +- dlls/msvideo.dll16/msvideo16.c | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/dlls/msvideo.dll16/Makefile.in b/dlls/msvideo.dll16/Makefile.in index e08205e086a..5f7a9a4c33d 100644 --- a/dlls/msvideo.dll16/Makefile.in +++ b/dlls/msvideo.dll16/Makefile.in @@ -1,5 +1,5 @@ MODULE = msvideo.dll16 -IMPORTS = msvfw32 version advapi32 +IMPORTS = msvfw32 version advapi32 user32 EXTRADLLFLAGS = -m16 -Wb,--main-module,msvfw32.dll diff --git a/dlls/msvideo.dll16/msvideo16.c b/dlls/msvideo.dll16/msvideo16.c index e6c6c1eefda..1b715e4c68e 100644 --- a/dlls/msvideo.dll16/msvideo16.c +++ b/dlls/msvideo.dll16/msvideo16.c @@ -981,11 +981,31 @@ BOOL CDECL MCIWndRegisterClass16(void) return MCIWndRegisterClass(); } +static LRESULT (WINAPI *pMCIWndProc)(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); + +static LRESULT WINAPI MCIWndProc16(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case MCIWNDM_SENDSTRINGA: + lparam = (ULONG_PTR)MapSL(lparam); + break; + + default: + break; + } + + return CallWindowProcA(pMCIWndProc, hwnd, msg, wparam, lparam); +} + /*********************************************************************** * MCIWndCreate(MSVIDEO.250) */ -HWND16 CDECL MCIWndCreate16(HWND16 hwnd, HINSTANCE16 hinst16, - DWORD style, LPSTR file) +HWND16 CDECL MCIWndCreate16(HWND16 parent, HINSTANCE16 hinst16, + DWORD style, LPSTR file) { - return HWND_16(MCIWndCreateA(HWND_32(hwnd), 0, style, file)); + HWND hwnd = MCIWndCreateA(HWND_32(parent), 0, style, file); + if (hwnd) + pMCIWndProc = (void *)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (ULONG_PTR)MCIWndProc16); + return HWND_16(hwnd); } -- 2.11.4.GIT