Skip to main content

DetectDriverFirmwarePatches

(Windows only) Detect applicable driver/firmware patches using system inventory and the loaded driver/firmware database.

Syntax​

Method ID​

#define WA_VMOD_DETECT_DRIVER_FIRMWARE_PATCHES 50902

JSON Input Structure​

{
"input": {
"method": 50902,
"inventory_file": string,
"components": [
string,
...
],
"categories": [
string,
...
]
}
}

Input Properties​

ParameterTypeDescription
inventory_filestring(optional) Path to the inventory JSON file generated by CollectDeviceInventory. If omitted, the engine collects inventory internally.
componentsarray<string>(optional) Filter patches by OPSWAT-defined component values. Omit to include all components.
categoriesarray<string>(optional) Filter patches by OPSWAT-defined category values. Omit to include all categories.

JSON Output Structure​

{
"result": {
"method": 50902,
"code": number,
"timing": number,
"timestamp": string,
"detected_vendor": string,
"patches": [
{
"patch_id": string,
"title": string,
"component": string,
"category": string,
"vendor_original_component": string,
"vendor_original_category": string,
"severity": string,
"current_version": string,
"target_version": string,
"reboot_required": number,
"download_urls": [
{
"url": string,
"expected_sha1": string,
"expected_sha256": string,
"expected_sha512": string,
"expected_md5": string,
"size": number
},
...
]
},
...
]
}
}

Output Properties​

PropertyTypeDescription
result.methodnumberThe method ID that generated this result.
result.codenumberThe result code. See Result Codes.
result.timingnumberThe measured time for the method call in milliseconds.
result.timestampstringThe timestamp in seconds of when the call was made.
result.detected_vendorstringVendor identified for patch matching (e.g., "dell", "lenovo").
result.patchesarray<object>List of applicable patches. Empty array if no patches are applicable.
result.patches.patch_idstringUnique patch identifier from the loaded driver/firmware patch database.
result.patches.titlestringHuman-readable patch title.
result.patches.componentstringOPSWAT-defined component classification.
result.patches.categorystringOPSWAT-defined category. Unrecognized vendor values are normalized to "Other".
result.patches.vendor_original_componentstringVendor-native component name before canonical mapping.
result.patches.vendor_original_categorystringVendor-native category name before canonical mapping.
result.patches.severitystringPatch severity as provided by the vendor.
result.patches.current_versionstring(optional) Currently installed version detected on the endpoint. Empty string if unavailable.
result.patches.target_versionstring(optional) Target version after applying the patch. Empty string if unavailable.
result.patches.reboot_requirednumberIndicates whether a restart may be required after installation.
• -1 = Unknown
• 0 = No reboot
• 1 = Requires reboot
• 2 = Forces reboot
• 3 = Forces shutdown
• 4 = Delayed forced reboot
result.patches.download_urlsarray<object>List of download entries for the patch package.
result.patches.download_urls.urlstringDownload URL for the patch package.
result.patches.download_urls.expected_sha1string(optional) Expected SHA-1 hash of the patch package.
result.patches.download_urls.expected_sha256string(optional) Expected SHA-256 hash of the patch package.
result.patches.download_urls.expected_sha512string(optional) Expected SHA-512 hash of the patch package.
result.patches.download_urls.expected_md5string(optional) Expected MD5 hash of the patch package.
result.patches.download_urls.sizenumber(optional) Package file size in bytes.

Result Codes​

CodeNameDescription
0WAAPI_OKDetection completed. patches may be empty if no applicable patches were found.
-5WAAPI_ERROR_NOT_INITIALIZEDOESIS Framework has not been initialized yet (for example, because wa_api_setup was not called successfully or the license required by this module is missing).
-16WAAPI_ERROR_DATABASE_NOT_INITIALIZEDDatabase not loaded — call LoadDriverFirmwareDatabase before this method.
-20WAAPI_ERROR_INVALID_INPUT_ARGSRequired field is missing or has unexpected type and/or value, or optional field exists but has unexpected type and/or value.
-21WAAPI_ERROR_INVALID_JSONinventory_file content is not valid JSON.
-22WAAPI_ERROR_ACCESS_DENIEDInsufficient permissions to read the inventory file or collect inventory internally.
-28WAAPI_ERROR_NOT_FOUNDInventory file does not exist.
-1066WA_VMOD_ERROR_VENDOR_NOT_SUPPORTEDThe device vendor is not supported.
-1067WA_VMOD_ERROR_MODEL_NOT_SUPPORTEDThe device model is not supported.
-1WAAPI_ERROR_GENERALUnexpected failure with no more specific error type.
note

Other codes may be returned. See the full Result Codes reference for the complete list.

Remarks​

Error Handling​

The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.

Examples​

Examples will be added here demonstrating the usage of this method.

See Also​


Last updated: 2026-10-01