From noreply at rubyforge.org Tue Sep 1 18:47:09 2009 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Tue, 1 Sep 2009 18:47:09 -0400 (EDT) Subject: [Win32utils-devel] [ win32utils-Bugs-26988 ] Process.create needs to explicitly make individual handles inheritable Message-ID: <20090901224709.D1D87185824A@rubyforge.org> Bugs item #26988, was opened at 2009-08-24 14:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=26988&group_id=85 Category: win32-process Group: Code Status: Open Resolution: None Priority: 3 Submitted By: Michael Buselli (cosine) Assigned to: Nobody (None) Summary: Process.create needs to explicitly make individual handles inheritable Initial Comment: I've encountered some versions of Ruby on Windows (in my particular case Ruby 1.9.1 compiled with MinGW) where IO.pipe does not create inheritable handles. This causes problems when Process.create is used to create a pipe to a child process. The attached patch to win32-process works around this issue by always explicitly calling SetHandleInformation to make the passed handles inheritable. ---------------------------------------------------------------------- >Comment By: Michael Buselli (cosine) Date: 2009-09-01 17:47 Message: No, you're thinking of the :inherit option, which I do have set to true; Process.create also sets it for you if you are passing IO handles to child processes. If the present software is helpful enough to add options it knows you need?which is why we have high-level functions like Process.create?it ought to make sure the objects are in the right state for you (i.e. inheritable), too. Thanks! ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2009-08-30 21:23 Message: Hi, Can't you just explicitly set the :process_inherit option to true and get the same effect? Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=26988&group_id=85 From djberg96 at gmail.com Wed Sep 2 06:55:39 2009 From: djberg96 at gmail.com (Daniel Berger) Date: Wed, 2 Sep 2009 04:55:39 -0600 Subject: [Win32utils-devel] Question on CreateProcess and handle inheritance Message-ID: <6037b70c0909020355l28faaea4kaeed2eaa98f48c36@mail.gmail.com> Hi, I just wanted to make sure that I'm not confused by Michael Buselli's comment and patch. As far as I can tell, if you set the bInheritHandle in the SECURITY_ATTRIBUTES structure that's passed to CreateProcess to true, it's the same as calling SetHandleInformation(handle, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) after the fact. CreateProcess: lpProcessAttributes [in, optional] A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle to the new process object can be inherited by child processes. If lpProcessAttributes is NULL, the handle cannot be inherited. SetHandleInformation: HANDLE_FLAG_INHERIT If this flag is set, a child process created with the bInheritHandles parameter of CreateProcess set to TRUE will inherit the object handle. Or is this a case of "can" (i.e. it's possible for the child to inherit the handle) vs "will" (i.e. the child process will definitely inherit the handle)? Regards, Dan From phasis at gmail.com Wed Sep 2 10:28:36 2009 From: phasis at gmail.com (Heesob Park) Date: Wed, 2 Sep 2009 23:28:36 +0900 Subject: [Win32utils-devel] Question on CreateProcess and handle inheritance In-Reply-To: <6037b70c0909020355l28faaea4kaeed2eaa98f48c36@mail.gmail.com> References: <6037b70c0909020355l28faaea4kaeed2eaa98f48c36@mail.gmail.com> Message-ID: Hi, 2009/9/2 Daniel Berger : > Hi, > > I just wanted to make sure that I'm not confused by Michael Buselli's > comment and patch. As far as I can tell, if you set the bInheritHandle > in the SECURITY_ATTRIBUTES structure that's passed to CreateProcess to > true, it's the same as calling SetHandleInformation(handle, > HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT) after the fact. > > CreateProcess: > > lpProcessAttributes [in, optional] > > ? ?A pointer to a SECURITY_ATTRIBUTES structure that determines > whether the returned handle to the new process object can be inherited > by child processes. If lpProcessAttributes is NULL, the handle cannot > be inherited. > You must notice that "the returned handle" has nothing to do with the handle of stdin, stdout, or stderr. The SECURITY_ATTRIBUTES structure provides security settings for objects created by various functions, such as CreateFile, CreatePipe, CreateProcess, RegCreateKeyEx, or RegSaveKeyEx. The returned handle can be a file handle, process handle or registry handle. > SetHandleInformation: > > HANDLE_FLAG_INHERIT > > ? If this flag is set, a child process created with the > bInheritHandles parameter of CreateProcess set to TRUE will inherit > the object handle. > > Or is this a case of "can" (i.e. it's possible for the child to > inherit the handle) vs "will" (i.e. the child process will definitely > inherit the handle)? > I guess the child process will definitely inherit the handle when bInheritHandles flag is set and the handle was not set by SetHandleInformation(handle,HANDLE_FLAG_INHERIT, 0). I think Michael Buselli's patch is acceptable. Regards, Park Heesob From luislavena at gmail.com Sat Sep 12 09:28:11 2009 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 12 Sep 2009 15:28:11 +0200 Subject: [Win32utils-devel] I wish I could comment on Daniels posts Message-ID: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> Hello Guys, Me again in reply to Daniel's post: http://djberg96.livejournal.com/169067.html Since LiveJournal really sucks, I cannot simply register for comment... no, it creates a whole LiveJournal account that I don't plan on use. Also, no OpenID. Anyway, to comment: Did you tried rake-compiler? http://github.com/luislavena/rake-compiler Basically it allow Gem specification playing so you can do this: rake compile to build the extensions rake native gem to package both 'ruby' source gem and 'native' to your platform. It also opens the possibility to cross compilation (I guess not useful for win32utils project) but it is for MinGW powered Ruby. Anyhow, wanted to chime in :-) I know, could be shameless self promotion, but perhaps is helpful, dunno. Cheers, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From djberg96 at gmail.com Sat Sep 12 12:02:44 2009 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 12 Sep 2009 10:02:44 -0600 Subject: [Win32utils-devel] I wish I could comment on Daniels posts In-Reply-To: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> References: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> Message-ID: <4AABC624.6030803@gmail.com> Luis Lavena wrote: > Hello Guys, > > Me again in reply to Daniel's post: > > http://djberg96.livejournal.com/169067.html > > Since LiveJournal really sucks, I cannot simply register for > comment... no, it creates a whole LiveJournal account that I don't > plan on use. > > Also, no OpenID. LJ says it supports OpenID: http://www.livejournal.com/openid/ > > Anyway, to comment: Did you tried rake-compiler? > > http://github.com/luislavena/rake-compiler > > Basically it allow Gem specification playing so you can do this: > > rake compile > > to build the extensions > > rake native gem > > to package both 'ruby' source gem and 'native' to your platform. > > It also opens the possibility to cross compilation (I guess not useful > for win32utils project) but it is for MinGW powered Ruby. > > Anyhow, wanted to chime in :-) > > I know, could be shameless self promotion, but perhaps is helpful, dunno. Thanks, I really do need to take a look at rake-compiler. :) Regards, Dan From luislavena at gmail.com Sat Sep 12 12:45:32 2009 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 12 Sep 2009 18:45:32 +0200 Subject: [Win32utils-devel] I wish I could comment on Daniels posts In-Reply-To: <4AABC624.6030803@gmail.com> References: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> <4AABC624.6030803@gmail.com> Message-ID: <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> On Sat, Sep 12, 2009 at 6:02 PM, Daniel Berger wrote: > Luis Lavena wrote: >> >> Hello Guys, >> >> Me again in reply to Daniel's post: >> >> http://djberg96.livejournal.com/169067.html >> >> Since LiveJournal really sucks, I cannot simply register for >> comment... no, it creates a whole LiveJournal account that I don't >> plan on use. >> >> Also, no OpenID. > > LJ says it supports OpenID: > > http://www.livejournal.com/openid/ > Yes, but is not turned on or there is no way to select it... so cannot comment :-P (it just show empty parenthesis, no way to select it) -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From djberg96 at gmail.com Sat Sep 12 12:42:32 2009 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 12 Sep 2009 10:42:32 -0600 Subject: [Win32utils-devel] I wish I could comment on Daniels posts In-Reply-To: <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> References: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> <4AABC624.6030803@gmail.com> <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> Message-ID: <4AABCF78.9020302@gmail.com> Luis Lavena wrote: > On Sat, Sep 12, 2009 at 6:02 PM, Daniel Berger wrote: >> Luis Lavena wrote: >>> Hello Guys, >>> >>> Me again in reply to Daniel's post: >>> >>> http://djberg96.livejournal.com/169067.html >>> >>> Since LiveJournal really sucks, I cannot simply register for >>> comment... no, it creates a whole LiveJournal account that I don't >>> plan on use. >>> >>> Also, no OpenID. >> LJ says it supports OpenID: >> >> http://www.livejournal.com/openid/ >> > > Yes, but is not turned on or there is no way to select it... so cannot > comment :-P > (it just show empty parenthesis, no way to select it) > Hm, I wonder if I have to explicitly enable it. Let me poke around a bit. Regards, Dan From djberg96 at gmail.com Sat Sep 12 12:46:55 2009 From: djberg96 at gmail.com (Daniel Berger) Date: Sat, 12 Sep 2009 10:46:55 -0600 Subject: [Win32utils-devel] I wish I could comment on Daniels posts In-Reply-To: <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> References: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> <4AABC624.6030803@gmail.com> <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> Message-ID: <4AABD07F.7000108@gmail.com> Luis Lavena wrote: > On Sat, Sep 12, 2009 at 6:02 PM, Daniel Berger wrote: >> Luis Lavena wrote: >>> Hello Guys, >>> >>> Me again in reply to Daniel's post: >>> >>> http://djberg96.livejournal.com/169067.html >>> >>> Since LiveJournal really sucks, I cannot simply register for >>> comment... no, it creates a whole LiveJournal account that I don't >>> plan on use. >>> >>> Also, no OpenID. >> LJ says it supports OpenID: >> >> http://www.livejournal.com/openid/ >> > > Yes, but is not turned on or there is no way to select it... so cannot > comment :-P > (it just show empty parenthesis, no way to select it) > Alright, I've changed the settings so that anyone can post (not just registered users), though comments from non-registered users will still have to be screened. I guess LJ still treats OpenID users as "anonymous". I didn't see a way to explicitly allow OpenID users, though. Regards, Dan From luislavena at gmail.com Sat Sep 12 13:41:49 2009 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 12 Sep 2009 19:41:49 +0200 Subject: [Win32utils-devel] I wish I could comment on Daniels posts In-Reply-To: <4AABCF78.9020302@gmail.com> References: <71166b3b0909120628v6b947adcm5dab0a69f822384d@mail.gmail.com> <4AABC624.6030803@gmail.com> <71166b3b0909120945u4d73c908i5d4d93dd587749ff@mail.gmail.com> <4AABCF78.9020302@gmail.com> Message-ID: <71166b3b0909121041v48af85b7ie5e3a2bbd1fc435a@mail.gmail.com> On Sat, Sep 12, 2009 at 6:42 PM, Daniel Berger wrote: > Luis Lavena wrote: >> >> On Sat, Sep 12, 2009 at 6:02 PM, Daniel Berger wrote: >>> >>> Luis Lavena wrote: >>>> >>>> Hello Guys, >>>> >>>> Me again in reply to Daniel's post: >>>> >>>> http://djberg96.livejournal.com/169067.html >>>> >>>> Since LiveJournal really sucks, I cannot simply register for >>>> comment... no, it creates a whole LiveJournal account that I don't >>>> plan on use. >>>> >>>> Also, no OpenID. >>> >>> LJ says it supports OpenID: >>> >>> http://www.livejournal.com/openid/ >>> >> >> Yes, but is not turned on or there is no way to select it... so cannot >> comment :-P >> (it just show empty parenthesis, no way to select it) >> > > Hm, I wonder if I have to explicitly enable it. Let me poke around a bit. > Thank you Daniel, LJ indeed treat OpenID as anonymous... Now I see the option for OpenID, which will be screened Cheers, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From phasis at gmail.com Fri Sep 25 20:06:40 2009 From: phasis at gmail.com (Heesob Park) Date: Sat, 26 Sep 2009 09:06:40 +0900 Subject: [Win32utils-devel] html clipboard format In-Reply-To: References: Message-ID: Hi, 2009/9/26 Paul Rogers : > Hi, > > Ive been using the clipboard library with some good success, but really need > to have the html formatted text. Is this possible? Do I just need to create > the type plugin? > Give me a pointer and I can probably write the code next week > The CVS version of win32-clipboard supports the HTML formatted text. Refer to http://rubyforge.org/pipermail/win32utils-devel/2009-April/001392.html http://rubyforge.org/tracker/index.php?func=detail&aid=25681&group_id=85&atid=414 Regards, Park Heesob From djberg96 at gmail.com Fri Sep 25 21:15:07 2009 From: djberg96 at gmail.com (Daniel Berger) Date: Fri, 25 Sep 2009 19:15:07 -0600 Subject: [Win32utils-devel] html clipboard format In-Reply-To: References: Message-ID: <4ABD6B1B.4080601@gmail.com> Heesob Park wrote: > Hi, > > 2009/9/26 Paul Rogers : >> Hi, >> >> Ive been using the clipboard library with some good success, but really need >> to have the html formatted text. Is this possible? Do I just need to create >> the type plugin? >> Give me a pointer and I can probably write the code next week >> > The CVS version of win32-clipboard supports the HTML formatted text. > > Refer to > http://rubyforge.org/pipermail/win32utils-devel/2009-April/001392.html > http://rubyforge.org/tracker/index.php?func=detail&aid=25681&group_id=85&atid=414 Yes, you can checkout what's in CVS. I haven't released it yet because I've been mulling over the interface. Regards, Dan