[patch] rpcrt4_conn_np_read needs to expect and accept ERROR_MORE_DATA

Luke Kenneth Casson Leighton luke.leighton at googlemail.com
Thu Feb 5 06:59:09 CST 2009


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

hooray!  very simple fix, here - allow ERROR_MORE_DATA status code as
an acceptable error.

... and _check it_, afterwards.

ideally, the loop to read a complete PDU should be vaguely like this:

do {
    RpcConnection conn->ops->read(data, &len)
    total_read += len;
    if GetLastError() == ERROR_MORE_DATA
        if total_read == total_packet_size
           return FALSE; /* not ok to return ERROR_MORE_DATA at end of PDU!
} while (total_read != total_packet_size);

i.e. you should _expect_ there to be an ERROR_MORE_DATA status code on
all but the _very_ last bit of the PDU.  but, you can't do that in
rpcrt4_conn_np_read() because that function is just a "data getter",
it doesn't know when it's being used to grab the last bit of the PDU.

this will prove to be important for catching problems, both internally
and also when SMBs are used.  _yes_ the SMB system also returns
ERROR_MORE_DATA.  actually, if NT STATUS codes are enabled, it's
STATUS_MORE_PROCESSING_REQUIRED which _do_ go over-the-wire if the smb
server negotiates their use, but that's another story.

l.



More information about the wine-devel mailing list