mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Fix a bug in CSR Capture APIs
- Fix bugs in kernel32 console APIs. - These changes fix vim and fix bug 796 as I promised. svn path=/trunk/; revision=18082
This commit is contained in:
parent
4293263024
commit
ad6d758184
3 changed files with 42 additions and 46 deletions
|
@ -1548,7 +1548,6 @@ IntPeekConsoleInput(HANDLE hConsoleInput,
|
||||||
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PVOID BufferTargetBase;
|
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
|
|
||||||
if(lpBuffer == NULL)
|
if(lpBuffer == NULL)
|
||||||
|
@ -1560,38 +1559,38 @@ IntPeekConsoleInput(HANDLE hConsoleInput,
|
||||||
Size = nLength * sizeof(INPUT_RECORD);
|
Size = nLength * sizeof(INPUT_RECORD);
|
||||||
|
|
||||||
/* Allocate a Capture Buffer */
|
/* Allocate a Capture Buffer */
|
||||||
DPRINT1("IntPeekConsoleInput: %lx %p\n", Size, lpNumberOfEventsRead);
|
DPRINT("IntPeekConsoleInput: %lx %p\n", Size, lpNumberOfEventsRead);
|
||||||
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
||||||
|
|
||||||
/* Allocate space in the Buffer */
|
/* Allocate space in the Buffer */
|
||||||
CsrCaptureMessageBuffer(CaptureBuffer, NULL, Size, &BufferTargetBase);
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
||||||
DPRINT1("Allocated message buffer: %p %p\n", CaptureBuffer, BufferTargetBase);
|
NULL,
|
||||||
|
Size,
|
||||||
|
(PVOID*)&Request.Data.PeekConsoleInputRequest.InputRecord);
|
||||||
|
|
||||||
/* Set up the data to send to the Console Server */
|
/* Set up the data to send to the Console Server */
|
||||||
CsrRequest = MAKE_CSR_API(PEEK_CONSOLE_INPUT, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(PEEK_CONSOLE_INPUT, CSR_CONSOLE);
|
||||||
Request.Data.PeekConsoleInputRequest.ConsoleHandle = hConsoleInput;
|
Request.Data.PeekConsoleInputRequest.ConsoleHandle = hConsoleInput;
|
||||||
Request.Data.PeekConsoleInputRequest.Unicode = bUnicode;
|
Request.Data.PeekConsoleInputRequest.Unicode = bUnicode;
|
||||||
Request.Data.PeekConsoleInputRequest.Length = nLength;
|
Request.Data.PeekConsoleInputRequest.Length = nLength;
|
||||||
Request.Data.PeekConsoleInputRequest.InputRecord = (INPUT_RECORD*)BufferTargetBase;
|
|
||||||
|
|
||||||
/* Call the server */
|
/* Call the server */
|
||||||
DPRINT1("Calling Server\n");
|
|
||||||
Status = CsrClientCallServer(&Request,
|
Status = CsrClientCallServer(&Request,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
sizeof(CSR_API_MESSAGE));
|
sizeof(CSR_API_MESSAGE));
|
||||||
DPRINT1("Server returned: %x\n", Request.Status);
|
DPRINT("Server returned: %x\n", Request.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success*/
|
||||||
if (NT_SUCCESS(Request.Status))
|
if (NT_SUCCESS(Request.Status))
|
||||||
{
|
{
|
||||||
/* Return the number of events read */
|
/* Return the number of events read */
|
||||||
DPRINT1("Events read: %lx\n", Request.Data.PeekConsoleInputRequest.Length);
|
DPRINT("Events read: %lx\n", Request.Data.PeekConsoleInputRequest.Length);
|
||||||
*lpNumberOfEventsRead = Request.Data.PeekConsoleInputRequest.Length;
|
*lpNumberOfEventsRead = Request.Data.PeekConsoleInputRequest.Length;
|
||||||
|
|
||||||
/* Copy into the buffer */
|
/* Copy into the buffer */
|
||||||
DPRINT1("Copying to buffer\n");
|
DPRINT("Copying to buffer\n");
|
||||||
RtlCopyMemory(lpBuffer,
|
RtlCopyMemory(lpBuffer,
|
||||||
Request.Data.PeekConsoleInputRequest.InputRecord,
|
Request.Data.PeekConsoleInputRequest.InputRecord,
|
||||||
sizeof(INPUT_RECORD) * *lpNumberOfEventsRead);
|
sizeof(INPUT_RECORD) * *lpNumberOfEventsRead);
|
||||||
}
|
}
|
||||||
|
@ -1603,7 +1602,6 @@ IntPeekConsoleInput(HANDLE hConsoleInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release the capture buffer */
|
/* Release the capture buffer */
|
||||||
DPRINT1("Release buffer and return\n");
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
/* Return TRUE or FALSE */
|
/* Return TRUE or FALSE */
|
||||||
|
@ -1767,7 +1765,6 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
|
||||||
{
|
{
|
||||||
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
PVOID BufferTargetBase;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
DWORD Size;
|
DWORD Size;
|
||||||
|
|
||||||
|
@ -1780,37 +1777,37 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
|
||||||
Size = nLength * sizeof(INPUT_RECORD);
|
Size = nLength * sizeof(INPUT_RECORD);
|
||||||
|
|
||||||
/* Allocate a Capture Buffer */
|
/* Allocate a Capture Buffer */
|
||||||
DPRINT1("IntWriteConsoleInput: %lx %p\n", Size, lpNumberOfEventsWritten);
|
DPRINT("IntWriteConsoleInput: %lx %p\n", Size, lpNumberOfEventsWritten);
|
||||||
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
||||||
|
|
||||||
/* Allocate space in the Buffer */
|
/* Allocate space in the Buffer */
|
||||||
CsrCaptureMessageBuffer(CaptureBuffer, NULL, Size, &BufferTargetBase);
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
||||||
DPRINT1("Allocated message buffer: %p %p\n", CaptureBuffer, BufferTargetBase);
|
NULL,
|
||||||
|
Size,
|
||||||
|
(PVOID*)&Request.Data.WriteConsoleInputRequest.InputRecord);
|
||||||
|
|
||||||
/* Set up the data to send to the Console Server */
|
/* Set up the data to send to the Console Server */
|
||||||
CsrRequest = MAKE_CSR_API(WRITE_CONSOLE_INPUT, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(WRITE_CONSOLE_INPUT, CSR_CONSOLE);
|
||||||
Request.Data.WriteConsoleInputRequest.ConsoleHandle = hConsoleInput;
|
Request.Data.WriteConsoleInputRequest.ConsoleHandle = hConsoleInput;
|
||||||
Request.Data.WriteConsoleInputRequest.Unicode = bUnicode;
|
Request.Data.WriteConsoleInputRequest.Unicode = bUnicode;
|
||||||
Request.Data.WriteConsoleInputRequest.Length = nLength;
|
Request.Data.WriteConsoleInputRequest.Length = nLength;
|
||||||
Request.Data.WriteConsoleInputRequest.InputRecord = (PINPUT_RECORD)BufferTargetBase;
|
|
||||||
|
|
||||||
/* Call the server */
|
/* Call the server */
|
||||||
DPRINT1("Calling Server\n");
|
|
||||||
Status = CsrClientCallServer(&Request,
|
Status = CsrClientCallServer(&Request,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
sizeof(CSR_API_MESSAGE));
|
sizeof(CSR_API_MESSAGE));
|
||||||
DPRINT1("Server returned: %x\n", Request.Status);
|
DPRINT("Server returned: %x\n", Request.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success*/
|
||||||
if (NT_SUCCESS(Request.Status))
|
if (NT_SUCCESS(Request.Status))
|
||||||
{
|
{
|
||||||
/* Return the number of events read */
|
/* Return the number of events read */
|
||||||
DPRINT1("Events read: %lx\n", Request.Data.WriteConsoleInputRequest.Length);
|
DPRINT("Events read: %lx\n", Request.Data.WriteConsoleInputRequest.Length);
|
||||||
*lpNumberOfEventsWritten = Request.Data.WriteConsoleInputRequest.Length;
|
*lpNumberOfEventsWritten = Request.Data.WriteConsoleInputRequest.Length;
|
||||||
|
|
||||||
/* Copy into the buffer */
|
/* Copy into the buffer */
|
||||||
DPRINT1("Copying to buffer\n");
|
DPRINT("Copying to buffer\n");
|
||||||
RtlCopyMemory(lpBuffer,
|
RtlCopyMemory(lpBuffer,
|
||||||
Request.Data.WriteConsoleInputRequest.InputRecord,
|
Request.Data.WriteConsoleInputRequest.InputRecord,
|
||||||
sizeof(INPUT_RECORD) * *lpNumberOfEventsWritten);
|
sizeof(INPUT_RECORD) * *lpNumberOfEventsWritten);
|
||||||
|
@ -1823,7 +1820,6 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release the capture buffer */
|
/* Release the capture buffer */
|
||||||
DPRINT1("Release buffer and return\n");
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
/* Return TRUE or FALSE */
|
/* Return TRUE or FALSE */
|
||||||
|
@ -1885,7 +1881,6 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
||||||
{
|
{
|
||||||
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
CSR_API_MESSAGE Request; ULONG CsrRequest;
|
||||||
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
PCSR_CAPTURE_BUFFER CaptureBuffer;
|
||||||
PVOID BufferTargetBase;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
DWORD Size, SizeX, SizeY;
|
DWORD Size, SizeX, SizeY;
|
||||||
|
|
||||||
|
@ -1898,12 +1893,14 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
||||||
Size = dwBufferSize.X * dwBufferSize.Y * sizeof(CHAR_INFO);
|
Size = dwBufferSize.X * dwBufferSize.Y * sizeof(CHAR_INFO);
|
||||||
|
|
||||||
/* Allocate a Capture Buffer */
|
/* Allocate a Capture Buffer */
|
||||||
DPRINT1("IntReadConsoleOutput: %lx %p\n", Size, lpReadRegion);
|
DPRINT("IntReadConsoleOutput: %lx %p\n", Size, lpReadRegion);
|
||||||
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
||||||
|
|
||||||
/* Allocate space in the Buffer */
|
/* Allocate space in the Buffer */
|
||||||
CsrCaptureMessageBuffer(CaptureBuffer, NULL, Size, &BufferTargetBase);
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
||||||
DPRINT1("Allocated message buffer: %p %p\n", CaptureBuffer, BufferTargetBase);
|
NULL,
|
||||||
|
Size,
|
||||||
|
(PVOID*)&Request.Data.ReadConsoleOutputRequest.CharInfo);
|
||||||
|
|
||||||
/* Set up the data to send to the Console Server */
|
/* Set up the data to send to the Console Server */
|
||||||
CsrRequest = MAKE_CSR_API(READ_CONSOLE_OUTPUT, CSR_CONSOLE);
|
CsrRequest = MAKE_CSR_API(READ_CONSOLE_OUTPUT, CSR_CONSOLE);
|
||||||
|
@ -1912,21 +1909,19 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
||||||
Request.Data.ReadConsoleOutputRequest.BufferSize = dwBufferSize;
|
Request.Data.ReadConsoleOutputRequest.BufferSize = dwBufferSize;
|
||||||
Request.Data.ReadConsoleOutputRequest.BufferCoord = dwBufferCoord;
|
Request.Data.ReadConsoleOutputRequest.BufferCoord = dwBufferCoord;
|
||||||
Request.Data.ReadConsoleOutputRequest.ReadRegion = *lpReadRegion;
|
Request.Data.ReadConsoleOutputRequest.ReadRegion = *lpReadRegion;
|
||||||
Request.Data.ReadConsoleOutputRequest.CharInfo = (PCHAR_INFO)BufferTargetBase;
|
|
||||||
|
|
||||||
/* Call the server */
|
/* Call the server */
|
||||||
DPRINT1("Calling Server\n");
|
|
||||||
Status = CsrClientCallServer(&Request,
|
Status = CsrClientCallServer(&Request,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
sizeof(CSR_API_MESSAGE));
|
sizeof(CSR_API_MESSAGE));
|
||||||
DPRINT1("Server returned: %x\n", Request.Status);
|
DPRINT("Server returned: %x\n", Request.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success*/
|
||||||
if (NT_SUCCESS(Request.Status))
|
if (NT_SUCCESS(Request.Status))
|
||||||
{
|
{
|
||||||
/* Copy into the buffer */
|
/* Copy into the buffer */
|
||||||
DPRINT1("Copying to buffer\n");
|
DPRINT("Copying to buffer\n");
|
||||||
SizeX = Request.Data.ReadConsoleOutputRequest.ReadRegion.Right -
|
SizeX = Request.Data.ReadConsoleOutputRequest.ReadRegion.Right -
|
||||||
Request.Data.ReadConsoleOutputRequest.ReadRegion.Left + 1;
|
Request.Data.ReadConsoleOutputRequest.ReadRegion.Left + 1;
|
||||||
SizeY = Request.Data.ReadConsoleOutputRequest.ReadRegion.Bottom -
|
SizeY = Request.Data.ReadConsoleOutputRequest.ReadRegion.Bottom -
|
||||||
|
@ -1942,11 +1937,10 @@ IntReadConsoleOutput(HANDLE hConsoleOutput,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the read region */
|
/* Return the read region */
|
||||||
DPRINT1("read region: %lx\n", Request.Data.ReadConsoleOutputRequest.ReadRegion);
|
DPRINT("read region: %lx\n", Request.Data.ReadConsoleOutputRequest.ReadRegion);
|
||||||
*lpReadRegion = Request.Data.ReadConsoleOutputRequest.ReadRegion;
|
*lpReadRegion = Request.Data.ReadConsoleOutputRequest.ReadRegion;
|
||||||
|
|
||||||
/* Release the capture buffer */
|
/* Release the capture buffer */
|
||||||
DPRINT1("Release buffer and return\n");
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
/* Return TRUE or FALSE */
|
/* Return TRUE or FALSE */
|
||||||
|
@ -2010,15 +2004,16 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput,
|
||||||
Size = dwBufferSize.Y * dwBufferSize.X * sizeof(CHAR_INFO);
|
Size = dwBufferSize.Y * dwBufferSize.X * sizeof(CHAR_INFO);
|
||||||
|
|
||||||
/* Allocate a Capture Buffer */
|
/* Allocate a Capture Buffer */
|
||||||
DPRINT1("IntWriteConsoleOutput: %lx %p\n", Size, lpWriteRegion);
|
DPRINT("IntWriteConsoleOutput: %lx %p\n", Size, lpWriteRegion);
|
||||||
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
CaptureBuffer = CsrAllocateCaptureBuffer(1, Size);
|
||||||
|
|
||||||
/* Allocate space in the Buffer */
|
/* Allocate space in the Buffer */
|
||||||
CsrCaptureMessageBuffer(CaptureBuffer, NULL, Size, &BufferTargetBase);
|
CsrCaptureMessageBuffer(CaptureBuffer,
|
||||||
DPRINT1("Allocated message buffer: %p %p\n", CaptureBuffer, BufferTargetBase);
|
NULL,
|
||||||
|
Size,
|
||||||
|
(PVOID*)&Request.Data.WriteConsoleOutputRequest.CharInfo);
|
||||||
|
|
||||||
/* Copy from the buffer */
|
/* Copy from the buffer */
|
||||||
DPRINT1("Copying into buffer\n");
|
|
||||||
RtlCopyMemory(BufferTargetBase, lpBuffer, Size);
|
RtlCopyMemory(BufferTargetBase, lpBuffer, Size);
|
||||||
|
|
||||||
/* Set up the data to send to the Console Server */
|
/* Set up the data to send to the Console Server */
|
||||||
|
@ -2028,15 +2023,13 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput,
|
||||||
Request.Data.WriteConsoleOutputRequest.BufferSize = dwBufferSize;
|
Request.Data.WriteConsoleOutputRequest.BufferSize = dwBufferSize;
|
||||||
Request.Data.WriteConsoleOutputRequest.BufferCoord = dwBufferCoord;
|
Request.Data.WriteConsoleOutputRequest.BufferCoord = dwBufferCoord;
|
||||||
Request.Data.WriteConsoleOutputRequest.WriteRegion = *lpWriteRegion;
|
Request.Data.WriteConsoleOutputRequest.WriteRegion = *lpWriteRegion;
|
||||||
Request.Data.WriteConsoleOutputRequest.CharInfo = (CHAR_INFO*)BufferTargetBase;
|
|
||||||
|
|
||||||
/* Call the server */
|
/* Call the server */
|
||||||
DPRINT1("Calling Server\n");
|
|
||||||
Status = CsrClientCallServer(&Request,
|
Status = CsrClientCallServer(&Request,
|
||||||
CaptureBuffer,
|
CaptureBuffer,
|
||||||
CsrRequest,
|
CsrRequest,
|
||||||
sizeof(CSR_API_MESSAGE));
|
sizeof(CSR_API_MESSAGE));
|
||||||
DPRINT1("Server returned: %x\n", Request.Status);
|
DPRINT("Server returned: %x\n", Request.Status);
|
||||||
|
|
||||||
/* Check for success*/
|
/* Check for success*/
|
||||||
if (!NT_SUCCESS(Request.Status))
|
if (!NT_SUCCESS(Request.Status))
|
||||||
|
@ -2046,11 +2039,10 @@ IntWriteConsoleOutput(HANDLE hConsoleOutput,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the read region */
|
/* Return the read region */
|
||||||
DPRINT1("read region: %lx\n", Request.Data.WriteConsoleOutputRequest.WriteRegion);
|
DPRINT("read region: %lx\n", Request.Data.WriteConsoleOutputRequest.WriteRegion);
|
||||||
*lpWriteRegion = Request.Data.WriteConsoleOutputRequest.WriteRegion;
|
*lpWriteRegion = Request.Data.WriteConsoleOutputRequest.WriteRegion;
|
||||||
|
|
||||||
/* Release the capture buffer */
|
/* Release the capture buffer */
|
||||||
DPRINT1("Release buffer and return\n");
|
|
||||||
CsrFreeCaptureBuffer(CaptureBuffer);
|
CsrFreeCaptureBuffer(CaptureBuffer);
|
||||||
|
|
||||||
/* Return TRUE or FALSE */
|
/* Return TRUE or FALSE */
|
||||||
|
|
|
@ -142,12 +142,12 @@ CsrAllocateMessagePointer(PCSR_CAPTURE_BUFFER CaptureBuffer,
|
||||||
CaptureBuffer->BufferEnd += MessageLength;
|
CaptureBuffer->BufferEnd += MessageLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increase the pointer count */
|
|
||||||
CaptureBuffer->PointerCount++;
|
|
||||||
|
|
||||||
/* Write down this pointer in the array */
|
/* Write down this pointer in the array */
|
||||||
CaptureBuffer->PointerArray[CaptureBuffer->PointerCount] = (ULONG_PTR)CaptureData;
|
CaptureBuffer->PointerArray[CaptureBuffer->PointerCount] = (ULONG_PTR)CaptureData;
|
||||||
|
|
||||||
|
/* Increase the pointer count */
|
||||||
|
CaptureBuffer->PointerCount++;
|
||||||
|
|
||||||
/* Return the aligned length */
|
/* Return the aligned length */
|
||||||
return MessageLength;
|
return MessageLength;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
|
||||||
PULONG_PTR Pointers;
|
PULONG_PTR Pointers;
|
||||||
ULONG_PTR CurrentPointer;
|
ULONG_PTR CurrentPointer;
|
||||||
DPRINT("CsrClientCallServer\n");
|
DPRINT("CsrClientCallServer\n");
|
||||||
|
|
||||||
/* Fill out the Port Message Header */
|
/* Fill out the Port Message Header */
|
||||||
ApiMessage->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
|
ApiMessage->Header.u1.s1.DataLength = RequestLength - sizeof(PORT_MESSAGE);
|
||||||
ApiMessage->Header.u1.s1.TotalLength = RequestLength;
|
ApiMessage->Header.u1.s1.TotalLength = RequestLength;
|
||||||
|
@ -79,7 +79,6 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
|
||||||
if (CaptureBuffer)
|
if (CaptureBuffer)
|
||||||
{
|
{
|
||||||
/* We have to convert from our local view to the remote view */
|
/* We have to convert from our local view to the remote view */
|
||||||
DPRINT1("Converting CaptureBuffer\n");
|
|
||||||
ApiMessage->CsrCaptureData = (PVOID)((ULONG_PTR)CaptureBuffer +
|
ApiMessage->CsrCaptureData = (PVOID)((ULONG_PTR)CaptureBuffer +
|
||||||
CsrPortMemoryDelta);
|
CsrPortMemoryDelta);
|
||||||
|
|
||||||
|
@ -91,14 +90,19 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
|
||||||
Pointers = CaptureBuffer->PointerArray;
|
Pointers = CaptureBuffer->PointerArray;
|
||||||
|
|
||||||
/* Loop through every pointer and convert it */
|
/* Loop through every pointer and convert it */
|
||||||
|
DPRINT("PointerCount: %lx\n", PointerCount);
|
||||||
while (PointerCount--)
|
while (PointerCount--)
|
||||||
{
|
{
|
||||||
/* Get this pointer and check if it's valid */
|
/* Get this pointer and check if it's valid */
|
||||||
|
DPRINT("Array Address: %p. This pointer: %p. Data: %p\n",
|
||||||
|
&Pointers, Pointers, *Pointers);
|
||||||
if ((CurrentPointer = *Pointers++))
|
if ((CurrentPointer = *Pointers++))
|
||||||
{
|
{
|
||||||
/* Update it */
|
/* Update it */
|
||||||
|
DPRINT("CurrentPointer: %p.\n", *(PULONG_PTR)CurrentPointer);
|
||||||
*(PULONG_PTR)CurrentPointer += CsrPortMemoryDelta;
|
*(PULONG_PTR)CurrentPointer += CsrPortMemoryDelta;
|
||||||
Pointers[-1] = CurrentPointer - (ULONG_PTR)ApiMessage;
|
Pointers[-1] = CurrentPointer - (ULONG_PTR)ApiMessage;
|
||||||
|
DPRINT("CurrentPointer: %p.\n", *(PULONG_PTR)CurrentPointer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +116,7 @@ CsrClientCallServer(PCSR_API_MESSAGE ApiMessage,
|
||||||
if (CaptureBuffer)
|
if (CaptureBuffer)
|
||||||
{
|
{
|
||||||
/* We have to convert from the remote view to our remote view */
|
/* We have to convert from the remote view to our remote view */
|
||||||
DPRINT1("Reconverting CaptureBuffer\n");
|
DPRINT("Reconverting CaptureBuffer\n");
|
||||||
ApiMessage->CsrCaptureData = (PVOID)((ULONG_PTR)
|
ApiMessage->CsrCaptureData = (PVOID)((ULONG_PTR)
|
||||||
ApiMessage->CsrCaptureData -
|
ApiMessage->CsrCaptureData -
|
||||||
CsrPortMemoryDelta);
|
CsrPortMemoryDelta);
|
||||||
|
|
Loading…
Reference in a new issue