WdfDriverIsVersionAvailable function (wdfdriver.h)

[Applies to KMDF and UMDF]

The WdfDriverIsVersionAvailable method returns a Boolean value that indicates whether the driver is running with a specified version of the Kernel-Mode Driver Framework library.

Syntax

BOOLEAN WdfDriverIsVersionAvailable(
  [in] WDFDRIVER                            Driver,
  [in] PWDF_DRIVER_VERSION_AVAILABLE_PARAMS VersionAvailableParams
);

Parameters

[in] Driver

A handle to the driver's framework driver object that the driver obtained from a previous call to WdfDriverCreate or WdfGetDriver.

[in] VersionAvailableParams

A pointer to a WDF_DRIVER_VERSION_AVAILABLE_PARAMS structure that identifies a version of the framework library.

Return value

WdfDriverIsVersionAvailable returns TRUE if the driver is running with the version of the library that the VersionAvailableParams parameter specifies.

The method returns FALSE if the driver is not running with the specified library version or if the WDF_DRIVER_VERSION_AVAILABLE_PARAMS structure is invalid.

A system bug check occurs if the Driver handle is invalid.

Remarks

For more information about library versions, see Framework Library Versioning.

Examples

The following code example reports an error if it detects an unexpected library version number.

WDF_DRIVER_VERSION_AVAILABLE_PARAMS ver;

WDF_DRIVER_VERSION_AVAILABLE_PARAMS_INIT(&ver, 1, 0);
if (!WdfDriverIsVersionAvailable(
                                 driver,
                                 &ver
                                 )) {
    DbgPrint("Unexpected library version.\n");
}

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdriver.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL PASSIVE_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf)

See also

WDF_DRIVER_VERSION_AVAILABLE_PARAMS

WdfDriverCreate

WdfDriverRetrieveVersionString

WdfGetDriver