MTP IP Authentication Functions (Compact 7)
3/12/2014
The following table shows the MTP IP Authentication functions for MTP Responder in Windows Embedded Compact.
Function | Description |
---|---|
Registers a notification event for a pending TCP/IP connection from an MTP initiator. |
|
Retrieves information about a pending connection from an MTP initiator. |
|
Allows or rejects a pending TCP/IP connection from an MTP initiator. |
Remarks
MTP IP Authentication functions manage incoming connections from MTP initiators over TCP/IP networks. You can use these functions to allow or reject a pending MTP IP connection by performing the following steps.
- Create an event object (you can use CreateEvent) and register for connection notification by passing the event object to MTPIPRegisterConnectionNotification.
- Wait for MTP Responder to notify you of an incoming connection. You can use WaitForSingleObject to wait on the event object.
- Upon notification of an incoming connection, call MTPIPGetConnectionData to return information about the pending connection in an MTPIPCONNECTIONINFO structure.
- Verify that the pending connection originates from a valid MTP initiator. To authenticate the connection, you can notify the user of a pending connection (you can display the MTP initiator host name returned in the MTPIPCONNECTIONINFO structure) and ask the user to allow or reject the connection to the device.
- To allow the pending connection to complete, call MTPIPAuthorizeConnection, pass in the "nonce" (number used once) that was returned in the MTPIPCONNECTIONINFO structure, and set the fAuthorize parameter to TRUE. To reject the connection, call MTPIPAuthorizeConnection, and set the fAuthorize parameter to FALSE.