[Bug 17195] NamedPipe datagrams need to be _really_ datagrams

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Feb 6 04:02:27 CST 2009


http://bugs.winehq.org/show_bug.cgi?id=17195





--- Comment #15 from Luke Kenneth Casson Leighton <lkcl at lkcl.net>  2009-02-06 04:02:26 ---
well, this is the implementation i have so far:

/***********************************************************************
 *           SetNamedPipeHandleState  (KERNEL32.@)
 */
BOOL WINAPI SetNamedPipeHandleState(
    HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount,
    LPDWORD lpCollectDataTimeout)
{
    /* should be a fixme, but this function is called a lot by the RPC
     * runtime, and it slows down InstallShield a fair bit. */
    TRACE("%p %p/%d %p %p\n",
          hNamedPipe, lpMode, lpMode ? *lpMode : 0,
          lpMaxCollectionCount, lpCollectDataTimeout);

    if (lpMode)
    {
        /* FIXME: This function should fail if PIPE_READMODE_MESSAGE
         * is specified for a byte-type pipe.
         * TODO: write a test that deliberately tries this on nt,
         * to find out the error code.
         */
        int flgs = 0;
        if ((*lpMode) & PIPE_READMODE_MESSAGE)
        {
            /* FIXME: the current "are we in message-mode" is based
             * on NAMED_PIPE_MESSAGE_STREAM_WRITE being set, but
             * this is READMODE being asked to be set - why?
             */
            flgs |= NAMED_PIPE_MESSAGE_STREAM_READ;
        }
        if ((*lpMode) & PIPE_NOWAIT)
        {
            flgs |= NAMED_PIPE_NONBLOCKING_MODE;
        }
        server_set_named_pipe_info( hNamedPipe,
                                       NAMED_PIPE_INFO_SET_FLAGS,
                                       flgs, 0 );
        return TRUE;
    }
    return TRUE; /* FIXME: ignore all but lpMode setting, for now */
}


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list