mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[NDK][XDK][RTL] Fix definition of RtlFillMemoryUlong on x64
This commit is contained in:
parent
e084a7ae83
commit
fb0ebac349
3 changed files with 39 additions and 7 deletions
|
@ -2119,13 +2119,42 @@ RtlFindCharInUnicodeString(
|
|||
//
|
||||
// Memory Functions
|
||||
//
|
||||
#if defined(_M_AMD64)
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
RtlFillMemoryUlong(
|
||||
_Out_writes_bytes_all_(Length) PVOID Destination,
|
||||
_In_ SIZE_T Length,
|
||||
_In_ ULONG Pattern)
|
||||
{
|
||||
PULONG Address = (PULONG)Destination;
|
||||
if ((Length /= 4) != 0) {
|
||||
if (((ULONG64)Address & 4) != 0) {
|
||||
*Address = Pattern;
|
||||
if ((Length -= 1) == 0) {
|
||||
return;
|
||||
}
|
||||
Address += 1;
|
||||
}
|
||||
__stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
|
||||
if ((Length & 1) != 0) Address[Length - 1] = Pattern;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#define RtlFillMemoryUlonglong(Destination, Length, Pattern) \
|
||||
__stosq((PULONG64)(Destination), Pattern, (Length) / 8)
|
||||
|
||||
#else
|
||||
|
||||
NTSYSAPI
|
||||
VOID
|
||||
NTAPI
|
||||
RtlFillMemoryUlong(
|
||||
_In_ PVOID Destination,
|
||||
_Out_writes_bytes_all_(Length) PVOID Destination,
|
||||
_In_ SIZE_T Length,
|
||||
_In_ ULONG Fill
|
||||
_In_ ULONG Pattern
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
|
@ -2137,6 +2166,8 @@ RtlFillMemoryUlonglong(
|
|||
_In_ ULONGLONG Pattern
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
|
|
@ -2376,9 +2376,9 @@ NTSYSAPI
|
|||
VOID
|
||||
NTAPI
|
||||
RtlFillMemoryUlong(
|
||||
OUT PVOID Destination,
|
||||
IN SIZE_T Length,
|
||||
IN ULONG Pattern);
|
||||
_Out_writes_bytes_all_(Length) PVOID Destination,
|
||||
_In_ SIZE_T Length,
|
||||
_In_ ULONG Pattern);
|
||||
|
||||
NTSYSAPI
|
||||
VOID
|
||||
|
|
|
@ -92,7 +92,7 @@ RtlFillMemory(PVOID Destination,
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifndef _M_AMD64
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -131,7 +131,8 @@ RtlFillMemoryUlonglong(
|
|||
Count--;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // _WIN64
|
||||
#endif // _M_AMD64
|
||||
|
||||
#undef RtlMoveMemory
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue