From ccbe111b8459970416bd4f06f0ba6f5d11bdd3b0 Mon Sep 17 00:00:00 2001 From: A1ive <10670106+a1ive@users.noreply.github.com> Date: Sat, 9 Dec 2023 19:27:54 +0800 Subject: [PATCH] DeviceIoControl add missing parameter --- libnw/disk.c | 3 ++- libnw/version.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libnw/disk.c b/libnw/disk.c index 7bedd280..8baca09b 100644 --- a/libnw/disk.c +++ b/libnw/disk.c @@ -533,13 +533,14 @@ PrintIsSsd(PNODE node, PHY_DRIVE_INFO* info, DWORD index) { if (NWLC->NwOsInfo.dwMajorVersion >= 6) { + DWORD dwBytes; STORAGE_PROPERTY_QUERY propQuery = { .QueryType = PropertyStandardQuery, .PropertyId = StorageDeviceSeekPenaltyProperty }; DEVICE_SEEK_PENALTY_DESCRIPTOR dspd = { 0 }; HANDLE hDisk = NWL_GetDiskHandleById(FALSE, FALSE, index); if (hDisk && hDisk != INVALID_HANDLE_VALUE) { if (DeviceIoControl(hDisk, IOCTL_STORAGE_QUERY_PROPERTY, &propQuery, sizeof(propQuery), - &dspd, sizeof(dspd), NULL, NULL)) + &dspd, sizeof(dspd), &dwBytes, NULL)) { NWL_NodeAttrSetBool(node, "SSD", (dspd.IncursSeekPenalty == FALSE), 0); CloseHandle(hDisk); diff --git a/libnw/version.h b/libnw/version.h index ee546f37..2edc8a3f 100644 --- a/libnw/version.h +++ b/libnw/version.h @@ -8,7 +8,7 @@ #define NWINFO_MAJOR_VERSION 0 #define NWINFO_MINOR_VERSION 9 #define NWINFO_MICRO_VERSION 2 -#define NWINFO_BUILD_VERSION 0 +#define NWINFO_BUILD_VERSION 1 #define NWINFO_VERSION NWINFO_MAJOR_VERSION,NWINFO_MINOR_VERSION,NWINFO_MICRO_VERSION,NWINFO_BUILD_VERSION #define NWINFO_VERSION_STR QUOTE(NWINFO_MAJOR_VERSION.NWINFO_MINOR_VERSION.NWINFO_MICRO_VERSION.NWINFO_BUILD_VERSION)