[KERNEL32] Check Basep8BitStringToDynamicUnicodeString() return and only call -W in case of success

CID 1419330
This commit is contained in:
Pierre Schweitzer 2017-10-23 13:39:44 +02:00
parent 19f1cd78c1
commit 3832f83a32

View file

@ -344,17 +344,18 @@ WINAPI
WaitNamedPipeA(LPCSTR lpNamedPipeName,
DWORD nTimeOut)
{
BOOL r;
BOOL r = FALSE;
UNICODE_STRING NameU;
/* Convert the name to Unicode */
Basep8BitStringToDynamicUnicodeString(&NameU, lpNamedPipeName);
if (Basep8BitStringToDynamicUnicodeString(&NameU, lpNamedPipeName))
{
/* Call the Unicode API */
r = WaitNamedPipeW(NameU.Buffer, nTimeOut);
/* Call the Unicode API */
r = WaitNamedPipeW(NameU.Buffer, nTimeOut);
/* Free the Unicode string */
RtlFreeUnicodeString(&NameU);
/* Free the Unicode string */
RtlFreeUnicodeString(&NameU);
}
/* Return result */
return r;