From noreply at rubyforge.org Tue Dec 5 00:15:46 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 5 Dec 2006 00:15:46 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Feature Requests-872 ] Port of Win32::Screenshot Message-ID: <20061205051547.59A9952416EF@rubyforge.org> Feature Requests item #872, was opened at 2004-09-05 20:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=872&group_id=85 Category: None Group: None >Status: Deleted >Resolution: Rejected Priority: 2 Submitted By: Daniel Berger (djberg96) >Assigned to: Nobody (None) Summary: Port of Win32::Screenshot Initial Comment: I think porting Petr ?mejkal's Win32::Screenshot Perl module would be nice. :) Dan ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2006-12-04 22:15 Message: Aslak Hellesoy has released his own version of Win32::Screenshot as its own project, so I'm dropping this. - Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=872&group_id=85 From djberg96 at gmail.com Thu Dec 7 12:08:24 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 7 Dec 2006 10:08:24 -0700 Subject: [Win32utils-devel] Fwd: win32-service problems with patch In-Reply-To: <45781AE8.8090109@systemware.com> References: <45781AE8.8090109@systemware.com> Message-ID: <6037b70c0612070908i70961edpdfb908e0c13f9485@mail.gmail.com> Got this today. Please take a look and let me know what you think. - Dan ---------- Forwarded message ---------- From: Kevin Burge Date: Dec 7, 2006 6:45 AM Subject: win32-service problems with patch To: djberg96 at gmail.com Hi Daniel, Thanks for win32-service. In the process of using it for running a reliable-msg (drb) server and clients, I had some issues with the process abnormally terminating, or just not responding. After much tweaking and playing with it, I think I have something that's reliable. Here are a summary of the changes: Logic changes: * now service_init is called before anything is actually done thread-wise (green or real). So, service_init needs to be fast, since it's done before the StartServiceCtrl stuff (SCM will be waiting). I may change this so that START_PENDINGs are sent while in service_init, but because that greatly complicated matters, and I was just trying to get something that WORKED first, the current code does not do this. * now the service terminates if service_init or service_main exit or raise exceptions. Problems I encountered or resolved: * Waiting for the ThreadGroup is not sufficient to make sure ALL threads have exited. Instead, I wait on Thread.list to == 1. I don't know that this was really necessary. * raising exceptions in service_init and service_main left the service running - required service_init and main to have rescue clauses to catch all exceptions AND NOT EXIT so that the SCM could still send the stop message, so that the threads would be cleaned up and etc. * ErrorStopService removed because it was abused - called when it didn't make sense. Instead, I explicitly put in error handling and set hStopEvent or set service status appropriately. Probably could still be better. * Waiting for hThread to exit AFTER closing hStopEvent (which might be waiting on hStopEvent) * the state SHOULD == RUNNING when service_main starts (I had a problem where it was 0). * EventHookHash was a global variable that Ruby didn't know about, so it was being garbage collected before the process terminated (especially when the ruby service control was trying to dispatch an event) * service_stop was never being called that I could tell - now I forcefully dispatch the event after the loop in the ruby green thread, before exiting. I didn't do anything to handle exceptions within the spawned green threads for the events dispatched. Not sure that anything needs to be done. I have not tried this code with any other win32-service app (rails, etc.) so I don't know how they'll work with this. The basic flow is now: Thread 1 Thread 2 "Green Thread" service_init start ThreadProc wait for hStart, or Thread 2 Exit Startup and set hStart wait for hStop start green thread wait for hStop wait for hStop && normal processing service_main wait for hStop wait for hStop && normal processing On exit: set hStop wait for hStop wait for hStop && normal processing wait for ruby threads wait for hStopCompleted schedule service_stop thread wait for ruby threads wait for hStopCompleted exit set hStopCompleted wait for hStopCompleted wait for Thred 2 to exit set SERVICE_STOPPED && exit close hStopEvent && exit http://www.systemware.com/ ? service_c.patch Index: lib/win32/service.c =================================================================== RCS file: /var/cvs/win32utils/win32utils/win32-service/lib/win32/service.c,v retrieving revision 1.67 diff -u -u -r1.67 service.c --- lib/win32/service.c 25 Nov 2006 16:58:41 -0000 1.67 +++ lib/win32/service.c 7 Dec 2006 13:28:27 -0000 @@ -14,6 +14,7 @@ static VALUE cDaemonError; static VALUE v_service_struct, v_service_status_struct; +static HANDLE hThread; static HANDLE hStartEvent; static HANDLE hStopEvent; static HANDLE hStopCompletedEvent; @@ -21,12 +22,6 @@ static DWORD dwServiceState; static TCHAR error[1024]; -static VALUE EventHookHash; -static VALUE thread_group; -static int cAdd; -static int cList; -static int cSize; - CRITICAL_SECTION csControlCode; // I happen to know from looking in the header file // that 0 is not a valid service control code @@ -39,7 +34,6 @@ static VALUE service_close(VALUE); void WINAPI Service_Main(DWORD dwArgc, LPTSTR *lpszArgv); void WINAPI Service_Ctrl(DWORD dwCtrlCode); -void ErrorStopService(); void SetTheServiceStatus(DWORD dwCurrentState,DWORD dwWin32ExitCode, DWORD dwCheckPoint, DWORD dwWaitHint); @@ -57,27 +51,27 @@ (LPHANDLER_FUNCTION)Service_Ctrl); if(ssh == (SERVICE_STATUS_HANDLE)0){ - ErrorStopService(); - rb_raise(cDaemonError,"RegisterServiceCtrlHandler failed"); - } - - // wait for sevice initialization - for(i=1;TRUE;i++) - { - if(WaitForSingleObject(hStartEvent, 1000) == WAIT_OBJECT_0) - break; - - SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000); + // no service to stop, no service handle to notify, + // nothing to do but exit + return; } // The service has started. SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0); + SetEvent(hStartEvent); + // Main loop for the service. while(WaitForSingleObject(hStopEvent, 1000) != WAIT_OBJECT_0) { } + // Main loop for the service. + while(WaitForSingleObject(hStopCompletedEvent, 1000) != WAIT_OBJECT_0) + { + OutputDebugString(TEXT("service_main: waiting for stop completed event\n")); + } + // Stop the service. SetTheServiceStatus(SERVICE_STOPPED, NO_ERROR, 0, 0); } @@ -97,10 +91,10 @@ return result; } -VALUE Ruby_Service_Ctrl() +VALUE Ruby_Service_Ctrl(VALUE self) { while (WaitForSingleObject(hStopEvent,0) == WAIT_TIMEOUT) - { + { __try { EnterCriticalSection(&csControlCode); @@ -108,20 +102,22 @@ // Check to see if anything interesting has been signaled if (waiting_control_code != IDLE_CONTROL_CODE) { - // if there is a code, create a ruby thread to deal with it - // this might be over engineering the solution, but I don't - // want to block Service_Ctrl longer than necessary and the - // critical section will block it. - VALUE val = rb_hash_aref(EventHookHash, INT2NUM(waiting_control_code)); - if(val!=Qnil) { - VALUE thread = rb_thread_create(Service_Event_Dispatch, (void*) val); - rb_funcall(thread_group, cAdd, 1, thread); + if (waiting_control_code != SERVICE_CONTROL_STOP) { + // if there is a code, create a ruby thread to deal with it + // this might be over engineering the solution, but I don't + // want to block Service_Ctrl longer than necessary and the + // critical section will block it. + VALUE EventHookHash = rb_ivar_get(self, rb_intern("@event_hooks")); + if (EventHookHash != Qnil) { + VALUE val = rb_hash_aref(EventHookHash, INT2NUM(waiting_control_code)); + if(val!=Qnil) { + VALUE thread = rb_thread_create(Service_Event_Dispatch, (void*) val); + } + } } - - // some seriously ugly flow control going on in here - if (waiting_control_code == SERVICE_CONTROL_STOP) + else { break; - + } waiting_control_code = IDLE_CONTROL_CODE; } } @@ -131,20 +127,19 @@ } // This is an ugly polling loop, be as polite as possible - rb_thread_polling(); - } - - for (;;) - { - VALUE list = rb_funcall(thread_group, cList, 0); - VALUE size = rb_funcall(list, cSize, 0); - if (NUM2INT(size) == 0) - break; - - // This is another ugly polling loop, be as polite as possible rb_thread_polling(); } - SetEvent(hStopCompletedEvent); + + // force service_stop call + { + VALUE EventHookHash = rb_ivar_get(self, rb_intern("@event_hooks")); + if (EventHookHash != Qnil) { + VALUE val = rb_hash_aref(EventHookHash, INT2NUM(SERVICE_CONTROL_STOP)); + if(val!=Qnil) { + VALUE thread = rb_thread_create(Service_Event_Dispatch, (void*) val); + } + } + } return Qnil; } @@ -198,16 +193,9 @@ if ((dwCtrlCode == SERVICE_CONTROL_STOP) || (dwCtrlCode == SERVICE_CONTROL_SHUTDOWN)) { - // how long should we give ruby to clean up? - // right now we give it forever :-) - while (WaitForSingleObject(hStopCompletedEvent, 500) == WAIT_TIMEOUT) - { - SetTheServiceStatus(dwState, NO_ERROR, 0, 0); + if (!SetEvent(hStopEvent)) { + SetTheServiceStatus(SERVICE_STOPPED, GetLastError(), 0, 0); } - - if (!SetEvent(hStopEvent)) - ErrorStopService(); - // Raise an error here? } } @@ -239,46 +227,82 @@ // Send status of the service to the Service Controller. if(!SetServiceStatus(ssh, &ss)){ - ErrorStopService(); + SetEvent(hStopEvent); } } -// Handle API errors or other problems by ending the service -void ErrorStopService(){ - - // If you have threads running, tell them to stop. Something went - // wrong, and you need to stop them so you can inform the SCM. - SetEvent(hStopEvent); - - // Stop the service. - SetTheServiceStatus(SERVICE_STOPPED, GetLastError(), 0, 0); -} - DWORD WINAPI ThreadProc(LPVOID lpParameter){ SERVICE_TABLE_ENTRY ste[] = {{TEXT(""),(LPSERVICE_MAIN_FUNCTION)Service_Main}, {NULL, NULL}}; if (!StartServiceCtrlDispatcher(ste)){ - ErrorStopService(); - strcpy(error,ErrorDescription(GetLastError())); - // Very questionable here, we should generate an event - // and be polling in a green thread for the event, but - // this really should not happen so here we go - rb_raise(cDaemonError,error); + // no service to step, no service handle, no ruby + // exceptions, just terminate thread + return 1; } return 0; } static VALUE daemon_allocate(VALUE klass){ - EventHookHash = rb_hash_new(); - - thread_group = rb_class_new_instance(0, 0, - rb_const_get(rb_cObject, rb_intern("ThreadGroup"))); return Data_Wrap_Struct(klass, 0, 0, 0); } +static VALUE +daemon_mainloop_protect(VALUE self) +{ + // Call service_main method + if(rb_respond_to(self,rb_intern("service_main"))){ + rb_funcall(self,rb_intern("service_main"),0); + } + + return self; +} + +static VALUE +daemon_mainloop_ensure(VALUE self) +{ + int i; + + // signal both the ruby thread and service_main thread to terminate + SetEvent(hStopEvent); + + // wait for ALL ruby threads to exit + + for(i=1;TRUE;i++) + { + VALUE list = rb_funcall(rb_cThread, rb_intern("list"), 0); + + { + char buf[80]; + sprintf(buf, "num_threads = %u\n", RARRAY(list)->len); + } + + if (RARRAY(list)->len <= 1) + break; + + // This is another ugly polling loop, be as polite as possible + rb_thread_polling(); + + SetTheServiceStatus(SERVICE_STOP_PENDING, 0, i, 1000); + } + + // just one ruby thread + SetEvent(hStopCompletedEvent); + + // wait for the thread to stop BEFORE we close the hStopEvent + // handle + WaitForSingleObject(hThread, INFINITE); + + // Close the event handle (who cares if it succeeds, and + // we may be cleaning up after an exception, so let's just + // let that exception fall through + CloseHandle(hStopEvent); + + return self; +} + /* * This is the method that actually puts your code into a loop and allows it * to run as a service. The code that is actually run while in the mainloop @@ -288,14 +312,19 @@ daemon_mainloop(VALUE self) { DWORD ThreadId; - HANDLE hThread; + HANDLE events[2]; + DWORD index; + VALUE result; + int status = 0; + VALUE EventHookHash; dwServiceState = 0; - // Save a couple symbols - cAdd = rb_intern("add"); - cList = rb_intern("list"); - cSize = rb_intern("size"); + // use a markable instance variable to prevent the garbage collector + // from freeing the hash before Ruby_Service_Ctrl exits, or just + // at any ole time while running the service + EventHookHash = rb_hash_new(); + rb_ivar_set(self, rb_intern("@event_hooks"), EventHookHash); // Event hooks if(rb_respond_to(self,rb_intern("service_stop"))){ @@ -358,11 +387,20 @@ } #endif + // calling init here so that init failures never even tries to + // start the service... of course that means that init methods + // must be very quick, because the SCM will be receiving no + // START_PENDING messages while init's running - I may fix this + // later + if(rb_respond_to(self,rb_intern("service_init"))){ + rb_funcall(self,rb_intern("service_init"),0); + OutputDebugString(TEXT("mainloop: called service init\n")); + } + // Create the event to signal the service to start. hStartEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if(hStartEvent == NULL){ strcpy(error,ErrorDescription(GetLastError())); - ErrorStopService(); rb_raise(cDaemonError,error); } @@ -370,7 +408,6 @@ hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if(hStopEvent == NULL){ strcpy(error,ErrorDescription(GetLastError())); - ErrorStopService(); rb_raise(cDaemonError,error); } @@ -378,47 +415,44 @@ hStopCompletedEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if(hStopCompletedEvent == NULL){ strcpy(error,ErrorDescription(GetLastError())); - ErrorStopService(); rb_raise(cDaemonError,error); } - // Create the green thread to poll for Service_Ctrl events - rb_thread_create(Ruby_Service_Ctrl, 0); - // Create Thread for service main hThread = CreateThread(NULL,0,ThreadProc,0,0,&ThreadId); if(hThread == INVALID_HANDLE_VALUE){ strcpy(error,ErrorDescription(GetLastError())); - ErrorStopService(); rb_raise(cDaemonError,error); } - if(rb_respond_to(self,rb_intern("service_init"))){ - rb_funcall(self,rb_intern("service_init"),0); - } - - SetEvent(hStartEvent); + events[0] = hThread; + events[1] = hStartEvent; - // Call service_main method - if(rb_respond_to(self,rb_intern("service_main"))){ - rb_funcall(self,rb_intern("service_main"),0); - } + // wait for the Service_Main function to either start + // the service OR terminate - while(WaitForSingleObject(hStopEvent, 1000) != WAIT_OBJECT_0) + while((index = WaitForMultipleObjects(2, events, FALSE, 1000)) == WAIT_TIMEOUT) { } - // Close the event handle and the thread handle. - if(!CloseHandle(hStopEvent)){ - strcpy(error,ErrorDescription(GetLastError())); - ErrorStopService(); - rb_raise(cDaemonError,error); + if (index == WAIT_OBJECT_0) { + // thread exited, so the show is off + rb_raise(cDaemonError,"Service_Main thread exited abnormally"); } - // Wait for Thread service main - WaitForSingleObject(hThread, INFINITE); + // from this point onward, stopevent must be triggered! - return self; + // Create the green thread to poll for Service_Ctrl events + rb_thread_create(Ruby_Service_Ctrl, (void *)self); + + result = rb_protect(daemon_mainloop_protect, self, &status); + if (status) { + // service_main raised an exception + daemon_mainloop_ensure(self); + rb_jump_tag(status); + } + // service_main exited cleanly + return daemon_mainloop_ensure(self); } /* From djberg96 at gmail.com Thu Dec 14 00:04:40 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 13 Dec 2006 22:04:40 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog Message-ID: <4580DB68.2060506@gmail.com> All, I got a bug report from Greg Holmes where the description wasn't being returned properly. At the moment, if there's no event associated with the event id, then the description is empty. However, it turns out that there can still be associated information about the event. So, I propose the following tweak to the get_description private method: # If FormatMessage() returned 0, but va_list isn't empty, # then return the va_list instead. if val == 0 && !va_list.empty? buf = va_list.join("\n") end Where 'val' is the result of the FormatMessage() call. I've attached the sample backup file he sent me to demonstrate the problem. The patch above seems to work fine. Please let me know if you have any issues with this approach. If not, I'd like to get a release out this weekend. Thanks, Dan -------------- next part -------------- A non-text attachment was scrubbed... Name: backup.evt Type: application/octet-stream Size: 4260 bytes Desc: not available Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20061213/0afbaba7/attachment.obj From djberg96 at gmail.com Sat Dec 16 10:34:35 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 16 Dec 2006 08:34:35 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <4580DB68.2060506@gmail.com> References: <4580DB68.2060506@gmail.com> Message-ID: <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> On 12/13/06, Daniel Berger wrote: > All, > > I got a bug report from Greg Holmes where the description wasn't being > returned properly. At the moment, if there's no event associated with > the event id, then the description is empty. > > However, it turns out that there can still be associated information > about the event. So, I propose the following tweak to the > get_description private method: > > # If FormatMessage() returned 0, but va_list isn't empty, > # then return the va_list instead. > if val == 0 && !va_list.empty? > buf = va_list.join("\n") > end > > Where 'val' is the result of the FormatMessage() call. I've attached > the sample backup file he sent me to demonstrate the problem. The patch > above seems to work fine. > > Please let me know if you have any issues with this approach. If not, > I'd like to get a release out this weekend. Actually, I've been looking over the Python evtlogutils stuff, and I think a better approach is to allow people to get at the string inserts independently of the full event log message as the Python module does. So, I'm going to add the string_inserts member to the EventLogStruct. Sound good? I also realized that we should probably check the CategoryMessageFile and ParameterMessageFile instead of only the EventMessageFile in the get_description method. Last but not least, I'm getting strange results for the attached backup event log. If you've got the .NET 2.0 runtime installed, you'll end up getting, ""The operation completed successfully." instead of what I would expect, i.e. nothing. Suggestions welcome. - Dan From waynev at gmail.com Sat Dec 16 19:13:42 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Sat, 16 Dec 2006 16:13:42 -0800 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> Message-ID: <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> Hi Dan, It was great seeing you again at RubyConf Denver! I gave the win32-eventlog 0.4.2 gem a try on my XP SP 2 system with Ruby 1.8.5 (.NET 2.0 runtime installed), and I get two test failures: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby -v ruby 1.8.5 (2006-08-25) [i386-mswin32] C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started ...................FF..... Finished in 57.969 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 26 tests, 5180 assertions, 2 failures, 0 errors I tried debugging this a little. In the above 2 cases, after the ReadEventLog call, GetLastError returns 87 ("The parameter is incorrect"). I played around with calls that failed and calls that succeeded, and finally got these two test cases: This one works: flags = EventLog::SEQUENTIAL_READ | EventLog::FORWARDS_READ @records = EventLog.read(nil, nil, flags) And this one fails: flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ @records = EventLog.read(nil, nil, flags) In the actual call to ReadEventLog in eventlog.rb line 460, the only difference is the value of flags, which is 5 when it works, and 6 when it fails. I checked the Win32 documentation, and everything seems to be fine, and it looks like both calls should succeed. I'm perfectly willing to help debug this, if anyone can suggest what I should try next. I guess one next step would be to try making this same call from C or C++, but I didn't try that yet. I also tried on Win2K SP4, Ruby 1.8.2, and that works fine. Thanks, Wayne On 12/16/06, Daniel Berger wrote: > On 12/13/06, Daniel Berger wrote: > > All, > > > > I got a bug report from Greg Holmes where the description wasn't being > > returned properly. At the moment, if there's no event associated with > > the event id, then the description is empty. > > > > However, it turns out that there can still be associated information > > about the event. So, I propose the following tweak to the > > get_description private method: > > > > # If FormatMessage() returned 0, but va_list isn't empty, > > # then return the va_list instead. > > if val == 0 && !va_list.empty? > > buf = va_list.join("\n") > > end > > > > Where 'val' is the result of the FormatMessage() call. I've attached > > the sample backup file he sent me to demonstrate the problem. The patch > > above seems to work fine. > > > > Please let me know if you have any issues with this approach. If not, > > I'd like to get a release out this weekend. > > Actually, I've been looking over the Python evtlogutils stuff, and I > think a better approach is to allow people to get at the string > inserts independently of the full event log message as the Python > module does. So, I'm going to add the string_inserts member to the > EventLogStruct. Sound good? > > I also realized that we should probably check the CategoryMessageFile > and ParameterMessageFile instead of only the EventMessageFile in the > get_description method. > > Last but not least, I'm getting strange results for the attached > backup event log. If you've got the .NET 2.0 runtime installed, > you'll end up getting, ""The operation completed successfully." > instead of what I would expect, i.e. nothing. Suggestions welcome. > > - Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From djberg96 at gmail.com Sat Dec 16 23:48:24 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 16 Dec 2006 21:48:24 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> Message-ID: <4584CC18.2080903@gmail.com> Wayne Vucenic wrote: > Hi Dan, > > It was great seeing you again at RubyConf Denver! Likewise. > I gave the win32-eventlog 0.4.2 gem a try on my XP SP 2 system with > Ruby 1.8.5 (.NET 2.0 runtime installed), and I get two test failures: > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby -v > ruby 1.8.5 (2006-08-25) [i386-mswin32] > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb > > Relax - this will take a few moments > > Loaded suite tc_eventlog > Started > ...................FF..... > Finished in 57.969 seconds. > > 1) Failure: > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > <11> expected but was > <0>. > > 2) Failure: > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > <10> expected but was > <0>. > > 26 tests, 5180 assertions, 2 failures, 0 errors > > I tried debugging this a little. In the above 2 cases, after the > ReadEventLog call, GetLastError returns 87 ("The parameter is > incorrect"). > > I played around with calls that failed and calls that succeeded, and > finally got these two test cases: > > This one works: > flags = EventLog::SEQUENTIAL_READ | EventLog::FORWARDS_READ > @records = EventLog.read(nil, nil, flags) > > And this one fails: > flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ > @records = EventLog.read(nil, nil, flags) > > In the actual call to ReadEventLog in eventlog.rb line 460, the only > difference is the value of flags, which is 5 when it works, and 6 when > it fails. I checked the Win32 documentation, and everything seems to > be fine, and it looks like both calls should succeed. > > I'm perfectly willing to help debug this, if anyone can suggest what I > should try next. I guess one next step would be to try making this > same call from C or C++, but I didn't try that yet. > > I also tried on Win2K SP4, Ruby 1.8.2, and that works fine. > > Thanks, > > Wayne These tests pass on my system. These tests are not especially robust. If the event log happens to have 10 or fewer event records, they will fail, so I'm guessing that's what happened here. I suppose I should check the length first, or just issue a failure message that warns about the possible reasons for a failure. Regards, Dan From waynev at gmail.com Sun Dec 17 00:59:42 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Sat, 16 Dec 2006 21:59:42 -0800 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <4584CC18.2080903@gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> Message-ID: <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> > If the event log happens to have 10 or fewer event records, they will > fail, so I'm guessing that's what happened here. I thought about that, which is why I tried the two test cases which don't pass the 10 parameter. And in any event (no pun intended), my Application event log has 2500 event records (as reported by Windows' Event Viewer) and my System event log has 1900 event records. > These tests pass on my system. Which OS are you using? They work for me on Win2K. They fail on XP SP2 and they fail in a different way on NT4 SP6 (but I'm assuming you don't support NT4, which is quite reasonable) You are quite correct that if the event log has 10 or less records, the same tests fail as failed in my case. But I'm pretty sure these are two different situations that simply happen to produce the same output. I cleared the Application event log on my Win2K system, where these tests used to all pass, and re-ran the tests: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started ...................FF..... Finished in 0.203 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 26 tests, 74 assertions, 2 failures, 0 errors But the difference is that in this case the ReadEventLog call is setting GetLastError to 38 (end of file), which makes sense. In the error I'm seeing (with an application eventlog with 2500 records), ReadEventLog sets GetLastError to 87. To demonstrate this, I made a change to eventlog.rb, adding one line after line 510: buf = 0.chr * BUFFER_SIZE read = [0].pack('L') end print "GetLastError returns ", GetLastError(), "\n" # ADDED LINE block_given? ? nil : array end Rerunning the test on Win2K (with empty Application log) with the changed eventlog.rb: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started .GetLastError returns 38 GetLastError returns 38 GetLastError returns 38 GetLastError returns 38 GetLastError returns 38 ..GetLastError returns 38 ...........GetLastError returns 38 .GetLastError returns 38 GetLastError returns 38 GetLastError returns 38 ....GetLastError returns 38 FGetLastError returns 38 F..... Finished in 0.563 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 26 tests, 74 assertions, 2 failures, 0 errors However, when I use the same eventlog.rb on my XP system that's having the problem: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started ...GetLastError returns 38 ................GetLastError returns 87 FGetLastError returns 87 F..... Finished in 61.25 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 26 tests, 5178 assertions, 2 failures, 0 errors So on Win2K with an empty Application log, these two tests get 0 records because the ReadEventLog call returns "end of file", which is correct. On my XP system with a full Application log, these two tests get 0 records because the ReadEventLog call returns error 87 "parameter is incorrect", which doesn't seem right. Perhaps eventlog.rb should be changed to throw an exception if we get any GetLastError() other than 38 (or 0) ? This particular problem isn't getting in my way at the moment, so I'm not suggesting that we need to figure out what's happening or do anything about it. But I did want to report it, just in case. Thanks, Wayne On 12/16/06, Daniel Berger wrote: > Wayne Vucenic wrote: > > Hi Dan, > > > > It was great seeing you again at RubyConf Denver! > > Likewise. > > > I gave the win32-eventlog 0.4.2 gem a try on my XP SP 2 system with > > Ruby 1.8.5 (.NET 2.0 runtime installed), and I get two test failures: > > > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby -v > > ruby 1.8.5 (2006-08-25) [i386-mswin32] > > > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.2\test>ruby tc_eventlog.rb > > > > Relax - this will take a few moments > > > > Loaded suite tc_eventlog > > Started > > ...................FF..... > > Finished in 57.969 seconds. > > > > 1) Failure: > > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > > <11> expected but was > > <0>. > > > > 2) Failure: > > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > > <10> expected but was > > <0>. > > > > 26 tests, 5180 assertions, 2 failures, 0 errors > > > > I tried debugging this a little. In the above 2 cases, after the > > ReadEventLog call, GetLastError returns 87 ("The parameter is > > incorrect"). > > > > I played around with calls that failed and calls that succeeded, and > > finally got these two test cases: > > > > This one works: > > flags = EventLog::SEQUENTIAL_READ | EventLog::FORWARDS_READ > > @records = EventLog.read(nil, nil, flags) > > > > And this one fails: > > flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ > > @records = EventLog.read(nil, nil, flags) > > > > In the actual call to ReadEventLog in eventlog.rb line 460, the only > > difference is the value of flags, which is 5 when it works, and 6 when > > it fails. I checked the Win32 documentation, and everything seems to > > be fine, and it looks like both calls should succeed. > > > > I'm perfectly willing to help debug this, if anyone can suggest what I > > should try next. I guess one next step would be to try making this > > same call from C or C++, but I didn't try that yet. > > > > I also tried on Win2K SP4, Ruby 1.8.2, and that works fine. > > > > Thanks, > > > > Wayne > > These tests pass on my system. These tests are not especially robust. > If the event log happens to have 10 or fewer event records, they will > fail, so I'm guessing that's what happened here. I suppose I should > check the length first, or just issue a failure message that warns about > the possible reasons for a failure. > > Regards, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From djberg96 at gmail.com Sun Dec 17 07:04:19 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 17 Dec 2006 05:04:19 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> Message-ID: <45853243.5000302@gmail.com> Wayne Vucenic wrote: >> If the event log happens to have 10 or fewer event records, they will >> fail, so I'm guessing that's what happened here. > > I thought about that, which is why I tried the two test cases which > don't pass the 10 parameter. And in any event (no pun intended), my > Application event log has 2500 event records (as reported by Windows' > Event Viewer) and my System event log has 1900 event records. > >> These tests pass on my system. > > Which OS are you using? They work for me on Win2K. They fail on XP > SP2 and they fail in a different way on NT4 SP6 (but I'm assuming you > don't support NT4, which is quite reasonable) Windows XP SP2. > You are quite correct that if the event log has 10 or less records, > the same tests fail as failed in my case. But I'm pretty sure these > are two different situations that simply happen to produce the same > output. Please do me a favor and backup the event log that's causing you problems and send it to me offlist. I have a couple of theories - could be a record number issue, could be a buffer issue - but I'm not positive. Thanks, Dan From djberg96 at gmail.com Sun Dec 17 10:59:34 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 17 Dec 2006 08:59:34 -0700 Subject: [Win32utils-devel] FormatMessage issue in eventlog.rb - more clues Message-ID: <45856966.30901@gmail.com> Hi all, Ok, I'm getting closer on this get_description failure and the mscoree.dll file. It has something to do with the way we're calling FormatMessage(). Consider the following C code, which behaves exactly the same way as the current Ruby code: #include #include int main(){ HMODULE hmod; int rv; char buf[4096]; char* dll = "C:\\WINDOWS\\system32\\mscoree.dll"; char* va_list[3]; int flags = FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY; hmod = LoadLibraryEx(dll, 0, LOAD_LIBRARY_AS_DATAFILE); printf("HMOD: %i\n", hmod); va_list[0] = "store application started"; rv = FormatMessage( flags, hmod, 0, 0, (LPTSTR)buf, sizeof(buf), va_list ); printf("RV: %i\n", rv); printf("BUF: %s\n", buf); FreeLibrary(hmod); return 0; } This will print "The operation completed successfully". Which, btw, is what GetLastError(39) returns. How that ends up getting assigned to the buffer, I'm not sure. Now, consider this approach: int main(){ HMODULE hmod; int rv; char* message; char* dll = "C:\\WINDOWS\\system32\\mscoree.dll"; int flags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS; hmod = LoadLibraryEx(dll, 0, LOAD_LIBRARY_AS_DATAFILE); printf("HMOD: %i\n", hmod); rv = FormatMessage( flags, hmod, 0, 0, (LPSTR)&message, 0, NULL ); printf("RV: %i\n", rv); FreeLibrary(hmod); return 0; } This fails as expected. More clues, but I'm still not sure what the appropriate solution is yet. Regards, Dan From djberg96 at gmail.com Sun Dec 17 16:02:24 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 17 Dec 2006 14:02:24 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog - SOLVED In-Reply-To: <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> Message-ID: <4585B060.3050801@gmail.com> [I meant to CC this but accidentally left the attachment on so it got rejected. Anyway, here's what I sent to Greg]. Greg, I think I've solved it. It seems to be the FORMAT_MESSAGE_FROM_SYSTEM flag. One poster claims that it doesn't actually work properly when used with FORMAT_MESSAGE_FROM_HMODULE. I'm not sure. From the docs for FORMAT_MESSAGE_FROM_SYSTEM: "If this flag is specified, an application can pass the result of the GetLastError function to retrieve the message text for a system-defined error." I think that's what it's doing, although I would think the app would only set that if there was an -actual failure-. That's arguably a bug in the .NET runtime. But whatever. What that tells me is that the Windows Event Viewer does *not* check for a system message. I guess now I have to decided if I should just remove the FORMAT_MESSAGE_FROM_SYSTEM flag (which fixes your problem, btw). I probably will, since it's a lot easier than dealing with the confusion otherwise generated. :) In any case, keep your eyes open for a new release soon. :) Many thanks for the bug report. This was a tough one. Regards, Dan From djberg96 at gmail.com Mon Dec 18 12:22:57 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 18 Dec 2006 10:22:57 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> Message-ID: <4586CE71.3020500@gmail.com> Wayne Vucenic wrote: >> If the event log happens to have 10 or fewer event records, they will >> fail, so I'm guessing that's what happened here. > > I thought about that, which is why I tried the two test cases which > don't pass the 10 parameter. And in any event (no pun intended), my > Application event log has 2500 event records (as reported by Windows' > Event Viewer) and my System event log has 1900 event records. Oh, I remember now. The offset parameter refers to a record number that actually exists. The ReadEventLog function isn't smart enough to take a 0 and understand that you mean to start at the oldest record. With the backup log that you sent me offlist, this snippet worked fine: flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ log = EventLog.open_backup('AppEventLogForDan.evt') log.read(flags, log.oldest_record_number).each{ |l| p l } log.close The tests you mentioned earlier fail because the oldest record number may not be the last record number - the numbers eventually get re-used. So, the only way to make them work is to use EventLog#oldest_record_number as the offset. I don't like using one method as part of another's test, but I see no choice here. I'll update the tests. I should have release 0.4.3 out today. Regards, Dan From waynev at gmail.com Tue Dec 19 00:32:47 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Mon, 18 Dec 2006 21:32:47 -0800 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <4586CE71.3020500@gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> <4586CE71.3020500@gmail.com> Message-ID: <88c9ce410612182132m1ca5274dp2372f966f5d018c9@mail.gmail.com> Hi Dan, Congratulations! Thanks for figuring out what's going on here. Take care, Wayne On 12/18/06, Daniel Berger wrote: > > Wayne Vucenic wrote: > >> If the event log happens to have 10 or fewer event records, they will > >> fail, so I'm guessing that's what happened here. > > > > I thought about that, which is why I tried the two test cases which > > don't pass the 10 parameter. And in any event (no pun intended), my > > Application event log has 2500 event records (as reported by Windows' > > Event Viewer) and my System event log has 1900 event records. > > > > Oh, I remember now. The offset parameter refers to a record number that > actually exists. The ReadEventLog function isn't smart enough to take a > 0 and understand that you mean to start at the oldest record. > > With the backup log that you sent me offlist, this snippet worked fine: > > flags = EventLog::SEEK_READ | EventLog::FORWARDS_READ > log = EventLog.open_backup('AppEventLogForDan.evt') > log.read(flags, log.oldest_record_number).each{ |l| > p l > } > log.close > > The tests you mentioned earlier fail because the oldest record number > may not be the last record number - the numbers eventually get re-used. > So, the only way to make them work is to use > EventLog#oldest_record_number as the offset. I don't like using one > method as part of another's test, but I see no choice here. I'll update > the tests. > > I should have release 0.4.3 out today. > > Regards, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061218/31850deb/attachment.html From djberg96 at gmail.com Wed Dec 20 21:38:58 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 20 Dec 2006 19:38:58 -0700 Subject: [Win32utils-devel] Curious win32-changenotify behavior - numbers instead of names Message-ID: <4589F3C2.9060907@gmail.com> Hi all, Ruby 1.8.5 win32-ipc 0.4.2 (or 0.5.0 in cvs) win32-changenotify 0.4.2 I noticed something strange tonight while tinkering with win32-changenotify. Here's my sample script: # cntest.rb require 'win32/changenotify' include Win32 path = "C:\\test" filter = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME cn = ChangeNotify.new(path, true, filter) cn.wait{ |arr| arr.each{ |e| p e } } while true cn.close I then created a file called "test.txt" with gvim, and occasionally did ":w" to save it. The weird thing is that sometimes I get the actual file name, and sometimes I get a strange number. Any idea what's causing it? # # # # # Any ideas? - Dan From waynev at gmail.com Wed Dec 20 22:47:25 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Wed, 20 Dec 2006 19:47:25 -0800 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <4586CE71.3020500@gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> <4586CE71.3020500@gmail.com> Message-ID: <88c9ce410612201947r582c5599re5d559c57bebd1ba@mail.gmail.com> Hi Dan, > I should have release 0.4.3 out today. I tried the 0.4.3 gem on my XP system that was having the problem before: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started ...................FF....F Finished in 317.016 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 3) Failure: test_version(TC_EventLog) [tc_eventlog.rb:29]: <"0.4.2"> expected but was <"0.4.3">. 26 tests, 5206 assertions, 3 failures, 0 errors It looks like something didn't get updated for 0.4.3. I notice that the tc_eventlog.rb file is identical between 0.4.2 and 0.4.3. I then tried it on my Win2K system that used to work, and I get: C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb Relax - this will take a few moments Loaded suite tc_eventlog Started ...................FF....F Finished in 0.609 seconds. 1) Failure: test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: <11> expected but was <0>. 2) Failure: test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: <10> expected but was <0>. 3) Failure: test_version(TC_EventLog) [tc_eventlog.rb:29]: <"0.4.2"> expected but was <"0.4.3">. 26 tests, 82 assertions, 3 failures, 0 errors It's odd that I'm now seeing the two failures on this system, as I didn't see them before. Thanks, Wayne From djberg96 at gmail.com Wed Dec 20 23:08:16 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 20 Dec 2006 21:08:16 -0700 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <88c9ce410612201947r582c5599re5d559c57bebd1ba@mail.gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> <4586CE71.3020500@gmail.com> <88c9ce410612201947r582c5599re5d559c57bebd1ba@mail.gmail.com> Message-ID: <458A08B0.8000506@gmail.com> Wayne Vucenic wrote: > Hi Dan, > >> I should have release 0.4.3 out today. > > I tried the 0.4.3 gem on my XP system that was having the problem before: > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb > > Relax - this will take a few moments > > Loaded suite tc_eventlog > Started > ...................FF....F > Finished in 317.016 seconds. > > 1) Failure: > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > <11> expected but was > <0>. > > 2) Failure: > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > <10> expected but was > <0>. > > 3) Failure: > test_version(TC_EventLog) [tc_eventlog.rb:29]: > <"0.4.2"> expected but was > <"0.4.3">. > > 26 tests, 5206 assertions, 3 failures, 0 errors > > It looks like something didn't get updated for 0.4.3. I notice that > the tc_eventlog.rb > file is identical between 0.4.2 and 0.4.3. > > I then tried it on my Win2K system that used to work, and I get: > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb > > Relax - this will take a few moments > > Loaded suite tc_eventlog > Started > ...................FF....F > Finished in 0.609 seconds. > > 1) Failure: > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > <11> expected but was > <0>. > > 2) Failure: > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > <10> expected but was > <0>. > > 3) Failure: > test_version(TC_EventLog) [tc_eventlog.rb:29]: > <"0.4.2"> expected but was > <"0.4.3">. > > 26 tests, 82 assertions, 3 failures, 0 errors > > It's odd that I'm now seeing the two failures on this system, as I didn't > see them before. Yeah, I forgot to update the test file. I wouldn't worry about the failures. They're likely failing for the same reason. I'm off to Florida tomorrow, so this will have to wait until next year. Regards, Dan From waynev at gmail.com Wed Dec 20 23:20:24 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Wed, 20 Dec 2006 20:20:24 -0800 Subject: [Win32utils-devel] Tweak to win32-eventlog In-Reply-To: <458A08B0.8000506@gmail.com> References: <4580DB68.2060506@gmail.com> <6037b70c0612160734tda8f4c8xc3b2f45ca8e20854@mail.gmail.com> <88c9ce410612161613x5d80e106yb26fe0eb35f22652@mail.gmail.com> <4584CC18.2080903@gmail.com> <88c9ce410612162159h2936b90fl35d06dc1bf96ba84@mail.gmail.com> <4586CE71.3020500@gmail.com> <88c9ce410612201947r582c5599re5d559c57bebd1ba@mail.gmail.com> <458A08B0.8000506@gmail.com> Message-ID: <88c9ce410612202020p71789b16q8b81fae95588ae63@mail.gmail.com> Sounds good. Have a great time in Florida! See you next year, Wayne On 12/20/06, Daniel Berger wrote: > Wayne Vucenic wrote: > > Hi Dan, > > > >> I should have release 0.4.3 out today. > > > > I tried the 0.4.3 gem on my XP system that was having the problem before: > > > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb > > > > Relax - this will take a few moments > > > > Loaded suite tc_eventlog > > Started > > ...................FF....F > > Finished in 317.016 seconds. > > > > 1) Failure: > > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > > <11> expected but was > > <0>. > > > > 2) Failure: > > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > > <10> expected but was > > <0>. > > > > 3) Failure: > > test_version(TC_EventLog) [tc_eventlog.rb:29]: > > <"0.4.2"> expected but was > > <"0.4.3">. > > > > 26 tests, 5206 assertions, 3 failures, 0 errors > > > > It looks like something didn't get updated for 0.4.3. I notice that > > the tc_eventlog.rb > > file is identical between 0.4.2 and 0.4.3. > > > > I then tried it on my Win2K system that used to work, and I get: > > > > C:\ruby\lib\ruby\gems\1.8\gems\win32-eventlog-0.4.3\test>ruby tc_eventlog.rb > > > > Relax - this will take a few moments > > > > Loaded suite tc_eventlog > > Started > > ...................FF....F > > Finished in 0.609 seconds. > > > > 1) Failure: > > test_seek_read(TC_EventLog) [tc_eventlog.rb:116]: > > <11> expected but was > > <0>. > > > > 2) Failure: > > test_seek_read_backwards(TC_EventLog) [tc_eventlog.rb:123]: > > <10> expected but was > > <0>. > > > > 3) Failure: > > test_version(TC_EventLog) [tc_eventlog.rb:29]: > > <"0.4.2"> expected but was > > <"0.4.3">. > > > > 26 tests, 82 assertions, 3 failures, 0 errors > > > > It's odd that I'm now seeing the two failures on this system, as I didn't > > see them before. > > Yeah, I forgot to update the test file. I wouldn't worry about the > failures. They're likely failing for the same reason. > > I'm off to Florida tomorrow, so this will have to wait until next year. > > Regards, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From djberg96 at gmail.com Thu Dec 21 10:46:49 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 21 Dec 2006 08:46:49 -0700 Subject: [Win32utils-devel] Hanging out on IRC today Message-ID: <458AAC69.40403@gmail.com> Hi all, With the major blizzard here, my travel plans are totally shot. So, I'll be hanging out on IRC today in #ruby-lang and #win32 (freenode) if anyone wants to discuss win32 stuff, or just shoot the breeze. - Dan