4.2.1.1 Connection Denied
Assume for a moment that the acceptor denies the connection request, then the acceptor will create a MESSAGE_PACKET with the MsgTag field set to MTAG_CONNECTION_REQ_DENIED (0x00000003), and it will provide a reason for the rejection in the Reason field (for example, E_ACCESSDENIED, or 0x80070005), which is appended to the end of the MESSAGE_PACKET. It will set the dwConnectionId field to the connection identifier that the initiator requested (0x00000001), and it will set the dwcbVarLenData field to four (the size of the Reason field that follows). The dwUserMsgType field is set to zero, because this is a MTAG_CONNECTION_REQ_DENIED message; likewise, the fIsMaster field is set to 0x00000000. The acceptor will then drop all incoming messages with a dwConnectionId field set to 0x00000001 until it receives a disconnect request.
The MESSAGE_PACKET structure is as follows.
Field |
Value |
Description |
---|---|---|
MsgTag |
0x00000003 |
MTAG_CONNECTION_REQ_DENIED |
fIsMaster |
0x00000000 |
0 |
dwConnectionId |
0x00000001 |
1 |
dwUserMsgType |
0x00000000 |
dwUserMsgType: 0 |
dwcbVarLenData |
0x00000004 |
4 |
dwReserved1 |
0xcd64cd64 |
dwReserved1: 0xcd64cd64 |
dwReason |
0x80070005 |
E_ACCESSDENIED |