libwinpr-pipe: implement WaitNamedPipe
This commit is contained in:
parent
3d2754e8ed
commit
979ed1b756
@ -225,7 +225,36 @@ BOOL TransactNamedPipe(HANDLE hNamedPipe, LPVOID lpInBuffer, DWORD nInBufferSize
|
||||
|
||||
BOOL WaitNamedPipeA(LPCSTR lpNamedPipeName, DWORD nTimeOut)
|
||||
{
|
||||
return TRUE;
|
||||
BOOL status;
|
||||
DWORD nWaitTime;
|
||||
char* lpFilePath;
|
||||
DWORD dwSleepInterval;
|
||||
|
||||
if (!lpNamedPipeName)
|
||||
return FALSE;
|
||||
|
||||
lpFilePath = GetNamedPipeUnixDomainSocketFilePathA(lpNamedPipeName);
|
||||
|
||||
if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
|
||||
nTimeOut = 50;
|
||||
|
||||
nWaitTime = 0;
|
||||
status = TRUE;
|
||||
dwSleepInterval = 10;
|
||||
|
||||
while (!PathFileExistsA(lpFilePath))
|
||||
{
|
||||
Sleep(dwSleepInterval);
|
||||
nWaitTime += dwSleepInterval;
|
||||
|
||||
if (nWaitTime >= nTimeOut)
|
||||
{
|
||||
status = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
BOOL WaitNamedPipeW(LPCWSTR lpNamedPipeName, DWORD nTimeOut)
|
||||
|
Loading…
Reference in New Issue
Block a user