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
5dafeacb
Commit
5dafeacb
authored
Nov 04, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Nov 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add a input parameter check to ClearEventLog.
parent
e13ead69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
eventlog.c
dlls/advapi32/eventlog.c
+18
-5
eventlog.c
dlls/advapi32/tests/eventlog.c
+0
-12
No files found.
dlls/advapi32/eventlog.c
View file @
5dafeacb
...
...
@@ -107,7 +107,7 @@ BOOL WINAPI BackupEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
/******************************************************************************
* ClearEventLogA [ADVAPI32.@]
*
* Clears the event log and
/or
saves the log to a backup file.
* Clears the event log and
optionally
saves the log to a backup file.
*
* PARAMS
* hEvenLog [I] Handle to event log to clear.
...
...
@@ -121,8 +121,14 @@ BOOL WINAPI BackupEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
*/
BOOL
WINAPI
ClearEventLogA
(
HANDLE
hEventLog
,
LPCSTR
lpBackupFileName
)
{
FIXME
(
"(%p,%s) stub
\n
"
,
hEventLog
,
debugstr_a
(
lpBackupFileName
));
return
TRUE
;
LPWSTR
backupW
;
BOOL
ret
;
backupW
=
SERV_dup
(
lpBackupFileName
);
ret
=
ClearEventLogW
(
hEventLog
,
backupW
);
HeapFree
(
GetProcessHeap
(),
0
,
backupW
);
return
ret
;
}
/******************************************************************************
...
...
@@ -132,8 +138,15 @@ BOOL WINAPI ClearEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
*/
BOOL
WINAPI
ClearEventLogW
(
HANDLE
hEventLog
,
LPCWSTR
lpBackupFileName
)
{
FIXME
(
"(%p,%s) stub
\n
"
,
hEventLog
,
debugstr_w
(
lpBackupFileName
));
return
TRUE
;
FIXME
(
"(%p,%s) stub
\n
"
,
hEventLog
,
debugstr_w
(
lpBackupFileName
));
if
(
!
hEventLog
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************************
...
...
dlls/advapi32/tests/eventlog.c
View file @
5dafeacb
...
...
@@ -508,22 +508,16 @@ static void test_clear(void)
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
NULL
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
/* Make a backup eventlog to work with */
create_backup
(
backup
);
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
NULL
,
backup
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
handle
=
OpenBackupEventLogA
(
NULL
,
backup
);
todo_wine
...
...
@@ -532,20 +526,14 @@ static void test_clear(void)
/* A real eventlog would fail with ERROR_ALREADY_EXISTS */
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
backup
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
/* Show that ClearEventLog only works for real eventlogs. */
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, 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