git-svn-id: file:///home/svn/framework3/trunk@5319 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2008-01-22 05:48:16 +00:00
parent 8ad5e6ce1e
commit 221b408c37
2 changed files with 15 additions and 18 deletions

View File

@ -171,11 +171,11 @@ end
def self.win32_dev_null
begin
@@k32 ||= DL.dlopen("kernel32.dll")
crt = @@k32['CreateFile', 'LPPLLLLL']
crt = @@k32['CreateFile', 'LPLLLLLL']
hnd, rs = crt.call(
("NUL\x00").to_ptr,
[GENERIC_READ | GENERIC_WRITE].pack("L"),
-GENERIC_READ | -GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
0,
OPEN_EXISTING,
@ -183,9 +183,6 @@ def self.win32_dev_null
0
)
p hnd
p rs
hnd
rescue ::Exception
raise $!

26
msfgui
View File

@ -78,28 +78,28 @@ class FakeOut
end
if(not debug)
begin; $stdout.close; rescue; end
begin; $stderr.close; rescue; end
fake = FakeOut.new
$stdout = fake
$stderr = fake
end
if(Rex::Compat.is_windows)
nul = Rex::Compat.win32_dev_null()
Rex::Compat.win32_set_std_handle('stdout', nul)
Rex::Compat.win32_set_std_handle('stderr', nul)
Rex::Compat.win32_set_std_handle('stdin', nul)
# The following will crash rubyw.exe without the above code
GLib::Log.log("Gtk", GLib::Log::LEVEL_CRITICAL, "gtk + rubyw problems > /dev/null")
end
# Only treat super nasty Gtk errors as fatal
GLib::Log.set_fatal_mask("GLib", GLib::Log::LEVEL_ERROR)
GLib::Log.set_fatal_mask("Gtk", GLib::Log::LEVEL_ERROR)
GLib::Log.set_fatal_mask("Gdk", GLib::Log::LEVEL_ERROR)
GLib::Log.set_fatal_mask(nil, GLib::Log::LEVEL_ERROR)
end
GLib::Log.log("Gtk", GLib::Log::LEVEL_CRITICAL, "TESTING > /dev/null")
$stderr.puts "[*] Debugging mode is enabled"
# Language is English
ENV['LANG'] = 'C'
# Create the driver instance and run it.
Msf::Ui::Gtk2::Driver.new(opts).run