kernel32/tests: GetComputerNameW is not implemented on win98.

This commit is contained in:
Paul Vriens 2007-04-25 13:16:37 +02:00 committed by Alexandre Julliard
parent 9dafa1fc11
commit c1f6501808
1 changed files with 14 additions and 8 deletions

View File

@ -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)