mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +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;
|
PEPORT Sender;
|
||||||
LIST_ENTRY QueueListEntry;
|
LIST_ENTRY QueueListEntry;
|
||||||
PORT_MESSAGE Message;
|
PORT_MESSAGE Message;
|
||||||
UCHAR MessageData[0x130]; /* FIXME: HACK */
|
|
||||||
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
|
} QUEUEDMESSAGE, *PQUEUEDMESSAGE;
|
||||||
|
|
||||||
typedef struct _LPC_DBG_MESSAGE
|
typedef struct _LPC_DBG_MESSAGE
|
||||||
|
|
|
@ -37,13 +37,19 @@ EiReplyOrRequestPort (IN PEPORT Port,
|
||||||
{
|
{
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
PQUEUEDMESSAGE MessageReply;
|
PQUEUEDMESSAGE MessageReply;
|
||||||
|
ULONG Size;
|
||||||
|
|
||||||
if (Port == NULL)
|
if (Port == NULL)
|
||||||
{
|
{
|
||||||
KEBUGCHECK(0);
|
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);
|
TAG_LPC_MESSAGE);
|
||||||
MessageReply->Sender = Sender;
|
MessageReply->Sender = Sender;
|
||||||
|
|
||||||
|
@ -51,6 +57,11 @@ EiReplyOrRequestPort (IN PEPORT Port,
|
||||||
{
|
{
|
||||||
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();
|
MessageReply->Message.ClientId.UniqueProcess = PsGetCurrentProcessId();
|
||||||
MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
|
MessageReply->Message.ClientId.UniqueThread = PsGetCurrentThreadId();
|
||||||
|
|
Loading…
Reference in a new issue