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
%dirid%. When the .inf file is loaded, the system replaces the
%dirid% tag with the file path that is represented by that dirid.
The Windows DDK documentation describes this technique in the topic "Using Dirids." This topic includes a list of common dirids and the directories that they represent. The
%dirid% 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
%WINDIR%\Inf directory. When the .inf file is loaded from the
%WINDIR%\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
%WINDIR%\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
%dirid% expression is used in Toastpkg.inf (located in the
DDK_INSTALL_PATH\Src\General\Toaster\Toastpkg\Inf folder) in the following sample code:
[ToastCoInfo]
; 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).
OriginalInfSourcePath = %1%
This section is read by the co-installer that is included with the Toaster Installation Package sample. Search for "[ToastCoInfo]" in the following folder:
DDK_INSTALL_PATH\Src\General\Toaster\Toastpkg\Toastco\Toastco.c