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
e6b5afcb
Commit
e6b5afcb
authored
Mar 02, 2023
by
Francois Gouget
Committed by
Alexandre Julliard
Oct 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Better identify OpenEventLogA() failures.
parent
e9f6ff8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
eventlog.c
dlls/advapi32/tests/eventlog.c
+11
-9
No files found.
dlls/advapi32/tests/eventlog.c
View file @
e6b5afcb
...
...
@@ -104,24 +104,24 @@ static void test_open_close(void)
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
NULL
,
NULL
);
ok
(
handle
==
NULL
,
"
Didn't expect a handle
\n
"
);
ok
(
handle
==
NULL
,
"
OpenEventLogA() succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
"IDontExist"
,
NULL
);
ok
(
handle
==
NULL
,
"
Didn't expect a handle
\n
"
);
ok
(
handle
==
NULL
,
"
OpenEventLogA(IDontExist,) succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
"IDontExist"
,
"deadbeef"
);
ok
(
handle
==
NULL
,
"
Didn't expect a handle
\n
"
);
ok
(
handle
==
NULL
,
"
OpenEventLogA(IDontExist,deadbeef) succeeded
\n
"
);
ok
(
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
||
GetLastError
()
==
RPC_S_INVALID_NET_ADDR
,
/* Some Vista and Win7 */
"Expected RPC_S_SERVER_UNAVAILABLE, got %ld
\n
"
,
GetLastError
());
/* This one opens the Application log */
handle
=
OpenEventLogA
(
NULL
,
"deadbeef"
);
ok
(
handle
!=
NULL
,
"
Expected a handle
: %ld
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"
OpenEventLogA(deadbeef) failed
: %ld
\n
"
,
GetLastError
());
ret
=
CloseEventLog
(
handle
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
/* Close a second time */
...
...
@@ -135,11 +135,11 @@ static void test_open_close(void)
/* Empty servername should be read as local server */
handle
=
OpenEventLogA
(
""
,
"Application"
);
ok
(
handle
!=
NULL
,
"
Expected a handle
: %ld
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"
OpenEventLogA('',Application) failed
: %ld
\n
"
,
GetLastError
());
CloseEventLog
(
handle
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
ok
(
handle
!=
NULL
,
"
Expected a handle
: %ld
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"
OpenEventLogA(Application) failed
: %ld
\n
"
,
GetLastError
());
CloseEventLog
(
handle
);
}
...
...
@@ -817,6 +817,7 @@ static void test_readwrite(void)
Sleep
(
2000
);
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
ok
(
handle
!=
NULL
,
"OpenEventLogA(%s) failed : %ld
\n
"
,
eventlogname
,
GetLastError
());
count
=
0xdeadbeef
;
GetNumberOfEventLogRecords
(
handle
,
&
count
);
if
(
count
!=
0
)
...
...
@@ -920,6 +921,7 @@ static void test_readwrite(void)
}
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
ok
(
handle
!=
NULL
,
"OpenEventLogA(%s) failed : %ld
\n
"
,
eventlogname
,
GetLastError
());
count
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
...
...
@@ -955,7 +957,7 @@ static void test_readwrite(void)
/* Read all events from our created eventlog, one by one */
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
ok
(
handle
!=
NULL
,
"
Failed to open Event Log, got %ld
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"
OpenEventLogA(%s) failed : %ld
\n
"
,
eventlogname
,
GetLastError
());
i
=
0
;
for
(;;)
{
...
...
@@ -1056,7 +1058,7 @@ static void test_readwrite(void)
/* Test clearing a real eventlog */
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
ok
(
handle
!=
NULL
,
"
Failed to open Event Log, got %ld
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"
OpenEventLogA(%s) failed : %ld
\n
"
,
eventlogname
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
NULL
);
...
...
@@ -1330,7 +1332,7 @@ static void test_eventlog_start(void)
handle
=
OpenEventLogW
(
0
,
L"System"
);
if
(
!
handle
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
))
{
win_skip
(
"Can't open event log
\n
"
);
win_skip
(
"Can't open
System
event log
\n
"
);
return
;
}
ok
(
handle
!=
NULL
,
"OpenEventLogW(System) failed : %ld
\n
"
,
GetLastError
());
...
...
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