mirror of
https://github.com/reactos/reactos.git
synced 2025-03-01 03:45:16 +00:00
[UCRT] Properly implement __crt_fast_encode/decode_pointer
This commit is contained in:
parent
c1145f0c89
commit
a58b713a5e
1 changed files with 8 additions and 6 deletions
|
@ -166,18 +166,20 @@ extern char __ImageBase;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
__forceinline
|
__forceinline
|
||||||
T __crt_fast_encode_pointer(T Ptr)
|
T __crt_fast_encode_pointer(T ptr)
|
||||||
{
|
{
|
||||||
// FIXME: use cookie
|
union { T Ptr; uintptr_t Uint; } u = { ptr };
|
||||||
return Ptr;
|
u.Uint ^= __security_cookie;
|
||||||
|
return u.Ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
__forceinline
|
__forceinline
|
||||||
T __crt_fast_decode_pointer(T Ptr)
|
T __crt_fast_decode_pointer(T ptr)
|
||||||
{
|
{
|
||||||
// FIXME: use cookie
|
union { T Ptr; uintptr_t Uint; } u = { ptr };
|
||||||
return Ptr;
|
u.Uint ^= __security_cookie;
|
||||||
|
return u.Ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
Loading…
Reference in a new issue