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
19f4c42f
Commit
19f4c42f
authored
Dec 06, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Fix some test failures when the computername is fully qualified.
parent
63231be8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
eventlog.c
dlls/advapi32/tests/eventlog.c
+29
-10
No files found.
dlls/advapi32/tests/eventlog.c
View file @
19f4c42f
...
...
@@ -31,6 +31,8 @@
static
BOOL
(
WINAPI
*
pCreateWellKnownSid
)(
WELL_KNOWN_SID_TYPE
,
PSID
,
PSID
,
DWORD
*
);
static
BOOL
(
WINAPI
*
pGetEventLogInformation
)(
HANDLE
,
DWORD
,
LPVOID
,
DWORD
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pGetComputerNameExA
)(
COMPUTER_NAME_FORMAT
,
LPSTR
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pWow64DisableWow64FsRedirection
)(
PVOID
*
);
static
BOOL
(
WINAPI
*
pWow64RevertWow64FsRedirection
)(
PVOID
);
...
...
@@ -42,6 +44,7 @@ static void init_function_pointers(void)
pCreateWellKnownSid
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"CreateWellKnownSid"
);
pGetEventLogInformation
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"GetEventLogInformation"
);
pGetComputerNameExA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetComputerNameExA"
);
pWow64DisableWow64FsRedirection
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"Wow64DisableWow64FsRedirection"
);
pWow64RevertWow64FsRedirection
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"Wow64RevertWow64FsRedirection"
);
}
...
...
@@ -709,8 +712,8 @@ static void test_readwrite(void)
BOOL
ret
,
sidavailable
;
BOOL
on_vista
=
FALSE
;
/* Used to indicate Vista, W2K8 or Win7 */
int
i
;
char
localcomputer
[
MAX_COMPUTERNAME_LENGTH
+
1
]
;
DWORD
len
=
sizeof
(
localcomputer
)
;
char
*
localcomputer
;
DWORD
size
;
if
(
pCreateWellKnownSid
)
{
...
...
@@ -727,7 +730,23 @@ static void test_readwrite(void)
user
=
NULL
;
}
GetComputerNameA
(
localcomputer
,
&
len
);
if
(
pGetComputerNameExA
)
{
size
=
0
;
SetLastError
(
0xdeadbeef
);
pGetComputerNameExA
(
ComputerNameDnsFullyQualified
,
NULL
,
&
size
);
/* Cope with W2K (needed size is not set) */
if
(
size
==
0
&&
GetLastError
()
==
ERROR_MORE_DATA
)
size
=
1024
;
localcomputer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
pGetComputerNameExA
(
ComputerNameDnsFullyQualified
,
localcomputer
,
&
size
);
}
else
{
size
=
MAX_COMPUTERNAME_LENGTH
+
1
;
localcomputer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
GetComputerNameA
(
localcomputer
,
&
size
);
}
/* Write an event with an incorrect event type. This will fail on Windows 7
* but succeed on all others, hence it's not part of the struct.
...
...
@@ -737,8 +756,7 @@ static void test_readwrite(void)
{
/* Intermittently seen on NT4 when tests are run immediately after boot */
win_skip
(
"Could not get a handle to the eventlog
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
return
;
goto
cleanup
;
}
count
=
0xdeadbeef
;
...
...
@@ -756,9 +774,8 @@ static void test_readwrite(void)
if
(
count
!=
0
)
{
win_skip
(
"We didn't open our new eventlog
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
CloseEventLog
(
handle
);
return
;
goto
cleanup
;
}
}
...
...
@@ -854,7 +871,7 @@ static void test_readwrite(void)
if
(
count
==
0
)
{
skip
(
"No events were written to the eventlog
\n
"
);
return
;
goto
cleanup
;
}
/* Report only once */
...
...
@@ -962,8 +979,6 @@ static void test_readwrite(void)
}
CloseEventLog
(
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
/* Test clearing a real eventlog */
handle
=
OpenEventLogA
(
NULL
,
eventlogname
);
...
...
@@ -977,6 +992,10 @@ static void test_readwrite(void)
ok
(
count
==
0
,
"Expected an empty eventlog, got %d records
\n
"
,
count
);
CloseEventLog
(
handle
);
cleanup:
HeapFree
(
GetProcessHeap
(),
0
,
localcomputer
);
HeapFree
(
GetProcessHeap
(),
0
,
user
);
}
/* Before Vista:
...
...
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