[2/2] shlwapi: Write file access also assumes read access.

Dmitry Timoshkov dmitry at baikal.ru
Thu Sep 12 23:52:26 CDT 2013


Admittedly this is a CreateFile() bug which was hidden by ReadFile 0-length
read optimization, but that needs to be tested and fixed separately.
IStream_Read(stream, NULL, 0, &count) on a file created with SHCreateStreamOnFileEx(STGM_WRITE)
was failing because of this corner case.
---
 dlls/shlwapi/istream.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/shlwapi/istream.c b/dlls/shlwapi/istream.c
index c7242d1..42f47fe 100644
--- a/dlls/shlwapi/istream.c
+++ b/dlls/shlwapi/istream.c
@@ -420,12 +420,10 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
   /* Access */
   switch (STGM_ACCESS_MODE(dwMode))
   {
+  case STGM_WRITE:
   case STGM_READWRITE:
     dwAccess = GENERIC_READ|GENERIC_WRITE;
     break;
-  case STGM_WRITE:
-    dwAccess = GENERIC_WRITE;
-    break;
   case STGM_READ:
     dwAccess = GENERIC_READ;
     break;
-- 
1.8.3.4




More information about the wine-patches mailing list