Daniel Berger
2010-Dec-02 15:19 UTC
[Win32utils-devel] Fwd: [win32utils-help][95414] RE: EventLog.open("Application") fails
I haven''t had the chance to dig into this yet, but I suspect a language/code page issue. Regards, Dan ---------- Forwarded message ---------- From: Little Snake <noreply at rubyforge.org> Date: Thu, Dec 2, 2010 at 8:06 AM Subject: [win32utils-help][95414] RE: EventLog.open("Application") fails To: noreply at rubyforge.org Read and respond to this message at: http://rubyforge.org/forum/message.php?msg_id=95414 By: Little Snake Hi, The OS is Windows XP (polish language version) with service pack 3 the ruby version is: ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] (the latest from the repository) as shown above it is version for cygwin (ver. 1.7.7-1). As I looked at the problem, I''ve traced it to windows-pr eventlog.rb line 33 where the OpenEventLog function is created, and then to API::initialize in windows-api api.rb line 316 (which I''m sure, is obvious for you) and there I was stuck, for the next step was win32-api api.c file which I''d rather not analyze myself at the moment ? I''m too much of a noob at the area :-(. But I run the test program for win32-api and surprise: it failed: $ ruby test_win32_api.rb Loaded suite test_win32_api Started F.....F........... ?1) Failure: test_call(TC_Win32_API) [test_win32_api.rb:37]: <"\lib\ruby\gems\1.8\gems\win32-api-1.4.6\test"> expected but was <"C:\cygwin\lib\ruby\gems\1.8\gems\win32-api-1.4.6\test">. diff: - \lib\ruby\gems\1.8\gems\win32-api-1.4.6\test + C:\cygwin\lib\ruby\gems\1.8\gems\win32-api-1.4.6\test ? +++++++++ ?2) Failure: test_constructor_expected_failures(TC_Win32_API) [test_win32_api.rb:95]: <Win32::API::LoadLibraryError> exception expected but was Class: <Win32::API::Error> Message: <"Attempt to format message failed (error = ''1815'')"> ---Backtrace--- test_win32_api.rb:95:in `initialize'' test_win32_api.rb:95:in `new'' test_win32_api.rb:95:in `test_constructor_expected_failures'' test_win32_api.rb:95:in `test_constructor_expected_failures'' --------------- Finished in 0.103 seconds. 18 tests, 40 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 88.8889% passed The first failure is obvious and irrelevant, but the second ? To double check I installed another instance of ruby from rubyinstaller for windows (the two instances do not interfere). The version according to ruby -v is: ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32] The result of the same program was slightly different, but again it was a failure: C:/prg/Ruby187/lib/ruby/gems/1.8/gems/windows-api-0.4.0/lib/windows/api.rb:336:in `initialize'': Attempt to format message failed (error = ''1815'') (Win32::API::Error) ? ? ? ?from C:/prg/Ruby187/lib/ruby/gems/1.8/gems/windows-api-0.4.0/lib/windows /api.rb:336:in `new'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/gems/1.8/gems/windows-api-0.4.0/lib/windows /api.rb:336:in `initialize'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/gems/1.8/gems/windows-pr-1.1.2/lib/windows/ eventlog.rb:39:in `new'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/gems/1.8/gems/windows-pr-1.1.2/lib/windows/ eventlog.rb:39 ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/gems/1.8/gems/win32-eventlog-0.5.2/lib/win3 2/eventlog.rb:2 ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'' ? ? ? ?from wlogex.rb:4 Then again ruby test_win32_api.rb C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error'': Could not find RubyGem test-unit (>= 0) (Gem::LoadError) ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'' ? ? ? ?from C:/prg/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'' ? ? ? ?from test_win32_api.rb:8 C:\prg\Ruby187\lib\ruby\gems\1.8\gems\win32-api-1.4.6-x86-mingw32\test>ruby test_win32_api.rb Loaded suite test_win32_api Started ......F........... ?1) Failure: test_constructor_expected_failures(TC_Win32_API) [test_win32_api.rb:95]: <Win32::API::LoadLibraryError> exception expected but was Class: <Win32::API::Error> Message: <"Attempt to format message failed (error = ''1815'')"> ---Backtrace--- test_win32_api.rb:95:in `initialize'' test_win32_api.rb:95:in `new'' test_win32_api.rb:95:in `test_constructor_expected_failures'' test_win32_api.rb:95:in `test_constructor_expected_failures'' --------------- Finished in 0.078066 seconds. 18 tests, 40 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 94.4444% passed And again the "Attempt to format message failed? error. I would be very gratefull for any help in resolving the issue. ?What I dreamed for was a nice script checking eventlogs on a number of windows servers, and I really long for such a thing ;-). Thank you for your time. Little Snake ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to RubyForge and visit: http://rubyforge.org/forum/monitor.php?forum_id=320&group_id=85&stop=1