No. Both are passed as NULL-pointers:

c:\test>buk-pipe.pl (XS)Win32::API::Call: prototype? 0 [n/a] (XS)Win32::API::Call: params[0].t=1, .u=76 (XS)Win32::API::Call: params[1].t=2, .u= (XS)Win32::API::Call: params[2].t=1, .u=1024 (XS)Win32::API::Call: params[3].t=2, .u=(null) (XS)Win32::API::Call: params[4].t=2, .u=(null) (XS)Win32::API::Call: params[5].t=2, .u=(null) (XS)Win32::API::Call: parameter 5 (P) is (null) (XS)Win32::API::Call: parameter 4 (P) is (null) (XS)Win32::API::Call: parameter 3 (P) is (null) (XS)Win32::API::Call: parameter 2 (N) is 1024 (XS)Win32::API::Call: parameter 1 (P) is (XS)Win32::API::Call: parameter 0 (N) is 76 (XS)Win32::API::Call: Calling ApiFunctionInteger() (XS)Win32::API::Call: ApiFunctionInteger returned 1 (XS)Win32::API::Call: freeing memory... (XS)Win32::API::Call: returning to caller. (XS)Win32::API::Call: returning 1. ...

If you look closely, you'll see that I am not actually using lpTotalBytesAvail / $cAvail. I was in an early cut of the code, but then I realised that I didn't need to. It is easier to extract the information I need directly from the buffer.

When I was using $cAvail, it was coded like to this:

sub readlineMaybe { my $fh = shift; my $osfh = GetOsFHandle( $fh ) or die $^E; my( $bufsize, $buffer, $cAvail, $read ) = ( 1024, chr(0)x1024, chr +(0)x4, 0 ); PeekNamedPipe( $osfh, $buffer, $bufsize, $read, $cAvail, 0 ) or $^E == 109 or die $^E; print 'Available: ', unpack 'V', $cAvail; return if $^E == 109; my $eolPos = 1+index $buffer, $/; return '' unless $eolPos; sysread( $fh, $buffer, $eolPos ) or die $!; return $buffer; }

Which produces this output:

c:\test>buk-pipe.pl (XS)Win32::API::Call: prototype? 0 [n/a] (XS)Win32::API::Call: params[0].t=1, .u=76 (XS)Win32::API::Call: params[1].t=2, .u= (XS)Win32::API::Call: params[2].t=1, .u=1024 (XS)Win32::API::Call: params[3].t=2, .u=(null) (XS)Win32::API::Call: params[4].t=2, .u= (XS)Win32::API::Call: params[5].t=2, .u=(null) (XS)Win32::API::Call: parameter 5 (P) is (null) (XS)Win32::API::Call: parameter 4 (P) is (XS)Win32::API::Call: parameter 3 (P) is (null) (XS)Win32::API::Call: parameter 2 (N) is 1024 (XS)Win32::API::Call: parameter 1 (P) is (XS)Win32::API::Call: parameter 0 (N) is 76 (XS)Win32::API::Call: Calling ApiFunctionInteger() (XS)Win32::API::Call: ApiFunctionInteger returned 1 (XS)Win32::API::Call: freeing memory... (XS)Win32::API::Call: returning to caller. (XS)Win32::API::Call: returning 1. Available: 0 (XS)Win32::API::Call: prototype? 0 [n/a] (XS)Win32::API::Call: params[0].t=1, .u=76 (XS)Win32::API::Call: params[1].t=2, .u= (XS)Win32::API::Call: params[2].t=1, .u=1024 (XS)Win32::API::Call: params[3].t=2, .u=(null) (XS)Win32::API::Call: params[4].t=2, .u= (XS)Win32::API::Call: params[5].t=2, .u=(null) (XS)Win32::API::Call: parameter 5 (P) is (null) (XS)Win32::API::Call: parameter 4 (P) is (XS)Win32::API::Call: parameter 3 (P) is (null) (XS)Win32::API::Call: parameter 2 (N) is 1024 (XS)Win32::API::Call: parameter 1 (P) is (XS)Win32::API::Call: parameter 0 (N) is 76 (XS)Win32::API::Call: Calling ApiFunctionInteger() (XS)Win32::API::Call: ApiFunctionInteger returned 1 (XS)Win32::API::Call: freeing memory... (XS)Win32::API::Call: returning to caller. (XS)Win32::API::Call: returning 1. Available: 37 Got: 'Wed Oct 1 08:32:59 2008: some text' ...

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^7: ... (Proof!) by BrowserUk
in thread Non-blocking Reads from Pipe Filehandle by cbudin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.