From djberg96 at gmail.com Tue Sep 4 07:24:58 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 4 Sep 2007 05:24:58 -0600 Subject: [Win32utils-devel] Win32 namespace In-Reply-To: References: <7524A45A1A5B264FA4809E2156496CFBE72D12@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <6037b70c0709040424k58b1cc45n4f6b4534b0719f5b@mail.gmail.com> On 7/30/07, Gordon Thiesfeld wrote: > > Hey, I like that. > > Thanks. All of my code is in svn on rubyforge if you're interested. > > http://rubyforge.org/projects/ruby-wmi/ > > > I think this approach makes sense, i.e. WMI is part of Win32, and > > LogicalDisk is part of WMI. > > > > Mind you, I certainly don't own the Win32 namespace so you can do as you > > wish, but I think this is the best approach, as it puts your code > > effectively under the "Win32::WMI" namespace, which should eliminate any > > potential namespace conflicts. > > > > What do you think? > > I think this is a good idea, but it won't work the way I've written > it. I'm using const_missing to create WMI classes as needed. > Win32_LogicalDisk is a WMI class, and it doesn't exist in ruby until > you invoke #find on it. It would have to be: > > Win32::WMI::Win32_LogicalDisk I would think you could recreate the class on the fly or something. I'll take a look at what you've got checked into SCM later this week if I get the chance. BTW, any ideas for a release date? Regards, Dan From gthiesfeld at gmail.com Tue Sep 4 08:37:19 2007 From: gthiesfeld at gmail.com (Gordon Thiesfeld) Date: Tue, 4 Sep 2007 07:37:19 -0500 Subject: [Win32utils-devel] Win32 namespace In-Reply-To: <6037b70c0709040424k58b1cc45n4f6b4534b0719f5b@mail.gmail.com> References: <7524A45A1A5B264FA4809E2156496CFBE72D12@ITOMAE2KM01.AD.QINTRA.COM> <6037b70c0709040424k58b1cc45n4f6b4534b0719f5b@mail.gmail.com> Message-ID: On 9/4/07, Daniel Berger wrote: > I would think you could recreate the class on the fly or something. > I'll take a look at what you've got checked into SCM later this week > if I get the chance. > Thanks. > BTW, any ideas for a release date? I could probably try to release it later this week. I'm still toying with just making this a subclass of ActiveRecord. I'm already just cutting and pasting methods from there, so it seems like the smart thing to do. But, there are a lot of methods I'll never need or want (save, create, etc.), so I'm thinking I may just use undef_method to get rid of them. Thanks again, Gordon From djberg96 at gmail.com Sat Sep 8 23:01:31 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 08 Sep 2007 21:01:31 -0600 Subject: [Win32utils-devel] windows-api command decision Message-ID: <46E3620B.3060305@gmail.com> Hi all, Ok folks, here's how it is. The windows-api project will, from now on, consist of two parts. The first part is "win32-api". This is a replacement for 'Win32API'. This is a refactored version of the Win32API that currently ships with Ruby's stdlib. It is a C extension. Changes include: * Name change - it's now "win32/api" instead of "Win32API". * It's now under the "Win32" namespace/module. * Refactored to use the Ruby 1.8 allocation scheme. * Changed the order of the arguments - the DLL has been moved from first to last, and now defaults to 'kernel32'. The prototype and return type also have default values. * There are now (sane) methods for obtaining instance variable information, such as prototype, return type, etc. The second part is the pure Ruby part of the windows-api library. This is still a wrapper, but uses our own "win32-api" library instead of Ruby's "Win32API". For the 0.2.0 release the changes were actually relatively minor. The upside of releasing our own version of win32-api is that we ensure that it will still exist once Ruby 2.0 is release. In addition, we can tweak it to suit our needs as we see fit. Specifically, this means we can add Park's callback interface. :) In practice, this means that end users will always use our version of windows-api, but we can modify the underlying C code as we see fit. Please, checkout the latest windows-api from CVS and see what you think. Regards, Dan From djberg96 at gmail.com Tue Sep 11 22:02:48 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Tue, 11 Sep 2007 20:02:48 -0600 Subject: [Win32utils-devel] RubyConf 2007? Message-ID: <46E748C8.2080505@gmail.com> Hi all, Is anyone on the list going to RubyConf this year? I don't know yet if I'm going to go. I'm still thinking about it. Regards, Dan From phurley at gmail.com Tue Sep 11 22:12:38 2007 From: phurley at gmail.com (Patrick Hurley) Date: Tue, 11 Sep 2007 22:12:38 -0400 Subject: [Win32utils-devel] RubyConf 2007? In-Reply-To: <46E748C8.2080505@gmail.com> References: <46E748C8.2080505@gmail.com> Message-ID: <554ac39c0709111912h67f3e51dlbe6d48e20ec544ad@mail.gmail.com> On 9/11/07, Daniel Berger wrote: > Hi all, > > Is anyone on the list going to RubyConf this year? > > I don't know yet if I'm going to go. I'm still thinking about it. > > Regards, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > There are so few of you "full-timers" left, you almost have to go :-) Not that it is a real reason to show, I will be there and would enjoy saying hi. pth From waynev at gmail.com Wed Sep 12 01:24:22 2007 From: waynev at gmail.com (Wayne Vucenic) Date: Tue, 11 Sep 2007 22:24:22 -0700 Subject: [Win32utils-devel] RubyConf 2007? In-Reply-To: <554ac39c0709111912h67f3e51dlbe6d48e20ec544ad@mail.gmail.com> References: <46E748C8.2080505@gmail.com> <554ac39c0709111912h67f3e51dlbe6d48e20ec544ad@mail.gmail.com> Message-ID: <88c9ce410709112224i27454db1pa4ed13741652a686@mail.gmail.com> Hi Dan, I haven't worked out all my scheduling details yet to be sure that I can go, but it looks likely that I'll be there. It would be great to see you again. Hi Patrick, Maybe I'll see you there! Wayne On 9/11/07, Patrick Hurley wrote: > On 9/11/07, Daniel Berger wrote: > > Hi all, > > > > Is anyone on the list going to RubyConf this year? > > > > I don't know yet if I'm going to go. I'm still thinking about it. > > > > Regards, > > > > Dan > > _______________________________________________ > > win32utils-devel mailing list > > win32utils-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/win32utils-devel > > > > There are so few of you "full-timers" left, you almost have to go :-) > > Not that it is a real reason to show, I will be there and would enjoy saying hi. > > pth > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From noreply at rubyforge.org Mon Sep 10 16:04:38 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 10 Sep 2007 16:04:38 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-13825 ] /win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) Message-ID: <20070910200438.DB3E55240CA5@rubyforge.org> Bugs item #13825, was opened at 2007-09-10 16:04 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=13825&group_id=85 Category: win32-file-stat Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: /win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) Initial Comment: When File.stat is called on a file that doesn't have a Created or Modified time (pointing to a Linux Samba share from WinXP in my case) it fails with; c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `initialize' from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.4/lib/win32/file.rb:532:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.4/lib/win32/file.rb:532:in `stat' If I don't require 'win32/file' this call suceeds (but I need the attribute methods that come with win32/file). ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=13825&group_id=85 From noreply at rubyforge.org Thu Sep 13 14:58:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 13 Sep 2007 14:58:41 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-13825 ] /win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) Message-ID: <20070913185841.4A90A5240EE6@rubyforge.org> Bugs item #13825, was opened at 2007-09-10 13:04 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=13825&group_id=85 Category: win32-file-stat Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) >Assigned to: Daniel Berger (djberg96) Summary: /win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) Initial Comment: When File.stat is called on a file that doesn't have a Created or Modified time (pointing to a Linux Samba share from WinXP in my case) it fails with; c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `at': bignum too big to convert into `long' (RangeError) from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.5/lib/win32/file/stat.rb:81:in `initialize' from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.4/lib/win32/file.rb:532:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.4/lib/win32/file.rb:532:in `stat' If I don't require 'win32/file' this call suceeds (but I need the attribute methods that come with win32/file). ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-09-13 11:58 Message: Curious. Please show me what the output of File.stat is (without win32/file I mean). I wonder if it defaults to epoch time or nil in that case. Thanks, Dan PS - Can you please provide your name so I can give you proper attribution in the CHANGES file? ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=13825&group_id=85 From djberg96 at gmail.com Wed Sep 19 13:51:39 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 19 Sep 2007 11:51:39 -0600 Subject: [Win32utils-devel] Fwd: win32-service of win32utils In-Reply-To: <20070919165224.114DC5240C49@rubyforge.org> References: <20070919165224.114DC5240C49@rubyforge.org> Message-ID: <6037b70c0709191051q6f44ad87y58ff5954ed8ec303@mail.gmail.com> Any ideas folks? Thanks, Dan ---------- Forwarded message ---------- From: Kay Date: Sep 19, 2007 10:52 AM Subject: win32-service of win32utils To: djberg96 at gmail.com I'm writing some scripts to programmatically change the user account of running a windows service. So I downloaded one of the windows utilities, win32-service, and wrote my scripts. However when I was trying to use the following scripts to change the name of the account of running a windows service s.configure_service{ |s| s.start_name = "name of the account" s.password = "password" # Note that I used plain text password } I was always given some kinds of error messages, which varied based on different formats of the account name being used. So with start_name = "domain_name\user_name" (using \ for escaping and have tried domain_name with either upper case or lower case), the message is "the parameter is incorrect". with start_name = "domain_name\user_name" (have tried domain_name with either upper case or lower case), the message is "the account name is invalid or does not exist, or the password is invalid for the account name specified". with start_name = "user_name at domain_name.com", the message is " the parameter is incorrect". with start_name = "user_name at another_domain_name.com", (another_domain_name is a possible domain name for me), the message is "the specified domain either does not exist or could not be contacted". with start_name = "user_name", the message is "the account name is invalid or does not exist, or the password is invalid for the account name specified". So I'm writing to ask for your suggestions. BTW, do you think it's right to use password in plain text? Your help is very appreciated. The following is a full script I was using. base = File.basename(Dir.pwd) if base == "examples" || base =~ /win32-service/ require "ftools" Dir.chdir("..") if base == "examples" Dir.mkdir("win32") unless File.exists?("win32") File.copy("service.so","win32") $LOAD_PATH.unshift Dir.pwd end require "win32/service" include Win32 s = Service.new("machine_name") # Create a new service if Service.exists?("foo") Service.delete("foo") end s.create_service{ |s| s.service_name = "foo" s.binary_path_name = "C:\Autonomy\DocumentumFetchOld\DocumentumFetchOld.exe" s.display_name = "My Foo Service" } # Configure a service that already exists s.configure_service{ |s| s.start_name = "start_name" s.password = "password" } s.close Service.start("foo") Service.pause("foo") Service.resume("foo") Service.stop("foo") Service.delete("foo") Service.getdisplayname("Schedule") # "Task Scheduler" Service.getservicename("ClipBook") # "ClipSrv" s = Service.status("ClipSrv") # Enumerate over all services, inspecting each struct Service.services{ |s| p s puts } Thanks! From phasis at gmail.com Wed Sep 19 21:34:59 2007 From: phasis at gmail.com (Heesob Park) Date: Thu, 20 Sep 2007 10:34:59 +0900 Subject: [Win32utils-devel] Fwd: win32-service of win32utils In-Reply-To: <6037b70c0709191051q6f44ad87y58ff5954ed8ec303@mail.gmail.com> References: <20070919165224.114DC5240C49@rubyforge.org> <6037b70c0709191051q6f44ad87y58ff5954ed8ec303@mail.gmail.com> Message-ID: Hi, 2007/9/20, Daniel Berger : > > Any ideas folks? > > Thanks, > > Dan > > ---------- Forwarded message ---------- > From: Kay > Date: Sep 19, 2007 10:52 AM > Subject: win32-service of win32utils > To: djberg96 at gmail.com > > > I'm writing some scripts to programmatically change the user account > of running a windows service. So I downloaded one of the windows > utilities, win32-service, and wrote my scripts. However when I was > trying to use the following scripts to change the name of the account > of running a windows service > > > > s.configure_service{ |s| > > s.start_name = "name of the account" > > s.password = "password" # Note that I used plain text password > > } > > > > I was always given some kinds of error messages, which varied based on > different formats of the account name being used. So > > > > with start_name = "domain_name\user_name" (using \ for escaping and > have tried domain_name with either upper case or lower case), the > message is "the parameter is incorrect". > > > > with start_name = "domain_name\user_name" (have tried domain_name with > either upper case or lower case), the message is "the account name is > invalid or does not exist, or the password is invalid for the account > name specified". > > > > with start_name = "user_name at domain_name.com", the message is " the > parameter is incorrect". > > > > with start_name = "user_name at another_domain_name.com", > (another_domain_name is a possible domain name for me), the message is > "the specified domain either does not exist or could not be > contacted". > > > > with start_name = "user_name", the message is "the account name is > invalid or does not exist, or the password is invalid for the account > name specified". > > > > So I'm writing to ask for your suggestions. BTW, do you think it's > right to use password in plain text? Your help is very appreciated. > The following is a full script I was using. > > > > base = File.basename(Dir.pwd) > > if base == "examples" || base =~ /win32-service/ > > require "ftools" > > Dir.chdir("..") if base == "examples" > > Dir.mkdir("win32") unless File.exists?("win32") > > File.copy("service.so","win32") > > $LOAD_PATH.unshift Dir.pwd > > end > > > > require "win32/service" > > include Win32 > > > > s = Service.new("machine_name") > > > > # Create a new service > > > > if Service.exists?("foo") > > Service.delete("foo") > > end > > > > s.create_service{ |s| > > s.service_name = "foo" > > s.binary_path_name = > "C:\Autonomy\DocumentumFetchOld\DocumentumFetchOld.exe" > > s.display_name = "My Foo Service" > > } > > > > > > # Configure a service that already exists > > s.configure_service{ |s| > > s.start_name = "start_name" > > s.password = "password" > > } > > > > s.close > > > > Service.start("foo") > > Service.pause("foo") > > Service.resume("foo") > > Service.stop("foo") > > > > Service.delete("foo") > > > > Service.getdisplayname("Schedule") # "Task Scheduler" > > Service.getservicename("ClipBook") # "ClipSrv" > > > > s = Service.status("ClipSrv") > > > > # Enumerate over all services, inspecting each struct > > Service.services{ |s| > > p s > > puts > > } > > > > Thanks! I guess it is due to the "\" character escaping. start_name = "domain_name\user_name" should be start_name = "domain_name\\user_name" or start_name = 'domain_name\user_name' Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070920/2d40fb6e/attachment.html From djberg96 at gmail.com Thu Sep 20 07:47:01 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 20 Sep 2007 05:47:01 -0600 Subject: [Win32utils-devel] IO.read - binary by default? Message-ID: <46F25DB5.2040003@gmail.com> Hi all, I'm sick of hitting bugs in 3rd party libs where the issue is that the authors didn't do a binary read on the data. It's hard to track down sometimes and it currently makes creating cross-platform code more difficult. Is there *any* downside to making IO.read binary by default (on Windows) that anyone can think of? Thanks, Dan From phurley at gmail.com Thu Sep 20 08:27:20 2007 From: phurley at gmail.com (Patrick Hurley) Date: Thu, 20 Sep 2007 08:27:20 -0400 Subject: [Win32utils-devel] IO.read - binary by default? In-Reply-To: <46F25DB5.2040003@gmail.com> References: <46F25DB5.2040003@gmail.com> Message-ID: <554ac39c0709200527n6c97ebfbib8de21c681ac6f42@mail.gmail.com> On 9/20/07, Daniel Berger wrote: > I'm sick of hitting bugs in 3rd party libs where the issue is that the > authors didn't do a binary read on the data. It's hard to track down > sometimes and it currently makes creating cross-platform code more > difficult. I agree > Is there *any* downside to making IO.read binary by default (on Windows) > that anyone can think of? When reading a text file with \r\n line endings, it will not "split" the same. pth From Daniel.Berger at qwest.com Thu Sep 20 14:56:18 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu, 20 Sep 2007 13:56:18 -0500 Subject: [Win32utils-devel] IO.read - binary by default? In-Reply-To: <554ac39c0709200527n6c97ebfbib8de21c681ac6f42@mail.gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E13@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Patrick Hurley > Sent: Thursday, September 20, 2007 6:27 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] IO.read - binary by default? > > > On 9/20/07, Daniel Berger wrote: > > I'm sick of hitting bugs in 3rd party libs where the issue > is that the > > authors didn't do a binary read on the data. It's hard to > track down > > sometimes and it currently makes creating cross-platform code more > > difficult. > > I agree > > > Is there *any* downside to making IO.read binary by default (on > > Windows) that anyone can think of? > > When reading a text file with \r\n line endings, it will not > "split" the same. Hm, what do you mean? For methods like IO.readlines and such? Couldn't we just modify those methods? Or did you mean something else? Regards, 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 phurley at gmail.com Thu Sep 20 15:37:37 2007 From: phurley at gmail.com (Patrick Hurley) Date: Thu, 20 Sep 2007 15:37:37 -0400 Subject: [Win32utils-devel] IO.read - binary by default? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72E13@ITOMAE2KM01.AD.QINTRA.COM> References: <554ac39c0709200527n6c97ebfbib8de21c681ac6f42@mail.gmail.com> <7524A45A1A5B264FA4809E2156496CFBE72E13@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <554ac39c0709201237p6a5167f7l9f8ce8bb68dab498@mail.gmail.com> On 9/20/07, Berger, Daniel wrote: > Hm, what do you mean? For methods like IO.readlines and such? Couldn't > we just modify those methods? Or did you mean something else? We could, but I am not sure you can unambiguously pull this off. Right now if you io.puts to a file on windows it writes \r\n, if the file is in binary, it only writes the \n. Won't this change break a lot of existing windows scripts? I wish I had a time machine, could go back to 1981 and smack someone at microsoft and get them to do this (and path separators) correctly from the start (and I would probably purchase some of there stock while I was there). But it is an unholy mess that cannot be easily fixed -- please tell me I am wrong :-) pth From djberg96 at gmail.com Thu Sep 20 20:35:10 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 20 Sep 2007 18:35:10 -0600 Subject: [Win32utils-devel] win32-service of win32utils In-Reply-To: References: <20070919165224.114DC5240C49@rubyforge.org> <46F1DBFA.9080703@gmail.com> Message-ID: <46F311BE.80907@gmail.com> Ah, excellent. Glad you got it figured out! Regards, Dan Yuhong Liu wrote: > Hi Dan, > > I think I have figured out the problem. The issue is because of the > setting of service type. So by default the service type is set as > Service::WIN32_OWN_PROCESS | Service::INTERACTIVE_PROCESS. This means > the service is configured to interact with the desktop, you cannot > change the service to run under a domain user account. So I changed the > code of configuring service by setting service type as WIN32_OWN_PROCESS. > > s.configure_service{ |s| > s.start_name = "name of the account" > s.password = "password" > s.service_type = Service::WIN32_OWN_PROCESS > } > > Then it works now. > > Thank you very much for the help. > > Kay > > > Date: Wed, 19 Sep 2007 20:33:30 -0600 > > From: djberg96 at gmail.com > > To: serphakay at hotmail.com > > Subject: Re: win32-service of win32utils > > > > Hi Kay, > > > > Just to be clear, you tried "domain_name\\user_name" and it didn't work? > > > > Regards, > > > > Dan > > > > Kay wrote: > > > I'm writing some scripts to programmatically change the user > account of running a windows service. So I downloaded one of the windows > utilities, win32-service, and wrote my scripts. However when I was > trying to use the following scripts to change the name of the account of > running a windows service > > > > > > > > > > > > s.configure_service{ |s| > > > > > > s.start_name = "name of the account" > > > > > > s.password = "password" # Note that I used plain text password > > > > > > } > > > > > > > > > > > > I was always given some kinds of error messages, which varied based > on different formats of the account name being used. So > > > > > > > > > > > > with start_name = "domain_name\user_name" (using \ for escaping and > have tried domain_name with either upper case or lower case), the > message is "the parameter is incorrect". > > > > > > > > > > > > with start_name = "domain_name\user_name" (have tried domain_name > with either upper case or lower case), the message is "the account name > is invalid or does not exist, or the password is invalid for the account > name specified". > > > > > > > > > > > > with start_name = "user_name at domain_name.com", the message is " the > parameter is incorrect". > > > > > > > > > > > > with start_name = "user_name at another_domain_name.com", > (another_domain_name is a possible domain name for me), the message is > "the specified domain either does not exist or could not be contacted". > > > > > > > > > > > > with start_name = "user_name", the message is "the account name is > invalid or does not exist, or the password is invalid for the account > name specified". > > > > > > > > > > > > So I'm writing to ask for your suggestions. BTW, do you think it's > right to use password in plain text? Your help is very appreciated. The > following is a full script I was using. > > > > > > > > > > > > base = File.basename(Dir.pwd) > > > > > > if base == "examples" || base =~ /win32-service/ > > > > > > require "ftools" > > > > > > Dir.chdir("..") if base == "examples" > > > > > > Dir.mkdir("win32") unless File.exists?("win32") > > > > > > File.copy("service.so","win32") > > > > > > $LOAD_PATH.unshift Dir.pwd > > > > > > end > > > > > > > > > > > > require "win32/service" > > > > > > include Win32 > > > > > > > > > > > > s = Service.new("machine_name") > > > > > > > > > > > > # Create a new service > > > > > > > > > > > > if Service.exists?("foo") > > > > > > Service.delete("foo") > > > > > > end > > > > > > > > > > > > s.create_service{ |s| > > > > > > s.service_name = "foo" > > > > > > s.binary_path_name = > "C:\Autonomy\DocumentumFetchOld\DocumentumFetchOld.exe" > > > > > > s.display_name = "My Foo Service" > > > > > > } > > > > > > > > > > > > > > > > > > # Configure a service that already exists > > > > > > s.configure_service{ |s| > > > > > > s.start_name = "start_name" > > > > > > s.password = "password" > > > > > > } > > > > > > > > > > > > s.close > > > > > > > > > > > > Service.start("foo") > > > > > > Service.pause("foo") > > > > > > Service.resume("foo") > > > > > > Service.stop("foo") > > > > > > > > > > > > Service.delete("foo") > > > > > > > > > > > > Service.getdisplayname("Schedule") # "Task Scheduler" > > > > > > Service.getservicename("ClipBook") # "ClipSrv" > > > > > > > > > > > > s = Service.status("ClipSrv") > > > > > > > > > > > > # Enumerate over all services, inspecting each struct > > > > > > Service.services{ |s| > > > > > > p s > > > > > > puts > > > > > > } > > > > > > > > > > > > Thanks! > > > > > > > ------------------------------------------------------------------------ > Invite your mail contacts to join your friends list with Windows Live > Spaces. It's easy! Try it! > From djberg96 at gmail.com Thu Sep 20 21:07:52 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 20 Sep 2007 19:07:52 -0600 Subject: [Win32utils-devel] win32-file-stat bug Message-ID: <46F31968.3090006@gmail.com> Heya all, Anyone have any ideas on this one? http://rubyforge.org/tracker/index.php?func=detail&aid=13825&group_id=85&atid=411 It's easy enough to rescue, I'd just like to know what MRI does in this case, so we can duplicate it. Regards, Dan From phasis at gmail.com Thu Sep 20 22:50:56 2007 From: phasis at gmail.com (Heesob Park) Date: Fri, 21 Sep 2007 11:50:56 +0900 Subject: [Win32utils-devel] win32-file-stat bug In-Reply-To: <46F31968.3090006@gmail.com> References: <46F31968.3090006@gmail.com> Message-ID: Hi, 2007/9/21, Daniel Berger : > Heya all, > > Anyone have any ideas on this one? > > > http://rubyforge.org/tracker/index.php?func=detail&aid=13825&group_id=85&atid=411 > > It's easy enough to rescue, I'd just like to know what MRI does in this > case, so we can duplicate it. > > Regards, > > Dan According to msdn( http://msdn2.microsoft.com/en-us/library/14h5k7ff(VS.71).aspx), st_ctime Time of creation of file. Valid on NTFS but not on FAT formatted disk drives. Maybe the Linux Samba version is not up-to-date. In my test with Samba 3.0.22, stat64 st_ctime works fine. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070921/6b7fef2a/attachment.html From Daniel.Berger at qwest.com Fri Sep 21 11:59:32 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Fri, 21 Sep 2007 10:59:32 -0500 Subject: [Win32utils-devel] Pure Ruby win32-open3, win32-service? Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E16@ITOMAE2KM01.AD.QINTRA.COM> Hi all, I can't remember - with callback support in our win32-api library now, can we turn win32-open3 and win32-service (specifically, the Daemon class) into pure Ruby libraries? If not, is there anything we could possibly add to win32-api so that we *could* make them pure Ruby? 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 djberg96 at gmail.com Sun Sep 23 11:28:27 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 23 Sep 2007 09:28:27 -0600 Subject: [Win32utils-devel] WinRuby? Message-ID: <46F6861B.2090708@gmail.com> Hi all, With the latest 1.8.6 release out today, I was wondering - what would you all think of a Windows-only fork of Ruby? I mean Perl has ActiveState, right? It ships with a slightly different interpreter and different libraries, so why not Ruby? Here's what I'm thinking: * Win2k or later. No 95/98/ME support. No cygwin/mingw, either. * Assume VC++ 8. Use whatever switches we want to optimize. * Scrap huge chunks of the stdlib, and add new libraries. * Use Windows specific functions where beneficial. * Remove UNIX-only functions/methods (or create equivalent functions). * TCHAR through and through, with possible Unicode benefits down the road. * ANSI C Areas I'm looking to improve specifically: File File::Stat Dir IO Process Socket Kernel#select Areas I'm looking to improve in general: Speed Tests (tailored for Windows) More Speed More Tests But, before I dive into this I would need serious help. How many of you would be willing to join me? I'm really looking for people who know C/C++, are at least somewhat familiar with the Windows API, and are willing to have commit access. On the other hand, if you absolutely HATE the idea, please say so. I don't want to chase anyone away. :) Lemme know! Regards, Dan From phasis at gmail.com Sun Sep 23 11:59:32 2007 From: phasis at gmail.com (Heesob Park) Date: Mon, 24 Sep 2007 00:59:32 +0900 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <46F6861B.2090708@gmail.com> References: <46F6861B.2090708@gmail.com> Message-ID: Hi, 2007/9/24, Daniel Berger : > > Hi all, > > With the latest 1.8.6 release out today, I was wondering - what would > you all think of a Windows-only fork of Ruby? I mean Perl has > ActiveState, right? It ships with a slightly different interpreter and > different libraries, so why not Ruby? > > Here's what I'm thinking: > > * Win2k or later. No 95/98/ME support. No cygwin/mingw, either. > * Assume VC++ 8. Use whatever switches we want to optimize. > * Scrap huge chunks of the stdlib, and add new libraries. > * Use Windows specific functions where beneficial. > * Remove UNIX-only functions/methods (or create equivalent functions). > * TCHAR through and through, with possible Unicode benefits down the road. > * ANSI C > > > Areas I'm looking to improve specifically: > > File > File::Stat > Dir > IO > Process > Socket > Kernel#select > > Areas I'm looking to improve in general: > > Speed > Tests (tailored for Windows) > More Speed > More Tests > > But, before I dive into this I would need serious help. How many of you > would be willing to join me? I'm really looking for people who know > C/C++, are at least somewhat familiar with the Windows API, and are > willing to have commit access. > > On the other hand, if you absolutely HATE the idea, please say so. I > don't want to chase anyone away. :) > > Lemme know! I agree totally with you. And I also hope the win32 native thread support if possible. The another area is the interface with .NET framework support(it is called IronRuby). I think if we made the WinRuby, the 3rdrail( http://www.codegear.com/products/3rdrail) could be the reliable distributer. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070924/4fac159a/attachment-0001.html From phurley at gmail.com Sun Sep 23 14:10:05 2007 From: phurley at gmail.com (Patrick Hurley) Date: Sun, 23 Sep 2007 14:10:05 -0400 Subject: [Win32utils-devel] WinRuby? In-Reply-To: References: <46F6861B.2090708@gmail.com> Message-ID: <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> On 9/23/07, Heesob Park wrote: > Hi, > > > 2007/9/24, Daniel Berger : > > Hi all, > > > > With the latest 1.8.6 release out today, I was wondering - what would > > you all think of a Windows-only fork of Ruby? I mean Perl has > > ActiveState, right? It ships with a slightly different interpreter and > > different libraries, so why not Ruby? > > > > Here's what I'm thinking: > > > > * Win2k or later. No 95/98/ME support. No cygwin/mingw, either. > > * Assume VC++ 8. Use whatever switches we want to optimize. > > * Scrap huge chunks of the stdlib, and add new libraries. > > * Use Windows specific functions where beneficial. > > * Remove UNIX-only functions/methods (or create equivalent functions). > > * TCHAR through and through, with possible Unicode benefits down the road. > > * ANSI C > > > > > > Areas I'm looking to improve specifically: > > > > File > > File::Stat > > Dir > > IO > > Process > > Socket > > Kernel#select > > > > Areas I'm looking to improve in general: > > > > Speed > > Tests (tailored for Windows) > > More Speed > > More Tests > > > > But, before I dive into this I would need serious help. How many of you > > would be willing to join me? I'm really looking for people who know > > C/C++, are at least somewhat familiar with the Windows API, and are > > willing to have commit access. > > > > On the other hand, if you absolutely HATE the idea, please say so. I > > don't want to chase anyone away. :) > > > > Lemme know! > > > I agree totally with you. > > And I also hope the win32 native thread support if possible. > > The another area is the interface with .NET framework support(it is called > IronRuby). > > I think if we made the WinRuby, the > 3rdrail(http://www.codegear.com/products/3rdrail) could be > the reliable distributer. > > Regards, > > Park Heesob > > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > Are we planing to support "fork" in a ActiveState sort of way? pth From djberg96 at gmail.com Sun Sep 23 14:57:35 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 23 Sep 2007 12:57:35 -0600 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> Message-ID: <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> On 9/23/07, Patrick Hurley wrote: > Are we planing to support "fork" in a ActiveState sort of way? > > pth I'm open to at least trying, but we should probably look at the latest AS Perl implementation. But, that's down the road a bit. My inclination is to fix Kernel#select first and see what falls out from that. Regards, Dan From djberg96 at gmail.com Sun Sep 23 15:04:02 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 23 Sep 2007 13:04:02 -0600 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> Message-ID: <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> On 9/23/07, Daniel Berger wrote: > On 9/23/07, Patrick Hurley wrote: > > > > > Are we planing to support "fork" in a ActiveState sort of way? > > > > pth > > I'm open to at least trying, but we should probably look at the latest > AS Perl implementation. But, that's down the road a bit. My > inclination is to fix Kernel#select first and see what falls out from > that. As a followup to that I'm considering turning Process into a class, and implementing Process.new so we can have lightweight processes ((or something along those lines). It was you, Patrick, that convinced me that we need both native threads AND lightweight processes of some sort. :) Regards, Dan From phurley at gmail.com Sun Sep 23 17:30:11 2007 From: phurley at gmail.com (Patrick Hurley) Date: Sun, 23 Sep 2007 17:30:11 -0400 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> Message-ID: <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> On 9/23/07, Daniel Berger wrote: > As a followup to that I'm considering turning Process into a class, > and implementing Process.new so we can have lightweight processes ((or > something along those lines). It was you, Patrick, that convinced me > that we need both native threads AND lightweight processes of some > sort. :) So are you thinking something along the lines of Evan Phonix's syndey, with a single global VM lock? pth From djberg96 at gmail.com Sun Sep 23 20:25:51 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 23 Sep 2007 18:25:51 -0600 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> Message-ID: <6037b70c0709231725k18ec869by9c6b875c501500da@mail.gmail.com> On 9/23/07, Patrick Hurley wrote: > On 9/23/07, Daniel Berger wrote: > > As a followup to that I'm considering turning Process into a class, > > and implementing Process.new so we can have lightweight processes ((or > > something along those lines). It was you, Patrick, that convinced me > > that we need both native threads AND lightweight processes of some > > sort. :) > > So are you thinking something along the lines of Evan Phonix's syndey, > with a single global VM lock? I'm not sure yet. That's down the road. For the early stages I just want to get the base classes and stdlib cleaned up, refactored, and sped up where possible. Regards, Dan From luislavena at gmail.com Sun Sep 23 22:43:13 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 23 Sep 2007 23:43:13 -0300 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <6037b70c0709231725k18ec869by9c6b875c501500da@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> <6037b70c0709231725k18ec869by9c6b875c501500da@mail.gmail.com> Message-ID: <71166b3b0709231943k5d72fa78mdabbf5f68ccbdb8e@mail.gmail.com> On 9/23/07, Daniel Berger wrote: > > I'm not sure yet. That's down the road. For the early stages I just > want to get the base classes and stdlib cleaned up, refactored, and > sped up where possible. > > Regards, > > Dan Dan, I just done a few rounds of test of latest release of ruby built with VC8, and to be honest, I get better performance from a hand-made build with MinGW. http://pastie.caboo.se/pastes/95210 I have pin-point almost every dependency needed by ruby 1.8.6 and built every extension bundled with it with VC8. The only one that I couldn't manage to get working was Tk, but I guess we could discard it ;-) Let me know if that helps the process, and I will like to see your VC8 numbers. Regards, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From djberg96 at gmail.com Sun Sep 23 23:42:36 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 23 Sep 2007 21:42:36 -0600 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <71166b3b0709231943k5d72fa78mdabbf5f68ccbdb8e@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> <6037b70c0709231725k18ec869by9c6b875c501500da@mail.gmail.com> <71166b3b0709231943k5d72fa78mdabbf5f68ccbdb8e@mail.gmail.com> Message-ID: <6037b70c0709232042vcb8729cqe2dfccac3044a9f@mail.gmail.com> On 9/23/07, Luis Lavena wrote: > On 9/23/07, Daniel Berger wrote: > > > > I'm not sure yet. That's down the road. For the early stages I just > > want to get the base classes and stdlib cleaned up, refactored, and > > sped up where possible. > > > > Regards, > > > > Dan > > Dan, I just done a few rounds of test of latest release of ruby built > with VC8, and to be honest, I get better performance from a hand-made > build with MinGW. > > http://pastie.caboo.se/pastes/95210 > > I have pin-point almost every dependency needed by ruby 1.8.6 and > built every extension bundled with it with VC8. > > The only one that I couldn't manage to get working was Tk, but I guess > we could discard it ;-) > > Let me know if that helps the process, and I will like to see your VC8 numbers. While that's interesting, speed isn't one of the primary factors in making WinRuby. It's just something I'd like to do along the way. I will not support mingw. VC 8 will be our compiler. Regards, Dan From luislavena at gmail.com Sun Sep 23 23:50:39 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 24 Sep 2007 00:50:39 -0300 Subject: [Win32utils-devel] WinRuby? In-Reply-To: <6037b70c0709232042vcb8729cqe2dfccac3044a9f@mail.gmail.com> References: <46F6861B.2090708@gmail.com> <554ac39c0709231110j4cc98507pdbc01f89a9870492@mail.gmail.com> <6037b70c0709231157tbe18788vfee8b01d3b3c261b@mail.gmail.com> <6037b70c0709231204w17f94f86j5dec1df536e87b83@mail.gmail.com> <554ac39c0709231430y579a3862o6b8c96c575cd523c@mail.gmail.com> <6037b70c0709231725k18ec869by9c6b875c501500da@mail.gmail.com> <71166b3b0709231943k5d72fa78mdabbf5f68ccbdb8e@mail.gmail.com> <6037b70c0709232042vcb8729cqe2dfccac3044a9f@mail.gmail.com> Message-ID: <71166b3b0709232050u35591fe9h6a746ac37343361@mail.gmail.com> On 9/24/07, Daniel Berger wrote: > While that's interesting, speed isn't one of the primary factors in > making WinRuby. It's just something I'd like to do along the way. I > will not support mingw. VC 8 will be our compiler. > Um, even that speed is one concern. I sympathize with you. With latest free compiler released by microsoft, we could provide a good fundation and could be easily expanded by end users (like solve the issue of no compilers will compile extensions for current release of ruby). As I said, I want to offer the time I invested in solve the dependencies to get base ruby built with VC8. >From the 21 official extensions (bundled with current mswin32 build), I only failed to build 2: tk and tk/tkutil. http://pastie.caboo.se/100080 I didn't take the msbuild / solutions path since to create them it requires VisualStudio, which I didn't installed to avoid conflict with free compiler distro. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From Daniel.Berger at qwest.com Tue Sep 25 09:29:48 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 25 Sep 2007 08:29:48 -0500 Subject: [Win32utils-devel] Using callbacks with ReadFileEx Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E27@ITOMAE2KM01.AD.QINTRA.COM> Hi all, First, I just realized I'll need to go back and fix some of the prototype declarations for windows-pr. The callback parameters will now need to be set to 'K'. ReadFileEx is one example of this. For purposes of my question, let's assume ReadFileEx has been declared like so: API.new('ReadFileEx', 'LPLPK', 'B') Now that we have callback support in win32-api, I thought I'd give asynchronous IO a shot. Problem is, I'm not sure how to do it in this case. What I would like is for the user to be able to provide a block, and have that block called once the read is finished. Here's what I've tried so far: require 'windows/file' require 'windows/handle' require 'windows/error' require 'windows/synchronize' require 'win32/event' module Windows module NIO include Windows::File include Windows::Handle include Windows::Error include Windows::Synchronize extend Windows::File extend Windows::Handle extend Windows::Error extend Windows::Synchronize class Error < StandardError; end def self.read_async(file, length=nil, offset=0, &block) handle = CreateFile( file, FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, 0 ) if handle == INVALID_HANDLE_VALUE raise Error, get_last_error end func = Win32::API::Callback.new('LLP', 'V'){ block.call } overlapped = 0.chr * 20 if offset > 0 overlapped[8,4] = [offset].pack('L') # OVERLAPPED.Offset end # Ruby's File.size fails for files over 2gb unless length size = [0].pack('Q') GetFileSizeEx(handle, size) length = size.unpack('Q').first end buf = 0.chr * length bool = ReadFileEx( handle, buf, length, overlapped, func ) unless bool err = get_last_error() CloseHandle(handle) raise Error, err end CloseHandle(handle) buf[0,length] end end end if $0 == __FILE__ include Win32 file = 'test.txt' data = NIO.read_async(file){ puts "Hello" } p data end When I run this, however, I get this error: C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in `call': wrong number of parameters: expected 1, got 0 (ArgumentEr ror) from C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in `get_last_error' from nio.rb:124:in `read_async' from nio.rb:140 What am I doing wrong here? 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 Daniel.Berger at qwest.com Tue Sep 25 14:10:07 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 25 Sep 2007 13:10:07 -0500 Subject: [Win32utils-devel] Using callbacks with ReadFileEx In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72E27@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E29@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Berger, Daniel > Sent: Tuesday, September 25, 2007 7:30 AM > To: Development and ideas for win32utils projects > Subject: [Win32utils-devel] Using callbacks with ReadFileEx > > > Hi all, > When I run this, however, I get this error: > > C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in > `call': wrong number of parameters: expected 1, got 0 (ArgumentEr > ror) > from C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in > `get_last_error' > from nio.rb:124:in `read_async' > from nio.rb:140 The "real" error is actually "The Parameter is incorrect". It seems I've smoked out a void prototype bug in win32/api. But, my original code still doesn't work. Regards, 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 Daniel.Berger at qwest.com Tue Sep 25 14:22:24 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 25 Sep 2007 13:22:24 -0500 Subject: [Win32utils-devel] Bug in win32-api with void prototypes? Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E2A@ITOMAE2KM01.AD.QINTRA.COM> Hi all, It seems that a void prototype requires an explicit argument in our version of win32/api: C:\>irb irb(main):001:0> require 'win32/api' => true irb(main):002:0> include Win32 => Object irb(main):003:0> require 'Win32API' => true # Our version irb(main):004:0> GetLastErrorA = API.new('GetLastError', 'V', 'L', 'kernel32') => # # Old version irb(main):005:0> GetLastErrorB = Win32API.new('kernel32', 'GetLastError', 'V', 'L') => # # Ours fails with no arguments irb(main):006:0> GetLastErrorA.call ArgumentError: wrong number of parameters: expected 1, got 0 from (irb):6:in `call' from (irb):6 # Works with an explicit nil - intentional? irb(main):007:0> GetLastErrorA.call(nil) => 10038 # Old version ignores it irb(main):008:0> GetLastErrorB.call => 10038 How should we handle this? Regards, 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 Wed Sep 26 09:22:13 2007 From: phasis at gmail.com (Heesob Park) Date: Wed, 26 Sep 2007 22:22:13 +0900 Subject: [Win32utils-devel] Using callbacks with ReadFileEx In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72E27@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72E27@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hi, 2007/9/25, Berger, Daniel : > > Hi all, > > First, I just realized I'll need to go back and fix some of the > prototype declarations for windows-pr. The callback parameters will now > need to be set to 'K'. ReadFileEx is one example of this. For purposes > of my question, let's assume ReadFileEx has been declared like so: > > API.new('ReadFileEx', 'LPLPK', 'B') > > Now that we have callback support in win32-api, I thought I'd give > asynchronous IO a shot. Problem is, I'm not sure how to do it in this > case. What I would like is for the user to be able to provide a block, > and have that block called once the read is finished. Here's what I've > tried so far: > > require 'windows/file' > require 'windows/handle' > require 'windows/error' > require 'windows/synchronize' > require 'win32/event' > > module Windows > module NIO > include Windows::File > include Windows::Handle > include Windows::Error > include Windows::Synchronize > extend Windows::File > extend Windows::Handle > extend Windows::Error > extend Windows::Synchronize > > class Error < StandardError; end > > def self.read_async(file, length=nil, offset=0, &block) > handle = CreateFile( > file, > FILE_READ_DATA, > FILE_SHARE_READ, > 0, > OPEN_EXISTING, > FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, > 0 > ) > > if handle == INVALID_HANDLE_VALUE > raise Error, get_last_error > end > > func = Win32::API::Callback.new('LLP', 'V'){ > block.call > } > > overlapped = 0.chr * 20 > > if offset > 0 > overlapped[8,4] = [offset].pack('L') # OVERLAPPED.Offset > end > > # Ruby's File.size fails for files over 2gb > unless length > size = [0].pack('Q') > GetFileSizeEx(handle, size) > length = size.unpack('Q').first > end > > buf = 0.chr * length > > bool = ReadFileEx( > handle, > buf, > length, > overlapped, > func > ) > > unless bool > err = get_last_error() > CloseHandle(handle) > raise Error, err > end > > CloseHandle(handle) > > buf[0,length] > end > end > end > > if $0 == __FILE__ > include Win32 > > file = 'test.txt' > data = NIO.read_async(file){ puts "Hello" } > p data > end > > When I run this, however, I get this error: > > C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in `call': wrong > number of parameters: expected 1, got 0 (ArgumentEr > ror) > from C:/ruby/lib/ruby/site_ruby/1.8/windows/error.rb:329:in > `get_last_error' > from nio.rb:124:in `read_async' > from nio.rb:140 > > What am I doing wrong here? There are two problems in your code. First, "FILE_FLAG_NO_BUFFERING" flag. MSDN says: An application must meet certain requirements when working with files opened with FILE_FLAG_NO_BUFFERING: File access must begin at byte offsets within the file that are integer multiples of the volume's sector size. To determine a volume's sector size, call the GetDiskFreeSpace function. File access must be for numbers of bytes that are integer multiples of the volume's sector size. For example, if the sector size is 512 bytes, an application can request reads and writes of 512, 1024, 1536, or 2048 bytes, but not of 335, 981, or 7171 bytes. Buffer addresses for read and write operations must be sector aligned (aligned on addresses in memory that are integer multiples of the volume's sector size). One way to sector align buffers is to use the VirtualAlloc function to allocate the buffers. This function allocates memory that is aligned on addresses that are integer multiples of the system's page size. Because both page and volume sector sizes are powers of 2, memory aligned by multiples of the system's page size is also aligned by multiples of the volume's sector size. In short words, the buffer length must be multiple of sector size and buffer address must be sector aligned. In my test, the length set to multiple of 1024 worked well. Or just removing FILE_FLAG_NO_BUFFERING flag will work. Second, lpCompletionRoutine callback function. The MSDN says: "lpCompletionRoutine [in] Pointer to the completion routine to be called when the read operation is complete and the calling thread is in an alertable wait state." The important bit being "alertable wait state". You can use SleepEx. In my test, Inserting SleepEx(1,1) between ReadFileEx and CloseHandle works fine. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070926/d2b3110e/attachment.html From phasis at gmail.com Wed Sep 26 09:30:38 2007 From: phasis at gmail.com (Heesob Park) Date: Wed, 26 Sep 2007 22:30:38 +0900 Subject: [Win32utils-devel] Bug in win32-api with void prototypes? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72E2A@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72E2A@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hi, 2007/9/26, Berger, Daniel : > > Hi all, > > It seems that a void prototype requires an explicit argument in our > version of win32/api: > > C:\>irb > irb(main):001:0> require 'win32/api' > => true > > irb(main):002:0> include Win32 > => Object > > irb(main):003:0> require 'Win32API' > => true > > # Our version > irb(main):004:0> GetLastErrorA = API.new('GetLastError', 'V', 'L', > 'kernel32') > => # > > # Old version > irb(main):005:0> GetLastErrorB = Win32API.new('kernel32', > 'GetLastError', 'V', 'L') > => # > > # Ours fails with no arguments > irb(main):006:0> GetLastErrorA.call > ArgumentError: wrong number of parameters: expected 1, got 0 > from (irb):6:in `call' > from (irb):6 > > # Works with an explicit nil - intentional? > irb(main):007:0> GetLastErrorA.call(nil) > => 10038 > > # Old version ignores it > irb(main):008:0> GetLastErrorB.call > => 10038 > > How should we handle this? If the api_call function is called with no argument, just set the argument v_args to [nil]. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070926/b3323ef4/attachment.html From luislavena at gmail.com Thu Sep 27 12:41:46 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 27 Sep 2007 13:41:46 -0300 Subject: [Win32utils-devel] Threads and IO (gets) still a problem for us? Message-ID: <71166b3b0709270941t5fa9be95s1e4dc61997172c84@mail.gmail.com> Hello Guys, I'm trying to get this working: t = Thread.new { while true puts "printing a line" sleep 2 end } gets t.exit puts "exiting" As you see, the idea is get multiple "printing a line" until a hit enter. The thing is this is a known problem for 1.8 on win32. I tried both mingw, VC6 and VC8 with the same results. Saw a post from Park Heesob patching this in 2003... but for 1.8.1. Should the new WinRuby propose a solution for this? :-D Just droping a new bomb on the battle field :-) In the meantime, there is a non-accepted patch for this? Park? Thanks in advance, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From Daniel.Berger at qwest.com Thu Sep 27 15:19:12 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu, 27 Sep 2007 14:19:12 -0500 Subject: [Win32utils-devel] Threads and IO (gets) still a problem for us? In-Reply-To: <71166b3b0709270941t5fa9be95s1e4dc61997172c84@mail.gmail.com> Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E36@ITOMAE2KM01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Luis Lavena > Sent: Thursday, September 27, 2007 10:42 AM > To: Development and ideas for win32utils projects > Subject: [Win32utils-devel] Threads and IO (gets) still a > problem for us? > > > Hello Guys, > > I'm trying to get this working: > > t = Thread.new { > while true > puts "printing a line" > sleep 2 > end > } > > gets > t.exit > puts "exiting" > > As you see, the idea is get multiple "printing a line" until > a hit enter. > > The thing is this is a known problem for 1.8 on win32. > > I tried both mingw, VC6 and VC8 with the same results. > > Saw a post from Park Heesob patching this in 2003... but for 1.8.1. > > Should the new WinRuby propose a solution for this? :-D Fixing Kernel#select for Windows is one of the goals. :) Regards, 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 luislavena at gmail.com Thu Sep 27 17:43:20 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 27 Sep 2007 18:43:20 -0300 Subject: [Win32utils-devel] Threads and IO (gets) still a problem for us? In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72E36@ITOMAE2KM01.AD.QINTRA.COM> References: <71166b3b0709270941t5fa9be95s1e4dc61997172c84@mail.gmail.com> <7524A45A1A5B264FA4809E2156496CFBE72E36@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <71166b3b0709271443r2a5bf1f7r5e3be0d86991c9de@mail.gmail.com> On 9/27/07, Berger, Daniel wrote: > > Fixing Kernel#select for Windows is one of the goals. :) > Good to know :-) btw, you didn't replied about my willing to share the partial dependency nightmare solution for Ruby 1.8.6 under VC8. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From Daniel.Berger at qwest.com Thu Sep 27 18:46:06 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu, 27 Sep 2007 17:46:06 -0500 Subject: [Win32utils-devel] Scattered I/O Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72E3D@ITOMAE2KM01.AD.QINTRA.COM> Hi all, I was just reading this article: http://www.artima.com/cppsource/scattered_io.html It made me wonder if we could use ReadFileScatter() and WriteFileGather() to optimize I/O on MS Windows. Any thoughts? Regards, 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 djberg96 at gmail.com Thu Sep 27 22:36:15 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 27 Sep 2007 20:36:15 -0600 Subject: [Win32utils-devel] Bug in win32-api with void prototypes? In-Reply-To: References: <7524A45A1A5B264FA4809E2156496CFBE72E2A@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <46FC689F.2000109@gmail.com> Heesob Park wrote: > Hi, > > 2007/9/26, Berger, Daniel >: > > Hi all, > > It seems that a void prototype requires an explicit argument in our > version of win32/api: > > C:\>irb > irb(main):001:0> require 'win32/api' > => true > > irb(main):002:0> include Win32 > => Object > > irb(main):003:0> require 'Win32API' > => true > > # Our version > irb(main):004:0> GetLastErrorA = API.new('GetLastError', 'V', 'L', > 'kernel32') > => # > > # Old version > irb(main):005:0> GetLastErrorB = Win32API.new ('kernel32', > 'GetLastError', 'V', 'L') > => # > > # Ours fails with no arguments > irb(main):006:0> GetLastErrorA.call > ArgumentError: wrong number of parameters: expected 1, got 0 > from (irb):6:in `call' > from (irb):6 > > # Works with an explicit nil - intentional? > irb(main):007:0> GetLastErrorA.call(nil) > => 10038 > > # Old version ignores it > irb(main):008:0> GetLastErrorB.call > => 10038 > > How should we handle this? > > > If the api_call function is called with no argument, just set the > argument v_args to [nil]. I released 1.0.1 tonight which fixes this issue. Regards, Dan From djberg96 at gmail.com Thu Sep 27 22:49:52 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 27 Sep 2007 20:49:52 -0600 Subject: [Win32utils-devel] win32-file-stat bug In-Reply-To: References: <46F31968.3090006@gmail.com> Message-ID: <46FC6BD0.3090300@gmail.com> Heesob Park wrote: > Hi, > > 2007/9/21, Daniel Berger >: > > Heya all, > > Anyone have any ideas on this one? > > http://rubyforge.org/tracker/index.php?func=detail&aid=13825&group_id=85&atid=411 > > > It's easy enough to rescue, I'd just like to know what MRI does in this > case, so we can duplicate it. > > Regards, > > Dan > > > According to > msdn(http://msdn2.microsoft.com/en-us/library/14h5k7ff(VS.71).aspx), > > st_ctime > Time of creation of file. Valid on NTFS but not on FAT formatted disk > drives. > > Maybe the Linux Samba version is not up-to-date. > > In my test with Samba 3.0.22, stat64 st_ctime works fine. Hm, how do you think we should handle this, though? Set the times to Time.at(0)? Time.now? nil? I'm guessing that Time.at(0) is what MRI returns. Regards, Dan From djberg96 at gmail.com Thu Sep 27 23:14:34 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Thu, 27 Sep 2007 21:14:34 -0600 Subject: [Win32utils-devel] Windows programming books? Message-ID: <46FC719A.2010705@gmail.com> Hi all, What do you all use for your Windows programming books? I've got Jeffrey Richter's "Advanced Windows, 3rd edition", and it's pretty good, though a little dated at this point. Suggestions? Thanks, Dan From phasis at gmail.com Fri Sep 28 00:16:32 2007 From: phasis at gmail.com (Heesob Park) Date: Fri, 28 Sep 2007 13:16:32 +0900 Subject: [Win32utils-devel] Windows programming books? In-Reply-To: <46FC719A.2010705@gmail.com> References: <46FC719A.2010705@gmail.com> Message-ID: Hi, 2007/9/28, Daniel Berger : > > Hi all, > > What do you all use for your Windows programming books? I've got Jeffrey > Richter's "Advanced Windows, 3rd edition", and it's pretty good, though > a little dated at this point. > > Suggestions? > > Thanks, > > Dan How about Johnson M.Hart's "Windows System Programming, 3rd Edition" and Charles Petzold's "Programming Windows, 5th Edition"? I have read the first and second edition. Now, I don't need a book any more for programming. My reference is google and MSDN. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070928/485825fd/attachment.html From waynev at gmail.com Fri Sep 28 00:18:08 2007 From: waynev at gmail.com (Wayne Vucenic) Date: Thu, 27 Sep 2007 21:18:08 -0700 Subject: [Win32utils-devel] Windows programming books? In-Reply-To: <46FC719A.2010705@gmail.com> References: <46FC719A.2010705@gmail.com> Message-ID: <88c9ce410709272118s75146492j9cfe8b070c60f3d6@mail.gmail.com> Hi Dan, I have Richter's book, but I don't much like it. In a number of places, when it starts discussing some concept, it makes a statement like "X always behaves like Y". But then, 10 or 20 pages later, in passing it says "X doesn't behave like Y in the case that...". To me, this makes the book almost useless as a reference. On more than one occasion, I wanted to learn about X, so I looked it up, found out that "X always behaves like Y", and wrote my code accordingly. It was only after my code didn't work right that I read further and found out there were exceptions or qualifications to the above statement. A book that I much prefer, that covers a similar set of topics, is "Win32 System Services: The Heart of Windows 98 and Windows 2000", 3rd ed, by Marshall Brain and Ron Reeves. As the title implies, this book is also a bit dated now. (But the advantage of that is that used copies are pretty cheap on Amazon.) I also like John Robbins' books on debugging. Not only is debugging a useful skill, but in explaining how to do really good debugging Robbins often explains how parts of Windows works, or how to do certain things. Depending on what I'm doing, I also find the following books useful: Windows Internals, 4th ed by Russinovich and Solomon Undocumented Windows NT by Dabak, et al. Undocumented Windows 2000 Secrets by Schreiber Windows NT/2000 Native API Reference by Nebbett I hope this helps! Take care, Wayne On 9/27/07, Daniel Berger wrote: > Hi all, > > What do you all use for your Windows programming books? I've got Jeffrey > Richter's "Advanced Windows, 3rd edition", and it's pretty good, though > a little dated at this point. > > Suggestions? > > Thanks, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > From phasis at gmail.com Fri Sep 28 00:18:13 2007 From: phasis at gmail.com (Heesob Park) Date: Fri, 28 Sep 2007 13:18:13 +0900 Subject: [Win32utils-devel] win32-file-stat bug In-Reply-To: <46FC6BD0.3090300@gmail.com> References: <46F31968.3090006@gmail.com> <46FC6BD0.3090300@gmail.com> Message-ID: 2007/9/28, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > 2007/9/21, Daniel Berger >>: > > > > Heya all, > > > > Anyone have any ideas on this one? > > > > > http://rubyforge.org/tracker/index.php?func=detail&aid=13825&group_id=85&atid=411 > > < > http://rubyforge.org/tracker/index.php?func=detail&aid=13825&group_id=85&atid=411 > > > > > > It's easy enough to rescue, I'd just like to know what MRI does in > this > > case, so we can duplicate it. > > > > Regards, > > > > Dan > > > > > > According to > > msdn(http://msdn2.microsoft.com/en-us/library/14h5k7ff(VS.71).aspx), > > > > st_ctime > > Time of creation of file. Valid on NTFS but not on FAT formatted disk > > drives. > > > > Maybe the Linux Samba version is not up-to-date. > > > > In my test with Samba 3.0.22, stat64 st_ctime works fine. > > Hm, how do you think we should handle this, though? Set the times to > Time.at(0)? Time.now? nil? > > I'm guessing that Time.at(0) is what MRI returns. I think Time.at(0) is a reasonable workaround. Regards, Park Heesob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070928/8841a800/attachment.html From waynev at gmail.com Fri Sep 28 00:31:48 2007 From: waynev at gmail.com (Wayne Vucenic) Date: Thu, 27 Sep 2007 21:31:48 -0700 Subject: [Win32utils-devel] Windows programming books? In-Reply-To: <46FC719A.2010705@gmail.com> References: <46FC719A.2010705@gmail.com> Message-ID: <88c9ce410709272131y1d6523bem863ac4c64e7b7f8a@mail.gmail.com> P.S. Also "Windows NT Win32 API Superbible" by Richard J. Simon. It's again old (1997), but again used copies are pretty cheap on Amazon. And big parts of the Win32 API haven't changed much since 1997. It divides the API calls into 30 chapters by function, for example "Memory Management" or "The Clipboard". There are C code snippets (all also on the enclosed CD-ROM) showing how to call many of the APIs. The description of each API call isn't nearly as detailed as on MSDN (otherwise this book would be a lot longer than its 1500 pages), and sometimes they leave out important information. But I find it amazingly helpful when I'm working in a given area to be able to see all the API calls in one place. Sometimes it's also convenient to use a book rather than going online. But after I find what I'm looking for I usually double-check it on MSDN. Wayne From noreply at rubyforge.org Fri Sep 28 04:23:41 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 28 Sep 2007 04:23:41 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-14298 ] windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Message-ID: <20070928082347.222655240E75@rubyforge.org> Bugs item #14298, was opened at 2007-09-28 10:23 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Lars Olsson (lasso) Assigned to: Nobody (None) Summary: windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Initial Comment: The latest version of windows-api/windows-pr segfault my ruby when I require 'win32/file'. The previous version worked without problems. Sample code (segfaults, uncomment lines to use older working gems instead): require 'rubygems' # gem 'windows-api', '=0.1.1' # gem 'windows-pr', '=0.7.0' require 'win32/file' System information ================== OS Name: Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600 C:\temp\rs2exe>ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\temp\rs2exe>gem list windows-api ... windows-api (0.2.0, 0.1.1) An easier way to create methods using Win32API C:\temp\rs2exe>gem list windows-pr ... windows-pr (0.7.1, 0.7.0) Windows functions and constants bundled via Win32::API C:\temp\rs2exe>gem list win32-file ... win32-file (0.5.4) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.5) A File::Stat class tailored to MS Windows ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 From noreply at rubyforge.org Fri Sep 28 07:09:27 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 28 Sep 2007 07:09:27 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-14298 ] windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Message-ID: <20070928110927.1C6825240A4F@rubyforge.org> Bugs item #14298, was opened at 2007-09-28 01:23 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Lars Olsson (lasso) Assigned to: Nobody (None) Summary: windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Initial Comment: The latest version of windows-api/windows-pr segfault my ruby when I require 'win32/file'. The previous version worked without problems. Sample code (segfaults, uncomment lines to use older working gems instead): require 'rubygems' # gem 'windows-api', '=0.1.1' # gem 'windows-pr', '=0.7.0' require 'win32/file' System information ================== OS Name: Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600 C:\temp\rs2exe>ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\temp\rs2exe>gem list windows-api ... windows-api (0.2.0, 0.1.1) An easier way to create methods using Win32API C:\temp\rs2exe>gem list windows-pr ... windows-pr (0.7.1, 0.7.0) Windows functions and constants bundled via Win32::API C:\temp\rs2exe>gem list win32-file ... win32-file (0.5.4) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.5) A File::Stat class tailored to MS Windows ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-09-28 04:09 Message: Hi, Ugh, you're right. I see this: irb(main):001:0> require 'win32/file' C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Looks like something in File::Stat. Let me dig deeper. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 From noreply at rubyforge.org Fri Sep 28 07:17:19 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 28 Sep 2007 07:17:19 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-14298 ] windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Message-ID: <20070928111720.406595240A9D@rubyforge.org> Bugs item #14298, was opened at 2007-09-28 01:23 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Lars Olsson (lasso) Assigned to: Nobody (None) Summary: windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Initial Comment: The latest version of windows-api/windows-pr segfault my ruby when I require 'win32/file'. The previous version worked without problems. Sample code (segfaults, uncomment lines to use older working gems instead): require 'rubygems' # gem 'windows-api', '=0.1.1' # gem 'windows-pr', '=0.7.0' require 'win32/file' System information ================== OS Name: Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600 C:\temp\rs2exe>ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\temp\rs2exe>gem list windows-api ... windows-api (0.2.0, 0.1.1) An easier way to create methods using Win32API C:\temp\rs2exe>gem list windows-pr ... windows-pr (0.7.1, 0.7.0) Windows functions and constants bundled via Win32::API C:\temp\rs2exe>gem list win32-file ... win32-file (0.5.4) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.5) A File::Stat class tailored to MS Windows ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2007-09-28 04:17 Message: More info. If I require 'win32/file/stat' first, then 'win32/file', it works ok. Not sure why yet: C:\Documents and Settings\djberge\workspace\windows-pr>irb irb(main):001:0> require 'win32/file/stat' => true irb(main):002:0> require 'win32/file' => true irb(main):003:0> quit C:\Documents and Settings\djberge\workspace\windows-pr>irb irb(main):001:0> require 'win32/file' C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2007-09-28 04:09 Message: Hi, Ugh, you're right. I see this: irb(main):001:0> require 'win32/file' C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Looks like something in File::Stat. Let me dig deeper. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 From noreply at rubyforge.org Fri Sep 28 07:30:59 2007 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 28 Sep 2007 07:30:59 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-14298 ] windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Message-ID: <20070928113100.0D1E65240A85@rubyforge.org> Bugs item #14298, was opened at 2007-09-28 10:23 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Lars Olsson (lasso) Assigned to: Nobody (None) Summary: windows-api 0.2.0/windows-pr 0.7.1 causes segfault with require of win32/file Initial Comment: The latest version of windows-api/windows-pr segfault my ruby when I require 'win32/file'. The previous version worked without problems. Sample code (segfaults, uncomment lines to use older working gems instead): require 'rubygems' # gem 'windows-api', '=0.1.1' # gem 'windows-pr', '=0.7.0' require 'win32/file' System information ================== OS Name: Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600 C:\temp\rs2exe>ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] C:\temp\rs2exe>gem list windows-api ... windows-api (0.2.0, 0.1.1) An easier way to create methods using Win32API C:\temp\rs2exe>gem list windows-pr ... windows-pr (0.7.1, 0.7.0) Windows functions and constants bundled via Win32::API C:\temp\rs2exe>gem list win32-file ... win32-file (0.5.4) Extra or redefined methods for the File class on Windows. win32-file-stat (1.2.5) A File::Stat class tailored to MS Windows ---------------------------------------------------------------------- >Comment By: Lars Olsson (lasso) Date: 2007-09-28 13:30 Message: running ruby with -d gives: Exception `LoadError' at C:/Program/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_requ ire.rb:27 - no such file to load -- win32/file Exception `Win32::API::Error' at C:/Program/Ruby/lib/ruby/gems/1.8/gems/windows- api-0.2.0/lib/windows/api.rb:211 - GetProcAddress() failed for '_mktemp_s', '_mktemp_sA' and '_mktemp_sW': Det g?r inte att hitta den angivna proceduren. C:/Program/Ruby/lib/ruby/gems/1.8/gems/windows-api- 0.2.0/lib/windows/api.rb:211: [BUG] Segmentation fault ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2007-09-28 13:17 Message: More info. If I require 'win32/file/stat' first, then 'win32/file', it works ok. Not sure why yet: C:\Documents and Settings\djberge\workspace\windows-pr>irb irb(main):001:0> require 'win32/file/stat' => true irb(main):002:0> require 'win32/file' => true irb(main):003:0> quit C:\Documents and Settings\djberge\workspace\windows-pr>irb irb(main):001:0> require 'win32/file' C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2007-09-28 13:09 Message: Hi, Ugh, you're right. I see this: irb(main):001:0> require 'win32/file' C:/ruby/lib/ruby/1.8/prettyprint.rb:182: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Looks like something in File::Stat. Let me dig deeper. Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=14298&group_id=85 From djberg96 at gmail.com Fri Sep 28 08:41:14 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 28 Sep 2007 06:41:14 -0600 Subject: [Win32utils-devel] Help with win32/api, windows-api Message-ID: <46FCF66A.8020202@gmail.com> Hi all, I must have been testing windows-pr with an old version of windows-api, because now when I run 'rake test' for windows-pr I get this: C:\Documents and Settings\djberge\workspace\windows-pr>rake test C:0:Warning: require_gem is obsolete. Use gem instead. (in C:/Documents and Settings/djberge/workspace/windows-pr) C:/ruby/lib/ruby/site_ruby/1.8/windows/api.rb:288: warning: instance variable @boolean not initialized C:/ruby/lib/ruby/1.8/openssl/buffering.rb:98: [BUG] Segmentation fault ruby 1.8.5 (2006-08-25) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. rake aborted! Command failed with status (3): [C:/ruby/bin/ruby -w -Ilib;lib;lib/windows ...] (See full trace by running task with --trace) The warning is bizarre. How can @boolean be uninitialized? The line number for the segfault it baffling. If I revert back to using an older version of windows-api (that uses the stdlib Win32API) everything works fine. We seemed to have messed up something in win32/api, but I couldn't tell you what. Help please!!! Regards, Dan From phasis at gmail.com Fri Sep 28 09:37:17 2007 From: phasis at gmail.com (Heesob Park) Date: Fri, 28 Sep 2007 22:37:17 +0900 Subject: [Win32utils-devel] Help with win32/api, windows-api In-Reply-To: <46FCF66A.8020202@gmail.com> References: <46FCF66A.8020202@gmail.com> Message-ID: Hi, 2007/9/28, Daniel Berger : > > Hi all, > > I must have been testing windows-pr with an old version of windows-api, > because now when I run 'rake test' for windows-pr I get this: > > C:\Documents and Settings\djberge\workspace\windows-pr>rake test > C:0:Warning: require_gem is obsolete. Use gem instead. > (in C:/Documents and Settings/djberge/workspace/windows-pr) > C:/ruby/lib/ruby/site_ruby/1.8/windows/api.rb:288: warning: instance > variable @boolean not initialized > C:/ruby/lib/ruby/1.8/openssl/buffering.rb:98: [BUG] Segmentation fault > ruby 1.8.5 (2006-08-25) [i386-mswin32] > > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > rake aborted! > Command failed with status (3): [C:/ruby/bin/ruby -w > -Ilib;lib;lib/windows ...] > > (See full trace by running task with --trace) > > The warning is bizarre. How can @boolean be uninitialized? The line > number for the segfault it baffling. > > If I revert back to using an older version of windows-api (that uses the > stdlib Win32API) everything works fine. We seemed to have messed up > something in win32/api, but I couldn't tell you what. > > Help please!!! The culprit is the pointer as always. typedef struct { HANDLE library; FARPROC function; int return_type; int prototype[]; } Win32API; in api.c should be typedef struct { HANDLE library; FARPROC function; int return_type; int prototype[16]; } Win32API; Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20070928/3fc84fca/attachment.html From djberg96 at gmail.com Fri Sep 28 22:19:30 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 28 Sep 2007 20:19:30 -0600 Subject: [Win32utils-devel] Pass by reference bug in win32/api? Message-ID: <46FDB632.4050503@gmail.com> I spotted this as the result of the latest win32-file-stat tests I've been running: require 'windows/path' include Windows::Path file1 = 'test' file2 = file1.dup PathStripToRoot(file1) p file1 => "\000est" p file1 => "\000est" Win32API (stdlib) doesn't do this. Is this our fault? Regards, Dan From djberg96 at gmail.com Fri Sep 28 22:31:27 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 28 Sep 2007 20:31:27 -0600 Subject: [Win32utils-devel] Fixed pass by reference bug Message-ID: <46FDB8FF.60804@gmail.com> Fixed the last bug. We were missing a rb_str_modify() in the call function. I'll fix and release. Regards, Dan From djberg96 at gmail.com Sun Sep 30 00:15:41 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 29 Sep 2007 22:15:41 -0600 Subject: [Win32utils-devel] Giving folks access to Win2k Message-ID: <46FF22ED.7020804@gmail.com> Hi all, As fate would have it I'm giving away my old desktop to a friend who has no computer. The upside is that means I have room to setup my old-old desktop, which happens to have Windows 2000 on it. It's a dual Pentium-II 400 with 512mb of RAM. I installed the Ruby 1.8.6 one-click on it, and it already had VC++ 6 on it. Fairly zippy, actually. What I would like to do is give certain people access to the machine. Preferably, just a command line login. Unfortunately, the only things I saw online for command line logins were commercial products. I thought about firing up the telnet service, but it seems to require NTLM authentication. My attempts to configure ntml were foiled - for some reason the OS thinks I don't have admin privileges (I do). Any suggestions? I'm willing to pay money if you think there's a commercial product out there that's worth it (I saw rlogind from MKS Software - any good?), but I would prefer a free solution if possible. You can email me offline (djberg96 at gmail dot com) if you prefer to take this offline. Thanks, Dan From luislavena at gmail.com Sun Sep 30 11:52:00 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 30 Sep 2007 12:52:00 -0300 Subject: [Win32utils-devel] Giving folks access to Win2k In-Reply-To: <46FF22ED.7020804@gmail.com> References: <46FF22ED.7020804@gmail.com> Message-ID: <71166b3b0709300852u4af487e4ycc9836d2ad0e8b2b@mail.gmail.com> On 9/30/07, Daniel Berger wrote: > Hi all, > > As fate would have it I'm giving away my old desktop to a friend who has > no computer. The upside is that means I have room to setup my old-old > desktop, which happens to have Windows 2000 on it. > > It's a dual Pentium-II 400 with 512mb of RAM. I installed the Ruby 1.8.6 > one-click on it, and it already had VC++ 6 on it. Fairly zippy, actually. > > What I would like to do is give certain people access to the machine. > Preferably, just a command line login. > > Unfortunately, the only things I saw online for command line logins were > commercial products. I thought about firing up the telnet service, but > it seems to require NTLM authentication. My attempts to configure ntml > were foiled - for some reason the OS thinks I don't have admin > privileges (I do). > > Any suggestions? I'm willing to pay money if you think there's a > commercial product out there that's worth it (I saw rlogind from MKS > Software - any good?), but I would prefer a free solution if possible. > > You can email me offline (djberg96 at gmail dot com) if you prefer to > take this offline. > Daniel, what about OpenSSH for Windows? http://sshwindows.sourceforge.net/ I know its a bit old (2004) and runs under cygwin, but if let you access to the command line, could be helpful. -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi From djberg96 at gmail.com Sun Sep 30 12:11:58 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 30 Sep 2007 10:11:58 -0600 Subject: [Win32utils-devel] Giving folks access to Win2k In-Reply-To: <71166b3b0709300852u4af487e4ycc9836d2ad0e8b2b@mail.gmail.com> References: <46FF22ED.7020804@gmail.com> <71166b3b0709300852u4af487e4ycc9836d2ad0e8b2b@mail.gmail.com> Message-ID: <46FFCACE.4020902@gmail.com> Luis Lavena wrote: > Daniel, what about OpenSSH for Windows? > > http://sshwindows.sourceforge.net/ > > I know its a bit old (2004) and runs under cygwin, but if let you > access to the command line, could be helpful. The problem there is that then the users would be in the cygwin environment, not the "real" Windows environment, which defeats the purpose of my real reason for wanting to give people access to the box - cross-platform testing. :) Regards, Dan From phasis at gmail.com Sun Sep 30 21:12:38 2007 From: phasis at gmail.com (Heesob Park) Date: Mon, 1 Oct 2007 10:12:38 +0900 Subject: [Win32utils-devel] Giving folks access to Win2k In-Reply-To: <46FF22ED.7020804@gmail.com> References: <46FF22ED.7020804@gmail.com> Message-ID: Hi, 2007/9/30, Daniel Berger : > > Hi all, > > As fate would have it I'm giving away my old desktop to a friend who has > no computer. The upside is that means I have room to setup my old-old > desktop, which happens to have Windows 2000 on it. > > It's a dual Pentium-II 400 with 512mb of RAM. I installed the Ruby 1.8.6 > one-click on it, and it already had VC++ 6 on it. Fairly zippy, actually. > > What I would like to do is give certain people access to the machine. > Preferably, just a command line login. > > Unfortunately, the only things I saw online for command line logins were > commercial products. I thought about firing up the telnet service, but > it seems to require NTLM authentication. My attempts to configure ntml > were foiled - for some reason the OS thinks I don't have admin > privileges (I do). > > Any suggestions? I'm willing to pay money if you think there's a > commercial product out there that's worth it (I saw rlogind from MKS > Software - any good?), but I would prefer a free solution if possible. > > You can email me offline (djberg96 at gmail dot com) if you prefer to > take this offline. > > Thanks, > > Dan How about KpyM Telnet/SSH Server? http://www.kpym.com It is a free, open source telnet/ssh server for Windows. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071001/0a858055/attachment.html From djberg96 at gmail.com Sun Sep 30 22:29:04 2007 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 30 Sep 2007 20:29:04 -0600 Subject: [Win32utils-devel] Giving folks access to Win2k In-Reply-To: References: <46FF22ED.7020804@gmail.com> Message-ID: <47005B70.4030402@gmail.com> Heesob Park wrote: > Hi, > How about KpyM Telnet/SSH Server? > > http://www.kpym.com > > It is a free, open source telnet/ssh server for Windows. That seems to be working, thanks. I just realized that this might be a moot point without a static IP, however. I've got DSL using DHCP. So, for the moment, I think I can only login from my living room. Suggestions welcome. :) Thanks, Dan From phasis at gmail.com Sun Sep 30 22:54:27 2007 From: phasis at gmail.com (Heesob Park) Date: Mon, 1 Oct 2007 11:54:27 +0900 Subject: [Win32utils-devel] Giving folks access to Win2k In-Reply-To: <47005B70.4030402@gmail.com> References: <46FF22ED.7020804@gmail.com> <47005B70.4030402@gmail.com> Message-ID: Hi, 2007/10/1, Daniel Berger : > > Heesob Park wrote: > > Hi, > > > > > How about KpyM Telnet/SSH Server? > > > > http://www.kpym.com > > > > It is a free, open source telnet/ssh server for Windows. > > That seems to be working, thanks. > > I just realized that this might be a moot point without a static IP, > however. I've got DSL using DHCP. So, for the moment, I think I can only > login from my living room. > > Suggestions welcome. :) Did you try DDNS(Dynamic DNS) service? www.dyndns.com www.dnip.net www.no-ip.com Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20071001/2342a774/attachment.html