WdfPreDeviceInstall - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfinstaller.h

ULONG WdfPreDeviceInstall(
  [in]           LPCWSTR InfPath,
  [in, optional] LPCWSTR InfSectionName
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfinstaller-wdfpredeviceinstall)

WdfPreDeviceInstall function

Description

[Applies to KMDF only]

The co-installer's WdfPreDeviceInstall function performs any operations that the co-installer might require before a non-Plug and Play (PnP) driver's installer creates the driver's kernel-mode service.

Parameters

InfPath [in]

A pointer to a null-terminated wide-character string that contains the directory path to the driver's INF file. The driver's installer can obtain this string by calling GetCurrentDirectory, which is described in the Microsoft Windows SDK.

InfSectionName [in, optional]

A pointer to a null-terminated wide-character string that contains the Wdf-install-section name in the driver's INF file. For more information about this name, see Using the KMDF Co-installer. If this pointer is NULL, the co-installer uses WdfSection for the name.

Return value

WdfPreDeviceInstall returns ERROR_SUCCESS if the operation succeeds. Otherwise, the function returns one of the additional ERROR_XXX values that are defined in Winerror.h.

Remarks

The installer for the framework-based drivers of a non-PnP device must call WdfPreDeviceInstall or WdfPreDeviceInstallEx before the installer calls CreateService.

To obtain the address of the co-installer's WdfPreDeviceInstall function, the installer must call GetProcAddress after the installer has called LoadLibrary to load the co-installer.

If the co-installer determines that the computer must be restarted to complete the driver installation (typically because an older version of the framework was previously installed), WdfPreDeviceInstall informs the Plug and Play (PnP) manager. The PnP manager then prompts the user that a restart is necessary.

For more information about the WdfPreDeviceInstall function and installers for framework-based drivers of non-PnP devices, see Installing a Non-PnP Driver. For more information about CreateService, GetProcAddress, and LoadLibrary, see the Microsoft Windows SDK documentation.

Examples

For a code example that uses the WdfPreDeviceInstall function, see the installer for the NONPNP sample.

See also

WdfPostDeviceInstall