Is it possible to get writing access to raw devices using python with windows?

前端 未结 2 812
暖寄归人
暖寄归人 2020-12-01 14:39

This is sort of a follow-up to this question. I want to know if you can access raw devices (i.e. \\\\.\\PhysicalDriveN) in writing mode and if this should be th

2条回答
  •  我在风中等你
    2020-12-01 15:16

    Possibly in Win 7 you have to do something more extreme, such as locking the volume(s) for the disk beforehand with DeviceIoControl(hVol, FSCTL_LOCK_VOLUME, ...)

    In Win 7 you don't have to do that; opening and writing with 'rb+' mode works fine.

提交回复
热议问题