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
| Parameter | Type | Description |
|---|---|---|
inventory_file | string | (optional) Path to the inventory JSON file generated by CollectDeviceInventory. If omitted, the engine collects inventory internally. |
components | array<string> | (optional) Filter patches by OPSWAT-defined component values. Omit to include all components. |
categories | array<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
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.detected_vendor | string | Vendor identified for patch matching (e.g., "dell", "lenovo"). |
result.patches | array<object> | List of applicable patches. Empty array if no patches are applicable. |
result.patches.patch_id | string | Unique patch identifier from the loaded driver/firmware patch database. |
result.patches.title | string | Human-readable patch title. |
result.patches.component | string | OPSWAT-defined component classification. |
result.patches.category | string | OPSWAT-defined category. Unrecognized vendor values are normalized to "Other". |
result.patches.vendor_original_component | string | Vendor-native component name before canonical mapping. |
result.patches.vendor_original_category | string | Vendor-native category name before canonical mapping. |
result.patches.severity | string | Patch severity as provided by the vendor. |
result.patches.current_version | string | (optional) Currently installed version detected on the endpoint. Empty string if unavailable. |
result.patches.target_version | string | (optional) Target version after applying the patch. Empty string if unavailable. |
result.patches.reboot_required | number | Indicates 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_urls | array<object> | List of download entries for the patch package. |
result.patches.download_urls.url | string | Download URL for the patch package. |
result.patches.download_urls.expected_sha1 | string | (optional) Expected SHA-1 hash of the patch package. |
result.patches.download_urls.expected_sha256 | string | (optional) Expected SHA-256 hash of the patch package. |
result.patches.download_urls.expected_sha512 | string | (optional) Expected SHA-512 hash of the patch package. |
result.patches.download_urls.expected_md5 | string | (optional) Expected MD5 hash of the patch package. |
result.patches.download_urls.size | number | (optional) Package file size in bytes. |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | Detection completed. patches may be empty if no applicable patches were found. |
| -5 | WAAPI_ERROR_NOT_INITIALIZED | OESIS 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). |
| -16 | WAAPI_ERROR_DATABASE_NOT_INITIALIZED | Database not loaded — call LoadDriverFirmwareDatabase before this method. |
| -20 | WAAPI_ERROR_INVALID_INPUT_ARGS | Required field is missing or has unexpected type and/or value, or optional field exists but has unexpected type and/or value. |
| -21 | WAAPI_ERROR_INVALID_JSON | inventory_file content is not valid JSON. |
| -22 | WAAPI_ERROR_ACCESS_DENIED | Insufficient permissions to read the inventory file or collect inventory internally. |
| -28 | WAAPI_ERROR_NOT_FOUND | Inventory file does not exist. |
| -1066 | WA_VMOD_ERROR_VENDOR_NOT_SUPPORTED | The device vendor is not supported. |
| -1067 | WA_VMOD_ERROR_MODEL_NOT_SUPPORTED | The device model is not supported. |
| -1 | WAAPI_ERROR_GENERAL | Unexpected 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