Rebase against 8c34add3bd747d8ff267974de67880b7eb50bc8d

This commit is contained in:
Alistair Leslie-Hughes
2019-07-06 12:41:27 +10:00
parent 52076762ec
commit eba1e9b28a
17 changed files with 165 additions and 168 deletions

View File

@ -21,21 +21,21 @@ index 24a46e8..daacaf5 100644
+ static const WCHAR format[] = {'%', 's', '\\', '%', 's', '\0'};
+ WCHAR filepath[MAX_PATH];
+
+ if (strlenW(PathToSource) + 1 + strlenW(FileSought) < sizeof(filepath))
+ if (lstrlenW(PathToSource) + 1 + lstrlenW(FileSought) < sizeof(filepath))
+ {
+ snprintfW(filepath, MAX_PATH, format, PathToSource, FileSought);
+ snwprintf(filepath, MAX_PATH, format, PathToSource, FileSought);
+
+ if (GetFileAttributesW(filepath) != INVALID_FILE_ATTRIBUTES)
+ {
+ if (PathRequiredSize)
+ *PathRequiredSize = strlenW(PathToSource) + 1;
+ *PathRequiredSize = lstrlenW(PathToSource) + 1;
+
+ if (!PathBuffer)
+ return DPROMPT_SUCCESS;
+
+ if (PathBufferSize >= strlenW(PathToSource) + 1)
+ if (PathBufferSize >= lstrlenW(PathToSource) + 1)
+ {
+ strcpyW(PathBuffer, PathToSource);
+ lstrcpyW(PathBuffer, PathToSource);
+ return DPROMPT_SUCCESS;
+ }
+ else