mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Allocated the message reply buffer according to the size of the message.
svn path=/trunk/; revision=17581
This commit is contained in:
parent
b5fbf00480
commit
37dced9725
2 changed files with 13 additions and 3 deletions
|
@ -88,7 +88,6 @@ typedef struct _QUEUEDMESSAGE
|
|||
PEPORT Sender;
|
||||
LIST_ENTRY QueueListEntry;
|
||||
PORT_MESSAGE Message;
|
||||
UCHAR MessageData[0x130]; /* FIXME: HACK */
|
||||
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
|
||||
|
||||
typedef struct _LPC_DBG_MESSAGE
|
||||
|
|
|
@ -37,19 +37,30 @@ EiReplyOrRequestPort (IN PEPORT Port,
|
|||
{
|
||||
KIRQL oldIrql;
|
||||
PQUEUEDMESSAGE MessageReply;
|
||||
ULONG Size;
|
||||
|
||||
if (Port == NULL)
|
||||
{
|
||||
KEBUGCHECK(0);
|
||||
}
|
||||
|
||||
MessageReply = ExAllocatePoolWithTag(NonPagedPool, sizeof(QUEUEDMESSAGE),
|
||||
Size = sizeof(QUEUEDMESSAGE);
|
||||
if (LpcReply && LpcReply->u1.s1.TotalLength > sizeof(PORT_MESSAGE))
|
||||
{
|
||||
Size += LpcReply->u1.s1.TotalLength - sizeof(PORT_MESSAGE);
|
||||
}
|
||||
MessageReply = ExAllocatePoolWithTag(NonPagedPool, Size,
|
||||
TAG_LPC_MESSAGE);
|
||||
MessageReply->Sender = Sender;
|
||||
|
||||
if (LpcReply != NULL)
|
||||
{
|
||||
memcpy(&MessageReply->Message, LpcReply, LpcReply->u1.s1.TotalLength);
|
||||
memcpy(&MessageReply->Message, LpcReply, LpcReply->u1.s1.TotalLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageReply->Message.u1.s1.TotalLength = sizeof(PORT_MESSAGE);
|
||||
MessageReply->Message.u1.s1.DataLength = 0;
|
||||
}
|
||||
|
||||
MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
|
||||
|
|
Loading…
Reference in a new issue