From djberg96 at gmail.com Fri Oct 6 16:02:38 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 06 Oct 2006 14:02:38 -0600 Subject: [Win32utils-devel] Need some help with latest win32-mmap Message-ID: <4526B65E.6070508@gmail.com> Hi all, I've got the latest win32-mmap code checked into CVS. Unfortunately, it seems that I'm not able to open an existing mapping and retrieve set data. Below is a simple example that seems like it ought to work but doesn't. Any ideas? # map1.rb require 'win32/mmap' include Win32 mmap = MMap.new(:name => 'alpha', :size => 20) p mmap.address mmap.test = "hello" mmap.close # map2.rb # mmap = MMap.open('alpha') # Boom! mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... p mmap.test # Boom! mmap.close I tried using MMap.open and MMap.new. Neither seems to work as expected. What am I doing wrong? Thanks, Dan PS - The code that actually gets and sets shared data is in method_missing. From phasis at gmail.com Mon Oct 9 01:02:51 2006 From: phasis at gmail.com (Heesob Park) Date: Mon, 9 Oct 2006 14:02:51 +0900 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <4526B65E.6070508@gmail.com> References: <4526B65E.6070508@gmail.com> Message-ID: Hi, 2006/10/7, Daniel Berger : > > Hi all, > > I've got the latest win32-mmap code checked into CVS. Unfortunately, it > seems that I'm not able to open an existing mapping and retrieve set > data. Below is a simple example that seems like it ought to work but > doesn't. Any ideas? > > # map1.rb > require 'win32/mmap' > include Win32 > > mmap = MMap.new(:name => 'alpha', :size => 20) > p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open('alpha') # Boom! > > mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work as > expected. What am I doing wrong? That's strange. I downloaded and tested the win32-mmap and your map1.rb and map2.rb It runs ok and seems to work as expected. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061009/19f9e144/attachment.html From Daniel.Berger at qwest.com Mon Oct 9 16:47:44 2006 From: Daniel.Berger at qwest.com (Daniel Berger) Date: Mon, 09 Oct 2006 14:47:44 -0600 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: References: <4526B65E.6070508@gmail.com> Message-ID: <452AB570.2070105@qwest.com> Heesob Park wrote: > Hi, > > 2006/10/7, Daniel Berger >: > > Hi all, > > I've got the latest win32-mmap code checked into CVS. Unfortunately, it > seems that I'm not able to open an existing mapping and retrieve set > data. Below is a simple example that seems like it ought to work but > doesn't. Any ideas? > > # map1.rb > require 'win32/mmap' > include Win32 > > mmap = MMap.new(:name => 'alpha', :size => 20) > p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open('alpha') # Boom! > > mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work as > expected. What am I doing wrong? > > > That's strange. > I downloaded and tested the win32-mmap and your map1.rb and map2.rb > It runs ok and seems to work as expected. > > Regards, > > Park Heesob Really? When you run map2.rb you see "hello"? When I run map2.rb I get the same address. But when I run map2.rb I get an error at mmap.rb, line 270: 'load - marshal data too short'. It seems that I'm getting an empty buffer from the memcpy, but I don't understand why. I just tried this at work, too - same result. 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 Mon Oct 9 22:02:21 2006 From: phasis at gmail.com (Heesob Park) Date: Tue, 10 Oct 2006 11:02:21 +0900 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <452AB570.2070105@qwest.com> References: <4526B65E.6070508@gmail.com> <452AB570.2070105@qwest.com> Message-ID: Hi, 2006/10/10, Daniel Berger : > Heesob Park wrote: > > Hi, > > > > 2006/10/7, Daniel Berger >>: > > > > Hi all, > > > > I've got the latest win32-mmap code checked into > CVS. Unfortunately, it > > seems that I'm not able to open an existing mapping and retrieve set > > data. Below is a simple example that seems like it ought to work > but > > doesn't. Any ideas? > > > > # map1.rb > > require 'win32/mmap' > > include Win32 > > > > mmap = MMap.new(:name => 'alpha', :size => 20) > > p mmap.address > > > > mmap.test = "hello" > > > > mmap.close > > > > # map2.rb > > # mmap = MMap.open('alpha') # Boom! > > > > mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... > > p mmap.test # Boom! > > > > mmap.close > > > > I tried using MMap.open and MMap.new. Neither seems to work as > > expected. What am I doing wrong? > > > > > > That's strange. > > I downloaded and tested the win32-mmap and your map1.rb and map2.rb > > It runs ok and seems to work as expected. > > > > Regards, > > > > Park Heesob > > Really? When you run map2.rb you see "hello"? > > When I run map2.rb I get the same address. But when I run map2.rb I get > an > error at mmap.rb, line 270: 'load - marshal data too short'. It seems > that I'm > getting an empty buffer from the memcpy, but I don't understand why. > > I just tried this at work, too - same result. As a matter of fact I modified map1.rb like this: require 'win32/mmap' include Win32 mmap = MMap.new(:name => 'alpha', :size => 20) p mmap.address mmap.test = "hello" sleep 1000 mmap.close And run map1.rb in one console and run map2.rb in another console. When running map2.rb only, I also get "marshal data too short" error. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061010/a0585682/attachment.html From johan.nilsson at esrange.ssc.se Tue Oct 10 02:51:29 2006 From: johan.nilsson at esrange.ssc.se (Johan Nilsson) Date: Tue, 10 Oct 2006 08:51:29 +0200 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <4526B65E.6070508@gmail.com> Message-ID: <6D2C2D1D3D1E8040AEFA12C90600868201104AF3@rbe-mail1.ssc.internal> Hi, > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Daniel Berger > Sent: den 6 oktober 2006 22:03 > To: win32utils-devel at rubyforge.org > Subject: [Win32utils-devel] Need some help with latest win32-mmap > > Hi all, > > I've got the latest win32-mmap code checked into CVS. > Unfortunately, it seems that I'm not able to open an existing > mapping and retrieve set data. Below is a simple example > that seems like it ought to work but doesn't. Any ideas? > > # map1.rb > require 'win32/mmap' > include Win32 > > mmap = MMap.new(:name => 'alpha', :size => 20) p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open('alpha') # Boom! > > mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work > as expected. What am I doing wrong? I haven't checked the implementation and this is probably too obvious to be the culprit, but: If map1.rb runs to completion and closes the mmap before map2.rb can attach by opening it, the memory map won't exist unless you are using something else than the paging file as backing storage. The Win32 mmaps are reference counted through their handles as pretty much everything else. Also, as you can see it that using MMap.new from map2.rb works as the first step, but as this only creates a new identically named mmap there is no 'test' data there. Hence the 'boom' I'd guess. HTH, Johan Nilsson From Daniel.Berger at qwest.com Tue Oct 10 09:43:18 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 10 Oct 2006 08:43:18 -0500 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <6D2C2D1D3D1E8040AEFA12C90600868201104AF3@rbe-mail1.ssc.internal> Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E871@QTOMAE2K3M01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Tuesday, October 10, 2006 12:51 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > Hi, > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Daniel Berger > > Sent: den 6 oktober 2006 22:03 > > To: win32utils-devel at rubyforge.org > > Subject: [Win32utils-devel] Need some help with latest win32-mmap > > > > Hi all, > > > > I've got the latest win32-mmap code checked into CVS. > > Unfortunately, it seems that I'm not able to open an existing > > mapping and retrieve set data. Below is a simple example > > that seems like it ought to work but doesn't. Any ideas? > > > > # map1.rb > > require 'win32/mmap' > > include Win32 > > > > mmap = MMap.new(:name => 'alpha', :size => 20) p mmap.address > > > > mmap.test = "hello" > > > > mmap.close > > > > # map2.rb > > # mmap = MMap.open('alpha') # Boom! > > > > mmap = MMap.new(:name => 'alpha', :size => 20) # Ok so far... p > > mmap.test # Boom! > > > > mmap.close > > > > I tried using MMap.open and MMap.new. Neither seems to work > > as expected. What am I doing wrong? > > I haven't checked the implementation and this is probably too > obvious to be the culprit, but: > > If map1.rb runs to completion and closes the mmap before > map2.rb can attach by opening it, the memory map won't exist > unless you are using something else than the paging file as > backing storage. The Win32 mmaps are reference counted > through their handles as pretty much everything else. > > Also, as you can see it that using MMap.new from map2.rb > works as the first step, but as this only creates a new > identically named mmap there is no 'test' data there. Hence > the 'boom' I'd guess. > > HTH, > > Johan Nilsson Yes, you and Heesob are both right. I was thinking the value stayed resident. Once I stuck a sleep call in there and ran it from a second terminal it worked fine. Duh. In other news, it looks like I need to set a default size for MMap.open. What sounds reasonabl? 1k? 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 johan.nilsson at esrange.ssc.se Wed Oct 11 03:13:03 2006 From: johan.nilsson at esrange.ssc.se (Johan Nilsson) Date: Wed, 11 Oct 2006 09:13:03 +0200 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <39AA6550E5AA554AB1456707D6E5563D0259E871@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <6D2C2D1D3D1E8040AEFA12C90600868201104B23@rbe-mail1.ssc.internal> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Berger, Daniel > Sent: den 10 oktober 2006 15:43 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Johan > > Nilsson > > Sent: Tuesday, October 10, 2006 12:51 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap [snip] > > I haven't checked the implementation and this is probably > too obvious > > to be the culprit, but: > > > > If map1.rb runs to completion and closes the mmap before > map2.rb can > > attach by opening it, the memory map won't exist unless you > are using > > something else than the paging file as backing storage. The Win32 > > mmaps are reference counted through their handles as pretty much > > everything else. > > > > Also, as you can see it that using MMap.new from map2.rb > works as the > > first step, but as this only creates a new identically named mmap > > there is no 'test' data there. Hence the 'boom' I'd guess. > > > > HTH, > > > > Johan Nilsson > > Yes, you and Heesob are both right. I was thinking the value > stayed resident. Once I stuck a sleep call in there and ran > it from a second terminal it worked fine. Duh. > > In other news, it looks like I need to set a default size for > MMap.open. > What sounds reasonabl? 1k? I haven't tried this myself, and judging from the MSDN docs it's also not entirely clear that it will work, but: Try using zero(0) as the size when calling MapViewOfFile, and then use VirtualQuery to retrieve the size of the view. If you want to persist the values, use a file as the backing store (could be an optional feature, e.g. :name => '/path/to/filename' ). Oh, and use the "Global\" prefix for map names if you intend to share the data between different terminal server sessions (Win2k and upwards). But I guess you already do that internally. Regards / Johan From Daniel.Berger at qwest.com Wed Oct 11 11:06:06 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Wed, 11 Oct 2006 10:06:06 -0500 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <6D2C2D1D3D1E8040AEFA12C90600868201104B23@rbe-mail1.ssc.internal> Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E877@QTOMAE2K3M01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Wednesday, October 11, 2006 1:13 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > In other news, it looks like I need to set a default size for > > MMap.open. > > What sounds reasonabl? 1k? > > I haven't tried this myself, and judging from the MSDN docs it's also > not entirely clear that it will work, but: Try using zero(0) > as the size > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > size of the view. Actually, I changed MMap.open to accept a hash of options that's simply forwarded on to MMap.new (though the name is still a required argument), so you can specify the size that way. However, I think you're right and, if it's possible, I'll do a VirtualQuery() to try to get the size of the view when MMap.open is used if a size isn't specified explicitly. That seems like a much friendlier way to go. :) > If you want to persist the values, use a file as the backing store > (could be an optional feature, e.g. :name => '/path/to/filename' ). Well, there is a separate :file option. I'm not sure I want to try to guess whether :name refers to a file or not. Or have I misunderstood? > Oh, and use the "Global\" prefix for map names if you intend to share > the data between different terminal server sessions (Win2k > and upwards). > But I guess you already do that internally. It will be up to the programmer to know details like that for the :name option, though I can copy/paste the relevant section out of the MSDN docs. Thanks for the feedback. - 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 Wed Oct 11 14:39:45 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Wed, 11 Oct 2006 13:39:45 -0500 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <6D2C2D1D3D1E8040AEFA12C90600868201104B23@rbe-mail1.ssc.internal> Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E87C@QTOMAE2K3M01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Wednesday, October 11, 2006 1:13 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > I haven't tried this myself, and judging from the MSDN docs it's also > not entirely clear that it will work, but: Try using zero(0) > as the size > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > size of the view. I've been tinkering with this a bit. I think I'm doing something wrong. Here's a private method I created to get the view size. Note that this requires modifying the "VirtualQuery" (in windows/memory.rb) method signature to "LPL": def get_view_size mbi = [0,0,0,0,0,0,0].pack('LLLLLLL') # MEMORY_BASIC_INFORMATION VirtualQuery(@base_address, mbi, mbi.size) return mbi[12,4].unpack('L').first # RegionSize end Then, in MMap.new, I have this: if @open size = get_view_size() @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) else @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) end The first issue, I think, is that get_view_size always returns 65536 (64k). I'm guessing 64k is a default amount of memory to allocate or something. Using the examples I provided previously, I would expect this to be 20. The second issue is that MapViewOfFileEx fails if I try to pass a size. I think I'm misreading the docs. I'd make some more commits so you could just check this out from RubyForge, but I'm getting timeouts at the moment from rubyforge.org... 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 Oct 11 21:09:05 2006 From: phasis at gmail.com (Heesob Park) Date: Thu, 12 Oct 2006 10:09:05 +0900 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <39AA6550E5AA554AB1456707D6E5563D0259E87C@QTOMAE2K3M01.AD.QINTRA.COM> References: <6D2C2D1D3D1E8040AEFA12C90600868201104B23@rbe-mail1.ssc.internal> <39AA6550E5AA554AB1456707D6E5563D0259E87C@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: Hi, 2006/10/12, Berger, Daniel : > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Johan Nilsson > > Sent: Wednesday, October 11, 2006 1:13 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > > I haven't tried this myself, and judging from the MSDN docs it's also > > not entirely clear that it will work, but: Try using zero(0) > > as the size > > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > > size of the view. > > I've been tinkering with this a bit. I think I'm doing something wrong. > Here's a private method I created to get the view size. Note that this > requires modifying the "VirtualQuery" (in windows/memory.rb) method > signature to "LPL": > > def get_view_size > mbi = [0,0,0,0,0,0,0].pack('LLLLLLL') # MEMORY_BASIC_INFORMATION > VirtualQuery(@base_address, mbi, mbi.size) > return mbi[12,4].unpack('L').first # RegionSize > end should be: def get_view_size mbi = [0,0,0,0,0,0,0].pack('LLLLLLL') # MEMORY_BASIC_INFORMATION VirtualQuery(@address, mbi, mbi.size) return mbi[12,4].unpack('L').first # RegionSize end Then, in MMap.new, I have this: > > if @open > size = get_view_size() > @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) > else > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > end should be: if @open @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) @size = get_view_size() else @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) end The first issue, I think, is that get_view_size always returns 65536 > (64k). I'm guessing 64k is a default amount of memory to allocate or > something. Using the examples I provided previously, I would expect > this to be 20. > > The second issue is that MapViewOfFileEx fails if I try to pass a size. > I think I'm misreading the docs. > > I'd make some more commits so you could just check this out from > RubyForge, but I'm getting timeouts at the moment from rubyforge.org... > > Regards, > > Dan It seems the memory map in windows aligns 4k boundary. When created with 20, get_view_size returns 4096 When created with 20000, get_view_size returns 20480. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061012/ce212b83/attachment.html From djberg96 at gmail.com Wed Oct 11 23:18:36 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 11 Oct 2006 21:18:36 -0600 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: References: <6D2C2D1D3D1E8040AEFA12C90600868201104B23@rbe-mail1.ssc.internal> <39AA6550E5AA554AB1456707D6E5563D0259E87C@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <6037b70c0610112018j276a40b9t41759040f8dc9c93@mail.gmail.com> On 10/11/06, Heesob Park wrote: > > Hi, > > 2006/10/12, Berger, Daniel : > > > > > -----Original Message----- > > > From: win32utils-devel-bounces at rubyforge.org > > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > > Johan Nilsson > > > Sent: Wednesday, October 11, 2006 1:13 AM > > > To: Development and ideas for win32utils projects > > > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > > > > > > I haven't tried this myself, and judging from the MSDN docs it's also > > > not entirely clear that it will work, but: Try using zero(0) > > > as the size > > > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > > > size of the view. > > > > I've been tinkering with this a bit. I think I'm doing something wrong. > > Here's a private method I created to get the view size. Note that this > > requires modifying the "VirtualQuery" (in windows/memory.rb) method > > signature to "LPL": > > > > def get_view_size > > mbi = [0,0,0,0,0,0,0].pack('LLLLLLL') # MEMORY_BASIC_INFORMATION > > VirtualQuery(@base_address, mbi, mbi.size) > > return mbi[12,4].unpack('L').first # RegionSize > > end > > > should be: > > def get_view_size > mbi = [0,0,0,0,0,0,0].pack('LLLLLLL') # MEMORY_BASIC_INFORMATION > VirtualQuery(@address, mbi, mbi.size) > return mbi[12,4].unpack('L').first # RegionSize > end > > > Then, in MMap.new, I have this: > > > > if @open > > size = get_view_size() > > @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) > > else > > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > > end > > > should be: > > if @open > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > @size = get_view_size() > else > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > end > > > The first issue, I think, is that get_view_size always returns 65536 > > (64k). I'm guessing 64k is a default amount of memory to allocate or > > something. Using the examples I provided previously, I would expect > > this to be 20. > > > > The second issue is that MapViewOfFileEx fails if I try to pass a size. > > I think I'm misreading the docs. > > > > I'd make some more commits so you could just check this out from > > RubyForge, but I'm getting timeouts at the moment from rubyforge.org... > > > > Regards, > > > > Dan > > > It seems the memory map in windows aligns 4k boundary. > When created with 20, get_view_size returns 4096 > When created with 20000, get_view_size returns 20480. > > Regards, > > Park Heesob > Many thanks. I have checked the changes into CVS, along with the semaphore locking code. All, please take a look and let me know if you think I'm missing anything or if there are any other interface changes you think need to be made. I wasn't sure about the method_missing approach, but I think it's nicer than the old getvar/setvar approach. I can always add that back in if necessary. If all looks good, I'll try to get a release out this weekend. Regards, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061011/9dddc674/attachment.html From johan.nilsson at esrange.ssc.se Thu Oct 12 02:45:35 2006 From: johan.nilsson at esrange.ssc.se (Johan Nilsson) Date: Thu, 12 Oct 2006 08:45:35 +0200 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: Message-ID: <6D2C2D1D3D1E8040AEFA12C90600868201104B4E@rbe-mail1.ssc.internal> > From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Heesob Park > Sent: den 12 oktober 2006 03:09 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > [snip] > It seems the memory map in windows aligns 4k boundary. > When created with 20, get_view_size returns 4096 > When created with 20000, get_view_size returns 20480. Actually, it aligns to the nearest page boundary (which is not necessarily 4k). Use GetSystemInformation to retrieve SYSTEM_INFO (dwPageSize member). / Johan From johan.nilsson at esrange.ssc.se Thu Oct 12 02:48:14 2006 From: johan.nilsson at esrange.ssc.se (Johan Nilsson) Date: Thu, 12 Oct 2006 08:48:14 +0200 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <39AA6550E5AA554AB1456707D6E5563D0259E877@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <6D2C2D1D3D1E8040AEFA12C90600868201104B50@rbe-mail1.ssc.internal> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Berger, Daniel > Sent: den 11 oktober 2006 17:06 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Johan > > Nilsson > > Sent: Wednesday, October 11, 2006 1:13 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap [snip] > > > If you want to persist the values, use a file as the backing store > > (could be an optional feature, e.g. :name => '/path/to/filename' ). > > Well, there is a separate :file option. I'm not sure I want > to try to guess whether :name refers to a file or not. Or > have I misunderstood? I'm sorry - I only replied using the information in previous mails. Haven't actually tried to use mmap or check out the examples. / Johan From Daniel.Berger at qwest.com Thu Oct 12 09:41:11 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu, 12 Oct 2006 08:41:11 -0500 Subject: [Win32utils-devel] Need some help with latest win32-mmap In-Reply-To: <6D2C2D1D3D1E8040AEFA12C90600868201104B4E@rbe-mail1.ssc.internal> Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E87F@QTOMAE2K3M01.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Thursday, October 12, 2006 12:46 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Heesob Park > > Sent: den 12 oktober 2006 03:09 > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap > > > > [snip] > > > > It seems the memory map in windows aligns 4k boundary. > > When created with 20, get_view_size returns 4096 > > When created with 20000, get_view_size returns 20480. > > Actually, it aligns to the nearest page boundary (which is > not necessarily 4k). Use GetSystemInformation to retrieve > SYSTEM_INFO (dwPageSize member). Right, I'll note that in the docs, 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 Fri Oct 13 15:00:09 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Fri, 13 Oct 2006 14:00:09 -0500 Subject: [Win32utils-devel] win32-mmap - trying to marshal self Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E88E@QTOMAE2K3M01.AD.QINTRA.COM> Hi all, I realized the current implmentation has a problem - you can only get the last value set? I realized, after looking at the old C code, that it actually stores values in a hash and marshals the hash, not the values themselves. That seemed clunky to me, though. I thought it would be more interesting if we just marshalled the entire mmap object and passed that back and forth. Unfortunately, it doesn't seem to work. For the getter in method_missing I simply did: marshal = Marshal.dump(self) For the getter in method_missing I did: obj = memcpy(buf, @address, @size) val = object.send(obj.to_sym) instance_variable_set("@#{method}", Marshal.load(val)) But when I run the map1.rb and map2.rb scripts again, I get errors (and beeping!) with odd characters no less: C:/Documents and Settings/djberge/workspace/win32-mmap/lib/win32/mmap.rb:334:in `send': undefined method o:?Win32::MMap? @inheriti' for nil:NilClass (NoMethodError) from C:/Documents and Settings/djberge/workspace/win32-mmap/lib/win32/mmap.rb:334:in `method_missing' from map2.rb:8 Is this because of the Semaphore? If we can't marshal self, that's fine, I'll just resort to the hash strategy, but I thought I would ask. 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 Fri Oct 13 21:03:22 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 13 Oct 2006 19:03:22 -0600 Subject: [Win32utils-devel] win32-mmap - trying to marshal self In-Reply-To: <39AA6550E5AA554AB1456707D6E5563D0259E88E@QTOMAE2K3M01.AD.QINTRA.COM> References: <39AA6550E5AA554AB1456707D6E5563D0259E88E@QTOMAE2K3M01.AD.QINTRA.COM> Message-ID: <6037b70c0610131803h28cadb2by8fe34da1e2a43b1f@mail.gmail.com> On 10/13/06, Berger, Daniel wrote: > > Hi all, > > I realized the current implmentation has a problem - you can only get the > last value set? I realized, after looking at the old C code, that it > actually stores values in a hash and marshals the hash, not the values > themselves. > > That seemed clunky to me, though. I thought it would be more interesting > if we just marshalled the entire mmap object and passed that back and > forth. Unfortunately, it doesn't seem to work. Ah, nevermind. I'll just pass a hash back and forth for now. I want to get something released this weekend so that folks get a chance to play with it in time for RubyConf. BTW, anyone on the list going to be at RubyConf? - Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061013/a114414f/attachment.html From waynev at gmail.com Sat Oct 14 02:05:42 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Fri, 13 Oct 2006 23:05:42 -0700 Subject: [Win32utils-devel] win32-mmap - trying to marshal self In-Reply-To: <6037b70c0610131803h28cadb2by8fe34da1e2a43b1f@mail.gmail.com> References: <39AA6550E5AA554AB1456707D6E5563D0259E88E@QTOMAE2K3M01.AD.QINTRA.COM> <6037b70c0610131803h28cadb2by8fe34da1e2a43b1f@mail.gmail.com> Message-ID: <88c9ce410610132305q747590b9p149a91c831f571d@mail.gmail.com> Hi Dan, > BTW, anyone on the list going to be at RubyConf? I enjoyed meeting you at RubyConf last year. See you in Denver! Wayne On 10/13/06, Daniel Berger wrote: > > > On 10/13/06, Berger, Daniel wrote: > > Hi all, > > > > I realized the current implmentation has a problem - you can only get the > last value set? I realized, after looking at the old C code, that it > actually stores values in a hash and marshals the hash, not the values > themselves. > > > > That seemed clunky to me, though. I thought it would be more interesting > if we just marshalled the entire mmap object and passed that back and forth. > Unfortunately, it doesn't seem to work. > > > > Ah, nevermind. I'll just pass a hash back and forth for now. I want to get > something released this weekend so that folks get a chance to play with it > in time for RubyConf. > > BTW, anyone on the list going to be at RubyConf? > > - Dan > > > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > > From noreply at rubyforge.org Fri Oct 13 23:02:53 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 13 Oct 2006 23:02:53 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-5287 ] v 0.4.1 - Clipboard.set_data causes Segmentation fault Message-ID: <20061014030255.1CE2F5241905@rubyforge.org> Bugs item #5287, was opened at 2006-08-03 08:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=5287&group_id=85 Category: win32-clipboard Group: Code >Status: Closed >Resolution: Rejected Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: v 0.4.1 - Clipboard.set_data causes Segmentation fault Initial Comment: Whenever Clipboard.set_data is called a Segmentation fault occurs and ruby reports abnormal program shutdown. You can discover this simply by running the test case. I have observed this on two diffent systems. Version 0.4.0 still works fine. win32-clipboard-0.4.1 ruby 1.8.4 WinXP sp2 Edwin King ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2006-10-13 20:02 Message: Rejected because I am almost certain the OP was using an old version of windows-pr and I can't reproduce it. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-08-04 17:28 Message: Are you sure? >ruby test\tc_clipboard.rb Loaded suite test/tc_clipboard Started ............. Finished in 0.016 seconds. 13 tests, 36 assertions, 0 failures, 0 errors What version of windows-pr are you using? - Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=5287&group_id=85 From djberg96 at yahoo.com Mon Oct 16 22:07:12 2006 From: djberg96 at yahoo.com (Daniel Berger) Date: Mon, 16 Oct 2006 19:07:12 -0700 (PDT) Subject: [Win32utils-devel] Fw: mmap 0.2.0 writing value from a child process Message-ID: <20061017020712.10756.qmail@web50307.mail.yahoo.com> I thought I would forward this to see if anyone has any suggestions (other than, "You shouldn't use this code in conjunction with fork"). Thanks, Dan ----- Forwarded Message ---- From: "Park, Chong SuhX" To: Daniel Berger Sent: Monday, October 16, 2006 3:59:55 PM Subject: mmap 0.2.0 writing value from a child process Hi Dan, First of all, I sincerely appreciate your great contribution. Mmap 0.2.0 is critically important piece of software for my project and would like to share with an issue I am found today. I think it might be a bug. Try following code and see if it is working. And then, remove comment # mmap.bar = 'My World' and run it again. You may find something interesting pid1 = fork do mmap = MMap.new(:name => 'alpha', :size => 2000) mmap.foo = 'Hello' mmap.bar = 'Your World' sleep 5 mmap.close end sleep 1 pid2 = fork do mmap = MMap.open('alpha') # mmap.bar = 'My World' p mmap.foo p mmap.bar mmap.close end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061016/c840a720/attachment-0001.html From djberg96 at yahoo.com Thu Oct 19 19:42:47 2006 From: djberg96 at yahoo.com (Daniel Berger) Date: Thu, 19 Oct 2006 16:42:47 -0700 (PDT) Subject: [Win32utils-devel] Fw: Win32 OVERLAPPING IO Message-ID: <20061019234247.57555.qmail@web50305.mail.yahoo.com> Suggestions? ----- Forwarded Message ---- From: James Tucker To: djberg96 at yahoo.com Sent: Thursday, October 19, 2006 7:28:30 AM Subject: Win32 OVERLAPPING IO Hi Daniel, My name is James Tucker, I've been hacking in Ruby for only a few months now, however am an experienced general programmer in a wide variety of languages. My current focus is on a new development project involving an RS232 data protocol handler, which up until now I have programmed in ruby. We have a small problem with the ruby platform for this issue however, and it is related to several factors: - Ruby threads are green threads, IO blocks block all threads. - RS232 Comms on Windows using the Windows::File#open don't provide non overlapping I/O. - There is little easy to introduce documentation on how to use Windows::File#ReadFileEx in ruby. Ruby does however provide us with some major advantages. I programmed the stateful parser and threading system in under a day, and to date it serves perfectly as a one-way reader. Today however, we need to change this to continue this project. Besides my own testing code, I have been reading as much as possible around the topic, and one such thing which has really raised an eyebrow is this: http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/ In particular the following statement: "Out-of-the-box, the only way of coding RS232 serial communications applications in the .NET environment is to import the outdated and somewhat limited MSComm ActiveX control. This article describes the development of a lean, multithreaded, and modern RS232 base class library in C# managed code. The library uses Platform Invocation Services to interact with the Win32 API directly. Application programmers can use the library from any .NET language through inheritance; the article explores examples written in C# and Visual Basic .NET." This would suggest that the only clean way to access RS232 non-blocking I/O in Windows is through this COM/Win32 API. I'm interested to know if: - The non-overlapping mode of Windows::File#ReadFileEx can achieve the same goal (if so, I would love to have some guidance on this, and in return I'll produce some clean documentation for you to add to the src). - If not, is there a way to hook the Win32 API using your code, in order to achieve the same goal? One final question, which I could not see a clear answer to reading on rubyforge, does upgrading the windows-pr gem upgrade all of the Windows namespace? I had some problems with Daemon a while back and am wondering if a fresh upgrade of windows-pr will solve this issue? Many thanks for any time you can spare me, James Tucker. P.S. If you are able to get onto freenode, I'm 'raggi'. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3573 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/win32utils-devel/attachments/20061019/dfe2fa07/attachment.bin From paul.rogers at shaw.ca Thu Oct 19 22:27:55 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 19 Oct 2006 20:27:55 -0600 Subject: [Win32utils-devel] Fw: Win32 OVERLAPPING IO References: <20061019234247.57555.qmail@web50305.mail.yahoo.com> Message-ID: <019a01c6f3ef$79dabef0$6400a8c0@laptop> some years ago I wrote a modbus simulator using ruby. Modbus is a protocol used on industrial measuring devices, like strain guages, thermomenters, flow meters ertc. I cant rememebr exactly what I did or which libraries I used, but I had one ruby process that dealt with the rs232 comms which communicated with the main app using drb. Paul ----- Original Message ----- From: "Daniel Berger" To: Sent: Thursday, October 19, 2006 5:42 PM Subject: [Win32utils-devel] Fw: Win32 OVERLAPPING IO Suggestions? ----- Forwarded Message ---- From: James Tucker To: djberg96 at yahoo.com Sent: Thursday, October 19, 2006 7:28:30 AM Subject: Win32 OVERLAPPING IO Hi Daniel, My name is James Tucker, I've been hacking in Ruby for only a few months now, however am an experienced general programmer in a wide variety of languages. My current focus is on a new development project involving an RS232 data protocol handler, which up until now I have programmed in ruby. We have a small problem with the ruby platform for this issue however, and it is related to several factors: - Ruby threads are green threads, IO blocks block all threads. - RS232 Comms on Windows using the Windows::File#open don't provide non overlapping I/O. - There is little easy to introduce documentation on how to use Windows::File#ReadFileEx in ruby. Ruby does however provide us with some major advantages. I programmed the stateful parser and threading system in under a day, and to date it serves perfectly as a one-way reader. Today however, we need to change this to continue this project. Besides my own testing code, I have been reading as much as possible around the topic, and one such thing which has really raised an eyebrow is this: http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/ In particular the following statement: "Out-of-the-box, the only way of coding RS232 serial communications applications in the .NET environment is to import the outdated and somewhat limited MSComm ActiveX control. This article describes the development of a lean, multithreaded, and modern RS232 base class library in C# managed code. The library uses Platform Invocation Services to interact with the Win32 API directly. Application programmers can use the library from any .NET language through inheritance; the article explores examples written in C# and Visual Basic .NET." This would suggest that the only clean way to access RS232 non-blocking I/O in Windows is through this COM/Win32 API. I'm interested to know if: - The non-overlapping mode of Windows::File#ReadFileEx can achieve the same goal (if so, I would love to have some guidance on this, and in return I'll produce some clean documentation for you to add to the src). - If not, is there a way to hook the Win32 API using your code, in order to achieve the same goal? One final question, which I could not see a clear answer to reading on rubyforge, does upgrading the windows-pr gem upgrade all of the Windows namespace? I had some problems with Daemon a while back and am wondering if a fresh upgrade of windows-pr will solve this issue? Many thanks for any time you can spare me, James Tucker. P.S. If you are able to get onto freenode, I'm 'raggi'. -------------------------------------------------------------------------------- > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel From djberg96 at gmail.com Sun Oct 22 21:34:36 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Sun, 22 Oct 2006 19:34:36 -0600 Subject: [Win32utils-devel] Need some help with MMap#[] and MMap#[]= Message-ID: <453C1C2C.8060900@gmail.com> Hi all, At RubyConf this year I talked about win32-mmap with Patrick Hurley and Ara Howard. Ara mentioned that Guy's version of mmap (for Unix) contains some string-like methods that let you access pieces of the view like a string. Patrick and I came up with this (which requires the latest windows-pr in cvs so that we can use a more flexible version of memcpy, as well as some constants for VirtualAlloc): def [](offset, length) buf = 0.chr * length memcpy(buf, @address + offset, length) buf end def []=(offset, length, string) memcpy(@address + offset, string, string.length) end This works as is but Ara also mentioned that some methods, such as MMap#[]=, will autoexpand the allocation size if the offset + length is greater than the initial allocation size. With the above implementation the string gets chopped: mmap = MMap.new(:file => 'test.txt', :size => 3) mmap[0,6] = "foobar" # only 'foo' gets written mmap.close I thought this was doable with VirtualAlloc, but I can't seem to get it to work: def []=(offset, length, string) if offset + length > @size diff = offset + length - size addr = [@address + diff + 1].pack('L') if VirtualAlloc(addr, diff, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE) == 0 raise Error, get_last_error end end memcpy(@address + offset, string, string.length) end When I try this, however, I get: C:/ruby/lib/ruby/site_ruby/1.8/windows/memory.rb:82:in `call': NULL pointer given (ArgumentError) from C:/ruby/lib/ruby/site_ruby/1.8/windows/memory.rb:82:in `VirtualAlloc' from C:/Documents and Settings/djberge/workspace/win32-mmap/lib/win32/mmap.rb:309:in `[]=' from test.rb:8 Am I using the right function? Do I have it declared correctly in windows-pr? BTW, I also tried changed the function prototype for VirtualAlloc from 'PLLL' to just 'LLLL' and using the numeric address directly, but that didn't seem to help. Any ideas? Thanks, Dan PS - It was great to see the guys from win32utils-devel who showed up at RubyConf! From djberg96 at gmail.com Wed Oct 25 23:43:49 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 25 Oct 2006 21:43:49 -0600 Subject: [Win32utils-devel] The win32-service patch is committed - and now, some questions Message-ID: <45402EF5.6060105@gmail.com> Hi all, I *finally* committed the patch from Patrick Hurley (you know, the one he submitted way back in June). Looks like it works. I've also revamped the code under the examples directory. There's now a tdaemon.rb (the test daemon) and tdaemon_ctl.rb (the test daemon controller). Before I release this into the wild I want to make sure I document how to use it properly. Based on what I experienced it now looks like users will need to put this snippet in their service_main: # You will see this line in tdaemon.rb while state == RUNNING || state == PAUSED || state == 0 # Do stuff end If I remove the '|| state == 0' portion, I still experience deadlock while trying to stop the service. I assume the 0 is the IDLE_CONTROL_CODE value that Patrick added. Is that correct? Also, I wonder if we could abstract that line down to something a little more user friendly. Instead of this stock line: while state == RUNNING || state == PAUSED || state == 0 ... end How about abstracting that down to something like: while running? ... end Just an idea. Regards, Dan From phurley at gmail.com Thu Oct 26 08:36:58 2006 From: phurley at gmail.com (Patrick Hurley) Date: Thu, 26 Oct 2006 08:36:58 -0400 Subject: [Win32utils-devel] The win32-service patch is committed - and now, some questions In-Reply-To: <45402EF5.6060105@gmail.com> References: <45402EF5.6060105@gmail.com> Message-ID: <554ac39c0610260536w6c804decna99c24454e7118c8@mail.gmail.com> On 10/25/06, Daniel Berger wrote: > How about abstracting that down to something like: > > while running? I like running? Not sure about the "0" state, as I have not looked at the code for a while. I will take a peek, at the very least we should provide a constant for the magic 0 state. pth From noreply at rubyforge.org Thu Oct 19 10:12:16 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 19 Oct 2006 10:12:16 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6237 ] Add Guid API Message-ID: <20061019141216.5135352417AC@rubyforge.org> Patches item #6237, was opened at 2006-10-19 16:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6237&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: Add Guid API Initial Comment: This adds API for creating GUIDs. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6237&group_id=85 From noreply at rubyforge.org Thu Oct 26 10:51:59 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 26 Oct 2006 10:51:59 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure ruby implementation Message-ID: <20061026145201.3B93852414A4@rubyforge.org> Patches item #6335, was opened at 2006-10-26 16:51 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 Category: win32-shortcut Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: pure ruby implementation Initial Comment: This is (not finished) pure-ruby implementation of Win32::Shortcut. Differences: - new takes block (yield self at the end of initialize) - open, relative_path, resolve and icon_number are not implemented - instead of show_cmd window_style is used Other than that, it should be pretty usable. I've attached simple unit test as well ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 From noreply at rubyforge.org Thu Oct 19 10:11:53 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 19 Oct 2006 10:11:53 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6237 ] Add Guid API Message-ID: <20061019141153.30F2952417A5@rubyforge.org> Patches item #6237, was opened at 2006-10-19 16:11 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6237&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: Add Guid API Initial Comment: This adds API for creating GUIDs. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6237&group_id=85 From noreply at rubyforge.org Thu Oct 19 10:10:46 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 19 Oct 2006 10:10:46 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6236 ] Add debug API Message-ID: <20061019141046.69A12524177D@rubyforge.org> Patches item #6236, was opened at 2006-10-19 16:10 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6236&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: Add debug API Initial Comment: This adds couple of methods to interface with debugger (WinDbg, MS VC, etc.) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6236&group_id=85 From noreply at rubyforge.org Thu Oct 19 10:12:38 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 19 Oct 2006 10:12:38 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6236 ] Add debug API Message-ID: <20061019141238.CA62252417B0@rubyforge.org> Patches item #6236, was opened at 2006-10-19 16:10 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6236&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: Add debug API Initial Comment: This adds couple of methods to interface with debugger (WinDbg, MS VC, etc.) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6236&group_id=85 From noreply at rubyforge.org Thu Oct 26 10:51:24 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 26 Oct 2006 10:51:24 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure ruby implementation Message-ID: <20061026145125.2173F524141E@rubyforge.org> Patches item #6335, was opened at 2006-10-26 16:51 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 Category: win32-shortcut Group: None Status: Open Resolution: None Priority: 3 Submitted By: Jano Svitok (janek) Assigned to: Nobody (None) Summary: pure ruby implementation Initial Comment: This is (not finished) pure-ruby implementation of Win32::Shortcut. Differences: - new takes block (yield self at the end of initialize) - open, relative_path, resolve and icon_number are not implemented - instead of show_cmd window_style is used Other than that, it should be pretty usable. I've attached simple unit test as well ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 From djberg96 at gmail.com Fri Oct 27 20:14:09 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 27 Oct 2006 18:14:09 -0600 Subject: [Win32utils-devel] The win32-service patch is committed - and now, some questions In-Reply-To: <554ac39c0610260536w6c804decna99c24454e7118c8@mail.gmail.com> References: <45402EF5.6060105@gmail.com> <554ac39c0610260536w6c804decna99c24454e7118c8@mail.gmail.com> Message-ID: <6037b70c0610271714w2baddf76p4c52b06be3e2eea9@mail.gmail.com> On 10/26/06, Patrick Hurley wrote: > > On 10/25/06, Daniel Berger wrote: > > How about abstracting that down to something like: > > > > while running? > > > I like running? Not sure about the "0" state, as I have not looked at > the code for a while. I will take a peek, at the very least we should > provide a constant for the magic 0 state. > > pth How about SERVICE_IDLE ? Also, do we want to revisit RegisterServiceCtrlHandlerEx()? - Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061027/f5282034/attachment.html From djberg96 at gmail.com Fri Oct 27 22:57:10 2006 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 27 Oct 2006 20:57:10 -0600 Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure ruby implementation In-Reply-To: <20061026145201.3B93852414A4@rubyforge.org> References: <20061026145201.3B93852414A4@rubyforge.org> Message-ID: <4542C706.20303@gmail.com> noreply at rubyforge.org wrote: > Patches item #6335, was opened at 2006-10-26 16:51 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 > > Category: win32-shortcut > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Jano Svitok (janek) > Assigned to: Nobody (None) > Summary: pure ruby implementation > > Initial Comment: > This is (not finished) pure-ruby implementation of Win32::Shortcut. > > Differences: > - new takes block (yield self at the end of initialize) > - open, relative_path, resolve and icon_number are not implemented > - instead of show_cmd window_style is used > > Other than that, it should be pretty usable. > > I've attached simple unit test as well > What do folks think of using WScript.Shell like this? - Dan From phurley at gmail.com Sat Oct 28 23:48:20 2006 From: phurley at gmail.com (Patrick Hurley) Date: Sat, 28 Oct 2006 23:48:20 -0400 Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure ruby implementation In-Reply-To: <4542C706.20303@gmail.com> References: <20061026145201.3B93852414A4@rubyforge.org> <4542C706.20303@gmail.com> Message-ID: <554ac39c0610282048uef112e6j46a22a64cc1336d0@mail.gmail.com> On 10/27/06, Daniel Berger wrote: > What do folks think of using WScript.Shell like this? In general I love it -- the pure Ruby code is succinct and easy to understand (as it lays on top of a high level api). My only concern is that I have experienced difficult to reproduce hangs and odd behavior (very rarely, but none the less), using WinOLE. I really only use it against Excel and in my case it is not a big deal as it is easy to stop and restart and things generally then preform as expected. Has anyone else ever encountered this type of behavior? (or is it Excel specific?) pth From Daniel.Berger at qwest.com Mon Oct 30 08:32:21 2006 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon, 30 Oct 2006 07:32:21 -0600 Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure rubyimplementation In-Reply-To: <554ac39c0610282048uef112e6j46a22a64cc1336d0@mail.gmail.com> Message-ID: <39AA6550E5AA554AB1456707D6E5563D0259E8CA@QTOMAE2K3M01.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: Saturday, October 28, 2006 9:48 PM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] [ win32utils-Patches-6335 ] > pure rubyimplementation > > > On 10/27/06, Daniel Berger wrote: > > What do folks think of using WScript.Shell like this? > > In general I love it -- the pure Ruby code is succinct and > easy to understand (as it lays on top of a high level api). > My only concern is that I have experienced difficult to > reproduce hangs and odd behavior (very rarely, but none the > less), using WinOLE. I really only use it against Excel and > in my case it is not a big deal as it is easy to stop and > restart and things generally then preform as expected. Has > anyone else ever encountered this type of behavior? (or is it Excel > specific?) > > pth Although I haven't experienced the problems you describe personally, I don't doubt you. I know there are bugs in win32ole, and that library could probably use a major refactoring. If someone on this list ever felt like doing a rewrite of win32ole, I certainly wouldn't mind. I'd be happy to host it, too. :) In the meantime, I've committed a pure Ruby version of win32-shortcut to CVS (look for it in the toplevel directory, not under the win32utils directory). I took Jano's basic patch and expanded it to match the current API, although there are some minor differences, mostly improvements: - The Shortcut.new method now takes a block, yields self, and automatically calls Shortcut#save at the end of the block. - The Shortcut#icon_number method is gone (not supported). Pretty useless method anyway, really. - The Shortcut#hotkey method now takes a more human readable string instead of a hex value. Nicer. - The Shortcut#show_cmd method was renamed Shortcut#window_style, as per Jano's request (with an alias for b.c.) - The Shortcut#window_style accessor now accepts/emits human readable strings, as well as constants. - The Shortcut.open method is more or less the same as Shortcut.new, since pointing to an existing shortcut opens it by default - no special code required. 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 noreply at rubyforge.org Mon Oct 30 23:58:21 2006 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 30 Oct 2006 23:58:21 -0500 (EST) Subject: [Win32utils-devel] [ win32utils-Patches-6335 ] pure ruby implementation Message-ID: <20061031045822.2D020A970014@rubyforge.org> Patches item #6335, was opened at 2006-10-26 07:51 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85 Category: win32-shortcut Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Jano Svitok (janek) >Assigned to: Daniel Berger (djberg96) Summary: pure ruby implementation Initial Comment: This is (not finished) pure-ruby implementation of Win32::Shortcut. Differences: - new takes block (yield self at the end of initialize) - open, relative_path, resolve and icon_number are not implemented - instead of show_cmd window_style is used Other than that, it should be pretty usable. I've attached simple unit test as well ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2006-10-30 21:58 Message: I've accepted the general idea in principle. No need to submit any more patches for a bit - I've already got it done in CVS - unless you think I've missed something critical. I'm going to put out a release tonight. Feel free to submit any more patches or bug reports against the 0.2.0 release. Many thanks, Dan ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-10-27 19:51 Message: Thanks for this Jano. It's definitely simple, but I need to discuss whether or not using Wscript.Shell is a good idea. - Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=413&aid=6335&group_id=85