forked from Mirrors/wine-wine
advapi32: Do not call MIDL_user_free() with pointer to stack memory.
parent
8a18e0e43a
commit
2ae8e87616
|
@ -1352,15 +1352,19 @@ done:
|
||||||
static DWORD move_string_to_buffer(BYTE **buf, LPWSTR *string_ptr)
|
static DWORD move_string_to_buffer(BYTE **buf, LPWSTR *string_ptr)
|
||||||
{
|
{
|
||||||
DWORD cb;
|
DWORD cb;
|
||||||
WCHAR empty_str[] = {0};
|
|
||||||
|
|
||||||
if (!*string_ptr)
|
if (!*string_ptr)
|
||||||
*string_ptr = empty_str;
|
{
|
||||||
|
cb = sizeof(WCHAR);
|
||||||
|
memset(*buf, 0, cb);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cb = (strlenW(*string_ptr) + 1)*sizeof(WCHAR);
|
||||||
|
memcpy(*buf, *string_ptr, cb);
|
||||||
|
MIDL_user_free(*string_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
cb = (strlenW(*string_ptr) + 1)*sizeof(WCHAR);
|
|
||||||
|
|
||||||
memcpy(*buf, *string_ptr, cb);
|
|
||||||
MIDL_user_free(*string_ptr);
|
|
||||||
*string_ptr = (LPWSTR)*buf;
|
*string_ptr = (LPWSTR)*buf;
|
||||||
*buf += cb;
|
*buf += cb;
|
||||||
|
|
||||||
|
|
|
@ -857,12 +857,12 @@ static void test_sequence(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = QueryServiceConfigA(svc_handle, config, given, &needed);
|
ret = QueryServiceConfigA(svc_handle, config, given, &needed);
|
||||||
ok(ret, "Expected success\n");
|
ok(ret, "Expected success\n");
|
||||||
todo_wine
|
|
||||||
{
|
|
||||||
ok(GetLastError() == ERROR_SUCCESS /* W2K3 */||
|
ok(GetLastError() == ERROR_SUCCESS /* W2K3 */||
|
||||||
GetLastError() == 0xdeadbeef /* NT4, XP, Vista */ ||
|
GetLastError() == 0xdeadbeef /* NT4, XP, Vista */ ||
|
||||||
GetLastError() == ERROR_IO_PENDING /* W2K */,
|
GetLastError() == ERROR_IO_PENDING /* W2K */,
|
||||||
"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(given == needed, "Expected the given (%d) and needed (%d) buffersizes to be equal\n", given, needed);
|
ok(given == needed, "Expected the given (%d) and needed (%d) buffersizes to be equal\n", given, needed);
|
||||||
}
|
}
|
||||||
ok(config->lpBinaryPathName && config->lpLoadOrderGroup && config->lpDependencies && config->lpServiceStartName &&
|
ok(config->lpBinaryPathName && config->lpLoadOrderGroup && config->lpDependencies && config->lpServiceStartName &&
|
||||||
|
|
Loading…
Reference in New Issue