Piotr Caban : msvcrt: Don't ignore pmode attribute in _wsopen_s.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Apr 17 04:22:21 CDT 2015
Module: wine
Branch: master
Commit: 760b78813d0e75d5d32f60318fe2bb4c7a5064b1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=760b78813d0e75d5d32f60318fe2bb4c7a5064b1
Author: Piotr Caban <piotr at codeweavers.com>
Date: Thu Apr 16 17:37:10 2015 +0200
msvcrt: Don't ignore pmode attribute in _wsopen_s.
---
dlls/msvcrt/file.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index f803f5d..c1ba5fd 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -2114,8 +2114,6 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int
{
if(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
FIXME(": pmode 0x%04x ignored\n", pmode);
- else
- WARN(": pmode 0x%04x ignored\n", pmode);
if (oflags & MSVCRT__O_EXCL)
creation = CREATE_NEW;
@@ -2150,7 +2148,11 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int
ERR( "Unhandled shflags 0x%x\n", shflags );
return MSVCRT_EINVAL;
}
- attrib = FILE_ATTRIBUTE_NORMAL;
+
+ if (!(pmode & ~MSVCRT_umask & MSVCRT__S_IWRITE))
+ attrib = FILE_ATTRIBUTE_READONLY;
+ else
+ attrib = FILE_ATTRIBUTE_NORMAL;
if (oflags & MSVCRT__O_TEMPORARY)
{
More information about the wine-cvs
mailing list