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
400d6216
Commit
400d6216
authored
Oct 28, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Oct 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some GetEventLogInformation tests.
parent
5e25a234
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
eventlog.c
dlls/advapi32/tests/eventlog.c
+72
-0
winbase.h
include/winbase.h
+10
-0
No files found.
dlls/advapi32/tests/eventlog.c
View file @
400d6216
...
...
@@ -27,6 +27,15 @@
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pGetEventLogInformation
)(
HANDLE
,
DWORD
,
LPVOID
,
DWORD
,
LPDWORD
);
static
void
init_function_pointers
(
void
)
{
HMODULE
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
pGetEventLogInformation
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"GetEventLogInformation"
);
}
static
void
test_open_close
(
void
)
{
HANDLE
handle
;
...
...
@@ -80,6 +89,66 @@ static void test_open_close(void)
CloseEventLog
(
handle
);
}
static
void
test_info
(
void
)
{
HANDLE
handle
;
BOOL
ret
;
DWORD
needed
;
EVENTLOG_FULL_INFORMATION
efi
;
if
(
!
pGetEventLogInformation
)
{
/* NT4 */
skip
(
"GetEventLogInformation is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
pGetEventLogInformation
(
NULL
,
1
,
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_LEVEL
,
"Expected ERROR_INVALID_LEVEL, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetEventLogInformation
(
NULL
,
EVENTLOG_FULL_INFO
,
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
RPC_X_NULL_REF_POINTER
,
"Expected RPC_X_NULL_REF_POINTER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
NULL
,
0
,
&
needed
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
RPC_X_NULL_REF_POINTER
,
"Expected RPC_X_NULL_REF_POINTER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
(
LPVOID
)
&
efi
,
0
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
RPC_X_NULL_REF_POINTER
,
"Expected RPC_X_NULL_REF_POINTER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
needed
=
0xdeadbeef
;
efi
.
dwFull
=
0xdeadbeef
;
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
(
LPVOID
)
&
efi
,
0
,
&
needed
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
ok
(
needed
==
sizeof
(
EVENTLOG_FULL_INFORMATION
),
"Expected sizeof(EVENTLOG_FULL_INFORMATION), got %d
\n
"
,
needed
);
ok
(
efi
.
dwFull
==
0xdeadbeef
,
"Expected no change to the dwFull member
\n
"
);
/* Not that we care, but on success last error is set to ERROR_IO_PENDING */
efi
.
dwFull
=
0xdeadbeef
;
needed
*=
2
;
ret
=
pGetEventLogInformation
(
handle
,
EVENTLOG_FULL_INFO
,
(
LPVOID
)
&
efi
,
needed
,
&
needed
);
ok
(
ret
,
"Expected succes
\n
"
);
ok
(
needed
==
sizeof
(
EVENTLOG_FULL_INFORMATION
),
"Expected sizeof(EVENTLOG_FULL_INFORMATION), got %d
\n
"
,
needed
);
ok
(
efi
.
dwFull
==
0
||
efi
.
dwFull
==
1
,
"Expected 0 (not full) or 1 (full), got %d
\n
"
,
efi
.
dwFull
);
CloseEventLog
(
handle
);
}
START_TEST
(
eventlog
)
{
SetLastError
(
0xdeadbeef
);
...
...
@@ -90,6 +159,9 @@ START_TEST(eventlog)
return
;
}
init_function_pointers
();
/* Parameters only */
test_open_close
();
test_info
();
}
include/winbase.h
View file @
400d6216
...
...
@@ -1223,6 +1223,15 @@ typedef struct tagHW_PROFILE_INFOW {
DECL_WINELIB_TYPE_AW
(
HW_PROFILE_INFO
)
DECL_WINELIB_TYPE_AW
(
LPHW_PROFILE_INFO
)
/* Event Logging */
#define EVENTLOG_FULL_INFO 0
typedef
struct
_EVENTLOG_FULL_INFORMATION
{
DWORD
dwFull
;
}
EVENTLOG_FULL_INFORMATION
,
*
LPEVENTLOG_FULL_INFORMATION
;
/* Stream data structures and defines */
/*the types of backup data -- WIN32_STREAM_ID.dwStreamId below*/
#define BACKUP_INVALID 0
...
...
@@ -1615,6 +1624,7 @@ WINBASEAPI DWORD WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
WINBASEAPI
DWORD
WINAPI
GetEnvironmentVariableW
(
LPCWSTR
,
LPWSTR
,
DWORD
);
#define GetEnvironmentVariable WINELIB_NAME_AW(GetEnvironmentVariable)
WINBASEAPI
UINT
WINAPI
GetErrorMode
(
void
);
WINADVAPI
BOOL
WINAPI
GetEventLogInformation
(
HANDLE
,
DWORD
,
LPVOID
,
DWORD
,
LPDWORD
);
WINBASEAPI
BOOL
WINAPI
GetExitCodeProcess
(
HANDLE
,
LPDWORD
);
WINBASEAPI
BOOL
WINAPI
GetExitCodeThread
(
HANDLE
,
LPDWORD
);
WINBASEAPI
DWORD
WINAPI
GetFileAttributesA
(
LPCSTR
);
...
...
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