Exemple #1
0
    def get_geometry(self):

        InBuffer = EMPTY_BUFFER()
        OutBuffer = DISK_GEOMETRY()
        MyDeviceIoControl(self.handle, IOCTL_DISK_GET_DRIVE_GEOMETRY, InBuffer,
                          OutBuffer)

        return struct2dict(OutBuffer)
Exemple #2
0
    def get_smart_version(self):
        # type: () -> dict

        InBuffer = EMPTY_BUFFER()
        OutBuffer = GETVERSIONINPARAMS()

        MyDeviceIoControl(self.handle, SMART_GET_VERSION, InBuffer, OutBuffer)

        return struct2dict(OutBuffer)
Exemple #3
0
    def get_capacity(self):
        # type: () -> dict
        """Accept drive and volume handles, but always returns related drive information.
        The DiskLength returned is the same as if `get_length` is used on the related drive.
        """

        InBuffer = EMPTY_BUFFER()
        OutBuffer = STORAGE_READ_CAPACITY()
        MyDeviceIoControl(self.handle, IOCTL_STORAGE_READ_CAPACITY, InBuffer,
                          OutBuffer)

        return struct2dict(OutBuffer)
Exemple #4
0
    def get_alignment(self):
        # type: () -> dict

        InBuffer = STORAGE_PROPERTY_QUERY()
        OutBuffer = STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR()

        InBuffer.PropertyId = STORAGE_PROPERTY_ID.StorageAccessAlignmentProperty
        InBuffer.QueryType = STORAGE_QUERY_TYPE.PropertyStandardQuery

        MyDeviceIoControl(self.handle, IOCTL_STORAGE_QUERY_PROPERTY, InBuffer,
                          OutBuffer)

        return struct2dict(OutBuffer)
Exemple #5
0
    def get_device(self):
        # type: () -> dict

        InBuffer = STORAGE_PROPERTY_QUERY()
        OutBuffer = STORAGE_DEVICE_DESCRIPTOR()

        InBuffer.PropertyId = STORAGE_PROPERTY_ID.StorageDeviceProperty
        InBuffer.QueryType = STORAGE_QUERY_TYPE.PropertyStandardQuery
        InBuffer.AdditionalParameters = (BYTE * 1)(0)

        MyDeviceIoControl(self.handle, IOCTL_STORAGE_QUERY_PROPERTY, InBuffer,
                          OutBuffer)

        return struct2dict(OutBuffer)