mirror of
https://github.com/reactos/reactos.git
synced 2026-06-04 10:20:48 +08:00
[UCRT] Properly implement __crt_fast_encode/decode_pointer
This commit is contained in:
@@ -166,18 +166,20 @@ extern char __ImageBase;
|
||||
|
||||
template<typename T>
|
||||
__forceinline
|
||||
T __crt_fast_encode_pointer(T Ptr)
|
||||
T __crt_fast_encode_pointer(T ptr)
|
||||
{
|
||||
// FIXME: use cookie
|
||||
return Ptr;
|
||||
union { T Ptr; uintptr_t Uint; } u = { ptr };
|
||||
u.Uint ^= __security_cookie;
|
||||
return u.Ptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
__forceinline
|
||||
T __crt_fast_decode_pointer(T Ptr)
|
||||
T __crt_fast_decode_pointer(T ptr)
|
||||
{
|
||||
// FIXME: use cookie
|
||||
return Ptr;
|
||||
union { T Ptr; uintptr_t Uint; } u = { ptr };
|
||||
u.Uint ^= __security_cookie;
|
||||
return u.Ptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user