void rdp_recv_logon_info_extended(rdpRdp* rdp, STREAM* s) { uint32 cbFieldData; uint32 fieldsPresent; uint16 Length; stream_read_uint16(s, Length); /* The total size in bytes of this structure */ stream_read_uint32(s, fieldsPresent); /* fieldsPresent (4 bytes) */ /* logonFields */ if (fieldsPresent & LOGON_EX_AUTORECONNECTCOOKIE) { stream_read_uint32(s, cbFieldData); /* cbFieldData (4 bytes) */ rdp_read_server_auto_reconnect_cookie(s, rdp->settings); } if (fieldsPresent & LOGON_EX_LOGONERRORS) { stream_read_uint32(s, cbFieldData); /* cbFieldData (4 bytes) */ rdp_recv_logon_error_info(rdp, s); } stream_seek(s, 570); /* pad */ }
BOOL rdp_recv_logon_info_extended(rdpRdp* rdp, wStream* s) { UINT32 cbFieldData; UINT32 fieldsPresent; UINT16 Length; if (Stream_GetRemainingLength(s) < 6) return FALSE; Stream_Read_UINT16(s, Length); /* The total size in bytes of this structure */ Stream_Read_UINT32(s, fieldsPresent); /* fieldsPresent (4 bytes) */ /* logonFields */ if (fieldsPresent & LOGON_EX_AUTORECONNECTCOOKIE) { if (Stream_GetRemainingLength(s) < 4) return FALSE; Stream_Read_UINT32(s, cbFieldData); /* cbFieldData (4 bytes) */ if (rdp_read_server_auto_reconnect_cookie(s, rdp->settings) == FALSE) return FALSE; } if (fieldsPresent & LOGON_EX_LOGONERRORS) { if (Stream_GetRemainingLength(s) < 4) return FALSE; Stream_Read_UINT32(s, cbFieldData); /* cbFieldData (4 bytes) */ if (rdp_recv_logon_error_info(rdp, s) == FALSE) return FALSE; } if (Stream_GetRemainingLength(s) < 570) return FALSE; Stream_Seek(s, 570); /* pad */ return TRUE; }