VirtualBox

Changeset 95084 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
May 24, 2022 8:49:36 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/pipe/win: Added workaround to RTPipeQueryReadable for XP and older where PeekNamedPipe could return a too high value for what's available to read. Seems this issue was addressed in some XP service pack (1?). [comment adjust]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/pipe-win.cpp

    r95083 r95084  
    12131213         *
    12141214         * Prior to XP SP1 (?), the returned cbAvailable value was not adjusted
    1215          * by read position in the current message/buffer, so it could
    1216          * potentially be too high.  This could cause the caller to try read
    1217          * more data than what's actually available, which may cause the read
    1218          * to block when the caller thought it wouldn't.
     1215         * by the read position in the current message/buffer, so it could
     1216         * potentially be too high.  This may cause the caller to try read more
     1217         * data than what's actually available, which may cause the read to
     1218         * block when the caller thought it wouldn't.
    12191219         *
    1220          * To get the accurate size, we have to provide and output buffer
    1221          * and see how much we actually get back in it, as the data peeking
    1222          * works correctly (as you would expect).
     1220         * To get an accurate readable size, we have to provide an output
     1221         * buffer and see how much we actually get back in it, as the data
     1222         * peeking works correctly (as you would expect).
    12231223         */
    12241224        if (cbAvailable == 0 || g_enmWinVer >= kRTWinOSType_XP64)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette