Tribes Vengeance writable directory test

Kenneth Porter shiva at sewingwitch.com
Mon Dec 6 02:04:44 CST 2004


The dedicated game server for Tribes Vengeance tests for a writable 
directory with

CreateFile(dirname,...,GENERIC_WRITE,...,FILE_FLAG_BACKUP_SEMANTICS,...)

This patch hacks file.c to catch this case and return success to satisfy 
the program.

See also:

<http://bugs.winehq.org/show_bug.cgi?id=2508>
<http://appdb.winehq.org/appview.php?appId=1795&versionId=2417>

This version of the patch is more narrow than the one in the bug report to 
avoid collateral damage (adding the test for GENERIC_WRITE), and is 
currently working on my game server.
-------------- next part --------------
--- wine-20040914/dlls/kernel/file.c	2004-08-17 17:04:58.000000000 -0700
+++ wine-20040914-tv/dlls/kernel/file.c	2004-11-18 10:11:49.334181317 -0800
@@ -1292,8 +1292,15 @@ HANDLE WINAPI CreateFileW( LPCWSTR filen
     /* now call NtCreateFile */
 
     options = 0;
-    if (attributes & FILE_FLAG_BACKUP_SEMANTICS)
-        options |= FILE_OPEN_FOR_BACKUP_INTENT;
+    if ((attributes & FILE_FLAG_BACKUP_SEMANTICS) &&
+        (access & GENERIC_WRITE))
+    {
+        options |= FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE;
+        // hack: Switch any GENERIC_WRITE to GENERIC_READ
+        // this is just used to test for writable directory
+        // in Tribes: Vengeance game
+        access = GENERIC_READ;
+    }
     else
         options |= FILE_NON_DIRECTORY_FILE;
     if (attributes & FILE_FLAG_DELETE_ON_CLOSE)


More information about the wine-patches mailing list