mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
- Check for the status after calling KeWaitForSingleObject in NtRequestWaitReplyPort.
svn path=/trunk/; revision=5643
This commit is contained in:
parent
14aa056fe0
commit
69ade55431
1 changed files with 32 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: send.c,v 1.11 2003/07/11 01:23:15 royce Exp $
|
||||
/* $Id: send.c,v 1.12 2003/08/18 11:48:19 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -268,24 +268,38 @@ NtRequestWaitReplyPort (IN HANDLE PortHandle,
|
|||
/*
|
||||
* Wait for a reply
|
||||
*/
|
||||
KeWaitForSingleObject(&Port->Semaphore,
|
||||
UserRequest,
|
||||
UserMode,
|
||||
FALSE,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* Dequeue the reply
|
||||
*/
|
||||
KeAcquireSpinLock(&Port->Lock, &oldIrql);
|
||||
Message = EiDequeueMessagePort(Port);
|
||||
KeReleaseSpinLock(&Port->Lock, oldIrql);
|
||||
DPRINT("Message->Message.MessageSize %d\n",
|
||||
Message->Message.MessageSize);
|
||||
Status = MmCopyToCaller(UnsafeLpcReply, &Message->Message,
|
||||
Message->Message.MessageSize);
|
||||
ExFreePool(Message);
|
||||
Status = KeWaitForSingleObject(&Port->Semaphore,
|
||||
UserRequest,
|
||||
UserMode,
|
||||
FALSE,
|
||||
NULL);
|
||||
if (Status == STATUS_SUCCESS)
|
||||
{
|
||||
|
||||
/*
|
||||
* Dequeue the reply
|
||||
*/
|
||||
KeAcquireSpinLock(&Port->Lock, &oldIrql);
|
||||
Message = EiDequeueMessagePort(Port);
|
||||
KeReleaseSpinLock(&Port->Lock, oldIrql);
|
||||
if (Message)
|
||||
{
|
||||
DPRINT("Message->Message.MessageSize %d\n",
|
||||
Message->Message.MessageSize);
|
||||
Status = MmCopyToCaller(UnsafeLpcReply, &Message->Message,
|
||||
Message->Message.MessageSize);
|
||||
ExFreePool(Message);
|
||||
}
|
||||
else
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
Status = STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
ObDereferenceObject(Port);
|
||||
|
||||
return(Status);
|
||||
|
|
Loading…
Reference in a new issue