Microsoft Windows CE 3.0  

CardRegisterClient

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function registers a callback function that is called by Card Services when a specified socket event occurs. The callback function notifies the driver of the event, such as card insertion, so that the driver can take the appropriate action.

CARD_CLIENT_HANDLE CardRegisterClient(
CLIENT_CALLBACK
CallBackFn
PCARD_REGISTER_PARMS
pParms
);

Parameters

CallBackFn
Pointer to the driver's callback function.
pParms
Pointer to a CARD_REGISTER_PARMSstructure defining the driver's characteristics.

Return Values

A driver handle indicates success. NULL indicates failure, and GetLastErrorreturns one of the following values:

CERR_BAD_ARGS
Indicates that the pointer specified in pParmsor CallBackFnis invalid.
CERR_OUT_OF_RESOURCE
Indicates that Card Services is unable to allocate memory to track the driver.

Remarks

This function turns on power to any unpowered sockets containing PC Cards so that the cards can be used by the newly registered PC Card driver. A driver can request artificial insertion notifications to check if a card that it controls has already been inserted.

Card Services sends a CE_CARD_INSERTION callback event code for every function on PC Cards that are currently inserted. If the driver does not require artificial insertion notices, it can clear the CLIENT_ATTR_NOTIFY_SHARED and CLIENT_ATTR_NOTIFY_EXCLUSIVE bits in the fAttributesmember of CARD_REGISTER_PARMS.

Because the CE_CARD_INSERTION callbacks can occur before this function returns, the Parm2member of the CARD_EVENT_PARMSstructure contains the registering client's CARD_CLIENT_HANDLE. For the same reason, Parm1also contains the registering client's handle on the CE_REGISTRATION_COMPLETE callback.

When the driver is unloaded, it must call CardDeregisterClientto free any PC Card resources allocated to the driver.

Driver name

PCMCIA

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later      
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CARD_CLIENT_HANDLE, CARD_EVENT, CARD_EVENT_PARMS, CARD_REGISTER_PARMS, CardDeregisterClient



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.