So, a short answer to my question: we can safely assume that the sector size for DVD / BD is 2048 bytes.
The reason I got different sizes during debugging sessions was due to an error in the code that counted sectors :)
The mentioned block of code was copied from http://www.codeproject.com/Articles/24544/Burning-and-Erasing-CD-DVD-Blu-ray-Media-with-C-an , so in case you post a quick correction.
source:
discFormatData = new MsftDiscFormat2Data(); discFormatData.Recorder = discRecorder; IMAPI_MEDIA_PHYSICAL_TYPE mediaType = discFormatData.CurrentPhysicalMediaType; fileSystemImage = new MsftFileSystemImage(); fileSystemImage.ChooseImageDefaultsForMediaType(mediaType); if (!discFormatData.MediaHeuristicallyBlank) { fileSystemImage.MultisessionInterfaces = discFormatData.MultisessionInterfaces; fileSystemImage.ImportFileSystem(); } Int64 freeMediaBlocks = fileSystemImage.FreeMediaBlocks;
fixed code:
discFormatData = new MsftDiscFormat2Data { Recorder = discRecorder }; fileSystemImage = new MsftFileSystemImage(); fileSystemImage.ChooseImageDefaults(discRecorder); if (!discFormatData.MediaHeuristicallyBlank) { fileSystemImage.MultisessionInterfaces = discFormatData.MultisessionInterfaces; fileSystemImage.ImportFileSystem(); } Int64 freeMediaBlocks = fileSystemImage.FreeMediaBlocks;
Nikita B
source share