Re: [v2 PATCH] ucrtbase: Added _sopen_dispatch/_wsopen_dispatch
On Fri, Oct 28, 2016 at 01:43:19PM +0300, Nikolay Sivov wrote:
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 432d5c7..37e5ece 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2144,9 +2144,10 @@ static int check_bom(HANDLE h, int oflags, BOOL seek) }
/********************************************************************* - * _wsopen_s (MSVCRT.@) + * _wsopen_dispatch (UCRTBASE.@) */ -int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode ) +int CDECL MSVCRT__wsopen_dispatch( const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode, + int *fd, int secure ) { DWORD access = 0, creation = 0, attrib; SECURITY_ATTRIBUTES sa;
You probably want to add 'secure' to the TRACE() just below here and change the order of the parameters in that TRACE() to match the new function. Huw.
On 10/28/16 13:41, Huw Davies wrote:
On Fri, Oct 28, 2016 at 01:43:19PM +0300, Nikolay Sivov wrote:
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 432d5c7..37e5ece 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2144,9 +2144,10 @@ static int check_bom(HANDLE h, int oflags, BOOL seek) }
/********************************************************************* - * _wsopen_s (MSVCRT.@) + * _wsopen_dispatch (UCRTBASE.@) */ -int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode ) +int CDECL MSVCRT__wsopen_dispatch( const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode, + int *fd, int secure ) { DWORD access = 0, creation = 0, attrib; SECURITY_ATTRIBUTES sa;
You probably want to add 'secure' to the TRACE() just below here and change the order of the parameters in that TRACE() to match the new function.
A FIXME message would be probably also useful since the secure parameter is ignored. Thanks, Piotr
On 28.10.2016 14:53, Piotr Caban wrote:
On 10/28/16 13:41, Huw Davies wrote:
On Fri, Oct 28, 2016 at 01:43:19PM +0300, Nikolay Sivov wrote:
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 432d5c7..37e5ece 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2144,9 +2144,10 @@ static int check_bom(HANDLE h, int oflags, BOOL seek) }
/********************************************************************* - * _wsopen_s (MSVCRT.@) + * _wsopen_dispatch (UCRTBASE.@) */ -int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode ) +int CDECL MSVCRT__wsopen_dispatch( const MSVCRT_wchar_t* path, int oflags, int shflags, int pmode, + int *fd, int secure ) { DWORD access = 0, creation = 0, attrib; SECURITY_ATTRIBUTES sa;
You probably want to add 'secure' to the TRACE() just below here and change the order of the parameters in that TRACE() to match the new function.
A FIXME message would be probably also useful since the secure parameter is ignored.
I'm not sure about that, every *sopen_s call will trigger it.
Thanks, Piotr
On 10/28/16 13:49, Nikolay Sivov wrote:
On 28.10.2016 14:53, Piotr Caban wrote:
A FIXME message would be probably also useful since the secure parameter is ignored.
I'm not sure about that, every *sopen_s call will trigger it. I don't know what the secure parameter is meant to do without doing some testing but I don't like the fact that it's ignored without any sign in logs. I guess you have some more information about it, e.g. I don't know why *_s function are passing 1 there. Did you find any documentation for this function?
Thanks, Piotr
participants (3)
-
Huw Davies -
Nikolay Sivov -
Piotr Caban