Block Driver Registry Settings

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

Windows Mobile Not SupportedWindows Embedded CE Supported


The Device Manager uses and manages several registry keys under the HKEY_LOCAL_MACHINE\Drivers registry key to load, track, and unload linear block device drivers.

Built-in devices rely on the registry settings to be present at startup. These keys must be part of the default registry, which includes the registry keys and values that you install.

You can install keys for removable block devices, such as linear flash memory PC Cards, on first use of the device.

This topic contains information about the following:

  • Name Limitations For Autoload Block Devices
  • PC Card Block Device Registry Keys
  • Built-In Block Device Registry Keys
  • ATAPI Block Device Driver Registry Keys
  • Secure Digital Card Registry Settings
  • the Hard Drives

Name Limitations For Autoload Block Devices

OEMs that add AutoLoad block drivers to their platform should keep AutoLoad sub-keys limited to seven characters to avoid possible name collisions.

Within the registry code that configures the driver, the AutoLoad sub-key string determines the name of a storage device. Because of the seven character limit, two drivers named Block Device1 and BlockDevice2 are both shortened to BlockDe, creating a name conflict.

The following example configures Storage Manager to AutoLoad two storage drivers, BlockDevice1 and BlockDevice2.



Note that both storage devices will still work, but one will not be accessibly via the storage manager API which can lead to limited functionality in some applications.

To work around this problem, shorten the AutoLoad key names to be shorter than 7 characters:



PC Card Block Device Registry Keys

To detect removable block devices, the Device Manager initiates a detection sequence to determine the specific device type.

The value of the Folder registry subkey under the HKEY_LOCAL_MACHINE\Drivers\PCMCIA\MyDriver registry key is optional. Its value determines the folder names that are associated with file system volumes.

The default value is Storage Card for the first volume, Storage Card2 for the second, and so on.

For example, if you use the value of the Folder registry subkey to change the folder name to My Folder, that is the name of the first device. The second folder is My Folder2, and so on.

The block device driver reads the Folder registry subkey when the file system driver requests a folder name.

The HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Detect\20 registry key is an example. The 20 registry subkey can be any other number. Its value determines the order in which the Device Manager tries the driver's MyDriverDetectdisk function relative to other drivers' detection functions when attempting to identify an unknown type of PC Card.

For more information about the Device Manager, see Device Manager.

The Device Manager requires registry keys to initiate the detection sequence. The following registry key examples show how a PC Card driver named MyDriver uses registry keys:

    "Prefix" = "XXX"
    "Dll" = "MyDriver.DLL"
    "Index" = DWORD:1
    "Order" = DWORD:1

Built-In Block Device Registry Keys

The HKEY_LOCAL_MACHINE\Drivers\BuiltIn registry key recognizes built-in block devices. The value of the Folder registry subkey is optional.

The following registry key example shows how a built-in driver called MyDriver should use the HKEY_LOCAL_MACHINE\Drivers\BuiltIn registry key:

    "Prefix" = "XXX"
    "Dll" = "MyDriver.DLL"
    "Index" = DWORD:1
    "Order" = DWORD:1

ATAPI Block Device Driver Registry Keys

The ATA/ATAPI driver for Windows Embedded CE is contains components that can be added or removed based on SYSGEN variable settings. The following table shows the components for the ATA/ATAPI driver.

SYSGEN variable Description


ATA PCMCIA/PC Card disk support.


On-board PCI ATA/ATAPI host bus adapter support. Hard disk only.


On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk and CD/DVD only.


On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk, CD/DVD, and peripheral PCI Promise PDC2026 host bus adapter.


Full ATA/ATAPI support, including, PCMCIA/PC Card disk, hard disk, CD/DVD, and PCI Promise PDC2026.

The following table shows the dependencies for the ATA/ATAPI SYSGEN variables.

SYSGEN variables Dependencies







The ATAPI driver consists of an IDE enumerator and an ATA/ATAPI driver. The IDE enumerator is activated for each IDE controller. On activation, the IDE enumerator scans the primary and secondary channel, if present, of the controller in search of ATA/ATAPI devices.

If the enumerator finds a device, it invokes a spawn function specified in the registry. Since a driver supports multiple IDE controllers, this spawn function distinguishes one IDE controller from another. This function is specified in the Platform.reg file for an OS design. No modification to the spawn function is necessary.

The following list shows the location of the registry files for the ATAPI driver:

  • %_WINCEROOT%\public\common\oak\drivers\block\atapi
    • Ali1543.reg
    • Genericide.reg
    • Geodeide.reg
    • I82371.reg
    • Pdc20262.reg
  • %_WINCEROOT%\public\common\oak\files
    • Common.reg
  • %_WINCEROOT%\platform\<your platform>\files
    • Platform.reg

The following registry example shows the registry settings for the Intel i82371 driver.

; SpawnFunction specified in platform.reg.
// The top-most key is that of the IDE enumerator

   "VendorID"=dword:8086           ; e.g., i82371 Vendor ID
   "ConfigEntry"="GenericConfig"   ; PCI configuration entry point
   "Legacy"=dword:01               ; legacy mode; use Irq for IRQ of primary channel and Irq+1 for IRQ of secondary channel; only required for legacy on-board controllers
   "Irq"=dword:0E                  ; 14; provided by bus driver
   "SysIntr"=dword:00              ; SysIntr not specified; provided by bus driver
   "DMAAlignment"=dword:04         ; default DMA alignment
   "SoftResetTimeout"=dword:03     ; ATA/ATAPI spec defines 31s ceiling; this is too long
;  "IsrDll"=""                     ; not required; only required for bus-agnostic drivers, e.g., Promise PDC20262; ATA PCMCIA/PC Card disk
;  "IsrHandler"=""                 ; not required; only required for bus-agnostic drivers, e.g., Promise PDC20262; ATA PCMCIA/PC Card disk
   "RegisterStride"=dword:01       ; ATA register stride; register block is contiguous

// Under the IDE enumerator key are 4 subkeys; one subkey for each possible device on a // two-channel controller: Device0 = master on primary channel, Device1 = slave on
// primary channel, Device2 = master on secondary channel, Device3 = slave on secondary
// channel

   "InterruptDriven"=dword:01      ; enable interrupt driven I/O
   "DMA"=dword:01                  ; enable DMA; 0 = disabled, 1 = enabled, 2 = enabled for hard disks and disabled for CD-ROMs
   "DoubleBufferSize"=dword:10000  ; 65536 byte (128 sectors) double buffer; maximum is 256 secotrs
   "DrqDataBlockSize"=dword:200    ; 1 sector (512 byte) DRQ data block
   "WriteCache"=dword:01           ; enable on-disk write cache
   "LookAhead"=dword:01            ; enable on-disk look-ahead
   "DeviceId"=dword:00             ; device 0, i.e., primary master
   "TransferMode"=dword:FF         ; use device default transfer mode (Ultra DMA 3, 4 require 80-conductor cable)

// The "TransferMode" byte value can take on the following values:

Mode                                Value (Hex)
----                                -----
PIO default mode                    00
PIO default mode, disable IORDY     01
PIO flow control transfer mode      Mode 0=08, 1=09, 2=0A, 3=0B, 4=0C
Multiword DMA mode                  Mode 0=20, 1=21, 2=22
Ultra DMA mode                      Mode 0=40, 1=41, 2=42, 3=43, 4=44

// Note: Not all drives support all DMA modes; Ultra DMA modes 3 and 4 require an 80-conductor cable.


Secure Digital Card Registry Settings

The following registry key examples show the registry settings for the SD memory driver.

; SD Memory Storage class driver
   "BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer
   ;"SingleBlockWrites"=dword:1  ; alternatively force the driver to use single block access
   ;"IdleTimeout"=dword:7D0      ; 2000 milliseconds
   ;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.
   ;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)


Naming the Hard Drives

To have a unique name for each hard disk, you need to add "HDProfile" keys. The following example shows how to add two, uniquely-named hard drives, one of which is the primary master and one the primary slave.

    “HDProfile”=”HDProfile2” ; primary master

    “HDProfile”=”HDProfile3” ; primary slave

    "Name"="IDE Hard Disk Drive"

    "Name"=" second IDE Hard Disk Drive"

See Also


Block Driver Architecture
Block Driver Samples