/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Win32 Kernel Library
- * FILE: lib/kernel32/file/npipe.c
+ * FILE: dll/win32/kernel32/client/file/npipe.c
* PURPOSE: Named Pipe Functions
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
* Ariadne ( ariadne@xs4all.nl)
if (nDefaultTimeOut)
{
/* Convert the time to NT format */
- DefaultTimeOut.QuadPart = UInt32x32To64(nDefaultTimeOut, -10000);
+ DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL;
}
else
{
WaitNamedPipeA(LPCSTR lpNamedPipeName,
DWORD nTimeOut)
{
- BOOL r;
+ BOOL r = FALSE;
UNICODE_STRING NameU;
/* Convert the name to Unicode */
- Basep8BitStringToDynamicUnicodeString(&NameU, lpNamedPipeName);
-
- /* Call the Unicode API */
- r = WaitNamedPipeW(NameU.Buffer, nTimeOut);
+ if (Basep8BitStringToDynamicUnicodeString(&NameU, lpNamedPipeName))
+ {
+ /* 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;
else
{
/* Convert to NT format */
- WaitPipeInfo->Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut);
+ WaitPipeInfo->Timeout.QuadPart = nTimeOut * -10000LL;
}
/* In both cases, we do have a timeout */
if (lpCollectDataTimeout)
{
/* Convert it to Quad */
- RemoteSettings.CollectDataTime.QuadPart =
- -(LONGLONG)UInt32x32To64(10000, *lpCollectDataTimeout);
+ RemoteSettings.CollectDataTime.QuadPart = *lpCollectDataTimeout * -10000LL;
}
/* Tell the driver to change them */
if (lpUserName != NULL)
{
/* FIXME - open the thread token, call ImpersonateNamedPipeClient() and
- retreive the user name with GetUserName(), revert the impersonation
+ retrieve the user name with GetUserName(), revert the impersonation
and finally restore the thread token */
}