Commit 0900c72b authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

advapi32/service: Cater better for domain in test.

parent a0dd646e
......@@ -140,8 +140,8 @@ static void test_open_svc(void)
static void test_create_delete_svc(void)
{
SC_HANDLE scm_handle, svc_handle1;
CHAR username[UNLEN + 1], *domain;
DWORD user_size = UNLEN + 1, domain_size = 0;
CHAR username[UNLEN + 1], domain[MAX_PATH];
DWORD user_size = UNLEN + 1;
CHAR account[UNLEN + 3];
static const CHAR servicename [] = "Winetest";
static const CHAR pathname [] = "we_dont_care.exe";
......@@ -155,14 +155,10 @@ static void test_create_delete_svc(void)
/* Get the username and turn it into an account to be used in some tests */
GetUserNameA(username, &user_size);
/* Get the domainname to cater for that situation */
GetComputerNameEx(ComputerNameDnsDomain, NULL, &domain_size);
domain = HeapAlloc(GetProcessHeap(), 0, domain_size);
GetComputerNameEx(ComputerNameDnsDomain, domain, &domain_size);
if (domain_size > 1)
if (GetEnvironmentVariableA("USERDOMAIN", domain, MAX_PATH))
sprintf(account, "%s\\%s", domain, username);
else
sprintf(account, ".\\%s", username);
HeapFree(GetProcessHeap(), 0, domain);
/* All NULL */
SetLastError(0xdeadbeef);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment