Export (0) Print
Expand All
Expand Minimize

SetupSetDirectoryIdEx function

[This function is available for use in the operating systems indicated in the Requirements section. It may be altered or unavailable in subsequent versions. SetupAPI should no longer be used for installing applications. Instead, use the Windows Installer for developing application installers. SetupAPI continues to be used for installing device drivers.]

The SetupSetDirectoryIdEx function associates a directory identifier in an INF file with a specific directory.

Syntax


BOOL SetupSetDirectoryIdEx(
  _In_        HINF InfHandle,
  _In_        DWORD Id,
  _In_        PCTSTR Directory,
  _In_        DWORD Flags,
  _Reserved_  DWORD Reserved1,
  _Reserved_  PVOID Reserved2
);

Parameters

InfHandle [in]

A handle for a loaded INF file.

Id [in]

A directory identifier (DIRID) to use for an association. This parameter can be NULL. This DIRID must be greater than or equal to DIRID_USER. If an association already exists for this DIRID, it is overwritten. If Id is zero, the Directory parameter is ignored, and the current set of user-defined DIRIDs is deleted.

Directory [in]

A pointer to a null-terminated string that specifies the directory path to associate with Id. This parameter can be NULL. If Directory is NULL, any directory associated with Id is unassociated. No error results if Id is not currently associated with a directory.

Flags [in]

This parameter can be set to SETDIRID_NOT_FULL_PATH (1) to indicate that the Directory does not specify a full path.

Reserved1

If the value of this parameter is not zero the function returns ERROR_INVALID_PARAMETER.

Reserved2

If the value of this parameter is not zero the function returns ERROR_INVALID_PARAMETER.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.

Remarks

SetupSetDirectoryIdEx can be used prior to queuing file copy operations to specify a target location that is only known at runtime.

After setting the directory identifier, this function traverses all appended INF files, and if any of them have unresolved string substitutions, the function attempts to re-apply string substitution to them based on the new DIRID mapping. Because of this, some INF values may change after calling SetupSetDirectoryIdEx.

DIRID_ABSOLUTE_16BIT is not a valid value for Id, which ensures compatibility with 16-bit setup.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Setupapi.h

Library

Setupapi.lib

DLL

Setupapi.dll

Unicode and ANSI names

SetupSetDirectoryIdExW (Unicode) and SetupSetDirectoryIdExA (ANSI)

See also

Functions
Overview

 

 

Community Additions

ADD
Show:
© 2014 Microsoft