[WINESYNC] setupapi: Add support for IDF_CHECKFIRST flag in SetupPromptForDiskW.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20465
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0422c6c4d0224c4e619771a0d22f4a5a1575f3f3 by Michael Müller <michael@fds-team.de>
This commit is contained in:
winesync 2023-09-15 19:15:50 +02:00 committed by Hermès Bélusca-Maïto
parent 2135ba933d
commit d651c6290b
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 28 additions and 1 deletions

View file

@ -228,6 +228,33 @@ UINT WINAPI SetupPromptForDiskW(HWND hwndParent, PCWSTR DialogTitle, PCWSTR Disk
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return DPROMPT_CANCEL; return DPROMPT_CANCEL;
} }
if (PathToSource && (DiskPromptStyle & IDF_CHECKFIRST))
{
WCHAR filepath[MAX_PATH];
if (lstrlenW(PathToSource) + 1 + lstrlenW(FileSought) < ARRAY_SIZE(filepath))
{
swprintf(filepath, ARRAY_SIZE(filepath), L"%s\\%s", PathToSource, FileSought);
if (GetFileAttributesW(filepath) != INVALID_FILE_ATTRIBUTES)
{
if (PathRequiredSize)
*PathRequiredSize = lstrlenW(PathToSource) + 1;
if (!PathBuffer)
return DPROMPT_SUCCESS;
if (PathBufferSize >= lstrlenW(PathToSource) + 1)
{
lstrcpyW(PathBuffer, PathToSource);
return DPROMPT_SUCCESS;
}
else
return DPROMPT_BUFFERTOOSMALL;
}
}
}
params.DialogTitle = DialogTitle; params.DialogTitle = DialogTitle;
params.DiskName = DiskName; params.DiskName = DiskName;
params.PathToSource = PathToSource; params.PathToSource = PathToSource;

View file

@ -10,4 +10,4 @@ files:
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
tags: tags:
wine: dc968dae42e3b3162e2767ed32b0f91ae9b23ad3 wine: 0422c6c4d0224c4e619771a0d22f4a5a1575f3f3