Reactos

[NDK][XDK][RTL] Fix definition of RtlFillMemoryUlong on x64

+39 -7
+33 -2
sdk/include/ndk/rtlfuncs.h
··· 2119 2119 // 2120 2120 // Memory Functions 2121 2121 // 2122 + #if defined(_M_AMD64) 2123 + 2124 + FORCEINLINE 2125 + VOID 2126 + RtlFillMemoryUlong( 2127 + _Out_writes_bytes_all_(Length) PVOID Destination, 2128 + _In_ SIZE_T Length, 2129 + _In_ ULONG Pattern) 2130 + { 2131 + PULONG Address = (PULONG)Destination; 2132 + if ((Length /= 4) != 0) { 2133 + if (((ULONG64)Address & 4) != 0) { 2134 + *Address = Pattern; 2135 + if ((Length -= 1) == 0) { 2136 + return; 2137 + } 2138 + Address += 1; 2139 + } 2140 + __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2); 2141 + if ((Length & 1) != 0) Address[Length - 1] = Pattern; 2142 + } 2143 + return; 2144 + } 2145 + 2146 + #define RtlFillMemoryUlonglong(Destination, Length, Pattern) \ 2147 + __stosq((PULONG64)(Destination), Pattern, (Length) / 8) 2148 + 2149 + #else 2150 + 2122 2151 NTSYSAPI 2123 2152 VOID 2124 2153 NTAPI 2125 2154 RtlFillMemoryUlong( 2126 - _In_ PVOID Destination, 2155 + _Out_writes_bytes_all_(Length) PVOID Destination, 2127 2156 _In_ SIZE_T Length, 2128 - _In_ ULONG Fill 2157 + _In_ ULONG Pattern 2129 2158 ); 2130 2159 2131 2160 NTSYSAPI ··· 2136 2165 _In_ SIZE_T Length, 2137 2166 _In_ ULONGLONG Pattern 2138 2167 ); 2168 + 2169 + #endif 2139 2170 2140 2171 NTSYSAPI 2141 2172 NTSTATUS
+3 -3
sdk/include/xdk/rtlfuncs.h
··· 2376 2376 VOID 2377 2377 NTAPI 2378 2378 RtlFillMemoryUlong( 2379 - OUT PVOID Destination, 2380 - IN SIZE_T Length, 2381 - IN ULONG Pattern); 2379 + _Out_writes_bytes_all_(Length) PVOID Destination, 2380 + _In_ SIZE_T Length, 2381 + _In_ ULONG Pattern); 2382 2382 2383 2383 NTSYSAPI 2384 2384 VOID
+3 -2
sdk/lib/rtl/mem.c
··· 92 92 } 93 93 94 94 95 - 95 + #ifndef _M_AMD64 96 96 /* 97 97 * @implemented 98 98 */ ··· 131 131 Count--; 132 132 } 133 133 } 134 - #endif 134 + #endif // _WIN64 135 + #endif // _M_AMD64 135 136 136 137 #undef RtlMoveMemory 137 138 /*