Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/localspl/localmon.c | 2 +- dlls/localspl/provider.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index 6937e050cd..e634a33253 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -777,7 +777,7 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot) { static MONITOREX mymonitorex = { - sizeof(MONITOREX) - sizeof(DWORD), + sizeof(MONITOR), { localmon_EnumPortsW, localmon_OpenPortW, diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index 4627284f12..7a12751f17 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -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; }