Dmitry Timoshkov : advapi32: Add event security access tests.
Module: wine Branch: master Commit: d574e7948e87d11de591b8d25012365622da02a9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d574e7948e87d11de591b8d250... Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Mar 16 18:31:43 2012 +0800 advapi32: Add event security access tests. --- dlls/advapi32/tests/security.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 0b653ff..9db84a4 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -4104,6 +4104,27 @@ static void test_mutex_security(HANDLE token) CloseHandle (mutex); } +static void test_event_security(HANDLE token) +{ + HANDLE event; + GENERIC_MAPPING mapping = { STANDARD_RIGHTS_READ, STANDARD_RIGHTS_WRITE, + STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, + STANDARD_RIGHTS_ALL | EVENT_ALL_ACCESS }; + + SetLastError(0xdeadbeef); + event = OpenEvent(0, FALSE, "WineTestEvent"); + ok(!event, "event should not exist\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + event = CreateEvent(NULL, FALSE, FALSE, "WineTestEvent"); + ok(event != 0, "CreateEvent error %d\n", GetLastError()); + + test_default_handle_security(token, event, &mapping); + + CloseHandle(event); +} + static BOOL validate_impersonation_token(HANDLE token, DWORD *token_type) { DWORD ret, needed; @@ -4175,6 +4196,7 @@ static void test_kernel_objects_security(void) ok(token_type == TokenImpersonation, "expected TokenImpersonation, got %d\n", token_type); test_mutex_security(token); + test_event_security(token); /* FIXME: test other kernel object types */ CloseHandle(process_token);
participants (1)
-
Alexandre Julliard