Closer
git-svn-id: file:///home/svn/framework3/trunk@5317 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
cad23e7977
commit
be156ef668
|
@ -171,21 +171,22 @@ end
|
||||||
def self.win32_dev_null
|
def self.win32_dev_null
|
||||||
begin
|
begin
|
||||||
@@k32 ||= DL.dlopen("kernel32.dll")
|
@@k32 ||= DL.dlopen("kernel32.dll")
|
||||||
crt = @@k32['CreateFile', 'LPPPLPLL']
|
crt = @@k32['CreateFile', 'LPPLLLLL']
|
||||||
|
|
||||||
hnd = crt.call(
|
hnd, rs = crt.call(
|
||||||
Rex::Text.to_unicode("NUL").to_ptr,
|
Rex::Text.to_unicode("NUL\x00").to_ptr,
|
||||||
[GENERIC_READ | GENERIC_WRITE].pack("L"),
|
[GENERIC_READ | GENERIC_WRITE].pack("L"),
|
||||||
[FILE_SHARE_READ | FILE_SHARE_WRITE].pack("L"),
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
0,
|
0,
|
||||||
[OPEN_EXISTING].pack("L"),
|
OPEN_EXISTING,
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
p hnd
|
p hnd
|
||||||
hnd[0]
|
p rs
|
||||||
|
|
||||||
|
hnd
|
||||||
rescue ::Exception
|
rescue ::Exception
|
||||||
raise $!
|
raise $!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue