CardRequestSocketMask

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.

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 allowable card events are shown in the following table.
    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 Values

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, that is, they will not fit in the fInterruptEvent and the fNotifyEvents members of the PDCARD_SOCKET_STATE structure.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Cardserv.h.
Link Library: Cardserv.lib.

See Also

CardReleaseSocketMask | CardRegisterClient | CardSetEventMask | PDCARD_SOCKET_STATE

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.