Erik de Castro Lopo : ntdll: Win64 fix for get_pointer_obfuscator.

Alexandre Julliard julliard at winehq.org
Fri Apr 25 08:10:57 CDT 2008


Module: wine
Branch: master
Commit: eba704b8bb756a91c455483a48d2e3bc30ec15c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eba704b8bb756a91c455483a48d2e3bc30ec15c1

Author: Erik de Castro Lopo <mle+win at mega-nerd.com>
Date:   Fri Apr 25 11:54:30 2008 +1000

ntdll: Win64 fix for get_pointer_obfuscator.

---

 dlls/ntdll/rtl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
index 1390c64..a4d1dac 100644
--- a/dlls/ntdll/rtl.c
+++ b/dlls/ntdll/rtl.c
@@ -904,10 +904,10 @@ static DWORD_PTR get_pointer_obfuscator( void )
         rand = RtlUniform( &seed );
 
         /* handle 64bit pointers */
-        rand ^= RtlUniform( &seed ) << ((sizeof (DWORD_PTR) - sizeof (ULONG))*8);
+        rand ^= (ULONG_PTR)RtlUniform( &seed ) << ((sizeof (DWORD_PTR) - sizeof (ULONG))*8);
 
         /* set the high bits so dereferencing obfuscated pointers will (usually) crash */
-        rand |= 0xc0000000 << ((sizeof (DWORD_PTR) - sizeof (ULONG))*8);
+        rand |= (ULONG_PTR)0xc0000000 << ((sizeof (DWORD_PTR) - sizeof (ULONG))*8);
 
         interlocked_cmpxchg_ptr( (void**) &pointer_obfuscator, (void*) rand, NULL );
     }




More information about the wine-cvs mailing list