The CardRequestExclusive function requests exclusive access to a specified socket and function pair.
STATUS CardRequestExclusive( CARD_CLIENT_HANDLE hCardClient CARD_SOCKET_HANDLE hSocket );
If the function succeeds, the return value is CERR_SUCCESS; otherwise, it is one of the following:
Value | Description |
---|---|
CERR_BAD_HANDLE | Indicates the driver handle specified for hCardClient is invalid. |
CERR_BAD_SOCKET | Indicates the socket identifier specified for hSocket is invalid or the PC Card not inserted. |
CERR_IN_USE | Indicates exclusive access is owned by another driver. |
CardRequestExclusive causes Card Services to issue a series of callback events services as it negotiates for approval with each registered driver. First, all registered drivers are queried with a CE_EXCLUSIVE_REQUEST event code to determine if they will allow exclusive use. If they all approve, each driver is sent a CE_CARD_REMOVAL event code. Finally a CE_CARD_INSERTION event code is sent to the requesting driver followed by a CE_EXCLUSIVE_COMPLETE event code. If any of the drivers do not approve, the requesting driver is sent a CE_EXCLUSIVE_COMPLETE event code with a failing status in Parm1 member of the CARD_EVENT_PARMS structure.