From: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/sane.ds/ui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/sane.ds/ui.c b/dlls/sane.ds/ui.c index 557cf81e0b1..25a1cf33970 100644 --- a/dlls/sane.ds/ui.c +++ b/dlls/sane.ds/ui.c @@ -475,8 +475,6 @@ BOOL DoScannerUI(void) LPWSTR szCaption; DWORD len; - hdc = GetDC(0); - memset(psp,0,sizeof(psp)); rc = sane_option_get_value( 0, &optcount ); if (rc != TWCC_SUCCESS) @@ -485,6 +483,8 @@ BOOL DoScannerUI(void) return FALSE; } + hdc = CreateCompatibleDC(0); + while (index < optcount) { struct option_descriptor opt; @@ -539,7 +539,9 @@ BOOL DoScannerUI(void) free((LPBYTE)psp[index].pszTitle); } free(szCaption); - + + DeleteDC(hdc); + if (psrc == IDOK) return TRUE; else -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7740