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
71fa5a36
Commit
71fa5a36
authored
Feb 19, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Fix the ReadEventLog error checking.
parent
2ef61017
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
eventlog.c
dlls/advapi32/tests/eventlog.c
+12
-7
No files found.
dlls/advapi32/tests/eventlog.c
View file @
71fa5a36
...
...
@@ -767,22 +767,28 @@ static void test_readwrite(void)
{
win_skip
(
"Win7 fails when using incorrect event types
\n
"
);
ret
=
ReportEvent
(
handle
,
0
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
);
ok
(
ret
,
"Expected success : %d
\n
"
,
GetLastError
());
}
else
{
void
*
buf
;
DWORD
read
,
needed
;
DWORD
read
,
needed
=
0
;
EVENTLOGRECORD
*
record
;
ok
(
ret
,
"Expected success : %d
\n
"
,
GetLastError
());
/* Needed to catch earlier Vista (with no ServicePack for example) */
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
EVENTLOGRECORD
));
if
(
ReadEventLogA
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
buf
,
sizeof
(
EVENTLOGRECORD
),
&
read
,
&
needed
))
if
(
!
(
ret
=
ReadEventLogA
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
buf
,
sizeof
(
EVENTLOGRECORD
),
&
read
,
&
needed
))
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
{
buf
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
needed
);
ReadEventLogA
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
buf
,
needed
,
&
read
,
&
needed
);
ret
=
ReadEventLogA
(
handle
,
EVENTLOG_SEQUENTIAL_READ
|
EVENTLOG_FORWARDS_READ
,
0
,
buf
,
needed
,
&
read
,
&
needed
);
}
if
(
ret
)
{
record
=
(
EVENTLOGRECORD
*
)
buf
;
/* Vista and W2K8 return EVENTLOG_SUCCESS, Windows versions before return
...
...
@@ -793,7 +799,6 @@ static void test_readwrite(void)
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
ok
(
ret
,
"Expected success : %d
\n
"
,
GetLastError
());
/* This will clear the eventlog. The record numbering for new
* events however differs on Vista SP1+. Before Vista the first
...
...
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