mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32/resolv.rb: check pointer size
* ext/win32/lib/win32/resolv.rb: check pointer size first, NT if it is larger than 4 as Windows 9X are 32-bit mode only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f5a841881
commit
486f3f4270
1 changed files with 7 additions and 5 deletions
|
@ -35,14 +35,16 @@ module Win32
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
kernel32 = Module.new do
|
nt = Module.new do
|
||||||
|
break true if [nil].pack("p").size > 4
|
||||||
extend Importer
|
extend Importer
|
||||||
dlload "kernel32"
|
dlload "kernel32"
|
||||||
|
getv = extern "int GetVersionExA(void *)", :stdcall
|
||||||
|
info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
|
||||||
|
getv.call(info)
|
||||||
|
break info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
|
||||||
end
|
end
|
||||||
getv = kernel32.extern "int GetVersionExA(void *)", :stdcall
|
if nt
|
||||||
info = [ 148, 0, 0, 0, 0 ].pack('V5') + "\0" * 128
|
|
||||||
getv.call(info)
|
|
||||||
if info.unpack('V5')[4] == 2 # VER_PLATFORM_WIN32_NT
|
|
||||||
#====================================================================
|
#====================================================================
|
||||||
# Windows NT
|
# Windows NT
|
||||||
#====================================================================
|
#====================================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue