Skip to content

Instantly share code, notes, and snippets.

@qsniyg
Last active June 24, 2021 01:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save qsniyg/ec21d68f9407991a1043a71fa6ffd4cf to your computer and use it in GitHub Desktop.
Save qsniyg/ec21d68f9407991a1043a71fa6ffd4cf to your computer and use it in GitHub Desktop.
USVFS wine patch (included in wine 4.21+)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 2b6a13fc0d..6798ecc8ff 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -754,7 +754,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
status = NtOpenFile( &info->handle, GENERIC_READ | SYNCHRONIZE, &attr, &io,
FILE_SHARE_READ | FILE_SHARE_WRITE,
- FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
+ FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT );
if (status != STATUS_SUCCESS)
{
@@ -801,7 +801,8 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
}
info->data_len = io.Information;
- if (!has_wildcard || info->data_len < info->data_size - max_entry_size)
+ /* Disable this check because USVFS underflows data_len */
+ if (!has_wildcard /*|| info->data_len < info->data_size - max_entry_size*/)
{
if (has_wildcard) /* release unused buffer space */
HeapReAlloc( GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY,
@jarrard
Copy link

jarrard commented Jun 23, 2021

ModOrganizer2/modorganizer#372
08:38:40.723 [E] failed to hook CopyFile2: No Error (this is just a win10 error, its probably not important and doesn't appear when set to win7)
08:38:40.723 [E] failed to hook NtQueryDirectoryFileEx: No Error

Dotnet48 used, many versions proton-GE testing..
Tested with TKG 6.8, same issue.

Don't know what to think at this point after further testing.. usvfs is just not working for me in any scenario. Perhaps kernel 5.12.6-xanmod1 is to blame...Might wait until some other people do some testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment