From djberg96 at gmail.com Mon Dec 3 23:59:19 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 03 Dec 2007 21:59:19 -0700 Subject: [Win32utils-devel] eventlog In-Reply-To: References: <4754BDE8.4070406@gmail.com> Message-ID: <4754DEA7.1030308@gmail.com> Hi, Hm, the string inserts are different, too. Any encoding issues? Your user name uses extended ASCII, too, right? Not sure if that's significant or not. I've cc'd the win32utils-devel list to see if anyone has any ideas. Thanks, Dan botp wrote: > On 12/4/07, Daniel Berger wrote: >> Can you tell us which record numbers in particular are causing you >> problems? We aren't finding any issues. > > all of them. the description is not complete or empty. > > in windows xp it works fine, eg > > # 10:48 +0800 2007, time_written=Tue Dec 04 12:10:48 +0800 2007, event_id=642, eve > nt_type="audit_success", category=7, source="Security", computer="BG-MIS-PBOT", > user="Pe\361aIJM", string_inserts=["-", "Guest", "BG-MIS-PBOT", "%{S-1-5-21-3438 > 18398-1177238915-839522115-501}", "Pe\361aIJM", "DMPI", "(0x0,0x14863)", "-"], d > escription="User Account Changed:\r\n\r\n\t-\r\n\r\n\tTarget Account Name:\tGues > t\r\n\r\n\tTarget Domain:\tBG-MIS-PBOT\r\n\r\n\tTarget Account ID:\t%{S-1-5-21-3 > 43818398-1177238915-839522115-501}\r\n\r\n\tCaller User Name:\tPe\361aIJM\r\n\r\ > n\tCaller Domain:\tDMPI\r\n\r\n\tCaller Logon ID:\t(0x0,0x14863)\r\n\r\n\tPrivil > eges:\t-"> > > note the description, it's in full text. > > but running it in win 2003 server, i get something like > > # 12:05:18 +0800 2007, time_written=Tue Dec 04 12:05:18 +0800 2007, event_id=560, > event_type="audit_success", category=3, source="Security", computer="BGDC01", us > er="pe\361aijm", string_inserts=["Security", "Key", "\\REGISTRY\\MACHINE\\SYSTEM > \\ControlSet001\\Services\\Eventlog\\Security\\Security", "1884", "0", "17829690 > 9", "956", "C:\\tools\\psloglist.exe", "pe\361aijm", "DMPI", "(0x0,0xA9E1DBF)", > "-", "-", "-", "%%1537\r\n\t\t\t%%1538\r\n\t\t\t%%1539\r\n\t\t\t%%1540\r\n\t\t\t > %%4432\r\n\t\t\t%%4433\r\n\t\t\t%%4434\r\n\t\t\t%%4435\r\n\t\t\t%%4436\r\n\t\t\t > %%4437\r\n\t\t\t", "-", "0", "0xF003F"], description=""> > > note the empty description > > comparing it with sysinternals psloglist command, i get > > recno : 674805 > datetime: 12/4/2007 12:05:18 PM > eventid : 560 > user : pe?aijm\DMPI > description: Object Open: Object Server: Security Object Type: Key > Object Name: \REGISTRY\MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Security\ > Security Handle ID: 1884 Operation ID: {0,178296909} Process ID: 956 > Image File Name: C:\tools\psloglist.exe Primary User Name: pe?aijm > Primary Domain: DMPI Primary Logon ID: (0x0,0xA9E1DBF) Client User Name: > - Client Domain: - Client Logon ID: - Accesses: DELETE READ_C > ONTROL WRITE_DAC WRITE_OWNER Query key value Set key val > ue Create sub-key Enumerate sub-keys Notify about changes to k > eys Create Link Privileges: - Restricted Sid Count: 0 A > ccess Mask: 0xF003F > > note how complete psloglist's description is. > > but anyway, i think you'll be releasing 0.4.7. maybe i'll try that too. > > kind regards -botp > From phasis at gmail.com Tue Dec 4 10:30:28 2007 From: phasis at gmail.com (Heesob Park) Date: Wed, 5 Dec 2007 00:30:28 +0900 Subject: [Win32utils-devel] eventlog In-Reply-To: <4754DEA7.1030308@gmail.com> References: <4754BDE8.4070406@gmail.com> <4754DEA7.1030308@gmail.com> Message-ID: Hi, 2007/12/4, Daniel Berger : > > Hi, > > Hm, the string inserts are different, too. Any encoding issues? Your > user name uses extended ASCII, too, right? Not sure if that's > significant or not. > > I've cc'd the win32utils-devel list to see if anyone has any ideas. > > Thanks, > > Dan The win32-eventlog module needs to support of handling parameters using ParameterMessageFile. Refer to http://www.grimes.demon.co.uk/workshops/InstrWSEight.htm#nt_event_log , Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071205/68f6745f/attachment.html From Daniel.Berger at qwest.com Tue Dec 4 12:30:08 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 4 Dec 2007 11:30:08 -0600 Subject: [Win32utils-devel] eventlog In-Reply-To: References: <4754BDE8.4070406@gmail.com><4754DEA7.1030308@gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB023D2D39@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Heesob Park > The win32-eventlog module needs to support of handling > parameters using ParameterMessageFile. > > Refer to > http://www.grimes.demon.co.uk/workshops/InstrWSEight.htm#nt_ev > ent_log , I guess I'm not sure how supporting ParameterMessageFiles in the EventLog.add_event_source will fix what appears to be an issue in the get_description private method. In any case, is this patch all that's needed for the EventLog.add_event_source? ### Eclipse Workspace Patch 1.0 #P win32-eventlog Index: lib/win32/eventlog.rb =================================================================== RCS file: /var/cvs/win32utils/win32-eventlog/lib/win32/eventlog.rb,v retrieving revision 1.36 diff -u -r1.36 eventlog.rb --- lib/win32/eventlog.rb 4 Dec 2007 02:53:43 -0000 1.36 +++ lib/win32/eventlog.rb 4 Dec 2007 17:28:24 -0000 @@ -169,7 +169,7 @@ raise TypeError unless args.is_a?(Hash) valid_keys = %w/source key_name category_count event_message_file - category_message_file supported_types/ + category_message_file parameter_message_file supported_types/ key_base = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\" @@ -315,6 +315,25 @@ end end + if hash['parameter_message_file'] + data = File.expand_path(hash['parameter_message_file']) + + rv = RegSetValueEx( + hkey, + 'ParameterMessageFile', + 0, + REG_EXPAND_SZ, + data, + data.size + ) + + if rv != ERROR_SUCCESS + error = 'RegSetValueEx() failed: ' + get_last_error + RegCloseKey(hkey) + raise Error, error + end + end + data = [hash['supported_types']].pack('L') rv = RegSetValueEx( hkey, Thanks, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From phasis at gmail.com Tue Dec 4 20:06:14 2007 From: phasis at gmail.com (Heesob Park) Date: Wed, 5 Dec 2007 10:06:14 +0900 Subject: [Win32utils-devel] eventlog In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB023D2D39@ITOMAE2KM01.AD.QINTRA.COM> References: <4754BDE8.4070406@gmail.com> <4754DEA7.1030308@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D39@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hi, 2007/12/5, Berger, Daniel : > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Heesob Park > > > > > The win32-eventlog module needs to support of handling > > parameters using ParameterMessageFile. > > > > Refer to > > http://www.grimes.demon.co.uk/workshops/InstrWSEight.htm#nt_ev > > ent_log , > > I guess I'm not sure how supporting ParameterMessageFiles in the > EventLog.add_event_source will fix what appears to be an issue in the > get_description private method. > > In any case, is this patch all that's needed for the > EventLog.add_event_source? > > ### Eclipse Workspace Patch 1.0 > #P win32-eventlog > Index: lib/win32/eventlog.rb > =================================================================== > RCS file: /var/cvs/win32utils/win32-eventlog/lib/win32/eventlog.rb,v > retrieving revision 1.36 > diff -u -r1.36 eventlog.rb > --- lib/win32/eventlog.rb 4 Dec 2007 02:53:43 -0000 1.36 > +++ lib/win32/eventlog.rb 4 Dec 2007 17:28:24 -0000 > @@ -169,7 +169,7 @@ > raise TypeError unless args.is_a?(Hash) > > valid_keys = %w/source key_name category_count > event_message_file > - category_message_file supported_types/ > + category_message_file parameter_message_file > supported_types/ > > key_base = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\" > > @@ -315,6 +315,25 @@ > end > end > > + if hash['parameter_message_file'] > + data = File.expand_path(hash['parameter_message_file']) > + > + rv = RegSetValueEx( > + hkey, > + 'ParameterMessageFile', > + 0, > + REG_EXPAND_SZ, > + data, > + data.size > + ) > + > + if rv != ERROR_SUCCESS > + error = 'RegSetValueEx() failed: ' + get_last_error > + RegCloseKey(hkey) > + raise Error, error > + end > + end > + > data = [hash['supported_types']].pack('L') > rv = RegSetValueEx( > hkey, > > Thanks, > > Dan I meant the get_description method could handle not just EventMessagFile but also ParameterMessageFile and other MessaeFiles like CategoryMessageFile, GuidMessageFile to acquire correct description. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071205/30503484/attachment.html From djberg96 at gmail.com Tue Dec 4 20:38:30 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 04 Dec 2007 18:38:30 -0700 Subject: [Win32utils-devel] eventlog In-Reply-To: References: <4754BDE8.4070406@gmail.com> <4754DEA7.1030308@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D39@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <47560116.50004@gmail.com> Heesob Park wrote: > Hi, > I meant the get_description method could handle not just EventMessagFile > but also ParameterMessageFile and other MessaeFiles like > CategoryMessageFile, GuidMessageFile to acquire correct description. Ah, ok. I'll put together a patch this week and see how it goes. Thanks, Dan From djberg96 at gmail.com Wed Dec 5 10:52:40 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 5 Dec 2007 07:52:40 -0800 (PST) Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> Message-ID: <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> Any ideas? ---------- Forwarded message ---------- From: Christian Kerth Date: Dec 5, 8:28 am Subject: win32/process problem To: comp.lang.ruby I have an application that consists of serveral independent parts. I want to use the Windows Process API to spawn the different processes. e.g. require 'rubygems' require 'win32/process' x = Process.create(:app_name => "rubyw learnbase_server.rb") puts x.process_id puts a process id, but i get the error: [BUG] Segmentation fault. Not even x = Process.create(:app_name => "notepad") works. It starts notepad, but i get the same error. -- Posted viahttp://www.ruby-forum.com/. From phasis at gmail.com Wed Dec 5 11:08:38 2007 From: phasis at gmail.com (Heesob Park) Date: Thu, 6 Dec 2007 01:08:38 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> Message-ID: Hi, 2007/12/6, Daniel Berger : > > Any ideas? > > > ---------- Forwarded message ---------- > From: Christian Kerth > Date: Dec 5, 8:28 am > Subject: win32/process problem > To: comp.lang.ruby > > > I have an application that consists of serveral independent parts. > > I want to use the Windows Process API to spawn the different > processes. > > e.g. > > require 'rubygems' > require 'win32/process' > > x = Process.create(:app_name => "rubyw learnbase_server.rb") > > puts x.process_id > > puts a process id, but i get the error: [BUG] Segmentation fault. > > Not even x = Process.create(:app_name => "notepad") works. It starts > notepad, but i get the same error. We need more information. What is the OS, Ruby version and win32-process version? What result of "p x" ? x = Process.create(:app_name => "notepad") p x Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071206/e53b4b8d/attachment-0001.html From phasis at gmail.com Thu Dec 6 04:08:01 2007 From: phasis at gmail.com (Heesob Park) Date: Thu, 6 Dec 2007 18:08:01 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> Message-ID: 2007/12/6, Daniel Berger : > > Any ideas? > > > ---------- Forwarded message ---------- > From: Christian Kerth > Date: Dec 5, 8:28 am > Subject: win32/process problem > To: comp.lang.ruby > > > I have an application that consists of serveral independent parts. > > I want to use the Windows Process API to spawn the different > processes. > > e.g. > > require 'rubygems' > require 'win32/process' > > x = Process.create(:app_name => "rubyw learnbase_server.rb") > > puts x.process_id > > puts a process id, but i get the error: [BUG] Segmentation fault. > > Not even x = Process.create(:app_name => "notepad") works. It starts > notepad, but i get the same error. > -- > Posted viahttp://www.ruby-forum.com/. Though it is doubtful whether this is the cause or not, Insert flowing two lines before ProcessInfo.new (line #409 of process.rb) might be helpful. CloseHandle(procinfo[8,4].unpack('L').first) CloseHandle(procinfo[12,4].unpack('L').first) Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071206/0e9c07f7/attachment.html From djberg96 at gmail.com Thu Dec 6 07:18:04 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 06 Dec 2007 05:18:04 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> Message-ID: <4757E87C.20501@gmail.com> Heesob Park wrote: > Though it is doubtful whether this is the cause or not, > Insert flowing two lines before ProcessInfo.new (line #409 of > process.rb) might be helpful. > > CloseHandle(procinfo[8,4].unpack('L').first) > CloseHandle(procinfo[12,4].unpack('L').first) I'm somewhat afraid to do that, because I can't be sure other people aren't using the process handle afterwards. At the very least I should document that, however. Hmm, let me mull it over. The good news is that his problem was fixed after upgrading the gem. Thanks, Dan From Daniel.Berger at qwest.com Thu Dec 6 18:00:06 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu, 6 Dec 2007 17:00:06 -0600 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <4757E87C.20501@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Daniel Berger > Sent: Thursday, December 06, 2007 5:18 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Fwd: win32/process problem > > Heesob Park wrote: > > > > > Though it is doubtful whether this is the cause or not, > Insert flowing > > two lines before ProcessInfo.new (line #409 of > > process.rb) might be helpful. > > > > CloseHandle(procinfo[8,4].unpack('L').first) > > CloseHandle(procinfo[12,4].unpack('L').first) > > I'm somewhat afraid to do that, because I can't be sure other > people aren't using the process handle afterwards. > > At the very least I should document that, however. Hmm, let > me mull it over. Ok, what if we add a "close_handles" option to Process.create? If set to true (the default), we'll close the handles automatically before returning from the method. Users could explicitly set it to false if they want to keep the handles open. Seem reasonable? Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From phasis at gmail.com Thu Dec 6 20:03:38 2007 From: phasis at gmail.com (Heesob Park) Date: Fri, 7 Dec 2007 10:03:38 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hi, 2007/12/7, Berger, Daniel : > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Daniel Berger > > Sent: Thursday, December 06, 2007 5:18 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Fwd: win32/process problem > > > > Heesob Park wrote: > > > > > > > > > Though it is doubtful whether this is the cause or not, > > Insert flowing > > > two lines before ProcessInfo.new (line #409 of > > > process.rb) might be helpful. > > > > > > CloseHandle(procinfo[8,4].unpack('L').first) > > > CloseHandle(procinfo[12,4].unpack('L').first) > > > > I'm somewhat afraid to do that, because I can't be sure other > > people aren't using the process handle afterwards. > > > > At the very least I should document that, however. Hmm, let > > me mull it over. > > Ok, what if we add a "close_handles" option to Process.create? If set to > true (the default), we'll close the handles automatically before > returning from the method. Users could explicitly set it to false if > they want to keep the handles open. > > Seem reasonable? Yes, it seems reasonable. BTW, how about your thought about supporting Process.create as a different user with CreateProcessWithLoginW API ? > Dan Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071207/ab172b70/attachment.html From djberg96 at gmail.com Thu Dec 6 21:24:51 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 06 Dec 2007 19:24:51 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <4758AEF3.4080203@gmail.com> Heesob Park wrote: > Hi, > > 2007/12/7, Berger, Daniel >: > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > > [mailto:win32utils-devel-bounces at rubyforge.org > ] On Behalf Of > > Daniel Berger > > Sent: Thursday, December 06, 2007 5:18 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Fwd: win32/process problem > > > > Heesob Park wrote: > > > > > > > > > Though it is doubtful whether this is the cause or not, > > Insert flowing > > > two lines before ProcessInfo.new (line #409 of > > > process.rb) might be helpful. > > > > > > CloseHandle(procinfo[8,4].unpack('L').first) > > > CloseHandle(procinfo[12,4].unpack('L').first) > > > > I'm somewhat afraid to do that, because I can't be sure other > > people aren't using the process handle afterwards. > > > > At the very least I should document that, however. Hmm, let > > me mull it over. > > Ok, what if we add a "close_handles" option to Process.create? If set to > true (the default), we'll close the handles automatically before > returning from the method. Users could explicitly set it to false if > they want to keep the handles open. > > Seem reasonable? > > > Yes, it seems reasonable. > > BTW, how about your thought about supporting Process.create as > a different user with CreateProcessWithLoginW API ? I think it's a good idea. Let's add a "with_logon" option as well. If set, it will call CreateProcessWithLoginW behind the scenes. Any chance I could get you to patch win32-eventlog to handle the other message files so I can work on this instead this weekend? BTW, I've made a couple minor commits since 0.4.6, so you'll want to grab the latest from CVS (there were some bugs in a few error messages). Thanks, Dan From phasis at gmail.com Fri Dec 7 12:05:22 2007 From: phasis at gmail.com (Park Heesob) Date: Sat, 8 Dec 2007 02:05:22 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> Message-ID: <001601c838f3$6f893310$9a7ba8c0@mycom> Hi, ----- Original Message ----- From: "Daniel Berger" To: "Development and ideas for win32utils projects" Sent: Friday, December 07, 2007 11:24 AM Subject: Re: [Win32utils-devel] Fwd: win32/process problem > Heesob Park wrote: >> Hi, >> >> 2007/12/7, Berger, Daniel > >: >> >> > -----Original Message----- >> > From: win32utils-devel-bounces at rubyforge.org >> >> > [mailto:win32utils-devel-bounces at rubyforge.org >> ] On Behalf Of >> > Daniel Berger >> > Sent: Thursday, December 06, 2007 5:18 AM >> > To: Development and ideas for win32utils projects >> > Subject: Re: [Win32utils-devel] Fwd: win32/process problem >> > >> > Heesob Park wrote: >> > >> > >> > >> > > Though it is doubtful whether this is the cause or not, >> > Insert flowing >> > > two lines before ProcessInfo.new (line #409 of >> > > process.rb) might be helpful. >> > > >> > > CloseHandle(procinfo[8,4].unpack('L').first) >> > > CloseHandle(procinfo[12,4].unpack('L').first) >> > >> > I'm somewhat afraid to do that, because I can't be sure other >> > people aren't using the process handle afterwards. >> > >> > At the very least I should document that, however. Hmm, let >> > me mull it over. >> >> Ok, what if we add a "close_handles" option to Process.create? If set to >> true (the default), we'll close the handles automatically before >> returning from the method. Users could explicitly set it to false if >> they want to keep the handles open. >> >> Seem reasonable? >> >> >> Yes, it seems reasonable. >> >> BTW, how about your thought about supporting Process.create as >> a different user with CreateProcessWithLoginW API ? > > I think it's a good idea. Let's add a "with_logon" option as well. If > set, it will call CreateProcessWithLoginW behind the scenes. > > Any chance I could get you to patch win32-eventlog to handle the other > message files so I can work on this instead this weekend? BTW, I've made > a couple minor commits since 0.4.6, so you'll want to grab the latest > from CVS (there were some bugs in a few error messages). > First of all, I implemented the ParameterMessage formatting routine. You can test it with the botp_sample_dmpi_security_log_2007_nov_27.evt file attached a few days ago. Here is get_description method code: def get_description(rec, event_source, lkey) str = rec[rec[36,4].unpack('L')[0] .. -1] num = rec[26,2].unpack('S')[0] # NumStrings hkey = [0].pack('L') key = BASE_KEY + "#{@source}\\#{event_source}" buf = 0.chr * 8192 va_list0 = (num == 0) ? [] : str.unpack('Z*' * num) if RegOpenKeyEx(lkey, key, 0, KEY_READ, hkey) == 0 value = 'ParameterMessageFile' file = 0.chr * MAX_SIZE hkey = hkey.unpack('L')[0] size = [file.length].pack('L') if RegQueryValueEx(hkey, value, 0, 0, file, size) == 0 file = file.nstrip exe = 0.chr * MAX_SIZE ExpandEnvironmentStrings(file, exe, exe.size) exe = exe.nstrip va_list = va_list0.map{|v| va = v v.scan(/%%(\d+)/).uniq.each {|x| exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hmodule, x.first.to_i, 0, buf, buf.size, v ) FreeLibrary(hmodule) break if buf.nstrip != "" end } va = va.gsub("%%#{x.first}",buf.nstrip) } va } end value = 'EventMessageFile' file = 0.chr * MAX_SIZE size = [file.length].pack('L') if RegQueryValueEx(hkey, value, 0, 0, file, size) == 0 file = file.nstrip exe = 0.chr * MAX_SIZE ExpandEnvironmentStrings(file, exe, exe.size) exe = exe.nstrip # Try to retrieve message *without* expanding the inserts yet exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) event_id = rec[20,4].unpack('L')[0] if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, hmodule, event_id, 0, buf, buf.size, nil ) FreeLibrary(hmodule) break if buf.nstrip != "" # All messages read end } # Determine higest %n insert number max_insert = [num,buf.nstrip.scan(/%(\d+)/).map{|x|x[0].to_i}.max].compact.max # Insert dummy strings for not provided by caller */ ((num+1)..(max_insert)).each {|x|va_list.push("%#{x}")} if va_list.length== 0 va_list_ptr = 0.chr * 4 else va_list_ptr = va_list.map{ |x| [x + 0.chr].pack('P').unpack('L')[0] }.pack('L*') end exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) event_id = rec[20,4].unpack('L')[0] if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hmodule, event_id, 0, buf, buf.size, va_list_ptr ) FreeLibrary(hmodule) break if buf.nstrip != "" # All messages read end } end RegCloseKey(hkey) end [va_list0, buf.strip] end Regards, Park Heesob From djberg96 at gmail.com Sat Dec 8 14:47:30 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 08 Dec 2007 12:47:30 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <001601c838f3$6f893310$9a7ba8c0@mycom> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> Message-ID: <475AF4D2.20908@gmail.com> Hi, Park Heesob wrote: > First of all, I implemented the ParameterMessage formatting routine. > You can test it with the botp_sample_dmpi_security_log_2007_nov_27.evt file attached a few days ago. > Here is get_description method code: I tried your code but I got this error when I tried to read the Application log: eventlog.rb:846:in `get_description': undefined method `length' for nil:NilClass (NoMethodError) I haven't dug further yet. Regards, Dan From djberg96 at gmail.com Sat Dec 8 15:00:03 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 08 Dec 2007 13:00:03 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <001601c838f3$6f893310$9a7ba8c0@mycom> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> Message-ID: <475AF7C3.3010406@gmail.com> Whoops, forgot to include the line that fails: if va_list.length == 0 So, for some reason va_list isn't set. Dan From phasis at gmail.com Sat Dec 8 20:18:39 2007 From: phasis at gmail.com (Heesob Park) Date: Sun, 9 Dec 2007 10:18:39 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <475AF7C3.3010406@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> <475AF7C3.3010406@gmail.com> Message-ID: Hi, 2007/12/9, Daniel Berger : > > Whoops, forgot to include the line that fails: > > if va_list.length == 0 > > So, for some reason va_list isn't set. > > Dan Did you modified my code? I did'nt use va_list.length. but I had omitted initializing va_list . Here is the corrent code: def get_description(rec, event_source, lkey) str = rec[rec[36,4].unpack('L')[0] .. -1] num = rec[26,2].unpack('S')[0] # NumStrings hkey = [0].pack('L') key = BASE_KEY + "#{@source}\\#{event_source}" buf = 0.chr * 8192 va_list = va_list0 = (num == 0) ? [] : str.unpack('Z*' * num) if RegOpenKeyEx(lkey, key, 0, KEY_READ, hkey) == 0 value = 'ParameterMessageFile' file = 0.chr * MAX_SIZE hkey = hkey.unpack('L')[0] size = [file.length].pack('L') if RegQueryValueEx(hkey, value, 0, 0, file, size) == 0 file = file.nstrip exe = 0.chr * MAX_SIZE ExpandEnvironmentStrings(file, exe, exe.size) exe = exe.nstrip va_list = va_list0.map{|v| va = v v.scan(/%%(\d+)/).uniq.each {|x| exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hmodule, x.first.to_i, 0, buf, buf.size, v ) FreeLibrary(hmodule) break if buf.nstrip != "" end } va = va.gsub("%%#{x.first}",buf.nstrip) } va } end value = 'EventMessageFile' file = 0.chr * MAX_SIZE size = [file.length].pack('L') if RegQueryValueEx(hkey, value, 0, 0, file, size) == 0 file = file.nstrip exe = 0.chr * MAX_SIZE ExpandEnvironmentStrings(file, exe, exe.size) exe = exe.nstrip # Try to retrieve message *without* expanding the inserts yet exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) event_id = rec[20,4].unpack('L')[0] if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, hmodule, event_id, 0, buf, buf.size, nil ) FreeLibrary(hmodule) break if buf.nstrip != "" # All messages read end } # Determine higest %n insert number max_insert = [num,buf.nstrip.scan (/%(\d+)/).map{|x|x[0].to_i}.max].compact.max # Insert dummy strings for not provided by caller */ ((num+1)..(max_insert)).each {|x|va_list.push("%#{x}")} if num == 0 va_list_ptr = 0.chr * 4 else va_list_ptr = va_list.map{ |x| [x + 0.chr].pack('P').unpack('L')[0] }.pack('L*') end exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) event_id = rec[20,4].unpack('L')[0] if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ARGUMENT_ARRAY, hmodule, event_id, 0, buf, buf.size, va_list_ptr ) FreeLibrary(hmodule) break if buf.nstrip != "" # All messages read end } end RegCloseKey(hkey) end [va_list0, buf.strip] end Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071209/dd959694/attachment-0001.html From phasis at gmail.com Sat Dec 8 21:44:06 2007 From: phasis at gmail.com (Heesob Park) Date: Sun, 9 Dec 2007 11:44:06 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <4758AEF3.4080203@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> Message-ID: 2007/12/7, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > 2007/12/7, Berger, Daniel > >: > > > > > -----Original Message----- > > > From: win32utils-devel-bounces at rubyforge.org > > > > > [mailto:win32utils-devel-bounces at rubyforge.org > > ] On Behalf Of > > > Daniel Berger > > > Sent: Thursday, December 06, 2007 5:18 AM > > > To: Development and ideas for win32utils projects > > > Subject: Re: [Win32utils-devel] Fwd: win32/process problem > > > > > > Heesob Park wrote: > > > > > > > > > > > > > Though it is doubtful whether this is the cause or not, > > > Insert flowing > > > > two lines before ProcessInfo.new (line #409 of > > > > process.rb) might be helpful. > > > > > > > > CloseHandle(procinfo[8,4].unpack('L').first) > > > > CloseHandle(procinfo[12,4].unpack('L').first) > > > > > > I'm somewhat afraid to do that, because I can't be sure other > > > people aren't using the process handle afterwards. > > > > > > At the very least I should document that, however. Hmm, let > > > me mull it over. > > > > Ok, what if we add a "close_handles" option to Process.create? If > set to > > true (the default), we'll close the handles automatically before > > returning from the method. Users could explicitly set it to false if > > they want to keep the handles open. > > > > Seem reasonable? > > > > > > Yes, it seems reasonable. > > > > BTW, how about your thought about supporting Process.create as > > a different user with CreateProcessWithLoginW API ? > > I think it's a good idea. Let's add a "with_logon" option as well. If > set, it will call CreateProcessWithLoginW behind the scenes. Here is the snippet for CreateProcessWithLogonW if hash['user'].nil? bool = CreateProcess( nil, # App name hash['app_name'], # Command line process_security, # Process attributes thread_security, # Thread attributes hash['inherit'], # Inherit handles? hash['creation_flags'], # Creation flags env, # Environment hash['cwd'], # Working directory startinfo, # Startup Info procinfo # Process Info ) else logon_flags = 0x1 # LOGON_WITH_PROFILE bool = CreateProcessWithLogonW( multi_to_wide(hash['user']), # User name multi_to_wide(hash['domain']), # Domain name multi_to_wide(hash['password']), # Password logon_flags, # Logon flags nil, # App name multi_to_wide(hash['app_name']), # Command line hash['creation_flags'], # Creation flags env, # Environment multi_to_wide(hash['cwd']), # Working directory startinfo, # Startup Info procinfo # Process Info ) end CreateProcessWithLogonW is defined as API.new('CreateProcessWithLogonW', 'PPPLPPLLPPP', 'B', 'advapi32') and called like this x = Process.create(:app_name => "notepad",:user=>'user',:password=>'pass') Regards, Park Heeosb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071209/42ad8bef/attachment.html From djberg96 at gmail.com Sat Dec 8 23:23:15 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 08 Dec 2007 21:23:15 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> <475AF7C3.3010406@gmail.com> Message-ID: <475B6DB3.6040709@gmail.com> Heesob Park wrote: > Hi, > > 2007/12/9, Daniel Berger >: > > Whoops, forgot to include the line that fails: > > if va_list.length == 0 > > So, for some reason va_list isn't set. > > Dan > > > Did you modified my code? > I did'nt use va_list.length. but I had omitted initializing va_list . > Here is the corrent code: Ok, there's good news and bad news. First the good news - this definitely picks up some descriptions we were missing before (specifically Winlogon events). Awesome. But there's some bad news. I sent the eventlog descriptions to a file using the original code and your code and found some discrepancies using diff. First, now I'm seeing literal parameter strings where I would expect data. For example: Security Configuration (OFF = 0 and ON = 1): - Network Administration of Transactions = 0, - Network Clients = 0, - Inbound Distributed Transactions using Native MSDTC Protocol = 0, - Outbound Distributed Transactions using Native MSDTC Protocol = 0, - Transaction Internet Protocol (TIP) = 0, - XA Transactions = 0 + Network Administration of Transactions = %1, + Network Clients = %2, + Inbound Distributed Transactions using Native MSDTC Protocol = %3, + Outbound Distributed Transactions using Native MSDTC Protocol = %4, + Transaction Internet Protocol (TIP) = %5, + XA Transactions = %6 Second, in rare cases I'm seeing some junk characters in the description: -Product: Nero 7 Ultra Edition -- Installation completed successfully. +`???`??? Nero 7 Ultra Edition -- Installation completed successfully. Last (and least), it looks it's picking up blank lines at the end. Nothing serious but it didn't do that before: -The Windows Installer initiated a system restart to complete or continue the configuration of ''. +The Windows Installer initiated a system restart to complete or continue the configuration of ''. + I've attached my (zipped) application so you can play with it. Regards, Dan -------------- next part -------------- A non-text attachment was scrubbed... Name: dan_app.zip Type: application/x-zip-compressed Size: 44212 bytes Desc: not available Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20071208/8b143417/attachment-0001.bin From phasis at gmail.com Sat Dec 8 23:56:11 2007 From: phasis at gmail.com (Heesob Park) Date: Sun, 9 Dec 2007 13:56:11 +0900 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: <475B6DB3.6040709@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> <475AF7C3.3010406@gmail.com> <475B6DB3.6040709@gmail.com> Message-ID: 2007/12/9, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > 2007/12/9, Daniel Berger >>: > > > > Whoops, forgot to include the line that fails: > > > > if va_list.length == 0 > > > > So, for some reason va_list isn't set. > > > > Dan > > > > > > Did you modified my code? > > I did'nt use va_list.length. but I had omitted initializing va_list . > > Here is the corrent code: > > > > Ok, there's good news and bad news. First the good news - this > definitely picks up some descriptions we were missing before > (specifically Winlogon events). Awesome. > > But there's some bad news. I sent the eventlog descriptions to a file > using the original code and your code and found some discrepancies using > diff. > > First, now I'm seeing literal parameter strings where I would expect > data. For example: > > Security Configuration (OFF = 0 and ON = 1): > - Network Administration of Transactions = 0, > - Network Clients = 0, > - Inbound Distributed Transactions using Native MSDTC Protocol = 0, > - Outbound Distributed Transactions using Native MSDTC Protocol = 0, > - Transaction Internet Protocol (TIP) = 0, > - XA Transactions = 0 > + Network Administration of Transactions = %1, > + Network Clients = %2, > + Inbound Distributed Transactions using Native MSDTC Protocol = %3, > + Outbound Distributed Transactions using Native MSDTC Protocol = %4, > + Transaction Internet Protocol (TIP) = %5, > + XA Transactions = %6 > > Second, in rare cases I'm seeing some junk characters in the description: > > -Product: Nero 7 Ultra Edition -- Installation completed successfully. > +`???`??? Nero 7 Ultra Edition -- Installation completed successfully. > > Last (and least), it looks it's picking up blank lines at the end. > Nothing serious but it didn't do that before: > > -The Windows Installer initiated a system restart to complete or > continue the configuration of ''. > +The Windows Installer initiated a system restart to complete or > continue the configuration of ''. > + > > I've attached my (zipped) application so you can play with it. > > Regards, > > Dan Ok, I saw it. Reinitializing buf after the first formatting like this works fine for me: # Try to retrieve message *without* expanding the inserts yet exe.split(';').each{ |file| hmodule = LoadLibraryEx(file, 0, DONT_RESOLVE_DLL_REFERENCES) event_id = rec[20,4].unpack('L')[0] if hmodule != 0 FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, hmodule, event_id, 0, buf, buf.size, nil ) FreeLibrary(hmodule) break if buf.nstrip != "" # All messages read end } buf = 0.chr * 8192 # Reinitialize buf Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071209/d6e45eb8/attachment.html From djberg96 at gmail.com Sun Dec 9 00:52:19 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 08 Dec 2007 22:52:19 -0700 Subject: [Win32utils-devel] Fwd: win32/process problem In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <001601c838f3$6f893310$9a7ba8c0@mycom> <475AF7C3.3010406@gmail.com> <475B6DB3.6040709@gmail.com> Message-ID: <475B8293.2050201@gmail.com> Heesob Park wrote: > Ok, I saw it. > Reinitializing buf after the first formatting like this works fine for me: > > # Try to retrieve message *without* expanding the inserts > yet > exe.split(';').each{ |file| > hmodule = LoadLibraryEx(file, 0, > DONT_RESOLVE_DLL_REFERENCES) > event_id = rec[20,4].unpack('L')[0] > if hmodule != 0 > FormatMessage( > FORMAT_MESSAGE_FROM_HMODULE | > FORMAT_MESSAGE_IGNORE_INSERTS, > hmodule, > event_id, > 0, > buf, > buf.size, > nil > ) > > FreeLibrary(hmodule) > break if buf.nstrip != "" # All messages read > end > } > > buf = 0.chr * 8192 # Reinitialize buf Excellent, that worked, thanks! I'll put out 0.4.7 tonight. Regards, Dan From djberg96 at gmail.com Mon Dec 10 22:41:43 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Mon, 10 Dec 2007 20:41:43 -0700 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> Message-ID: <475E06F7.7040509@gmail.com> Heesob Park wrote: > > BTW, how about your thought about supporting Process.create as > > a different user with CreateProcessWithLoginW API ? > > I think it's a good idea. Let's add a "with_logon" option as well. If > set, it will call CreateProcessWithLoginW behind the scenes. > > > Here is the snippet for CreateProcessWithLogonW > > if hash['user'].nil? > bool = CreateProcess( > nil, # App name > hash['app_name'], # Command line > process_security, # Process attributes > thread_security, # Thread attributes > hash['inherit'], # Inherit handles? > hash['creation_flags'], # Creation flags > env, # Environment > hash['cwd'], # Working directory > startinfo, # Startup Info > procinfo # Process Info > ) > else > logon_flags = 0x1 # LOGON_WITH_PROFILE > bool = CreateProcessWithLogonW( > multi_to_wide(hash['user']), # User name > multi_to_wide(hash['domain']), # Domain name > multi_to_wide(hash['password']), # Password > logon_flags, # Logon flags > nil, # App name > multi_to_wide(hash['app_name']), # Command line > hash['creation_flags'], # Creation flags > env, # Environment > multi_to_wide(hash['cwd']), # Working directory > startinfo, # Startup Info > procinfo # Process Info > ) > > end > > CreateProcessWithLogonW is defined as > API.new('CreateProcessWithLogonW', 'PPPLPPLLPPP', 'B', 'advapi32') > and called like this > x = Process.create(:app_name => "notepad",:user=>'user',:password=>'pass') I modified what you provided slightly and committed to CVS. I had to make an adjustment to wide_to_multi and multi_to_wide in the Windows::Unicode module so that they return nil if the argument is nil instead of segfaulting. After I made those changes I tried this: struct = Process.create( :app_name => 'notepad.exe', :creation_flags => Process::DETACHED_PROCESS, :process_inherit => false, :thread_inherit => true, :cwd => "C:\\", :inherit => true, :environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\", :with_logon => 'some_local_account', :domain => 'MYDOMAIN', :password => 'xxxx' ) p struct However, I couldn't make this work. I always get a "parameter is incorrect" error. I know I've got the right logon and password. The domain my local domain, which the Sys::Admin library confirms. Any ideas? You may want to take a look at multi_to_wide just to make sure I didn't break it, btw. Regards, Dan From phasis at gmail.com Mon Dec 10 23:45:34 2007 From: phasis at gmail.com (Heesob Park) Date: Tue, 11 Dec 2007 13:45:34 +0900 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: <475E06F7.7040509@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> Message-ID: Hi, 2007/12/11, Daniel Berger : > Heesob Park wrote: > > > > I modified what you provided slightly and committed to CVS. I had to > make an adjustment to wide_to_multi and multi_to_wide in the > Windows::Unicode module so that they return nil if the argument is nil > instead of segfaulting. > > After I made those changes I tried this: > > struct = Process.create( > :app_name => 'notepad.exe', > :creation_flags => Process::DETACHED_PROCESS, > :process_inherit => false, > :thread_inherit => true, > :cwd => "C:\\", > :inherit => true, > :environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\", > :with_logon => 'some_local_account', > :domain => 'MYDOMAIN', > :password => 'xxxx' > ) > > p struct The creation flag is not correct. It must be combination of following constant: CREATE_DEFAULT_ERROR_MODE 0x04000000 CREATE_NEW_CONSOLE 0x00000010 CREATE_NEW_PROCESS_GROUP 0x00000200 CREATE_SEPARATE_WOW_VDM 0x00000800 CREATE_SUSPENDED 0x00000004 CREATE_UNICODE_ENVIRONMENT 0x00000400 EXTENDED_STARTUPINFO_PRESENT 0x00080000 After modify the env to unicode and set create_flag to CREATE_UNICODE_ENVIRONMENT like this if hash['with_logon'] logon = multi_to_wide(hash['with_logon']) domain = multi_to_wide(hash['domain']) app = multi_to_wide(hash['app_name']) cwd = multi_to_wide(hash['cwd']) passwd = multi_to_wide(hash['password']) if hash['environment'] env = hash['environment'].split(File::PATH_SEPARATOR) << 0.chr env = env.map{|x|multi_to_wide(x)} env = [env.join("\0\0")].pack('p*').unpack('L').first else env = nil end hash['creation_flags'] |= CREATE_UNICODE_ENVIRONMENT # 0x00000400 bool = CreateProcessWithLogonW( logon, # User domain, # Domain passwd, # Password LOGON_WITH_PROFILE, # Logon flags nil, # App name app, # Command line hash['creation_flags'], # Creation flags env, # Environment cwd, # Working directory startinfo, # Startup Info procinfo # Process Info ) else And call like this struct = Process.create( :app_name => 'notepad.exe', :creation_flags => CREATE_NEW_CONSOLE, # 0x00000010 :process_inherit => false, :thread_inherit => true, :cwd => "C:\\", :inherit => true, :environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\", :with_logon => 'some_local_account', :domain => 'MYDOMAIN', :password => 'xxxx' ) work fine for me. > However, I couldn't make this work. I always get a "parameter is > incorrect" error. I know I've got the right logon and password. The > domain my local domain, which the Sys::Admin library confirms. > > Any ideas? You may want to take a look at multi_to_wide just to make > sure I didn't break it, btw. > > Regards, > > Dan Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071211/e1a04f58/attachment-0001.html From noreply at rubyforge.org Tue Dec 11 04:31:40 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 11 Dec 2007 04:31:40 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16211 ] win32-service will not install/build corectly if the system has VC8 Message-ID: <20071211093141.1338B18585D6@rubyforge.org> Bugs item #16211, was opened at 2007-12-10 15:40 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16211&group_id=85 Category: win32-service Group: Packaging Status: Closed Resolution: Rejected Priority: 3 Submitted By: Sorin Sbarnea (intersol) Assigned to: Daniel Berger (djberg96) Summary: win32-service will not install/build corectly if the system has VC8 Initial Comment: Currently ruby is compiled with VC6 and if someone does have VC8 installed the build will succeed but the extension will crash at load because incompatibilities between CTR. #case 1: --------------------------- ruby.exe - Unable To Locate Component --------------------------- This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem. --------------------------- OK --------------------------- #case 2: (after coping the MSVCR80.dll to ruby.exe dir) (bad ideea, look down) --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Runtime Error! Program: c:\ruby\bin\ruby.exe R6034 An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information. ----------- Looking for a solution? #1 fast one - provide an already build gem with version 0.6 I've spend some time investigating this and I think that the problem is that the application must load the DLL from SxS directory instead of current directory. I don't have quite a good experience with this but i think these links could help: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=132033&SiteID=1 ---------------------------------------------------------------------- >Comment By: Sorin Sbarnea (intersol) Date: 2007-12-11 11:31 Message: I know, i've been documenting further and it's not possible. Meanwile I've installed VC6 and made a hack I've wrote some info regarding building with VC8, it's not much but it's a start http://nusunt.eu/Building_ruby_extensions_on_Windows_VC6/VC8 ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2007-12-11 02:57 Message: Hi Sorin, Well, I can't make VC8 work with VC6 - that's really not a bug. I have, however, provided a VC6 specific gem. You can grab it here: http://rubyforge.org/frs/download.php/28400/win32-service-0.6.0-x86-mswin32-60.gem I think rubygems 0.9.5 has a bug that will prevent you from installing it remotely. I recommend downloading the gem file and installing locally. Closing ticket. Regards, Dan ---------------------------------------------------------------------- Comment By: Sorin Sbarnea (intersol) Date: 2007-12-10 15:54 Message: Some news: At compile a file named daemon.so.manifest is generated but it's not delivered nor loaded. I've renamed the file to "ruby.exe.manifest" and copied to c:\ruby\bin and surprize: it seams that to work, at lease win32-service will pass the tests now. Considering that ruby.exe is build with vc6 and is "hacked" by this manifest to use newer CRT I don't know if this will crash other things. Do someone know how to run the tests for the entire ruby installation including gems? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16211&group_id=85 From djberg96 at gmail.com Tue Dec 11 09:29:52 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 11 Dec 2007 07:29:52 -0700 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <2167ae21-b278-4631-9ca5-f63abb3c31ef@s19g2000prg.googlegroups.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> Message-ID: <475E9EE0.7020504@gmail.com> Heesob Park wrote: > Hi, > > 2007/12/11, Daniel Berger >: > > Heesob Park wrote: > > > > I modified what you provided slightly and committed to CVS. I had to > make an adjustment to wide_to_multi and multi_to_wide in the > Windows::Unicode module so that they return nil if the argument is nil > instead of segfaulting. > > After I made those changes I tried this: > > struct = Process.create( > :app_name => 'notepad.exe', > :creation_flags => Process::DETACHED_PROCESS, > :process_inherit => false, > :thread_inherit => true, > :cwd => "C:\\", > :inherit => true, > :environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\", > :with_logon => 'some_local_account', > :domain => 'MYDOMAIN', > :password => 'xxxx' > ) > > p struct > > > The creation flag is not correct. > It must be combination of following constant: > > CREATE_DEFAULT_ERROR_MODE > 0x04000000 > > CREATE_NEW_CONSOLE > 0x00000010 > > CREATE_NEW_PROCESS_GROUP > 0x00000200 > > CREATE_SEPARATE_WOW_VDM > 0x00000800 > > CREATE_SUSPENDED > 0x00000004 > > CREATE_UNICODE_ENVIRONMENT > 0x00000400 > > EXTENDED_STARTUPINFO_PRESENT > 0x00080000 > > After modify the env to unicode and set create_flag to > CREATE_UNICODE_ENVIRONMENT like this > > > if hash['with_logon'] > logon = multi_to_wide(hash['with_logon']) > domain = multi_to_wide(hash['domain']) > app = multi_to_wide(hash['app_name']) > cwd = multi_to_wide(hash['cwd']) > passwd = multi_to_wide(hash['password']) > if hash['environment'] > env = hash['environment'].split(File::PATH_SEPARATOR) << 0.chr > env = env.map{|x|multi_to_wide(x)} > env = [env.join("\0\0")].pack('p*').unpack('L').first > else > env = nil > end > hash['creation_flags'] |= CREATE_UNICODE_ENVIRONMENT # 0x00000400 > > bool = CreateProcessWithLogonW( > logon, # User > domain, # Domain > passwd, # Password > LOGON_WITH_PROFILE, # Logon flags > nil, # App name > app, # Command line > hash['creation_flags'], # Creation flags > env, # Environment > cwd, # Working directory > startinfo, # Startup Info > procinfo # Process Info > ) > else > > And call like this > > struct = Process.create( > :app_name => 'notepad.exe', > :creation_flags => CREATE_NEW_CONSOLE, # 0x00000010 > :process_inherit => false, > :thread_inherit => true, > :cwd => "C:\\", > :inherit => true, > :environment => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\", > :with_logon => 'some_local_account', > :domain => 'MYDOMAIN', > :password => 'xxxx' > ) > > work fine for me. Ok, I made the changes you suggested (in slightly different places, but you'll see the changes), but I still couldn't make it work. It could just be me, though. Please check out the latest from CVS and see if it works for you. Thanks, Dan Please checkout the lates From phasis at gmail.com Tue Dec 11 09:51:15 2007 From: phasis at gmail.com (Heesob Park) Date: Tue, 11 Dec 2007 23:51:15 +0900 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: <475E9EE0.7020504@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> <475E9EE0.7020504@gmail.com> Message-ID: Hi, 2007/12/11, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > 2007/12/11, Daniel Berger >>: > > > > Heesob Park wrote: > > > > > > > > Ok, I made the changes you suggested (in slightly different places, but > you'll see the changes), but I still couldn't make it work. It could > just be me, though. > > Please check out the latest from CVS and see if it works for you. Thanks, > > Dan The lastest CVS code works fine on my WinXP Prof. What's your result? any error message? or just nothing? Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071211/d2601a38/attachment.html From djberg96 at gmail.com Tue Dec 11 11:09:30 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 11 Dec 2007 09:09:30 -0700 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <4757E87C.20501@gmail.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> <475E9EE0.7020504@gmail.com> Message-ID: <475EB63A.9070109@gmail.com> Heesob Park wrote: > Hi, > > 2007/12/11, Daniel Berger >: > > Heesob Park wrote: > > Hi, > > > > 2007/12/11, Daniel Berger < djberg96 at gmail.com > >>: > > > > Heesob Park wrote: > > > > > > > > Ok, I made the changes you suggested (in slightly different places, but > you'll see the changes), but I still couldn't make it work. It could > just be me, though. > > Please check out the latest from CVS and see if it works for you. > > > Thanks, > > Dan > > > The lastest CVS code works fine on my WinXP Prof. > > What's your result? any error message? or just nothing? I tried this on WinXP Home: struct = Process.create( :app_name => "notepad.exe", :with_logon => 'foo', :password => 'xxxx', :domain => 'MYDOMAIN' ) (Note that I didn't set the flags explicitly - the docs say the CREATE_DEFAULT_ERROR_MODE, CREATE_NEW_CONSOLE, and CREATE_NEW_PROCESS_GROUP flags are enabled by default). The result was: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.: CreateProcess() failed: (Process::Error) That error is junk - the number (1058) must just happen to match a service error. Maybe it's a Home vs Pro issue? Or maybe I'm just doing something wrong. Regards, Dan From phasis at gmail.com Tue Dec 11 20:09:19 2007 From: phasis at gmail.com (Heesob Park) Date: Wed, 12 Dec 2007 10:09:19 +0900 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: <475EB63A.9070109@gmail.com> References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> <475E9EE0.7020504@gmail.com> <475EB63A.9070109@gmail.com> Message-ID: 2007/12/12, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > 2007/12/11, Daniel Berger >>: > > > > Heesob Park wrote: > > > Hi, > > > > > > 2007/12/11, Daniel Berger < djberg96 at gmail.com > > > >>: > > > > > > Heesob Park wrote: > > > > > > > > > > > > > Ok, I made the changes you suggested (in slightly different places, > but > > you'll see the changes), but I still couldn't make it work. It could > > just be me, though. > > > > Please check out the latest from CVS and see if it works for you. > > > > > > Thanks, > > > > Dan > > > > > > The lastest CVS code works fine on my WinXP Prof. > > > > What's your result? any error message? or just nothing? > > I tried this on WinXP Home: > > struct = Process.create( > :app_name => "notepad.exe", > :with_logon => 'foo', > :password => 'xxxx', > :domain => 'MYDOMAIN' > ) > > (Note that I didn't set the flags explicitly - the docs say the > CREATE_DEFAULT_ERROR_MODE, CREATE_NEW_CONSOLE, and > CREATE_NEW_PROCESS_GROUP flags are enabled by default). > > The result was: > > The service cannot be started, either because it is disabled or because > it has no enabled devices associated with it.: CreateProcess() failed: > (Process::Error) > > That error is junk - the number (1058) must just happen to match a > service error. > > Maybe it's a Home vs Pro issue? Or maybe I'm just doing something wrong. That's strange. On my WinXP Home, your test code works fine also. What result wtih another domain like "." or nil? It works same with whatever domain even with nil in my case. Regards, > > Dan Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071212/ccbfb660/attachment.html From djberg96 at gmail.com Tue Dec 11 22:07:12 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 11 Dec 2007 20:07:12 -0700 Subject: [Win32utils-devel] Process.create with logon issue In-Reply-To: References: <716a9ef6c5a9dcb851ff653a112e62d2@ruby-forum.com> <7524A45A1A5B264FA4809E2156496CFB023D2D67@ITOMAE2KM01.AD.QINTRA.COM> <4758AEF3.4080203@gmail.com> <475E06F7.7040509@gmail.com> <475E9EE0.7020504@gmail.com> <475EB63A.9070109@gmail.com> Message-ID: <475F5060.2070005@gmail.com> Heesob Park wrote: > > What's your result? any error message? or just nothing? > > I tried this on WinXP Home: > > struct = Process.create( > :app_name => "notepad.exe", > :with_logon => 'foo', > :password => 'xxxx', > :domain => 'MYDOMAIN' > ) > > (Note that I didn't set the flags explicitly - the docs say the > CREATE_DEFAULT_ERROR_MODE, CREATE_NEW_CONSOLE, and > CREATE_NEW_PROCESS_GROUP flags are enabled by default). > > The result was: > > The service cannot be started, either because it is disabled or because > it has no enabled devices associated with it.: CreateProcess() failed: > (Process::Error) > > That error is junk - the number (1058) must just happen to match a > service error. > > Maybe it's a Home vs Pro issue? Or maybe I'm just doing something wrong. > > > That's strange. On my WinXP Home, your test code works fine also. > What result wtih another domain like "." or nil? > It works same with whatever domain even with nil in my case. I can only guess that I've shut off some service that this function requires, but I don't see anything documented. Ah, well. If you say it works, then I'll release it. :) Thanks, Dan From djberg96 at gmail.com Thu Dec 13 17:23:22 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 13 Dec 2007 15:23:22 -0700 Subject: [Win32utils-devel] Fun things to do while I take a break Message-ID: <4761B0DA.4010009@gmail.com> All, I need a break from coding for a while. At least until after Christmas vacation. But, if you want to work on some code while I hibernate, I've got a list of things for you: * Finish converting daemon.c (from win32-service) to pure Ruby (partially complete) * Finish converting win32-changejournal to pure Ruby (partially complete) * Convert win32-open3 to pure Ruby. Ditch the Windows 95/98/ME support. * Create a pure Ruby version of zlib 1.2.x :) * Any other enhancements to Win32Utils stuff you would like to see Regards, Dan PS - I will still fix any critical bugs, however. From noreply at rubyforge.org Wed Dec 26 21:11:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 26 Dec 2007 21:11:19 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Patches-16626 ] Fix errors in wait_any() method Message-ID: <20071227021119.6BC0118585E6@rubyforge.org> Patches item #16626, was opened at 2007-12-26 21:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16626&group_id=85 Category: win32-ipc Group: Bug Fix Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Fix errors in wait_any() method Initial Comment: The wait_any() method contained several run-time errors. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16626&group_id=85 From noreply at rubyforge.org Wed Dec 26 21:13:07 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 26 Dec 2007 21:13:07 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Patches-16627 ] Replace inefficient busy wait loop with UDP/IP loopback socket. Message-ID: <20071227021307.AD10C18585E1@rubyforge.org> Patches item #16627, was opened at 2007-12-26 21:13 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16627&group_id=85 Category: win32-service Group: Code Cleanup Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Replace inefficient busy wait loop with UDP/IP loopback socket. Initial Comment: Here are some patches for win32-service which eliminate the messy busy loop that polls the hStopEvent with a zero timeout. Instead of using a Windows event, these patches create a UDP/IP socket bound to the loopback interface which can be used in ruby's green threads event loop. I believe this is a much cleaner and more efficient mechanism than the WIndows event flag since it allows the ruby thread to block until there's really a control event from the WIndows service manager. I also include a hCtrlEvent event flag which can be used by ruby win32 services which must wait for control events. This event handle is accessible via the daemon.event_handle method. Note that the hCtrlEvent is not used by the daemon.c logic, it's merely an event which can be used by the Daemon subclass. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16627&group_id=85 From noreply at rubyforge.org Thu Dec 27 15:58:38 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 27 Dec 2007 15:58:38 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16648 ] Cannot find the file specified with Service.services Message-ID: <20071227205838.DD1B618585BE@rubyforge.org> Bugs item #16648, was opened at 2007-12-27 13:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 Category: win32-service Group: Code Status: Open Resolution: None Priority: 4 Submitted By: Daniel Berger (djberg96) Assigned to: Park Heesob (phasis68) Summary: Cannot find the file specified with Service.services Initial Comment: Hi, Just trying to help my dad out here while I'm on Christmas vacation and I hit this error while listing the Services via Service.services: Win32::Service::Error: The system cannot find the file specified. from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1334:in `get_config_info' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1085:in `services' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `upto' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `services' from (irb):5 This happens after listing about a dozen services or so just fine. I can't tell which service is causing this problem, as there appear to be several services not listed in the Windows Services GUI that show up in the Service.services call. Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 From noreply at rubyforge.org Sun Dec 30 00:04:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 30 Dec 2007 00:04:17 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16700 ] 1.0.5 x86-mswin32-60 gem is broken Message-ID: <20071230050419.1802518585A5@rubyforge.org> Bugs item #16700, was opened at 2007-12-30 02:04 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85 Category: win32-api Group: Packaging Status: Open Resolution: None Priority: 3 Submitted By: Luis Lavena (luislavena) Assigned to: Nobody (None) Summary: 1.0.5 x86-mswin32-60 gem is broken Initial Comment: Daniel, The gem you have created with RubyGems 0.9.5 for win32-api is broken, and is forcing users to the pure-ruby and extension building process instead. This is part of the specification yaml: --- !ruby/object:Gem::Specification name: win32-api version: !ruby/object:Gem::Version version: 1.0.5 platform: current authors: - Daniel J. Berger autorequire: bindir: bin cert_chain: [] platform shouldn't be current, but i386-mswin32 or x86-mswin32-60. This problem was fixed in rubygems 1.0, so I suggest you update and recreate the gem with the correction. I'm getting a lot of reports of unsuccessful installation of mongrel_service (which depends on win32-service) due this. Regards, Luis ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85 From noreply at rubyforge.org Sun Dec 30 00:06:05 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 30 Dec 2007 00:06:05 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16701 ] 0.6.0 x86-mswin32-60 gem is broken. Message-ID: <20071230050605.3DF7418586B4@rubyforge.org> Bugs item #16701, was opened at 2007-12-30 02:06 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16701&group_id=85 Category: win32-service Group: None Status: Open Resolution: None Priority: 3 Submitted By: Luis Lavena (luislavena) Assigned to: Nobody (None) Summary: 0.6.0 x86-mswin32-60 gem is broken. Initial Comment: In the similar way of #16700, win32-service gem is broken too: --- !ruby/object:Gem::Specification name: win32-service version: !ruby/object:Gem::Version version: 0.6.0 platform: current authors: - Daniel J. Berger autorequire: bindir: bin cert_chain: [] I'm getting a lot of faulty reports of mongrel_service installation due this. Regards, Luis Lavena ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16701&group_id=85 From noreply at rubyforge.org Sun Dec 30 04:50:17 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 30 Dec 2007 04:50:17 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16648 ] Cannot find the file specified with Service.services Message-ID: <20071230095017.2CD5D18586B2@rubyforge.org> Bugs item #16648, was opened at 2007-12-28 05:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 Category: win32-service Group: Code Status: Open Resolution: None Priority: 4 Submitted By: Daniel Berger (djberg96) Assigned to: Park Heesob (phasis68) Summary: Cannot find the file specified with Service.services Initial Comment: Hi, Just trying to help my dad out here while I'm on Christmas vacation and I hit this error while listing the Services via Service.services: Win32::Service::Error: The system cannot find the file specified. from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1334:in `get_config_info' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1085:in `services' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `upto' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `services' from (irb):5 This happens after listing about a dozen services or so just fine. I can't tell which service is causing this problem, as there appear to be several services not listed in the Windows Services GUI that show up in the Service.services call. Dan ---------------------------------------------------------------------- >Comment By: Park Heesob (phasis68) Date: 2007-12-30 18:50 Message: Hi, I cannot repeat your problem. So I have no idea. Please try with some debugging code insert before get_config_info to know what service_name, display_name and other information cause the problem. Regards, Park Heesob ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 From noreply at rubyforge.org Sun Dec 30 08:02:47 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sun, 30 Dec 2007 08:02:47 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16648 ] Cannot find the file specified with Service.services Message-ID: <20071230130249.3B40418586C9@rubyforge.org> Bugs item #16648, was opened at 2007-12-27 13:58 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 Category: win32-service Group: Code Status: Open Resolution: None Priority: 4 Submitted By: Daniel Berger (djberg96) Assigned to: Park Heesob (phasis68) Summary: Cannot find the file specified with Service.services Initial Comment: Hi, Just trying to help my dad out here while I'm on Christmas vacation and I hit this error while listing the Services via Service.services: Win32::Service::Error: The system cannot find the file specified. from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1334:in `get_config_info' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1085:in `services' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `upto' from c:/ruby/lib/ruby/gems/1.8/gems/win32-service-0.6.0-x86-mswin32-60/l ib/win32/service.rb:1047:in `services' from (irb):5 This happens after listing about a dozen services or so just fine. I can't tell which service is causing this problem, as there appear to be several services not listed in the Windows Services GUI that show up in the Service.services call. Dan ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-12-30 06:02 Message: Hi, I tried it again this morning and naturally I can no longer duplicate it either. Now it works fine. :( I can only guess that it was related to the Symantec services (aka Norton Antivirus), which I later disabled. Perhaps whatever was causing the problem was ultimately deleted. I tried several times to uninstall NAV but was only partially successful. The only thing I can think of is that there was a service installed, then disabled, then the executable it pointed to was deleted but the service itself was not. Could that have caused it? Otherwise, I'm not sure. I see one or two similar posts on Google, but nothing definitive. Anyway, feel free to reject this ticket if you like. We'll just have to keep it in mind if it ever shows up again. Regards, Dan ---------------------------------------------------------------------- Comment By: Park Heesob (phasis68) Date: 2007-12-30 02:50 Message: Hi, I cannot repeat your problem. So I have no idea. Please try with some debugging code insert before get_config_info to know what service_name, display_name and other information cause the problem. Regards, Park Heesob ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16648&group_id=85 From noreply at rubyforge.org Mon Dec 31 00:29:46 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 31 Dec 2007 00:29:46 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Patches-16626 ] Fix errors in wait_any() method Message-ID: <20071231052946.AE28418585C1@rubyforge.org> Patches item #16626, was opened at 2007-12-26 19:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16626&group_id=85 Category: win32-ipc Group: Bug Fix >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Nobody (None) >Assigned to: Daniel Berger (djberg96) Summary: Fix errors in wait_any() method Initial Comment: The wait_any() method contained several run-time errors. ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-12-30 22:29 Message: Thanks, applied. I'll put out 0.5.1 in a couple days. Note that there *should* have been a WAIT_ABANDONED_0 constant in the Windows::Synchronize module (the value is the same as WAIT_ABANDONED). I've since updated it, but I'll still apply your patch as-is, since it's easier for the users than having to update windows-pr again. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=16626&group_id=85 From noreply at rubyforge.org Mon Dec 31 20:50:28 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 31 Dec 2007 20:50:28 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16700 ] 1.0.5 x86-mswin32-60 gem is broken Message-ID: <20080101015028.9E5071858646@rubyforge.org> Bugs item #16700, was opened at 2007-12-29 22:04 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85 Category: win32-api Group: Packaging Status: Open Resolution: None Priority: 3 Submitted By: Luis Lavena (luislavena) Assigned to: Nobody (None) Summary: 1.0.5 x86-mswin32-60 gem is broken Initial Comment: Daniel, The gem you have created with RubyGems 0.9.5 for win32-api is broken, and is forcing users to the pure-ruby and extension building process instead. This is part of the specification yaml: --- !ruby/object:Gem::Specification name: win32-api version: !ruby/object:Gem::Version version: 1.0.5 platform: current authors: - Daniel J. Berger autorequire: bindir: bin cert_chain: [] platform shouldn't be current, but i386-mswin32 or x86-mswin32-60. This problem was fixed in rubygems 1.0, so I suggest you update and recreate the gem with the correction. I'm getting a lot of reports of unsuccessful installation of mongrel_service (which depends on win32-service) due this. Regards, Luis ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-12-31 18:50 Message: Doesn't CURRENT set it to i386-mswin32-60 if that's the compiler it was built with? That's how the resulting gem name looks. I'm afraid I do not understand the platform system any more Luis. What should the gemspec look like? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85 From noreply at rubyforge.org Mon Dec 31 22:25:04 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 31 Dec 2007 22:25:04 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Bugs-16700 ] 1.0.5 x86-mswin32-60 gem is broken Message-ID: <20080101032505.196A1185866D@rubyforge.org> Bugs item #16700, was opened at 2007-12-30 02:04 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85 Category: win32-api Group: Packaging Status: Open Resolution: None Priority: 3 Submitted By: Luis Lavena (luislavena) Assigned to: Nobody (None) Summary: 1.0.5 x86-mswin32-60 gem is broken Initial Comment: Daniel, The gem you have created with RubyGems 0.9.5 for win32-api is broken, and is forcing users to the pure-ruby and extension building process instead. This is part of the specification yaml: --- !ruby/object:Gem::Specification name: win32-api version: !ruby/object:Gem::Version version: 1.0.5 platform: current authors: - Daniel J. Berger autorequire: bindir: bin cert_chain: [] platform shouldn't be current, but i386-mswin32 or x86-mswin32-60. This problem was fixed in rubygems 1.0, so I suggest you update and recreate the gem with the correction. I'm getting a lot of reports of unsuccessful installation of mongrel_service (which depends on win32-service) due this. Regards, Luis ---------------------------------------------------------------------- >Comment By: Luis Lavena (luislavena) Date: 2008-01-01 00:25 Message: it should look: platform: x86-mswin32-60 or if was packaged with 0.9.4: platform: i386-mswin32 The problem is that 0.9.5 was broken and setting platform to 'current' (actually, current is the text written in the spec, not Gem::Platform::CURRENT). So, the resulting gem will be excluded and not properly picked by rubyforge indexer. RubyGems 0.9.5 was setting the gem name to -x86-mswin32-60, but storing into the metadata the wrong information. RubyGems 1.0.x ships with fixes for this, generating not just the correct gem name like 0.9.5, but also storing the proper platform into the metadata. 0.9.5 => Gem::Platform::CURRENT => platform: current (WRONG) 1.0.1 => Gem::Platform::CURRENT => platform: x86-mswin32-60 (GOOD) Hope this shed some light to the situation. Regards, Luis ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2007-12-31 22:50 Message: Doesn't CURRENT set it to i386-mswin32-60 if that's the compiler it was built with? That's how the resulting gem name looks. I'm afraid I do not understand the platform system any more Luis. What should the gemspec look like? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=16700&group_id=85