driver-win.rst
changeset 1159 60db6debab94
parent 1151 dfcec55a1240
parent 1158 d8fa153ef4d4
child 1183 35a64ff26d4c
equal deleted inserted replaced
1151:dfcec55a1240 1159:60db6debab94
     1 -*- mode: outline; coding: utf-8; -*-
       
     2 
       
     3 * About.
       
     4 
       
     5   microsoft.public.development.device.drivers
       
     6                 NNTP driver development group at msnews.microsoft.com:119
       
     7   http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
       
     8                 Web-interface to NNTP forum
       
     9 
       
    10 * Which version exist?
       
    11 
       
    12  - VxD
       
    13                 Windows 3.x and Windows 9x
       
    14  - Windows Driver Model (WDM)
       
    15                 Windows 98, Windows 98 Second Edition, Windows Me, Windows
       
    16                 2000, Windows XP, Windows Server 2003 and Windows Vista (for
       
    17                 backwards compatibility)
       
    18  - Windows Driver Foundation (WDF)
       
    19                 Windows 2000 and later
       
    20 
       
    21 * VxD.
       
    22 
       
    23 See
       
    24 
       
    25   http://en.wikipedia.org/wiki/VxD
       
    26 
       
    27 * WDM.
       
    28 
       
    29 See
       
    30 
       
    31   http://en.wikipedia.org/wiki/Windows_Driver_Model
       
    32 
       
    33 * WDF.
       
    34 
       
    35 See
       
    36 
       
    37   http://en.wikipedia.org/wiki/Windows_Driver_Foundation
       
    38 
       
    39 * Tools.
       
    40 
       
    41 ** Msinfo32.exe
       
    42 
       
    43 Windows XP/2003 System Information Tool.
       
    44 
       
    45 See
       
    46 
       
    47   http://support.microsoft.com/kb/308549
       
    48 
       
    49 ** Sysinternals.
       
    50 
       
    51 *** WinObj.
       
    52 
       
    53 Winobj is a program that lets you browse the Windows NT Object Manager
       
    54 namespace.
       
    55 
       
    56 ** devtree.
       
    57 
       
    58 The DeviceTree V2.12 utility is a Windows XP/Server 2003 utility written by
       
    59 OSR, that allows the user the ability to display the drivers and devices
       
    60 loaded in 2 different views. The first view Driver View the user sees a list
       
    61 of all the drivers loaded in kernel mode and all the devices that those
       
    62 drivers have created. In the second view PnP View the user sees a list of all
       
    63 the devices in the system from that of Plug and Play Manager (PnP).
       
    64 
       
    65 ** Microsoft DDK.
       
    66 
       
    67 *** DevCon.
       
    68 
       
    69 Supported device classes:
       
    70 
       
    71   cmd> devcon.exe classes
       
    72 
       
    73 Which files used by specific driver (with "*" prints list of files for all drivers):
       
    74 
       
    75   cmd> devcon.exe driverfiles *
       
    76 
       
    77 Device ID (names included):
       
    78 
       
    79   cmd> devcon.exe hwids *
       
    80 
       
    81 Device status (running/stoped):
       
    82 
       
    83   cmd> devcon.exe status *
       
    84 
       
    85 ** USB Command Verifier.
       
    86 
       
    87 All USB peripherals are required to pass the Device Framework tests in order
       
    88 to gain certification.
       
    89 
       
    90   http://www.usb.org/developers/tools/
       
    91 
       
    92 * Files.
       
    93 
       
    94 ** Windows 98 SE/ME.
       
    95 
       
    96  * .386
       
    97    VxD driver under Windows 3.x
       
    98  * .vxd
       
    99    VxD driver under Windows 95
       
   100 
       
   101 ** Windows NT (2000/XP/2003).
       
   102 
       
   103  * .inf
       
   104    Stored in %Windir%\Inf.
       
   105  * .pnf
       
   106    Precompiled INF File. Stored in %Windir%\Inf.
       
   107 
       
   108 * Driver type.
       
   109 
       
   110 ** CDC.
       
   111 
       
   112   http://support.microsoft.com/kb/837637
       
   113                 How to use or to reference the Usbser.sys driver from
       
   114                 universal serial bus (USB) modem .inf files.
       
   115 
       
   116 * Driver class.
       
   117 
       
   118 See
       
   119 
       
   120   http://msdn.microsoft.com/en-us/library/ms791134.aspx
       
   121                 System-Supplied Device Setup Classes
       
   122   http://msdn.microsoft.com/en-us/library/ff538820.aspx
       
   123                 Drivers for the Supported USB Device Classes
       
   124 
       
   125 * How list drivers?
       
   126 
       
   127 Set environment devmgr_show_nonpresent_devices to 1 and run Device Manager,
       
   128 select "View" --> "Show hidden devices".
       
   129 
       
   130 * How install drivers?
       
   131 
       
   132 ** dpinst.
       
   133 
       
   134 Driver Install Frameworks (DIFx) tools allow installing driver under following
       
   135 OSes:
       
   136 
       
   137   Windows Server 2008 R2
       
   138   Windows 7
       
   139   Windows Server 2008
       
   140   Windows Vista
       
   141   Windows Server 2003
       
   142   Windows XP
       
   143   Windows 2000
       
   144 
       
   145 It consist from API (from library, DIFxAPI, DIFxApp) and command line tool
       
   146 (DPInst) which can be found in WDK and their licence allow redistribution.
       
   147 
       
   148   http://www.microsoft.com/whdc/driver/install/DIFxFAQ.mspx
       
   149                 Information about Driver Install Frameworks Tools
       
   150   http://msdn.microsoft.com/ru-ru/magazine/cc302206%28en-us%29.aspx
       
   151                 If you update any drivers in Device Manager
       
   152                 %windir%\system32\ReinstallBackups folder is created with
       
   153                 backups of the old drivers.
       
   154 
       
   155 ** devcon.
       
   156 
       
   157 This command-line specifies the location of the driver package's INF file (c:\toaster\toastpkg.inf)
       
   158 and the toaster device's hardware identifier (ID), which is specified within the INF file.
       
   159 
       
   160   cmd# devcon.exe install c:\toaster\toastpkg.inf {b85b7c50-6a01-11d2-b841-00c04fad5171}\mstoaster
       
   161 
       
   162   http://msdn.microsoft.com/en-us/library/ff553642.aspx
       
   163                 Using the DevCon Tool to Install a Driver Package
       
   164 
       
   165 * How debug Windows drivers.
       
   166 
       
   167 To detect whether a driver loaded, check the status of the device in Device Manager.
       
   168 
       
   169 SetupAPI logs information about device installation in a plain-text log file
       
   170 that you can use to verify the installation of a device and to troubleshoot
       
   171 device installation problems.
       
   172 
       
   173 For Windows XP/2003 check:
       
   174 
       
   175   %SystemRoot%/setupapi.log
       
   176 
       
   177 For Windows Vista and later versions of Windows check:
       
   178 
       
   179   %SystemRoot%\inf\SetupAPI.dev.log     installation events in the device
       
   180   %SystemRoot%\inf\SetupAPI.app.log     application installation
       
   181 
       
   182   http://msdn.microsoft.com/en-us/library/ff553497.aspx
       
   183                 Troubleshooting Install and Load Problems with Signed Driver Packages
       
   184   http://www.microsoft.com/whdc/devtools/debugging/debugtips.mspx
       
   185                 Improve Driver Debuggability
       
   186   http://msdn.microsoft.com/en-us/library/ff551063.aspx
       
   187                 Debugging Tools for Windows
       
   188   http://msdn.microsoft.com/en-us/library/ff543450%28VS.85%29.aspx
       
   189                 Checked and Free Build Differences
       
   190 
       
   191 * Driver signing.
       
   192 
       
   193 Type of signature:
       
   194 
       
   195  * Signed by a Windows signing authority.
       
   196  * Signed by a trusted publisher.
       
   197  * Signed by an untrusted publisher.
       
   198  * Signed by a publisher of unknown trust.
       
   199  * Altered.
       
   200  * Unsigned.
       
   201 
       
   202   http://msdn.microsoft.com/en-us/library/ff544703.aspx
       
   203                 Type of signature and performed action.
       
   204   http://www.microsoft.com/whdc/driver/install/drvsign/best-practices.mspx
       
   205                 Code-Signing Best Practices.
       
   206   http://msdn.microsoft.com/en-us/library/ff550764.aspx
       
   207                 Device Installation Signing Requirements.
       
   208   http://www.microsoft.com/whdc/winlogo/categories.mspx
       
   209                 Windows Logo Program Test Categories.
       
   210   http://www.microsoft.com/whdc/driver/install/drvsign/crosscert.mspx
       
   211                 Root Authority Cross-Certificate List
       
   212 
       
   213 ** Tools for Signing Drivers.
       
   214 
       
   215 'certmgr.msc' present in Windows 2000 and upper.
       
   216 
       
   217 From Windows SDK/WDK:
       
   218 
       
   219   CertMgr Inf2Cat MakeCat MakeCert Pvk2Pfx SignTool
       
   220 
       
   221   http://msdn.microsoft.com/en-us/library/ff552958.aspx
       
   222                 Tools for Signing Drivers
       
   223 
       
   224 * Invoking a Device Properties Dialog Box from a Command-line Prompt.
       
   225 
       
   226 You need get device-instance-ID-parameter:
       
   227 
       
   228   cmd# rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID "ACPI\PNP0F03\4&1A8C8C2E&0"
       
   229 
       
   230   http://msdn.microsoft.com/en-us/library/ff548170.aspx
       
   231 
       
   232 * Driver Selection Process.
       
   233 
       
   234 Windows uses the following criteria to select a driver for a device:
       
   235 
       
   236  * Windows selects the driver that has the lowest rank value as the best match for the device.
       
   237  * For drivers that have equal rank, Windows selects the driver that has the most recent date.
       
   238  * For the drivers that have equal rank and date, Windows selects the driver that has the highest version.
       
   239  * Windows XP SP1 and later: For drivers that have equal rank, date, and version, Windows can select any driver.
       
   240  * Windows XP and Windows 2000: For drivers that have equal rank, date, and version, Windows can select any driver.
       
   241 
       
   242   http://msdn.microsoft.com/en-us/library/ff549553.aspx
       
   243 
       
   244 * Distributing a Driver Package.
       
   245 
       
   246 ** Windows Update.
       
   247 
       
   248 You can distribute a driver package through the Windows Update program if the driver package:
       
   249 
       
   250  * Passes the WHQL test program and receives a WHQL release signature.
       
   251  * Qualifies for the Windows Logo program.
       
   252  * Meets additional requirements that ensure that Windows Update can determine the correct driver
       
   253    package for the user's device, can legally distribute it, and can automatically download it.
       
   254 
       
   255   http://msdn.microsoft.com/en-us/library/ff554874.aspx
       
   256 
       
   257 * Hardware ID.
       
   258 
       
   259 PCI and AGP buses: Contain subsystem ID and subsystem vendor ID (&SUBSYS in the ID string). Drivers
       
   260 must have VID/DID/SVID/SID PNP ID entries to be published via Windows Update.
       
   261 
       
   262 PCI Device Subsystem IDs and Windows specifications are available at:
       
   263 http://www.microsoft.com/whdc/archive/pciidspec.mspx
       
   264 
       
   265 PCMCIA: Always specific; contains PCMCIA in the ID string.
       
   266 
       
   267 USB: Contains VID and &PID in the ID string.
       
   268 
       
   269 IEEE 1394: Always specific; contains 1394 in the ID string.
       
   270 
       
   271 HID: Contains &VID and &PID in the ID string.
       
   272 
       
   273 IDE: Contains IDE\ in the ID string.
       
   274 
       
   275 Parallel Port Printers: Contain LPTENUM\ in the ID string.
       
   276 
       
   277 IrDA Printers: IDs begin with HWP.
       
   278 
       
   279   http://www.microsoft.com/whdc/winlogo/winup/default.mspx
       
   280                 Windows Update Driver Publishing