As mentioned, the block device driver exposes standard stream interface functions common to all drivers controlled by the Device Manager. For information about these standard stream interface functions, see Required Entry Points for Stream Interface Driver DLLs. In addition to the common stream interface API, the block device driver must also expose the following more specialized functions:
An entry point function for the device driver DLL. After the Device Manager calls LoadLibrary to map the DLL, the system calls MyDriverEntry. This function performs any initialization tasks necessary for the block device driver. Upon successful return from MyDriverEntry, the Device Manager associates the driver’s stream interface functions with a special device file name so that applications can access the device. The first flash memory device is named “DSK1:”, the second “DSK2:”, and so on. DSK_ is the device file name prefix for all block device drivers.
The status callback function for notification of events from removable flash media cards. The block device driver registers this callback function with the PC Card Services driver.
The entry point for the block device driver’s detection routine. MyDriverDetectdisk is a detection function for sockets that support hot insertion of block media. After the Device Manager loads the block device driver DLL, it calls this function to perform detection on the media. Detection typically takes place at cold start and warm start. However, for sockets that support hot insertion, detection occurs when a device is inserted into the socket.