[PATCH 2/2] Fix test failures when the computername is fully qualified on W2K3 and earlier
Paul Vriens
Paul.Vriens.Wine at gmail.com
Tue Dec 8 02:28:49 CST 2009
---
dlls/advapi32/tests/eventlog.c | 34 ++++++++++++++++------------------
1 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c
index a781c06..3a1bbe5 100644
--- a/dlls/advapi32/tests/eventlog.c
+++ b/dlls/advapi32/tests/eventlog.c
@@ -730,24 +730,6 @@ static void test_readwrite(void)
user = NULL;
}
- 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.
*/
@@ -878,6 +860,22 @@ static void test_readwrite(void)
if (on_vista)
skip("There is no DWORD alignment enforced for UserSid on Vista, W2K8 or Win7\n");
+ if (on_vista && pGetComputerNameExA)
+ {
+ /* New Vista+ behavior */
+ size = 0;
+ SetLastError(0xdeadbeef);
+ pGetComputerNameExA(ComputerNameDnsFullyQualified, NULL, &size);
+ localcomputer = HeapAlloc(GetProcessHeap(), 0, size);
+ pGetComputerNameExA(ComputerNameDnsFullyQualified, localcomputer, &size);
+ }
+ else
+ {
+ size = MAX_COMPUTERNAME_LENGTH + 1;
+ localcomputer = HeapAlloc(GetProcessHeap(), 0, size);
+ GetComputerNameA(localcomputer, &size);
+ }
+
/* Read all events from our created eventlog, one by one */
handle = OpenEventLogA(NULL, eventlogname);
i = 0;
--
1.6.2.5
--------------010706010502000506030708--
More information about the wine-patches
mailing list