CardRequestSocketMask (Windows Embedded CE 6.0)
1/6/2010
This function associates a socket and function pair with an event mask for the driver. Card services then restricts its future callbacks to the driver to those associated with the event mask passed to this function.
Syntax
STATUS CardRequestSocketMask(
CARD_CLIENT_HANDLE hCardClient,
CARD_SOCKET_HANDLE hSock,
UINT16 fEventMask
);
Parameters
- hCardClient
[in] Handle obtained from the CardRegisterClient function.
- hSock
[in] Handle to a socket and function pair.
fEventMask
[in] Specifies a bitmask indicating the events that trigger a callback.The following table shows the PC card events that are allowed.
Event mask Description EVENT_MASK_WRITE_PROTECT
Write-protect state
EVENT_MASK_CARD_LOCK
Card lock state
EVENT_MASK_EJECT_REQ
Ejection request
EVENT_MASK_INSERT_REQ
Insertion request
EVENT_MASK_BATTERY_DEAD
Battery dead
EVENT_MASK_BATTERY_LOW
Battery low
EVENT_MASK_CARD_READY
Ready change
EVENT_MASK_CARD_DETECT
Card detect
EVENT_MASK_POWER_MGMT
Power management change
EVENT_MASK_RESET
Card reset
EVENT_MASK_STATUS_CHANGE
Card-generated status change interrupt
Return Value
CERR_SUCCESS indicates success. One of the following values indicates failure:
- CERR_BAD_HANDLE
Indicates that the driver handle specified for hCardClient is not valid.
- CERR_BAD_SOCKET
Indicates that the socket identifier specified for hSock is not valid.
- CERR_OUT_OF_RESOURCE
Indicates that insufficient memory is available to create a new event mask.
Remarks
An event mask should not be confused with the global event mask, which pertains to all sockets and is set by CardRegisterClient.
The CardSetEventMask function can change either a socket-specific event mask or the mask specified by CardRegisterClient.
The EVENT_MASK_POWER_MGMT, EVENT_MASK_RESET and EVENT_MASK_STATUS_CHANGE event masks should not be generated by the socket itself.
Requirements
Header | cardserv.h |
Library | Cardserv.lib |
Windows Embedded CE | Windows CE 1.0 and later |
See Also
Reference
PCMCIA Legacy Compatibility Layer Functions
CardReleaseSocketMask
CardRegisterClient
CardSetEventMask