git-svn-id: file:///home/svn/framework3/trunk@5317 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-01-22 05:27:23 +00:00
parent cad23e7977
commit be156ef668
1 changed files with 8 additions and 7 deletions

View File

@ -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