How to Pass Parameters to a SCSI Miniport via the Registry (133706)



The information in this article applies to:

  • Microsoft Win32 Device Driver Kit (DDK) for Windows NT 3.51
  • Microsoft Windows 2000 Driver Development Kit (DDK)
  • Microsoft Windows XP Driver Development Kit (DDK)

This article was previously published under Q133706

SUMMARY

This article describes how to pass information from the Windows NT registry to a SCSI miniport driver. The parameter string passed to the SCSI miniport is in the fourth parameter of the HwFindAdapter routine. This article refers to the following registry location:
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
				

MORE INFORMATION

There are two formats that can be used to pass registry information to SCSI miniports.

Use Format One when a different parameter string must be passed to each HBA that the SCSI miniport supports. Use Format Two when the same parameter string should be passed to all the HBAs the SCSI miniport supports.

The registry string described below will be passed in as the fourth parameter (the ArgumentString) in the SCSI miniport's HwScsiFindAdapter routine. The FD8XX driver in the Windows NT DDK shows an example of the parameter string being passed to the SCSI miniport.

NOTE: The DriverParameters key can hold a maximum of 512 bytes.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

323170 HOW TO: Backup, Edit, and Restore the Registry in Windows NT 4.0

Format One

MpName                                 // SCSI miniport key name
   Parameters                          // key name
      Device0                          // key name
         DriverParameter               // value name
            REG_SZ                     // value data type
            Parm string for HBA-0      // parameter string
      Device1
         DriverParameter
            REG_SZ
            Parm string for HBA-1
      ...

      DeviceN
         DriverParameter
            REG_SZ
            Parm string for HBA-N
				

Format Two

MpName                                          // SCSI miniport key name
   Parameters                                   // key name
      Device                                    // key name
         DriverParameter                        // value name
            REG_SZ                              // value data type
            Parm string for all MpName HBA's    // parameter string

				
There are several methods to add the information to the registry:
  • Using REGEDT32.EXE
  • Using INF files
  • Using various Win32 APIs
NOTE: The SCSI miniport cannot use any of the C run-time functions such as STRCMP or STRCPY. Therefore, the driver writer must write any string-handling functions that are needed to interpret the parameter information.

Modification Type:MinorLast Reviewed:5/24/2004
Keywords:KB133706