From c1f6501808ca8ca8b03984f6218b905d095fb9c9 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Wed, 25 Apr 2007 13:16:37 +0200 Subject: [PATCH] kernel32/tests: GetComputerNameW is not implemented on win98. --- dlls/kernel32/tests/environ.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/kernel32/tests/environ.c b/dlls/kernel32/tests/environ.c index dab57f7704..b53a4b46f0 100644 --- a/dlls/kernel32/tests/environ.c +++ b/dlls/kernel32/tests/environ.c @@ -265,16 +265,22 @@ static void test_GetComputerName(void) HeapFree(GetProcessHeap(), 0, name); size = 0; + SetLastError(0xdeadbeef); ret = GetComputerNameW((LPWSTR)0xdeadbeef, &size); error = GetLastError(); - todo_wine - ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameW should have failed with ERROR_BUFFER_OVERFLOW instead of %d\n", error); - size++; /* nul terminating character */ - nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); - ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); - ret = GetComputerNameW(nameW, &size); - ok(ret, "GetComputerNameW failed with error %d\n", GetLastError()); - HeapFree(GetProcessHeap(), 0, nameW); + if (error == ERROR_CALL_NOT_IMPLEMENTED) + skip("GetComputerNameW is not implemented\n"); + else + { + todo_wine + ok(!ret && error == ERROR_BUFFER_OVERFLOW, "GetComputerNameW should have failed with ERROR_BUFFER_OVERFLOW instead of %d\n", error); + size++; /* nul terminating character */ + nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(nameW[0])); + ok(nameW != NULL, "HeapAlloc failed with error %d\n", GetLastError()); + ret = GetComputerNameW(nameW, &size); + ok(ret, "GetComputerNameW failed with error %d\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, nameW); + } pGetComputerNameExA = GetProcAddress(GetModuleHandle("kernel32.dll"), "GetComputerNameExA"); if (!pGetComputerNameExA) -- 2.32.0.93.g670b81a890