localspl: Fix MONITOR2.cbSize calculation when converting from MONITOREX.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e620a3f359
commit
24a16c0037
|
@ -777,7 +777,7 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
|
|||
{
|
||||
static MONITOREX mymonitorex =
|
||||
{
|
||||
sizeof(MONITOREX) - sizeof(DWORD),
|
||||
sizeof(MONITOR),
|
||||
{
|
||||
localmon_EnumPortsW,
|
||||
localmon_OpenPortW,
|
||||
|
|
|
@ -504,7 +504,9 @@ static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname)
|
|||
if (pmonitorEx)
|
||||
{
|
||||
/* Layout of MONITOREX and MONITOR2 mostly matches */
|
||||
memcpy(&pm->monitor, pmonitorEx, min(pmonitorEx->dwMonitorSize + sizeof(DWORD), sizeof(pm->monitor)));
|
||||
memcpy(&pm->monitor, pmonitorEx, min(pmonitorEx->dwMonitorSize + sizeof(void *), sizeof(pm->monitor)));
|
||||
/* MONITOREX.dwMonitorSize doesn't include the size field, while MONITOR2.cbSize does */
|
||||
pm->monitor.cbSize += sizeof(void *);
|
||||
pm->old_XcvOpenPort = pmonitorEx->Monitor.pfnXcvOpenPort;
|
||||
pm->monitor.pfnXcvOpenPort = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue