kernel32: Specify the access rights when creating a file object.

Dmitry Timoshkov dmitry at baikal.ru
Thu Jan 12 03:29:57 CST 2012


While investigating how to fix the file section access tests in kernel32 I've
found that some places in Wine deliberately create objects with access rights
set to 0, that leads to creation of potentially not accessible objects.

---
 dlls/kernel32/path.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index e376def..def7424 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -946,7 +946,7 @@ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists )
     if (!fail_if_exists)
     {
         BOOL same_file = FALSE;
-        h2 = CreateFileW( dest, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+        h2 = CreateFileW( dest, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
                          OPEN_EXISTING, 0, 0);
         if (h2 != INVALID_HANDLE_VALUE)
         {
-- 
1.7.7.4




More information about the wine-patches mailing list