Commit 24a16c00 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

localspl: Fix MONITOR2.cbSize calculation when converting from MONITOREX.

parent e620a3f3
...@@ -777,7 +777,7 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot) ...@@ -777,7 +777,7 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
{ {
static MONITOREX mymonitorex = static MONITOREX mymonitorex =
{ {
sizeof(MONITOREX) - sizeof(DWORD), sizeof(MONITOR),
{ {
localmon_EnumPortsW, localmon_EnumPortsW,
localmon_OpenPortW, localmon_OpenPortW,
......
...@@ -504,7 +504,9 @@ static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname) ...@@ -504,7 +504,9 @@ static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname)
if (pmonitorEx) if (pmonitorEx)
{ {
/* Layout of MONITOREX and MONITOR2 mostly matches */ /* 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->old_XcvOpenPort = pmonitorEx->Monitor.pfnXcvOpenPort;
pm->monitor.pfnXcvOpenPort = NULL; pm->monitor.pfnXcvOpenPort = NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment