Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ea7eb956
Commit
ea7eb956
authored
Dec 16, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Skip event log tests on Windows when access is not allowed.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2c1a68e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
eventlog.c
dlls/advapi32/tests/eventlog.c
+31
-3
No files found.
dlls/advapi32/tests/eventlog.c
View file @
ea7eb956
...
...
@@ -65,6 +65,11 @@ static BOOL create_backup(const char *filename)
DWORD
rc
,
attribs
;
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
if
(
!
handle
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
))
{
win_skip
(
"Can't open event log
\n
"
);
return
FALSE
;
}
ok
(
handle
!=
NULL
,
"OpenEventLogA(Application) failed : %d
\n
"
,
GetLastError
());
DeleteFileA
(
filename
);
...
...
@@ -274,6 +279,11 @@ static void test_oldest(void)
ok
(
oldest
==
0xdeadbeef
,
"Expected oldest to stay unchanged
\n
"
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
if
(
!
handle
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
))
{
win_skip
(
"Can't open event log
\n
"
);
return
;
}
ok
(
handle
!=
NULL
,
"OpenEventLogA(Application) failed : %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
...
...
@@ -327,6 +337,11 @@ static void test_backup(void)
ok
(
GetFileAttributesA
(
backup
)
==
INVALID_FILE_ATTRIBUTES
,
"Expected no backup file
\n
"
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
if
(
!
handle
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
))
{
win_skip
(
"Can't open event log
\n
"
);
return
;
}
ok
(
handle
!=
NULL
,
"OpenEventLogA(Application) failed : %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
...
...
@@ -439,6 +454,11 @@ static void test_read(void)
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
if
(
!
handle
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
))
{
win_skip
(
"Can't open event log
\n
"
);
return
;
}
ok
(
handle
!=
NULL
,
"OpenEventLogA(Application) failed : %d
\n
"
,
GetLastError
());
/* Show that we need the proper dwFlags with a (for the rest) proper call */
...
...
@@ -537,7 +557,10 @@ static void test_openbackup(void)
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
NULL
,
"idontexist.evt"
);
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
||
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
,
"got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
"IDontExist"
,
NULL
);
...
...
@@ -593,8 +616,10 @@ static void test_openbackup(void)
handle
=
OpenBackupEventLogA
(
NULL
,
backup
);
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
||
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
||
GetLastError
()
==
ERROR_EVENTLOG_FILE_CORRUPT
,
/* Vista and Win7 */
"
Expected ERROR_NOT_ENOUGH_MEMORY,
got %d
\n
"
,
GetLastError
());
"got %d
\n
"
,
GetLastError
());
CloseEventLog
(
handle
);
DeleteFileA
(
backup
);
...
...
@@ -604,7 +629,10 @@ static void test_openbackup(void)
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
NULL
,
backup
);
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_EVENTLOG_FILE_CORRUPT
,
"Expected ERROR_EVENTLOG_FILE_CORRUPT, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_EVENTLOG_FILE_CORRUPT
||
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
,
"got %d
\n
"
,
GetLastError
());
CloseEventLog
(
handle
);
DeleteFileA
(
backup
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment