kernel32: Fix a few failing tests in win2k.
This commit is contained in:
parent
25c02c884f
commit
a4f733ab0b
|
@ -364,6 +364,8 @@ static void test_GetComputerNameExA(void)
|
||||||
LPSTR name;
|
LPSTR name;
|
||||||
DWORD error;
|
DWORD error;
|
||||||
|
|
||||||
|
static const int MAX_COMP_NAME = 32767;
|
||||||
|
|
||||||
if (!pGetComputerNameExA)
|
if (!pGetComputerNameExA)
|
||||||
{
|
{
|
||||||
skip("GetComputerNameExA function not implemented\n");
|
skip("GetComputerNameExA function not implemented\n");
|
||||||
|
@ -373,8 +375,11 @@ static void test_GetComputerNameExA(void)
|
||||||
size = 0;
|
size = 0;
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsDomain, (LPSTR)0xdeadbeef, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsDomain, (LPSTR)0xdeadbeef, &size);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExA should have failed with ERROR_MORE_DATA instead of %d\n", error);
|
ok(ret == 0, "Expected 0, got %d\n", ret);
|
||||||
trace("domain size is %d\n", size);
|
ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error);
|
||||||
|
|
||||||
|
/* size is not set in win2k */
|
||||||
|
size = MAX_COMP_NAME;
|
||||||
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
||||||
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsDomain, name, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsDomain, name, &size);
|
||||||
|
@ -385,8 +390,11 @@ static void test_GetComputerNameExA(void)
|
||||||
size = 0;
|
size = 0;
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, (LPSTR)0xdeadbeef, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, (LPSTR)0xdeadbeef, &size);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExA should have failed with ERROR_MORE_DATA instead of %d\n", error);
|
ok(ret == 0, "Expected 0, got %d\n", ret);
|
||||||
trace("fully qualified hostname size is %d\n", size);
|
ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error);
|
||||||
|
|
||||||
|
/* size is not set in win2k */
|
||||||
|
size = MAX_COMP_NAME;
|
||||||
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
||||||
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, name, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsFullyQualified, name, &size);
|
||||||
|
@ -397,8 +405,11 @@ static void test_GetComputerNameExA(void)
|
||||||
size = 0;
|
size = 0;
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsHostname, (LPSTR)0xdeadbeef, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsHostname, (LPSTR)0xdeadbeef, &size);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExA should have failed with ERROR_MORE_DATA instead of %d\n", error);
|
ok(ret == 0, "Expected 0, got %d\n", ret);
|
||||||
trace("hostname size is %d\n", size);
|
ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error);
|
||||||
|
|
||||||
|
/* size is not set in win2k */
|
||||||
|
size = MAX_COMP_NAME;
|
||||||
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
||||||
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
||||||
ret = pGetComputerNameExA(ComputerNameDnsHostname, name, &size);
|
ret = pGetComputerNameExA(ComputerNameDnsHostname, name, &size);
|
||||||
|
@ -409,8 +420,11 @@ static void test_GetComputerNameExA(void)
|
||||||
size = 0;
|
size = 0;
|
||||||
ret = pGetComputerNameExA(ComputerNameNetBIOS, (LPSTR)0xdeadbeef, &size);
|
ret = pGetComputerNameExA(ComputerNameNetBIOS, (LPSTR)0xdeadbeef, &size);
|
||||||
error = GetLastError();
|
error = GetLastError();
|
||||||
ok(!ret && error == ERROR_MORE_DATA, "GetComputerNameExA should have failed with ERROR_MORE_DATA instead of %d\n", error);
|
ok(ret == 0, "Expected 0, got %d\n", ret);
|
||||||
trace("NetBIOS size is %d\n", size);
|
ok(error == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", error);
|
||||||
|
|
||||||
|
/* size is not set in win2k */
|
||||||
|
size = MAX_COMP_NAME;
|
||||||
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
name = HeapAlloc(GetProcessHeap(), 0, size * sizeof(name[0]));
|
||||||
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
ok(name != NULL, "HeapAlloc failed with error %d\n", GetLastError());
|
||||||
ret = pGetComputerNameExA(ComputerNameNetBIOS, name, &size);
|
ret = pGetComputerNameExA(ComputerNameNetBIOS, name, &size);
|
||||||
|
|
Loading…
Reference in New Issue