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
|
||||
begin
|
||||
@@k32 ||= DL.dlopen("kernel32.dll")
|
||||
crt = @@k32['CreateFile', 'LPPPLPLL']
|
||||
crt = @@k32['CreateFile', 'LPPLLLLL']
|
||||
|
||||
hnd = crt.call(
|
||||
Rex::Text.to_unicode("NUL").to_ptr,
|
||||
hnd, rs = crt.call(
|
||||
Rex::Text.to_unicode("NUL\x00").to_ptr,
|
||||
[GENERIC_READ | GENERIC_WRITE].pack("L"),
|
||||
[FILE_SHARE_READ | FILE_SHARE_WRITE].pack("L"),
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
0,
|
||||
[OPEN_EXISTING].pack("L"),
|
||||
OPEN_EXISTING,
|
||||
0,
|
||||
0
|
||||
)
|
||||
|
||||
p hnd
|
||||
hnd[0]
|
||||
p rs
|
||||
|
||||
hnd
|
||||
rescue ::Exception
|
||||
raise $!
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue