CardGetFirstTuple

The CardGetFirstTuple function retrieves the first tuple of the specified type for the specified socket and function.

Syntax

STATUS CardGetFirstTuple( PCARD_TUPLE_PARMS pGetTupleParms );

Parameters

pGetTupleParms
Specifies a pointer to a CARD_TUPLE_PARMS structure.

Return Values

If the function succeeds, the return value is CERR_SUCCESS; otherwise, it is one of the following values:

Value Description
CERR_BAD_ARGS Indicates the pointer specified for pGetTupleParms is invalid.
CERR_BAD_SOCKET Indicates the socket identifier specified for the hSocket member of the CARD_TUPLE_PARMS structure is invalid, or there is no PC Card inserted in the socket.
CERR_NO_MORE_ITEMS Indicates the end of the CIS was reached or the requested tuple not found.
CERR_OUT_OF_RESOURCE Indicates that Card Services was unable to set up a memory window to read the CIS.
CERR_READ_FAILURE Indicates that no PC Card is inserted, or that the PC Card is unreadable.

Remarks

CardGetFirstTuple searches the CIS tuple chain in the PC Card's attribute memory for the tuple specified by the uDesiredTuple member of the CARD_TUPLE_PARMS structure. A uDesiredTuple value of 0xFF indicates that all tuples should be returned. The driver should retain the values returned in the uLinkOffset, uCISOffset and fFlags members of the CARD_TUPLE_PARMS structure so that subsequent CardGetNextTuple or CardGetTupleData calls can follow the tuple chain. The members uTupleCode and uTupleLink should be ignored when the return value is not CERR_SUCCESS.

To obtain tuple data, call CardGetTupleData.

The CARD_TUPLE_PARMS and the CARD_DATA_PARMS structures are arranged so that their corresponding members are aligned. With care, a single buffer can be used in all calls to the Card Services tuple functions.

See Also

CARD_DATA_PARMS_wceddk_CARD_DATA_PARMS, CARD_TUPLE_PARMS_wceddk_CARD_TUPLE_PARMS, CardGetNextTuple_wceddk_CardGetNextTuple, CardGetTupleData_wceddk_CardGetTupleData, PC Card Tuple Codes_wceddk_PC_Card_Tuple_Codes