mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 23:53:38 +00:00
advapi32/service: Fix buffersize calculations for GetServiceDisplayNameW.
This commit is contained in:
parent
95d2f04611
commit
dc6653887c
|
@ -2356,6 +2356,10 @@ BOOL WINAPI GetServiceDisplayNameW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
|
||||||
SetLastError(ret);
|
SetLastError(ret);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Always return the correct needed size on success */
|
||||||
|
*lpcchBuffer = (size / sizeof(WCHAR)) - 1;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -527,12 +527,9 @@ static void test_get_displayname(void)
|
||||||
GetLastError() == ERROR_IO_PENDING /* W2K */ ||
|
GetLastError() == ERROR_IO_PENDING /* W2K */ ||
|
||||||
GetLastError() == 0xdeadbeef /* NT4, XP, Vista */,
|
GetLastError() == 0xdeadbeef /* NT4, XP, Vista */,
|
||||||
"Expected ERROR_SUCCESS, ERROR_IO_PENDING or 0xdeadbeef, got %d\n", GetLastError());
|
"Expected ERROR_SUCCESS, ERROR_IO_PENDING or 0xdeadbeef, got %d\n", GetLastError());
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(displaysize == tempsizeW, "Expected the needed buffersize\n");
|
ok(displaysize == tempsizeW, "Expected the needed buffersize\n");
|
||||||
ok(lstrlenW(displaynameW) == displaysize,
|
ok(lstrlenW(displaynameW) == displaysize,
|
||||||
"Expected the buffer to be the length of the string\n") ;
|
"Expected the buffer to be the length of the string\n") ;
|
||||||
}
|
|
||||||
ok(tempsize / 2 == tempsizeW,
|
ok(tempsize / 2 == tempsizeW,
|
||||||
"Expected the needed buffersize (in bytes) to be the same for the A and W call\n");
|
"Expected the needed buffersize (in bytes) to be the same for the A and W call\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue