![]() Printf("\nserial number : %s\n\n", serialNumber) VLMremoveLeadingSpaces(buffer + descrip->SerialNumberOffset) *printf("case 2: serialnumberoffset %d\n", descrip->SerialNumberOffset) Printf("NumberOfIdentifiers :%d\n", descrip->NumberOfIdentifiers) Printf("\ncbBytesReturned - %d\n\n and buffer is ", cbBytesReturned) Query.PropertyId = StorageDeviceProperty If(query.PropertyId = StorageDeviceProperty) If (!DeviceIoControl(hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY, So, if it fails then set the PropertyId to StorageDeviceProperty*/ *we have set the PropertyId as StorageDeviceUniqueIdProperty which is not supported before Windows Vista and Windows Server 2008, query.PropertyId = StorageDeviceProperty Query.PropertyId = StorageDeviceUniqueIdProperty Memset ((void *) & query, 0, sizeof (query)) " CreateFile(%s) returned INVALID_HANDLE_VALUE\n" Printf("ReadPhysicalDriveInNT_StorageQuery ERROR:" If(hPhysicalDriveIOCTL = INVALID_HANDLE_VALUE) ![]() HPhysicalDriveIOCTL = CreateFile (TEXT(deviceName), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL) STORAGE_DEVICE_ID_DESCRIPTOR * descrip = NULL STORAGE_DEVICE_DESCRIPTOR * descrip = NULL Int ReadPhysicalDriveInNT_StorageQuery (char *deviceName, char *realDiskID, int diskid_len) īut in some windows physical machine, we are getting wrong offset as we have not typecast the buffer but if we typecast the buffer to STORAGE_DEVICE_ID_DESCRIPTOR instead of STORAGE_DEVICE_DESCRIPTOR then I don't have any member in structure to return the offset value. In laptops having type samsung NVMe, we are getting incorect hard disk serial number, so for this we have used StorageDeviceUniqueIdProperty instead of StorageDeviceProperty.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |