Sample ATADISK Driver (Windows Embedded CE 6.0)

1/6/2010

The sample ATADISK driver is in the %_WINCEROOT%\Public\Common\OAK\Drivers\Block\ATADisk directory.

In addition to the standard stream interface functions, the ATADISK driver also exports a PC Card Plug and Play detection function, DetectATADisk.

The detection function only reads the attribute space of the PC Card; it does not read any data or perform any write operations on the PC Card.

The function looks for disk device type 4 in the PC Card's CISTPL_FUNCID tuple, and for ATA device type 1 in the type 1 CISTPL_FUNCE tuple.

The presence of the HKEY_LOCAL_MACHINE\Drivers\PCMCIA\ATADisk registry key causes the Device Manager to call the driver's DetectATADisk function when you insert a PC Card and there is no driver that is associated with the card's Plug and Play identifier. For more information about the Device Manager, see Device Manager.

The following registry key example shows this:

[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Detect\50]
    "Dll"="ATADISK.DLL"
    "Entry"="DetectATADisk"

When DetectATADisk detects an ATA-compatible PC Card, it causes the Device Manager to load the driver listed in the HKEY_LOCAL_MACHINE\Drivers\PCMCIA\ATADisk registry key.

The following registry key example shows this:

[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\ATADisk]
    "Dll"="ATADISK.DLL"
    "Prefix"="DSK"
    "Ioctl"=dword:4
    "Profile"="PCMCIA"
    "IClass"=multi_sz:"{A32942B7-920C-486b-B0E6-92A702A99B35}","{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"

The following table shows optional values that can go under HKEY_LOCAL_MACHINE\Drivers\PCMCIA\ATADisk; these values affect all devices that the ATADISK driver effects.

Key Description

Cylinders

A value ofxxx causes the ATADISK driver to not rely on the number of cylinders that the ATA device reports in response to the ATA IDENTIFY command.

The number specified by the Cylinders registry value is used.

Heads

A value ofhh causes the ATADISK driver to not rely on the number of heads that the ATA device reports in response to the ATA IDENTIFY command.

The number specified by the Heads registry value is used.

Sectors

A value of ss causes the ATADISK driver to not rely on the number of sectors per track reported by the ATA device in response to the ATA IDENTIFY command.

The number specified by the Sectors registry value is used.

CHSMode

A value of 1 forces the ATADISK driver to use Cylinder/Head/Sector (CHS) addressing mode.

If the CHSMode value is 0 or the value is not present, the ATADISK driver uses the addressing mode reported by the ATA device in response to the ATA IDENTIFY command.

The ATADISK driver uses logical block address (LBA) mode when available.

See Also

Concepts

Block Driver Samples
Block Driver Architecture
Block Driver Registry Settings
Legacy PCMCIA Driver Support