e$B$3$s$P$s$oe(B
test_win32ole_method.rbe$B$Ne(Btest_offset_vtble$B$G4|BT$9$k%*%U%;%C%H$,e(B64e$B%S%C%H4D6-$@$H0[$J$k$h$&$G$9!#e(B
e$B<!$N%F%9%[email protected]$7$^$9!#e(B
t = WIN32OLE_TYPE.new(“Microsoft Shell Controls And Automation”,
“Shell”)
assert_equal(0, WIN32OLE_METHOD.new(t, ‘QueryInterface’).offset_vtbl)
assert_equal(8, WIN32OLE_METHOD.new(t, ‘AddRef’).offset_vtbl)
assert_equal(16, WIN32OLE_METHOD.new(t, ‘Release’).offset_vtbl)
assert_equal(24, WIN32OLE_METHOD.new(t, ‘GetTypeInfoCount’).offset_vtbl)
assert_equal(32, WIN32OLE_METHOD.new(t, ‘GetTypeInfo’).offset_vtbl)
assert_equal(40, WIN32OLE_METHOD.new(t, ‘GetIDsOfNames’).offset_vtbl)
assert_equal(48, WIN32OLE_METHOD.new(t, ‘invoke’).offset_vtbl)
e$B=uED$G$9!#e(B
On Thu, Jun 24, 2010 at 01:27:29AM +0900, kuwamoto shintaro wrote:
e$B<!$N%F%9%[email protected]$7$^$9!#e(B
t = WIN32OLE_TYPE.new(“Microsoft Shell Controls And Automation”, “Shell”)
assert_equal(0, WIN32OLE_METHOD.new(t, ‘QueryInterface’).offset_vtbl)
assert_equal(8, WIN32OLE_METHOD.new(t, ‘AddRef’).offset_vtbl)
assert_equal(16, WIN32OLE_METHOD.new(t, ‘Release’).offset_vtbl)
assert_equal(24, WIN32OLE_METHOD.new(t, ‘GetTypeInfoCount’).offset_vtbl)
assert_equal(32, WIN32OLE_METHOD.new(t, ‘GetTypeInfo’).offset_vtbl)
assert_equal(40, WIN32OLE_METHOD.new(t, ‘GetIDsOfNames’).offset_vtbl)
assert_equal(48, WIN32OLE_METHOD.new(t, ‘invoke’).offset_vtbl)
e$B>pJs$"$j$,$H$&$4$6$$$^$9!#e(B
e$B$H$3$m$G!“e(B64bit Windows e$B$+e(B 32bit Windows e$B$+e(B Ruby
e$B$+$iF0E*$K8+J,$1$kJ}K!e(B
e$B$C$F2?$+$”$k$s$G$7$g$&$+!)e(B > e$B<1<T$NJ}e(B
e$B=uEDe(B e$B2m5*e(B
e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
In message “[ruby-dev:41712] Re: WIN32OLE_METHOD offset_vtbl”
on Jun.24,2010 20:09:17, [email protected] wrote:
e$B$H$3$m$G!“e(B64bit Windows e$B$+e(B 32bit Windows e$B$+e(B Ruby e$B$+$iF0E*$K8+J,$1$kJ}K!e(B
e$B$C$F2?$+$”$k$s$G$7$g$&$+!)e(B > e$B<1<T$NJ}e(B
e$B$($($H!"e(BWindowse$B$r8+J,$1$?$$$N$+!“e(BRubye$B$r8+J,$1$?$$$N$+!”$I$C$Ae(B
e$B$G$7$g$&e(B?
e$B$&!<$s!"8@MU$,Fq$7$$$G$9$M!#e(B
(a)
32bite$B%P%$%J%jHGe(BRubye$B$r;H$C$F!“<B9T4D6-$G$”$ke(BWindowse$B$,e(B32bit
e$B$G$“$k$+e(B64bite$B$G$”$k$+$rCN$j$?$$e(B
(b)
64bite$B%P%$%J%jHGe(BRubye$B$r;H$C$F!“<B9T4D6-$G$”$ke(BWindowse$B$,e(B32bit
e$B$G$“$k$+e(B64bite$B$G$”$k$+$rCN$j$?$$e(B
(c)
e$BC1$K:#<B9T$7$F$$$ke(BRubye$B$,e(B32bite$B%P%$%J%j$G$“$k$+e(B64bite$B%P%$e(B
e$B%J%j$G$”$k$+$rCN$j$?$$e(B
e$B$N$I$l$G$7$g$&e(B?
e$B$?$V$se(B(c)e$B$@$H;W$&$N$GEz$($F$$/$H!"e(BRUBY_PLATFORMe$B$GH=Dj$7$F$/e(B
e$B$@$5$$!#e(B64bite$B%P%$%J%j$Oe(B-mswin64e$B$G$9!#e(B
e$B8+$?$3$H$J$$$G$9$1$I$b$7e(Bmingwe$B$G2DG=$@$C$?$H$7$?$i!"e(B*-mingw64
e$B$K$J$k$H;W$$$^$9!#e(B
e$B$=$l$G$O!#e(B
e$B5WJ]$G$9!#e(B
e$BA08e4X78$rGD0.$7$F$J$$$N$G$O$:$7$F$$$k$+$b$7$l$J$$$,!"e(B
2010/6/24 U.Nakamura [email protected]:
(a) 32bite$B%P%$%J%jHGe(BRubye$B$r;H$C$F!“<B9T4D6-$G$”$ke(BWindowse$B$,e(B32bit
e$B$G$“$k$+e(B64bite$B$G$”$k$+$rCN$j$?$$e(B
e$B<j85$K4D6-$,$J$$$N$G3NG’$G$-$J$$$1$I!“e(B%windir%\SysWOW64
e$B$,$”$ke(B
e$B$+$I$&$+$G8+J,$1$i$l$k$H;W$o$l$k!#e(B
ruby
e$B$+$i$G$O$J$/$F!"e(BCe$B8@8l$+$i$C$F$$$&$N$J$i!"e(BIsWow64Process()
e$B$,;H$($^$9!#e(B
IsWow64Process function (wow64apiset.h) - Win32 apps | Microsoft Learn
e$B=uED$G$9!#e(B
On Thu, Jun 24, 2010 at 08:26:30PM +0900, U.Nakamura wrote:
e$B$G$"$k$+e(B64bite$B$G$"$k$+$rCN$j$?$$e(B
© e$BC1$K:#<B9T$7$F$$$ke(BRubye$B$,e(B32bite$B%P%$%J%j$G$"$k$+e(B64bite$B%P%$e(B
e$B%J%j$G$"$k$+$rCN$j$?$$e(B
e$B$N$I$l$G$7$g$&e(B?
e$B$?$V$se(B©e$B$@$H;W$&$N$GEz$($F$$/$H!"e(BRUBY_PLATFORMe$B$GH=Dj$7$F$/e(B
e$B$@$5$$!#e(B64bite$B%P%$%J%j$Oe(B-mswin64e$B$G$9!#e(B
e$B8+$?$3$H$J$$$G$9$1$I$b$7e(Bmingwe$B$G2DG=$@$C$?$H$7$?$i!"e(B*-mingw64
e$B$K$J$k$H;W$$$^$9!#e(B
e$B$I$A$i$+$H$$$&$He(B (a)
e$B$N$D$b$je(B(Windowse$B$r8+J,$1$?$$e(B)e$B$G$7$?!#e(B
e$B$=$&$$$&$3$H$O5$$K$7$J$/$F$h$/$F!"e(B
Windows e$B$,e(B 64 bit - Ruby e$B$be(B 64bit
Windows e$B$,e(B 32 bit - Ruby e$B$be(B 32bit
e$B$H$$$&$N$rA0Ds$K$7$F$$$$$s$G$7$g$&$+!)e(B
(b)e$B$OA4$/9M$($F$^$;$s$G$7$?!#e(B
e$B=uEDe(B
artone$B$G$9!#e(B
e$B$=$&$$$&$3$H$O5$$K$7$J$/$F$h$/$F!“e(B
Windows e$B$,e(B 64 bit - Ruby e$B$be(B 64bit
Windows e$B$,e(B 32 bit - Ruby e$B$be(B 32bit
e$B$H$$$&$N$rA0Ds$K$7$F$$$$$s$G$7$g$&$+!)e(B
e$B$=$l$O!”$H$F$b:$$j$^$9!#$$=$i$/!"e(BWin64e$B$rMxMQ$7$F$$$k?M$N$[$H$s$I$O!"e(B
SQLServere$B$He(BIISe$B!J$H$=$N>e$GF0$/e(B.NET
Frameworke$B!K$@$1e(B64e$B%S%C%H$GF0$+$7$?$$e(B
e$B$N$G$O!#e(B
e$B0J2<$NJ}K!$G8+J,$1$i$l$^$9!#e(B
1.8e$B$G$bF0$/$h$&$K!"J8;z$N@Z$j=P$7$G$O$J$/J8;zNs$N@Z$j=P$7$rMxMQ$7$F$$$^e(B
e$B$9!#!Je(B1.9.1p378 e$B$He(B 1.8.7p249e$B$G3NG’!Ke(B
require ‘Win32API’
get_current_process = Win32API.new(‘kernel32’, ‘GetCurrentProcess’, nil,
‘i’)
handle = get_current_process.call
is_wow64 = false
begin
isWow64 = Win32API.new(‘Kernel32’, ‘IsWow64Process’, [‘i’, ‘p’], ‘i’)
bool = ’ ’
if isWow64.call(handle, bool)
is_wow64 = bool[0,1] == “\x01”
end
end
p is_wow64
–
arton [email protected]
artone$B$G$9!#e(B
Windows 2000 e$B$H$+!"e(BWindows XP SP1 e$B$K$Oe(B IsWow64Process e$B$O$J$$$N$G!“e(B
Win32API.new(‘Kernel32’, ‘IsWow64Process’, [‘i’, ‘p’], ‘i’) e$B$,<:GT$7$?$H$-$NBP=he(B
e$B$bF~$l$J$$$H!#e(B(e$B6qBNE*$K$I$&$d$k$N$+$OCN$i$J$$$1$Ie(B)
e$B$”!“e(Bbegine$B$@$1=q$$$Fe(Brescuee$B$rK:$l$F$$$^$7$?!#e(B
e$B$”$H!“e(B0e$B$Oe(Bfalsee$B$G$O$J$$$N$G!”@5$7$/$O0J2<$N$h$&$K$J$j$^$9!#e(B
require ‘Win32API’
get_current_process = Win32API.new(‘kernel32’, ‘GetCurrentProcess’, nil,
‘i’)
handle = get_current_process.call
is_wow64 = false
begin
isWow64 = Win32API.new(‘Kernel32’, ‘IsWow64Process’, [‘i’, ‘p’], ‘i’)
bool = “\0\0\0\0”
if isWow64.call(handle, bool) != 0
is_wow64 = bool[0,1] != “\0\0\0\0”
end
rescue RuntimeError
no IsWow64Process
end
p is_wow64
e$B$“$H$O!“e(BRUBY_PLATFORMe$B$H$NAH$_9g$o$;$Ge(B
PLATFORMe$B$,e(B64e$B$G$”$l$P!”$=$l$,F0$$$F$$$k$N$@$+$iEvA3e(B64e$B$G!"$=$&$G$J$/>e5-$Ne(B
e$BH=Dj$Ge(Bis_wow64e$B$,e(Btruee$B$K$J$l$Pe(BWin64e$B$Ge(BRubye$B$Oe(B32e$B!"e(Bis_wow64e$B$,e(Bfalsee$B!Je(BAPIe$B$,L$Dje(B
e$B5A$N>l9g$r4^$a!K$J$ie(Bwin32e$B!#e(B
–
arton [email protected]
artone$B$G$9!#e(B
e$B$A$g$C$H=$@5e(B
- is_wow64 = bool[0,1] != “\0\0\0\0”
- is_wow64 = bool != “\0\0\0\0”
–
arton [email protected]
2010/6/24 arton [email protected]:
1.8e$B$G$bF0$/$h$&$K!"J8;z$N@Z$j=P$7$G$O$J$/J8;zNs$N@Z$j=P$7$rMxMQ$7$F$$$^e(B
if isWow64.call(handle, bool)
is_wow64 = bool[0,1] == “\x01”
end
end
p is_wow64
Windows 2000 e$B$H$+!"e(BWindows XP SP1 e$B$K$Oe(B IsWow64Process
e$B$O$J$$$N$G!"e(B
Win32API.new(‘Kernel32’, ‘IsWow64Process’, [‘i’, ‘p’], ‘i’)
e$B$,<:GT$7$?$H$-$NBP=he(B
e$B$bF~$l$J$$$H!#e(B(e$B6qBNE*$K$I$&$d$k$N$+$OCN$i$J$$$1$Ie(B)
e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
In message “[ruby-dev:41714] Re: WIN32OLE_METHOD offset_vtbl”
on Jun.24,2010 21:39:56, [email protected] wrote:
| e$B$I$A$i$+$H$$$&$He(B (a) e$B$N$D$b$je(B(Windowse$B$r8+J,$1$?$$e(B)e$B$G$7$?!#e(B
e$B$G$Oe(Bartone$B$5$s$N=q$$$F2<$5$C$?J}K!$G!#e(B
| e$B$=$&$$$&$3$H$O5$$K$7$J$/$F$h$/$F!"e(B
| Windows e$B$,e(B 64 bit - Ruby e$B$be(B 64bit
| Windows e$B$,e(B 32 bit - Ruby e$B$be(B 32bit
| e$B$H$$$&$N$rA0Ds$K$7$F$$$$$s$G$7$g$&$+!)e(B
e$BIaDL$N?M$O$?$V$se(B64bit Windowse$B$G$be(B32bit
Rubye$B$r;H$&$H;W$$$^$9!#e(B
| (b)e$B$OA4$/9M$($F$^$;$s$G$7$?!#e(B
(b)e$B$NEz$($O!Ve(B64bite$B$K7h$^$C$F$k$8$c$s!W$G$9$Me(B ^^;
e$B$=$l$G$O!#e(B
e$B=uED$G$9!#e(B
On Fri, Jun 25, 2010 at 01:26:32AM +0900, arton wrote:
e$B$"$H$O!“e(BRUBY_PLATFORMe$B$H$NAH$_9g$o$;$Ge(B
PLATFORMe$B$,e(B64e$B$G$”$l$P!"$=$l$,F0$$$F$$$k$N$@$+$iEvA3e(B64e$B$G!"$=$&$G$J$/>e5-$Ne(B
e$BH=Dj$Ge(Bis_wow64e$B$,e(Btruee$B$K$J$l$Pe(BWin64e$B$Ge(BRubye$B$Oe(B32e$B!"e(Bis_wow64e$B$,e(Bfalsee$B!Je(BAPIe$B$,L$Dje(B
e$B5A$N>l9g$r4^$a!K$J$ie(Bwin32e$B!#e(B
e$B$"$j$,$H$&$4$6$$$^$7$?!#e(B
test_win32ole_method.rb e$B$Ne(B test_offset_vtbl
e$B$NCf$G!"$3$NH=Dj$r$7$F$+$i!“e(B
e$B%F%9%H$9$k$h$&$K=$@5$7$F%3%_%C%H$7$?$N$G$9$,!”$3$l$Ge(B 64bit
e$B4D6-$G$be(B
e$B%F%9%HDL$k$G$7$g$&$+!)e(B > 64bit e$B$N4D6-$r$*;}$A$NJ}!9e(B
e$B=uEDe(B
e$B5WJ]$G$9!#e(B
2010/6/27 kuwamoto shintaro [email protected]:
e$B$=$l$H!"$3$A$i$N4D6-$@$He(BRUBY_PLATFORMe$B$,e(Bx64-mswin64_90e$B$K$J$k$N$Ge(B /win64$/ =~ RUBY_PLATFORMe$B$@$H%@%a$G$7$?!#e(B
[nil].pack(‘p’).length == 4 e$B$,e(B true e$B$+e(B false e$B$+$Ge(B
32bit ruby e$B$+e(B 64bit ruby e$B$+$re(B
e$B6hJL$9$k$H$$$&$N$O$I$&$G$7$g$&$+!)e(B
e$B$3$s$K$A$o!#e(B
e$B$9$_$^$;$s!#$O$8$a$NEj9F$G@bL@$,B-$j$J$+$C$?$G$9!#e(B
OSe$B$,e(Bwin64e$B4D6-2<$Ge(Bwow64e$B%W%m%;%9$J$ie(B32bite$B%W%m%;%9$HF1$8%*%U%;%C%H$K$J$j$^$9!#e(B
32bitOS-32bit process: offset24
64bitOS-32bit process(wow64): offset24
64bitOS-64bit process: offset48
e$B$G$9$N$G!"$3$N%F%9%H$N>l9g$Oe(BRUBY_PLATFORMe$B$Ke(Bwin64e$B$,4^$^$l$k$+$I$&$+$@$1$Ge(Bwow64e$BFCM-$NLdBj$,L5$1$l$PH=CG$,IU$/$H;W$$$^$9!#e(B
e$B$=$l$H!"$3$A$i$N4D6-$@$He(BRUBY_PLATFORMe$B$,e(Bx64-mswin64_90e$B$K$J$k$N$Ge(B
/win64$/ =~ RUBY_PLATFORMe$B$@$H%@%a$G$7$?!#e(B
2010e$BG/e(B6e$B7ne(B26e$BF|e(B8:17 Masaki S.
[email protected]:
test_win32ole_method.rb e$B$Ne(B test_offset_vtbl e$B$NCf$G!"$3$NH=Dj$r$7$F$+$i!“e(B
e$B%F%9%H$9$k$h$&$K=$@5$7$F%3%_%C%H$7$?$N$G$9$,!”$3$l$Ge(B 64bit e$B4D6-$G$be(B
e$B%F%9%HDL$k$G$7$g$&$+!)e(B > 64bit e$B$N4D6-$r$*;}$A$NJ}!9e(B
e$B=uEDe(B
kuwamoto
e$B=uED$G$9!#e(B
On Sun, Jun 27, 2010 at 06:28:33PM +0900, kuwamoto shintaro wrote:
OSe$B$,e(Bwin64e$B4D6-2<$Ge(Bwow64e$B%W%m%;%9$J$ie(B32bite$B%W%m%;%9$HF1$8%*%U%;%C%H$K$J$j$^$9!#e(B
32bitOS-32bit process: offset24
64bitOS-32bit process(wow64): offset24
64bitOS-64bit process: offset48
e$B$J$k$[$I!"$=$&$$$&$3$H$J$s$G$9$+!#e(B
64bitOS-32bit process(wow64) e$B$O!"$F$C$-$je(B 48
e$B$K$J$k$b$N$H4*0c$$$7$F$^$7$?!#e(B
e$B$=$l$H!"$3$A$i$N4D6-$@$He(BRUBY_PLATFORMe$B$,e(Bx64-mswin64_90e$B$K$J$k$N$Ge(B /win64$/ =~ RUBY_PLATFORMe$B$@$H%@%a$G$7$?!#e(B
/win64/ =~ RUBY_PLATFORM
e$B$G%A%’%C%/$9$k$h$&$K$7$F$_$^$7$?!#e(B
e$B$I$&$G$7$g$&$+!)e(B
e$B=uEDe(B
e$B=uED$G$9!#e(B
On Mon, Jun 28, 2010 at 09:08:27PM +0900, U.Nakamura wrote:
e$B$O$C$-$jDs<($7$F$$$$?J}$,$$$$$h$&$J5$$,$7$F$-$?$N$GL@8@$7$Ae(B
e$B$c$&$H!"e(B
/mswin64|mingw64/ =~ RUBY_PLATFORM
e$B$,D94|E$K9M$($F$b$h$m$7$$$N$G$O$J$$$+$H;W$$$^$9!#e(B
e$B$=$N$h$&$K$7$F$*$-$^$7$?!#e(B
e$B=uEDe(B
e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B
In message “[ruby-dev:41755] Re: WIN32OLE_METHOD offset_vtbl”
on Jun.28,2010 20:44:36, [email protected] wrote:
/win64/ =~ RUBY_PLATFORM
e$B$G%A%'%C%/$9$k$h$&$K$7$F$_$^$7$?!#e(B
e$B$I$&$G$7$g$&$+!)e(B
e$B$O$C$-$jDs<($7$F$$$$?J}$,$$$$$h$&$J5$$,$7$F$-$?$N$GL@8@$7$Ae(B
e$B$c$&$H!"e(B
/mswin64|mingw64/ =~ RUBY_PLATFORM
e$B$,D94|E$K9M$($F$b$h$m$7$$$N$G$O$J$$$+$H;W$$$^$9!#e(B
mse$B$NM-L5$Oe(B…
e$B$^$"!"e(Bdarwin64e$B$H$+$$$&e(Bplatforme$B$,>-Mh8=$l$k$H$7e(B
e$B$F$b!"e(Bwin32olee$B$J$iF’$`$3$H$O$J$$$H$$$($P$J$$$+$i$$$$$N$+$Je(B
e$B$=$l$G$O!#e(B