mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:21:38 +00:00
[NTOS][NDK][RTL] A bunch of 'wrong size' fixes
This commit is contained in:
parent
4d35d59fb9
commit
d6792047f3
8 changed files with 21 additions and 16 deletions
|
@ -205,6 +205,7 @@ RtlReadOutOfProcessMemoryStream(
|
|||
ULONG CopyLength;
|
||||
PRTL_MEMORY_STREAM Stream = IStream_To_RTL_MEMORY_STREAM(This);
|
||||
SIZE_T Available = (PUCHAR)Stream->End - (PUCHAR)Stream->Current;
|
||||
SIZE_T LocalBytesRead = 0;
|
||||
|
||||
if (BytesRead)
|
||||
*BytesRead = 0;
|
||||
|
@ -218,10 +219,14 @@ RtlReadOutOfProcessMemoryStream(
|
|||
Stream->Current,
|
||||
Buffer,
|
||||
CopyLength,
|
||||
BytesRead);
|
||||
&LocalBytesRead);
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
Stream->Current = (PUCHAR)Stream->Current + *BytesRead;
|
||||
{
|
||||
Stream->Current = (PUCHAR)Stream->Current + LocalBytesRead;
|
||||
if (BytesRead)
|
||||
*BytesRead = (ULONG)LocalBytesRead;
|
||||
}
|
||||
|
||||
return HRESULT_FROM_WIN32(RtlNtStatusToDosError(Status));
|
||||
}
|
||||
|
|
|
@ -27,10 +27,10 @@ extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line);
|
|||
#endif
|
||||
|
||||
#define ROUND_DOWN(n, align) \
|
||||
(((ULONG)(n)) & ~((align) - 1l))
|
||||
(((ULONG_PTR)(n)) & ~((align) - 1l))
|
||||
|
||||
#define ROUND_UP(n, align) \
|
||||
ROUND_DOWN(((ULONG)(n)) + (align) - 1, (align))
|
||||
ROUND_DOWN(((ULONG_PTR)(n)) + (align) - 1, (align))
|
||||
|
||||
#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue