Determining the region code of a DVD in OS X in C WITHOUT requiring a DVD to be in the disc

Basically, I start a network of computers and should know in which register code the disks of different computers are installed. I do not need to change the region, but I have no idea how to determine the region without going to each computer individually and sticking to the disk. I tried using an Apple cocoa flash drive, but this requires the drive to be inserted in the drive, which spoils the target.

So, are there any APIs that I can use to define the region code on a Mac Pro DVD drive without having to insert a disc? I am ready to code almost any language.

thanks

+6
source share
2 answers

I found several utilities that can work with DVD region settings in OS X: DVD Info X and Region X. DVD Info X will display the region code of your disc without having to insert a DVD.

Region X is more interesting because, although it does not directly correspond to your goal, its source is available . Looking at this, I found that the ScanAll method in Region Xm is what you need. More specifically, an interesting case is where the disc name is not found (since there is no disc on it), and the SCSI command is used to determine the properties of the DVD drive (calling printf is my complement):

 task = (*scsitaskinterface)->CreateSCSITask(scsitaskinterface); if (task) { cdb[0] = 0xa4; cdb[1] = 0x00; cdb[2] = 0x00; cdb[3] = 0x00; cdb[4] = 0x00; cdb[5] = 0x00; cdb[6] = 0x00; cdb[7] = 0x00; cdb[8] = (sizeof(DVDInfo) >> 8) & 0xff; cdb[9] = sizeof(DVDInfo) & 0xff; cdb[10] = 0x08; cdb[11] = 0x00; memset(&DVDInfo, 0, sizeof(DVDInfo)); ProcessCDB(task, cdb, 12, DirIn, &DVDInfo, sizeof(DVDInfo), 30000); printf("drive region %#hhx\n", DVDInfo.driveRegion); printf("number of region changes left: %hhu\n", DVDInfo.numberUserResets); if (DVDInfo.rpcScheme == 0) RPC1++; if (DVDInfo.rpcScheme != 0) RPC2++; (*task)->Release(task); } 

I ran this on my Macbook Pro and the result was as expected.

Obviously, you will need to massage it in order to isolate this part into something that you can use, but I think this code will be a useful starting point.

+3
source

I have no answer as such, but I have 2 links for you:

Since these are pure SCSI commands, it may be possible to adapt them for Mac.

+1
source

Source: https://habr.com/ru/post/902846/


All Articles