diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 199b2f3e449..2c8074b9096 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -3568,8 +3568,8 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp ntlen = devlen + (result->Length/sizeof(WCHAR) - 2); if (ntlen + 1 > *pdwSize) { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; + status = STATUS_BUFFER_TOO_SMALL; + goto cleanup; } *pdwSize = ntlen;