lib/win32/security/sid.rb in win32-security-0.3.0 vs lib/win32/security/sid.rb in win32-security-0.3.1
- old
+ new
@@ -181,10 +181,16 @@
# Win32::Security::SID.new("\001\000\000\000\000\000\001\000\000\000\000")
#
def initialize(account=nil, host=Socket.gethostname)
if account.nil?
begin
- ptoken = FFI::MemoryPointer.new(:uintptr_t)
+ if RUBY_PLATFORM == 'java' && ENV_JAVA['sun.arch.data.model'] == '64'
+ ptr_type = :ulong_long
+ else
+ ptr_type = :uintptr_t
+ end
+
+ ptoken = FFI::MemoryPointer.new(ptr_type)
# Try the thread token first, default to the process token.
bool = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, true, ptoken)
if !bool && FFI.errno != ERROR_NO_TOKEN