mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Make WaitNamedPipe (copied from the new implementation #ifdef USING_PROPER_NPFS_WAIT_SEMANTICS) and corresponding part in npfs.sys actually respect the timeout.
svn path=/trunk/; revision=31691
This commit is contained in:
parent
5c1602ce91
commit
bb5bf44217
2 changed files with 35 additions and 3 deletions
|
@ -498,7 +498,30 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
WaitPipe.Timeout.QuadPart = nTimeOut * -10000LL;
|
||||
/* Check what timeout we got */
|
||||
if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
|
||||
{
|
||||
/* Don't use a timeout */
|
||||
WaitPipe.TimeoutSpecified = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Check if we should wait forever */
|
||||
if (nTimeOut == NMPWAIT_WAIT_FOREVER)
|
||||
{
|
||||
/* Set the max */
|
||||
WaitPipe.Timeout.LowPart = 0;
|
||||
WaitPipe.Timeout.HighPart = 0x80000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert to NT format */
|
||||
WaitPipe.Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut);
|
||||
}
|
||||
|
||||
/* In both cases, we do have a timeout */
|
||||
WaitPipe.TimeoutSpecified = FALSE;
|
||||
}
|
||||
|
||||
Status = NtFsControlFile(FileHandle,
|
||||
NULL,
|
||||
|
|
|
@ -289,6 +289,7 @@ NpfsWaitPipe(PIRP Irp,
|
|||
PNPFS_CCB ServerCcb;
|
||||
PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
|
||||
NTSTATUS Status;
|
||||
LARGE_INTEGER TimeOut;
|
||||
|
||||
DPRINT("NpfsWaitPipe\n");
|
||||
|
||||
|
@ -320,12 +321,20 @@ NpfsWaitPipe(PIRP Irp,
|
|||
current_entry = current_entry->Flink;
|
||||
}
|
||||
|
||||
/* no listening server fcb found -- wait for one */
|
||||
/* No listening server fcb found */
|
||||
|
||||
/* If no timeout specified, use the default one */
|
||||
if (WaitPipe->TimeoutSpecified)
|
||||
TimeOut = WaitPipe->Timeout;
|
||||
else
|
||||
TimeOut = Fcb->TimeOut;
|
||||
|
||||
/* Wait for one */
|
||||
Status = KeWaitForSingleObject(&Ccb->ConnectEvent,
|
||||
UserRequest,
|
||||
KernelMode,
|
||||
FALSE,
|
||||
&WaitPipe->Timeout);
|
||||
&TimeOut);
|
||||
|
||||
DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status);
|
||||
|
||||
|
|
Loading…
Reference in a new issue