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
452b59bb
Commit
452b59bb
authored
Dec 23, 2023
by
Daniel Lehman
Committed by
Alexandre Julliard
Jan 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some more EventLog tests.
parent
8c91e484
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
eventlog.c
dlls/advapi32/tests/eventlog.c
+48
-2
No files found.
dlls/advapi32/tests/eventlog.c
View file @
452b59bb
...
...
@@ -1347,8 +1347,8 @@ static void test_eventlog_start(void)
{
BOOL
ret
,
found
;
HANDLE
handle
,
handle2
;
EVENTLOGRECORD
*
record
;
DWORD
size
,
count
,
read
,
needed
;
EVENTLOGRECORD
*
record
,
*
record2
;
DWORD
size
,
size2
,
count
,
count2
,
read
,
needed
;
WCHAR
*
sourcename
,
*
computername
,
*
localcomputer
;
char
*
sourcenameA
,
*
computernameA
,
*
localcomputerA
;
...
...
@@ -1547,6 +1547,14 @@ static void test_eventlog_start(void)
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
count
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ret
=
read_record
(
handle
,
EVENTLOG_SEEK_READ
|
EVENTLOG_FORWARDS_READ
,
count
+
1
,
&
record
,
&
size
);
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
todo_wine
{
ret
=
read_record
(
handle
,
EVENTLOG_SEEK_READ
|
EVENTLOG_FORWARDS_READ
,
2
,
&
record
,
&
size
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
...
...
@@ -1603,6 +1611,44 @@ static void test_eventlog_start(void)
}
CloseEventLog
(
handle
);
/* reading same log with different handles */
handle
=
OpenEventLogW
(
0
,
L"System"
);
handle2
=
OpenEventLogW
(
0
,
L"SYSTEM"
);
todo_wine
{
ret
=
read_record
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
&
record
,
&
size
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ok
(
record
->
RecordNumber
==
1
,
"Expected 1, got %lu
\n
"
,
record
->
RecordNumber
);
ret
=
read_record
(
handle2
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
&
record
,
&
size
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ok
(
record
->
RecordNumber
==
1
,
"Expected 1, got %lu
\n
"
,
record
->
RecordNumber
);
}
CloseEventLog
(
handle2
);
CloseEventLog
(
handle
);
/* using source name */
size2
=
size
;
record2
=
malloc
(
size2
);
handle
=
OpenEventLogW
(
0
,
L"System"
);
handle2
=
OpenEventLogW
(
0
,
L"EventLog"
);
todo_wine
{
ret
=
read_record
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
&
record
,
&
size
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ret
=
read_record
(
handle2
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
&
record2
,
&
size2
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
}
ok
(
size
==
size2
,
"Expected %lu, got %lu
\n
"
,
size
,
size2
);
ok
(
!
memcmp
(
record
,
record2
,
min
(
size
,
size2
)),
"Records miscompare
\n
"
);
count
=
0xdeadbeef
;
count2
=
0xdeadbeef
;
ret
=
GetNumberOfEventLogRecords
(
handle
,
&
count
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ret
=
GetNumberOfEventLogRecords
(
handle2
,
&
count2
);
ok
(
ret
,
"Expected success : %ld
\n
"
,
GetLastError
());
ok
(
count
==
count2
,
"Expected %lu, got %lu
\n
"
,
count
,
count2
);
CloseEventLog
(
handle2
);
CloseEventLog
(
handle
);
free
(
record2
);
free
(
record
);
}
...
...
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