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
59588b66
Commit
59588b66
authored
May 15, 2021
by
Francois Gouget
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Trace GetLastError() when an event log API fails.
Signed-off-by:
Francois Gouget
<
fgouget@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a76fd1c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
eventlog.c
dlls/advapi32/tests/eventlog.c
+15
-15
No files found.
dlls/advapi32/tests/eventlog.c
View file @
59588b66
...
...
@@ -113,9 +113,9 @@ static void test_open_close(void)
/* This one opens the Application log */
handle
=
OpenEventLogA
(
NULL
,
"deadbeef"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
ok
(
handle
!=
NULL
,
"Expected a handle
: %d
\n
"
,
GetLastError
()
);
ret
=
CloseEventLog
(
handle
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
/* Close a second time */
SetLastError
(
0xdeadbeef
);
ret
=
CloseEventLog
(
handle
);
...
...
@@ -127,11 +127,11 @@ static void test_open_close(void)
/* Empty servername should be read as local server */
handle
=
OpenEventLogA
(
""
,
"Application"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
ok
(
handle
!=
NULL
,
"Expected a handle
: %d
\n
"
,
GetLastError
()
);
CloseEventLog
(
handle
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
ok
(
handle
!=
NULL
,
"Expected a handle
: %d
\n
"
,
GetLastError
()
);
CloseEventLog
(
handle
);
}
...
...
@@ -189,7 +189,7 @@ static void test_info(void)
efi
->
dwFull
=
0xdeadbeef
;
needed
=
sizeof
(
buffer
);
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
efi
,
needed
,
&
needed
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
needed
==
sizeof
(
EVENTLOG_FULL_INFORMATION
),
"Expected sizeof(EVENTLOG_FULL_INFORMATION), got %d
\n
"
,
needed
);
ok
(
efi
->
dwFull
==
0
||
efi
->
dwFull
==
1
,
"Expected 0 (not full) or 1 (full), got %d
\n
"
,
efi
->
dwFull
);
...
...
@@ -224,7 +224,7 @@ static void test_count(void)
count
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
count
!=
0xdeadbeef
,
"Expected the number of records
\n
"
);
CloseEventLog
(
handle
);
...
...
@@ -241,7 +241,7 @@ static void test_count(void)
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
todo_wine
{
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
count
!=
0xdeadbeef
,
"Expected the number of records
\n
"
);
}
...
...
@@ -278,7 +278,7 @@ static void test_oldest(void)
oldest
=
0xdeadbeef
;
ret
=
GetOldestEventLogRecord
(
handle
,
&
oldest
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
oldest
!=
0xdeadbeef
,
"Expected the number of the oldest record
\n
"
);
CloseEventLog
(
handle
);
...
...
@@ -295,7 +295,7 @@ static void test_oldest(void)
ret
=
GetOldestEventLogRecord
(
handle
,
&
oldest
);
todo_wine
{
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
oldest
!=
0xdeadbeef
,
"Expected the number of the oldest record
\n
"
);
}
...
...
@@ -335,7 +335,7 @@ static void test_backup(void)
CloseEventLog
(
handle
);
return
;
}
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
todo_wine
ok
(
GetFileAttributesA
(
backup
)
!=
INVALID_FILE_ATTRIBUTES
,
"Expected a backup file
\n
"
);
...
...
@@ -358,7 +358,7 @@ static void test_backup(void)
ret
=
BackupEventLogA
(
handle
,
backup2
);
todo_wine
{
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
GetFileAttributesA
(
backup2
)
!=
INVALID_FILE_ATTRIBUTES
,
"Expected a backup file
\n
"
);
}
...
...
@@ -505,7 +505,7 @@ static void test_read(void)
read
=
needed
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadEventLogA
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
buf
,
toread
,
&
read
,
&
needed
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
read
==
toread
||
broken
(
read
<
toread
),
/* NT4 wants a buffer size way bigger than just 1 record */
"Expected the requested size to be read
\n
"
);
...
...
@@ -886,7 +886,7 @@ static void test_readwrite(void)
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
count
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
todo_wine
ok
(
count
==
i
,
"Expected %d records, got %d
\n
"
,
i
,
count
);
CloseEventLog
(
handle
);
...
...
@@ -1024,11 +1024,11 @@ static void test_readwrite(void)
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
NULL
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
count
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success
\n
"
);
ok
(
ret
,
"Expected success
: %d
\n
"
,
GetLastError
()
);
ok
(
count
==
0
,
"Expected an empty eventlog, got %d records
\n
"
,
count
);
CloseEventLog
(
handle
);
...
...
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