Share via


Client Driver Entry Points

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

A Secure Digital (SD) card client driver is a streams driver that implements the standard streams entry points. Of these entry points, only XXX_Init (Device Manager) and XXX_Deinit (Device Manager) are required. These functions are always called during device loading and unloading. Implementation of one or more of the entry points XXX_Open (Device Manager), XXX_Close (Device Manager), XXX_Write (Device Manager), XXX_Read (Device Manager), XXX_Seek (Device Manager), or XXX_IOControl (Device Manager) are required in order to provide an application interface to the driver.

An SD client driver does not use the XXX_PowerUp (Device Manager) and XXX_PowerDown (Device Manager) functions. Power management is handled using Power Manager aware IOCTLs. However, a client driver can implement these entry points to receive power up and power down notifications. The power up and power down entry points are used only to notify the driver of the event. Since these functions are called in a non-preemptible interrupt context, very little can be done other than to set notification flags in the driver.

A DLL entry point is called by the Windows Embedded CE module loader once each time a DLL is loaded and unloaded. The client driver then initializes or deinitializes the SD card library. The following code example shows the layout of a typical DLL entry point.

BOOL SDMemoryDllEntry (HINSTANCE  hInstance,
  ULONG Reason,
  LPVOID pReserved)
{
  if(Reason == DLL_PROCESS_ATTACH ) {
    if(!SDInitializeCardLib()) {
      fRet = FALSE;
    }
  }
  else if(Reason == DLL_PROCESS_DETACH ) {
    SDDeinitializeCardLib();
  }
  return fRet;
}

The entry point for a client driver must also be included in the associated sources file. The following code example shows the entry point for a client driver in a sources file.

DLLENTRY= SDMemoryDllEntry

See Also

Reference

XXX_Init (Device Manager)
XXX_Deinit (Device Manager)
XXX_Open (Device Manager)
XXX_Close (Device Manager)
XXX_Write (Device Manager)
XXX_Read (Device Manager)
XXX_Seek (Device Manager)
XXX_IOControl (Device Manager)
XXX_PowerUp (Device Manager)
XXX_PowerDown (Device Manager)

Concepts

Secure Digital Card Client Driver