Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/2023 in all areas

  1. I will give up on this for now, but for anyone who might run into the same issue, I found a reference here that seems to confirm that 7/Aero does something weird with window sizing. Border rendering is affected by left=0 too.
    1 point
  2. ..bright and early. Good time to start the day coding This ( https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddstor/ne-ntddstor-_storage_protocol_nvme_data_type ) may bring some light into he dilemma. g'night
    1 point
  3. I'll have a look later, it's 6 AM here and I didn't sleep yet.
    1 point
  4. also has the wrong data
    1 point
  5. Because these are not NVMe https://crystalmark.info/en/download/ also gives out the right SN
    1 point
  6. Doesn't look very reliable but I might be wrong.
    1 point
  7. the information is also in the register Computer\HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 1\Target Id 0\Logical Unit Id 0
    1 point
  8. Looks fine for me.
    1 point
  9. Well, there are all kinds of serials and product IDs but the above it's certainly the serial number of the disk. For example if I use ProductIdOffset member to obtain the vendor product ID for my disk I get something like this KINGSTON RBUSNS8180DS3256GJ. There is also a SerialNumber member in STORAGE_ADAPTER_SERIAL_NUMBER structure so pick what serial you need.
    1 point
  10. its supposed to show something like: but maybe because there are NVMe drives shows these xxxx_xxxx_xxxx_xxxx outputs ?
    1 point
  11. https://www.hdsentinel.com/
    1 point
  12. How did you get these? WMI?
    1 point
  13. I was looking for something more like: Hard Disk Model ID: Samsung SSD 980 PRO 2TB Firmware Revision: 5B2QGXA7 Hard Disk Serial Number: S6B0NU0W123456P but I get something like 0025_3957_0240_ED41 Is there a way to get something like that ?, not the firmware revision or drive name but the actual hardware serial number ?
    1 point
  14. The promised code: #RequireAdmin #include <WinAPIFiles.au3> #include <WinAPIHObj.au3> MsgBox(0, 'Serial', 'Disk serial: ' & GetDiskSerial(@HomeDrive)) Func GetDiskSerial($sDriveLetter) Local Const $IOCTL_STORAGE_QUERY_PROPERTY = 0x2D1400 Local $tagSTORAGE_PROPERTY_QUERY = 'int PropertyId; int QueryType; byte AdditionalParameters[1];' Local $tagSTORAGE_DESCRIPTOR_HEADER = 'dword Version;dword Size;' Local $tagSTORAGE_DEVICE_DESCRIPTOR = 'dword Version;dword Size; byte DeviceType;byte DeviceTypeModifier; boolean RemovableMedia;' & _ 'boolean CommandQueueing;dword VendorIdOffset;dword ProductIdOffset;dword ProductRevisionOffset;dword SerialNumberOffset;int BusType;' & _ 'dword RawPropertiesLength;byte RawDeviceProperties[1];' Local $aDevice = _WinAPI_GetDriveNumber ($sDriveLetter) If @error Then Return SetError(1, @error, Null) Local $hDevice = _WinAPI_CreateFile('\\.\PhysicalDrive' & $aDevice[1], 2, 2, 6) If @error Then Return SetError(2, @error, Null) Local $tSTORAGE_PROPERTY_QUERY = DllStructCreate($tagSTORAGE_PROPERTY_QUERY) $tSTORAGE_PROPERTY_QUERY.PropertyId = 0 ; StorageDeviceProperty $tSTORAGE_PROPERTY_QUERY.QueryType = 0 ; PropertyStandardQuery Local $tSTORAGE_DESCRIPTOR_HEADER = DllStructCreate($tagSTORAGE_DESCRIPTOR_HEADER) If Not _WinAPI_DeviceIoControl($hDevice, $IOCTL_STORAGE_QUERY_PROPERTY, _ DllStructGetPtr($tSTORAGE_PROPERTY_QUERY), DllStructGetSize($tSTORAGE_PROPERTY_QUERY), _ DllStructGetPtr($tSTORAGE_DESCRIPTOR_HEADER), DllStructGetSize($tSTORAGE_DESCRIPTOR_HEADER)) _ Then _WinAPI_CloseHandle($hDevice) Return SetError(3, 0, Null) EndIf Local $tBuffer = DllStructCreate('byte[' & $tSTORAGE_DESCRIPTOR_HEADER.Size & ']') If Not _WinAPI_DeviceIoControl($hDevice, $IOCTL_STORAGE_QUERY_PROPERTY, _ DllStructGetPtr($tSTORAGE_PROPERTY_QUERY), DllStructGetSize($tSTORAGE_PROPERTY_QUERY), _ DllStructGetPtr($tBuffer), DllStructGetSize($tBuffer)) _ Then _WinAPI_CloseHandle($hDevice) Return SetError(4, 0, Null) EndIf Local $tSTORAGE_DEVICE_DESCRIPTOR = DllStructCreate($tagSTORAGE_DEVICE_DESCRIPTOR, DllStructGetPtr($tBuffer)) If $tSTORAGE_DEVICE_DESCRIPTOR.SerialNumberOffset = 0 Then _WinAPI_CloseHandle($hDevice) Return SetError(5, 0, Null) EndIf Local $tSerial = DllStructCreate('char Serial[32]', DllStructGetPtr($tBuffer) + $tSTORAGE_DEVICE_DESCRIPTOR.SerialNumberOffset) _WinAPI_CloseHandle($hDevice) Return $tSerial.Serial EndFunc
    1 point
  15. That "you can get" is not so. I can not either. Can you cook some code for us him. I'm clueless busy right now. So very busy
    1 point
  16. "RMA stands for Return Merchandise Authorization"
    1 point
  17. The answer is above, STORAGE_DEVICE_DESCRIPTOR. PS: what is RMA?
    1 point
  18. ...still. Say you'll RMA a drive. You'll need the serial number of the device that you can read off the label but the question is: how can I ask the OS for it. Storage Space knows it, so how can I get it too ? ( that is the OP question )
    1 point
  19. Same s*** with and without an interface.
    1 point
  20. @Andreik facepalm (thought he said no wmic)
    1 point
  21. @rsn For some reason he doesn't want to use WMI. @r2du-soft You can get the serial using DeviceIoControl to get access to STORAGE_DEVICE_DESCRIPTOR and then use SerialNumberOffset member of the structure to get the serial number.
    1 point
  22. Try this: $WMIObj = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") If @error Then MsgBox ( 4096 , @ScriptName , "Error getting wmi : " & Hex(@error, 8)) Else $WMIObjItems = $WMIObj.ExecQuery("select * FROM Win32_DiskDrive" ) If IsObj($WMIObjItems) Then For $oItem In $WMIObjItems $sSerialNumber = $oItem.SerialNumber Next EndIf EndIf MsgBox ( 4096 , @ScriptName , $sSerialNumber )
    1 point
  23. What's wrong with native DriveGetSerial()?
    1 point
  24. WinAPI provides this: #include <WinAPIFiles.au3> Local $aData = _WinAPI_GetVolumeInformation() ; you can parse a root dir (as string, with trailing backslash) here ConsoleWrite('Serial number: ' & $aData[1] & @CRLF)
    1 point
×
×
  • Create New...