Microsoft KB Archive/829645

= BUG: The INF Dirid String Substitution Sometimes Does Not Work for DIRID_SRCPATH =

Article ID: 829645

Article Last Modified on 7/22/2004

-

APPLIES TO


 * Microsoft Windows XP Professional
 * Microsoft Windows XP Professional
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Service Pack 1
 * Microsoft Windows 2000 Service Pack 2
 * Microsoft Windows 2000 Service Pack 3
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)

-





SYMPTOMS
For some helpful background information about this issue, see the &quot;More Information&quot; section of the article.

In certain scenarios, the  substitution does not return the expected value. Instead of returning the original directory where the .inf file was installed, the original operating system installation directory is returned. This problem occurs when both of the following conditions exist:  The directory where the .inf file was installed is in the DevicePath value of the following registry key:

 The .inf file was not installed from the \Inf directory.

These conditions do not typically exist because the DevicePath registry key typically contains only the \Inf path.

One scenario where this problem has been reported is during an OEM Preinstall Kit (OPK) installation. An OPK installation requires that paths to pre-installed drivers be included in the DevicePath registry value.



WORKAROUND
To work around this problem, only use the value that is generated by string substitution if the .inf file is being installed from the \Inf directory; otherwise, use the current directory that the driver package is being installed from.

When the .inf file is installed from \Inf, as is the case with a pre-installed or previously installed driver, the substitution works correctly.

This workaround is demonstrated by the DDK Toaster Installation Package sample file. Search for &quot;[ToastCoInfo]&quot; in the following folder:

\Src\General\Toaster\Toastpkg\Toastco\Toastco.c



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
A directory ID (DIRID) is a number that identifies a specific directory in an information (.inf) file. Dirids can be used in .inf file entries to represent all or part of the file path, in the form. When the .inf file is loaded, the system replaces the  tag with the file path that is represented by that dirid.

The Windows DDK documentation describes this technique in the topic &quot;Using Dirids.&quot; This topic includes a list of common dirids and the directories that they represent. The  substitution can be used anywhere in the .inf file that a string value is expected, except in the [Strings] section.

DIRID_SRCPATH (1 or 01) represents the original directory that the .inf file was installed from. This directory may be an Internet site, the manufacturer's CD, or a local directory. When the .inf file is first installed, or when it is pre-installed, this directory matches the directory that the .inf file is being loaded from. After the .inf file is installed on the system, it resides in the \Inf directory. When the .inf file is loaded from the \Inf directory, DIRID_SRCPATH continues to match the original source directory for the .inf file, instead of the directory that it is currently being loaded from.

One reason hardware vendors use DIRID_SRCPATH string substitution is so that their co-installers can determine the original source path if the .inf file is loaded from the \Inf directory. This technique is demonstrated by the DDK Toaster Installation Package sample (the Toasted sample is included in Windows XP and later versions of the DDK). The  expression is used in Toastpkg.inf (located in the  \Src\General\Toaster\Toastpkg\Inf folder) in the following sample code: [ToastCoInfo] OriginalInfSourcePath = %1% This section is read by the co-installer that is included with the Toaster Installation Package sample. Search for &quot;[ToastCoInfo]&quot; in the following folder:
 * This is used by the toaster co-installer to determine where the original media is
 * located (so that it can start value-added setup programs).

\Src\General\Toaster\Toastpkg\Toastco\Toastco.c

Keywords: kbbug KB829645

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.