msvcrt: Check pmode in _wsopen_dispatch.
Signed-off-by: Lauri Kenttä <lauri.kentta@gmail.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
85214c56e3
commit
2775931536
|
@ -2171,8 +2171,8 @@ int CDECL MSVCRT__wsopen_dispatch( const MSVCRT_wchar_t* path, int oflags, int s
|
|||
|
||||
if (oflags & MSVCRT__O_CREAT)
|
||||
{
|
||||
if(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
|
||||
FIXME(": pmode 0x%04x ignored\n", pmode);
|
||||
if (secure && !MSVCRT_CHECK_PMT(!(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))))
|
||||
return MSVCRT_EINVAL;
|
||||
|
||||
if (oflags & MSVCRT__O_EXCL)
|
||||
creation = CREATE_NEW;
|
||||
|
|
|
@ -396,11 +396,9 @@ static void test__sopen_dispatch(void)
|
|||
SET_EXPECT(global_invalid_parameter_handler);
|
||||
fd = 0;
|
||||
ret = p_sopen_dispatch(tempf, _O_CREAT, _SH_DENYWR, 0xff, &fd, 1);
|
||||
todo_wine {
|
||||
ok(ret == EINVAL, "got %d\n", ret);
|
||||
ok(fd == -1, "got fd %d\n", fd);
|
||||
CHECK_CALLED(global_invalid_parameter_handler);
|
||||
}
|
||||
if (fd > 0)
|
||||
{
|
||||
_close(fd);
|
||||
|
@ -438,11 +436,9 @@ static void test__sopen_s(void)
|
|||
SET_EXPECT(global_invalid_parameter_handler);
|
||||
fd = 0;
|
||||
ret = p_sopen_s(&fd, tempf, _O_CREAT, _SH_DENYWR, 0xff);
|
||||
todo_wine {
|
||||
ok(ret == EINVAL, "got %d\n", ret);
|
||||
ok(fd == -1, "got fd %d\n", fd);
|
||||
CHECK_CALLED(global_invalid_parameter_handler);
|
||||
}
|
||||
p__set_invalid_parameter_handler(NULL);
|
||||
|
||||
free(tempf);
|
||||
|
|
Loading…
Reference in New Issue