如何检查Windows中的VIA RAID状态,而不是使用GUI?

如何在Windows中检查VIA RAID状态,而不是使用GUI? 驱动程序包中没有CLI工具。

威盛RAID从来不打算在服务器上使用,但只能在客户机上使用。 我强烈怀疑它没有(logging)的CLI,但只有一个简单的GUI。 看看这里的RAID驱动程序包,并且提取相关的文档(CHM格式, 在这里转换成PDF格式 ),没有提到任何types的CLI。

而且,威盛消费芯片组部门在很多年前已经解散,所以你应该考虑更换这台机器。

好的,在Windows驱动程序包中有一个名为drvInterface.dll的DLL,因此可以使用它。 有趣的是,所有的函数和数据types都只在一个Linux驱动程序包中以PDFforms描述。 :)虽然,这个描述不是100%正确的,所以更好的检查头文件(也只在Linux驱动程序包中)。

无论如何,这是AutoIt中的一个脚本,它使用drvInterface.dll来获取arrays和磁盘状态(如果一切正常,返回“1”,如果有任何错误,则返回“0”)。 通过更多的努力,您可以获得威盛RAID工具界面中的磁盘型号,序列号和其他数据:

#NoTrayIcon #include <Array.au3> Local $pTest Global $bStatus = True $hDLL = DllOpen(@ScriptDir & "\drvInterface.dll") If @error <> 0 Then $bStatus = False EndIf _checkStatus() ;~ VINT vr_init (void); $sTest = DllCall($hDLL, "int:cdecl", "?vr_init@@YAHXZ") If @error <> 0 Then $bStatus = False EndIf _checkStatus() ;~ VINT vr_get_controller_num (VINT *pnumber); $sTest = DllCall($hDLL, "int:cdecl", "?vr_get_controller_num@@YAHPAH@Z", "int*", $pTest) If @error <> 0 Then $bStatus = False EndIf _checkStatus() If IsArray($sTest) and UBound($sTest) >= 2 Then $iControllerNumber = $sTest[1] Else $bStatus = False EndIf _checkStatus() ;~ VINT vr_get_array_num (VINT only_raid, VINT *pnumber); $sTest = DllCall($hDLL, "int:cdecl", "?vr_get_array_num@@YAHHPAH@Z", "int", 0, "int*", $pTest) If @error <> 0 Then $bStatus = False EndIf _checkStatus() If IsArray($sTest) and UBound($sTest) >= 3 Then $iArrayNumber = $sTest[2] Else $bStatus = False EndIf _checkStatus() If Not $iArrayNumber >=1 Then $bStatus = False EndIf _checkStatus() ;~ VINT vr_get_device_num (VINT *pnumber); $sTest = DllCall($hDLL, "int:cdecl", "?vr_get_device_num@@YAHPAH@Z", "int*", $pTest) If @error <> 0 Then $bStatus = False EndIf _checkStatus() If IsArray($sTest) and UBound($sTest) >= 2 Then $iDeviceNumber = $sTest[1] Else $bStatus = False EndIf _checkStatus() If Not $iDeviceNumber >=1 Then $bStatus = False EndIf _checkStatus() ;~ ConsoleWrite("$iDeviceNumber = " & $iDeviceNumber & @CRLF) For $i = 0 To $iArrayNumber-1 $vr_array_info = DllStructCreate("ushort status;ubyte raidType;ubyte diskNum;ulong capacityLow;ulong capacityHigh;ulong realCapacityLow;ulong realCapacityHigh;ulong stripeSize;ulong blockSize;int bNeedMigration;int bNeedInit;int bOptimized;ubyte systemDisk;ushort raid_index;int index") If @error <> 0 Then $bStatus = False EndIf _checkStatus() $sTest = DllCall($hDLL, "int:cdecl", "?vr_get_array_info@@YAHHPAU_vr_array_info@@@Z", "int", $i, "struct*", DllStructGetPtr($vr_array_info)) If @error <> 0 Then $bStatus = False EndIf _checkStatus() $iArrayStatus = DllStructGetData($vr_array_info, "status") If @error <> 0 Then $bStatus = False EndIf _checkStatus() If $iArrayStatus == 0 And $bStatus Then $bStatus = True Else $bStatus = False EndIf _checkStatus() Next For $i = 0 To $iDeviceNumber-1 $vr_device_info = DllStructCreate("char serialNumber[32];char firmwareRevison[16];char modelName[64];char minorRevisonNumber[64];ulong cylinderNumber;ulong headNumber;ulong sectorNumberPerTrack;ulong capacityLow;ulong capacityHigh;ubyte supportPIOTransferMode;ubyte supportMultiDMAMode;ubyte supportUltraDMAMode;ubyte currentTransferMode;ubyte deviceType;ushort status;ubyte ctrler_index;ubyte chan_index;int master;int index;ubyte systemDisk;int bDevInRaid;ushort array_position;int array_index;ulong realCapacityLow;ulong realCapacityHigh") If @error <> 0 Then $bStatus = False EndIf _checkStatus() $sTest = DllCall($hDLL, "int:cdecl", "?vr_get_device_info@@YAHHPAU_vr_device_info@@@Z", "int", $i, "struct*", DllStructGetPtr($vr_device_info)) If @error <> 0 Then $bStatus = False EndIf _checkStatus() $iDeviceStatus = DllStructGetData($vr_device_info, "status") If @error <> 0 Then $bStatus = False EndIf _checkStatus() If $iDeviceStatus == 0 And $bStatus Then $bStatus = True Else $bStatus = False EndIf _checkStatus() Next ;~ void vr_exit (void); $sTest = DllCall($hDLL, "none", "?vr_exit@@YAXXZ") DllClose($hDLL) If $bStatus Then ConsoleWrite("1") Else ConsoleWrite("0") EndIf Exit Func _checkStatus() If Not $bStatus Then ConsoleWrite("0") Exit EndIf EndFunc