I've discovered a bit of a problem with accessing Raw windows devices. A read in a Copy-protected sector may result in a pywintypes exception stating Copy Protection Error - The read failed because the sector is encrypted. while trying to read general data, possibly data used as headers or anchors and such, the data for general structure parsing.
For me, this error occurred on a CSS-protected DVD9 when reading 2048 bytes from offset 0x8157108224 (Sector 3,982,963/3,983,220), which is basically at the end of the disc. This isn't a problem specific to any of the code within pycdlib, as all programs or methods to try to read from that sector results in the same problem.
However, I believe this error would still have happened before the addition of the Windows Raw Device handler, so at least there's that.
As for a possible fix, it seems to be related to some kind of operation needing to be done specifically relating to DVD CSS protection. After a quick google, it seems you essentially need to "unlock the drive". It seems it then re-locks itself after a short while unless you tell it to unlock again before it locks.
I know of a few programs that can in fact unlock the drive for you. PowerDVD (lasts only a very short while unless you are actively playing content from it that reads within those sectors), and AnyDVD HD which will seemingly keep it open for a lot longer.
The problem is both software is closed source so we cannot see how it's doing it.
This could very well be boiled down to an issue not directly related to pycdlib, nor something pycdlib necessarily needs to look into, but I thought I would mention it in case anyone else is confused about this error.
I will keep you updated with any new information I get.
I've discovered a bit of a problem with accessing Raw windows devices. A read in a Copy-protected sector may result in a pywintypes exception stating
Copy Protection Error - The read failed because the sector is encrypted.
while trying to read general data, possibly data used as headers or anchors and such, the data for general structure parsing.For me, this error occurred on a CSS-protected DVD9 when reading 2048 bytes from offset 0x8157108224 (Sector 3,982,963/3,983,220), which is basically at the end of the disc. This isn't a problem specific to any of the code within pycdlib, as all programs or methods to try to read from that sector results in the same problem.
However, I believe this error would still have happened before the addition of the Windows Raw Device handler, so at least there's that.
As for a possible fix, it seems to be related to some kind of operation needing to be done specifically relating to DVD CSS protection. After a quick google, it seems you essentially need to "unlock the drive". It seems it then re-locks itself after a short while unless you tell it to unlock again before it locks.
I know of a few programs that can in fact unlock the drive for you. PowerDVD (lasts only a very short while unless you are actively playing content from it that reads within those sectors), and AnyDVD HD which will seemingly keep it open for a lot longer.
The problem is both software is closed source so we cannot see how it's doing it.
This could very well be boiled down to an issue not directly related to pycdlib, nor something pycdlib necessarily needs to look into, but I thought I would mention it in case anyone else is confused about this error.
I will keep you updated with any new information I get.