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
e94c1ce3
Commit
e94c1ce3
authored
Nov 02, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Nov 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add some input parameter checks to OpenBackupEventLog.
parent
381533e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
eventlog.c
dlls/advapi32/eventlog.c
+32
-4
eventlog.c
dlls/advapi32/tests/eventlog.c
+0
-12
No files found.
dlls/advapi32/eventlog.c
View file @
e94c1ce3
...
...
@@ -378,8 +378,16 @@ BOOL WINAPI NotifyChangeEventLog( HANDLE hEventLog, HANDLE hEvent )
*/
HANDLE
WINAPI
OpenBackupEventLogA
(
LPCSTR
lpUNCServerName
,
LPCSTR
lpFileName
)
{
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_a
(
lpUNCServerName
),
debugstr_a
(
lpFileName
));
return
(
HANDLE
)
0xcafe4242
;
LPWSTR
uncnameW
,
filenameW
;
HANDLE
handle
;
uncnameW
=
SERV_dup
(
lpUNCServerName
);
filenameW
=
SERV_dup
(
lpFileName
);
handle
=
OpenBackupEventLogW
(
uncnameW
,
filenameW
);
HeapFree
(
GetProcessHeap
(),
0
,
uncnameW
);
HeapFree
(
GetProcessHeap
(),
0
,
filenameW
);
return
handle
;
}
/******************************************************************************
...
...
@@ -389,8 +397,28 @@ HANDLE WINAPI OpenBackupEventLogA( LPCSTR lpUNCServerName, LPCSTR lpFileName )
*/
HANDLE
WINAPI
OpenBackupEventLogW
(
LPCWSTR
lpUNCServerName
,
LPCWSTR
lpFileName
)
{
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_w
(
lpUNCServerName
),
debugstr_w
(
lpFileName
));
return
(
HANDLE
)
0xcafe4242
;
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_w
(
lpUNCServerName
),
debugstr_w
(
lpFileName
));
if
(
!
lpFileName
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
if
(
lpUNCServerName
&&
lpUNCServerName
[
0
])
{
FIXME
(
"Remote server not supported
\n
"
);
SetLastError
(
RPC_S_SERVER_UNAVAILABLE
);
return
NULL
;
}
if
(
GetFileAttributesW
(
lpFileName
)
==
INVALID_FILE_ATTRIBUTES
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
NULL
;
}
return
(
HANDLE
)
0xcafe4242
;
}
/******************************************************************************
...
...
dlls/advapi32/tests/eventlog.c
View file @
e94c1ce3
...
...
@@ -413,37 +413,25 @@ static void test_openbackup(void)
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
NULL
,
NULL
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
NULL
,
"idontexist.evt"
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
"IDontExist"
,
NULL
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenBackupEventLogA
(
"IDontExist"
,
"idontexist.evt"
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
||
GetLastError
()
==
RPC_S_INVALID_NET_ADDR
,
/* Some Vista and Win7 */
"Expected RPC_S_SERVER_UNAVAILABLE, got %d
\n
"
,
GetLastError
());
}
/* Make a backup eventlog to work with */
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