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
d2227cb8
Commit
d2227cb8
authored
Oct 30, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Oct 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add some input parameter checks to BackupEventLog.
parent
b90ef8c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
eventlog.c
dlls/advapi32/eventlog.c
+29
-4
eventlog.c
dlls/advapi32/tests/eventlog.c
+0
-7
No files found.
dlls/advapi32/eventlog.c
View file @
d2227cb8
...
...
@@ -64,8 +64,14 @@ static inline LPWSTR SERV_dup( LPCSTR str )
*/
BOOL
WINAPI
BackupEventLogA
(
HANDLE
hEventLog
,
LPCSTR
lpBackupFileName
)
{
FIXME
(
"(%p,%s) stub
\n
"
,
hEventLog
,
debugstr_a
(
lpBackupFileName
));
return
TRUE
;
LPWSTR
backupW
;
BOOL
ret
;
backupW
=
SERV_dup
(
lpBackupFileName
);
ret
=
BackupEventLogW
(
hEventLog
,
backupW
);
HeapFree
(
GetProcessHeap
(),
0
,
backupW
);
return
ret
;
}
/******************************************************************************
...
...
@@ -75,8 +81,27 @@ BOOL WINAPI BackupEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
*/
BOOL
WINAPI
BackupEventLogW
(
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
(
!
lpBackupFileName
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
hEventLog
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
GetFileAttributesW
(
lpBackupFileName
)
!=
INVALID_FILE_ATTRIBUTES
)
{
SetLastError
(
ERROR_ALREADY_EXISTS
);
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************************
...
...
dlls/advapi32/tests/eventlog.c
View file @
d2227cb8
...
...
@@ -223,15 +223,11 @@ static void test_backup(void)
SetLastError
(
0xdeadbeef
);
ret
=
BackupEventLogA
(
NULL
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
ret
=
BackupEventLogA
(
NULL
,
backup
);
todo_wine
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetFileAttributesA
(
backup
)
==
INVALID_FILE_ATTRIBUTES
,
"Expected no backup file
\n
"
);
...
...
@@ -239,11 +235,8 @@ static void test_backup(void)
SetLastError
(
0xdeadbeef
);
ret
=
BackupEventLogA
(
handle
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
ret
=
BackupEventLogA
(
handle
,
backup
);
ok
(
ret
,
"Expected succes
\n
"
);
...
...
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