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
84d689bd
Commit
84d689bd
authored
Oct 27, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Oct 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some input parameter checks.
parent
48033db6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
13 deletions
+40
-13
eventlog.c
dlls/advapi32/eventlog.c
+40
-4
eventlog.c
dlls/advapi32/tests/eventlog.c
+0
-9
No files found.
dlls/advapi32/eventlog.c
View file @
84d689bd
...
...
@@ -29,11 +29,25 @@
#include "wmistr.h"
#include "evntrace.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
WINE_DECLARE_DEBUG_CHANNEL
(
eventlog
);
static
inline
LPWSTR
SERV_dup
(
LPCSTR
str
)
{
UINT
len
;
LPWSTR
wstr
;
if
(
!
str
)
return
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
wstr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
wstr
,
len
);
return
wstr
;
}
/******************************************************************************
* BackupEventLogA [ADVAPI32.@]
*
...
...
@@ -283,8 +297,16 @@ HANDLE WINAPI OpenBackupEventLogW( LPCWSTR lpUNCServerName, LPCWSTR lpFileName )
*/
HANDLE
WINAPI
OpenEventLogA
(
LPCSTR
uncname
,
LPCSTR
source
)
{
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_a
(
uncname
),
debugstr_a
(
source
));
return
(
HANDLE
)
0xcafe4242
;
LPWSTR
uncnameW
,
sourceW
;
HANDLE
handle
;
uncnameW
=
SERV_dup
(
uncname
);
sourceW
=
SERV_dup
(
source
);
handle
=
OpenEventLogW
(
uncnameW
,
sourceW
);
HeapFree
(
GetProcessHeap
(),
0
,
uncnameW
);
HeapFree
(
GetProcessHeap
(),
0
,
sourceW
);
return
handle
;
}
/******************************************************************************
...
...
@@ -294,8 +316,22 @@ HANDLE WINAPI OpenEventLogA( LPCSTR uncname, LPCSTR source )
*/
HANDLE
WINAPI
OpenEventLogW
(
LPCWSTR
uncname
,
LPCWSTR
source
)
{
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_w
(
uncname
),
debugstr_w
(
source
));
return
(
HANDLE
)
0xcafe4242
;
FIXME
(
"(%s,%s) stub
\n
"
,
debugstr_w
(
uncname
),
debugstr_w
(
source
));
if
(
!
source
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
if
(
uncname
)
{
FIXME
(
"Remote server not supported
\n
"
);
SetLastError
(
RPC_S_SERVER_UNAVAILABLE
);
return
NULL
;
}
return
(
HANDLE
)
0xcafe4242
;
}
/******************************************************************************
...
...
dlls/advapi32/tests/eventlog.c
View file @
84d689bd
...
...
@@ -44,29 +44,20 @@ static void test_open_close(void)
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
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
=
OpenEventLogA
(
"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
=
OpenEventLogA
(
"IDontExist"
,
"deadbeef"
);
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
());
}
/* This one opens the Application log */
handle
=
OpenEventLogA
(
NULL
,
"deadbeef"
);
...
...
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