I think that it could be that the Win32API package is handline lzstptr parameters as Ruby strings as opposed to null terminated byte arrays. The behavior that is being displayed is much more like the BSTR, which (while still being null terminated) also carries a length value, so it can include /000 in the data.

Should the two be handled differently? I would say yes, that if you're calling an API that is taking a long zero char pointer as a string value, then you should approach it differently than if the API call is expecting a BSTR.

Paul

 On Fri, 20 May 2005 12:25:14 +0900, Daniel Berger wrote:
>
>aul Leonard wrote:
>>he api call is just taking the char buffer you're sending it,
>>
>ropping a null after the path to terminate it just like a normal
>indows application would expect. I would have thought that the
>in32API module would take care of this sort of thing for you, but
>hat doesn't seem to be the case.
>
>>ou could do the split, or the amusing but probably terrible:
>>
>>uts "Path is [#{path.unpack(A4*).join}]"
>>
>>aul Leonard
>>
> don't think it's Win32API per se, so much as just the way Ruby
>andles strings. 've picked up '\000' before in strings parsing
>proc on Linux, for example. 'll just have to deal with it (or
>se C). :)
>
>hanks to everyone who replied.
>
>egards,
>
>an