/*! The type code field specifies the current state of regionalization process Reference [1] Table 524, page 533 */ enum RPC_STATE_TYPE_CODES { //! No drive region RPC_STATE_TYPECODE_NONE =0, //! Drive region is set RPC_STATE_TYPECODE_SET =1, //! Drive region is set. Additional restrictions required to make changes RPC_STATE_TYPECODE_LAST_CHANCE =2, //! Drive region has been set permamently, but may be reset by vendor RPC_STATE_TYPECODE_PERM =3 };
/*! RPC Scheme specifies the type of Region Playback Controls being used by the Drive */ enum RPC_STATE_SCHEMES { //!Drive does not enforce Region Playback Controls (RPC) RPC_STATE_SCHEMES_UNK =0, /*! Drive region shall adhere to this standard and all requirements of the CSS license agreement concerning RPC. */ RPC_STATE_SCHEMES_RPC2 =1 };
/*! This structure is returned when a REPORT_KEY is executed with key type = 8 Reference [1]p.533 */ typedef struct _REPORT_KEY_DATA_RPC_STATE { char rsvrd1[4];
// // RPC state // /*! # of User Controlled Changes Available is a count down counter that indicates the number of times that the user may set the region. This value is initially 5. */ unsigned char nb_user_changes: 3;
/*! # of Vendor Resets Available is a count down counter that indicates the number of times that the vendor may reset the region. The manufacturer of the Drive sets this value to 4 and the value is decremented each time the vendor clears the Drives region. When this value is zero, the vendor may no longer clear the Drives region. */ unsigned char nb_vendor_resets: 3; unsigned char type_code: 2;
/*! The Region Mask returns a value that specifies the Drive Region in which the Drive is located. Once the Drive Region has been set, the Drive shall be located in only one region. Each bit represents one of eight regions. If a bit is cleared in this field, the disc may be played in the corresponding region. If a bit is set in this field, the disc may not be played in the corresponding region. */ unsigned char region_mask;
/* RPC Scheme specifies the type of Region Playback Controls being used by the Drive */ unsigned char rpc_scheme; char rsvrd2; } REPORT_KEY_DATA_RPC_STATE;
typedef struct _SCSI_INQUIRY_STD_DATA { UCHAR preipheral_device_type : 5; UCHAR peripheral_qualifier: 3; UCHAR rsvrd : 7; UCHAR rmb: 1; UCHAR version; UCHAR RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. UCHAR ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data UCHAR SCCSReserved; // SCC-2 device flag and reserved fields UCHAR flags1; // First byte of support flags UCHAR flags2; // Second byte of support flags (Byte 7) char vendor_id[8]; char product_id[16]; char product_revision_level[4]; } SCSI_INQUIRY_STD_DATA; #ifndef SCSIOP_INQUIRY
void print_region_info(HANDLE device) { staticchar*region_names[] = { "United States of America, Canada", // Region 1 "Europe, including France, Greece, Turkey, Egypt, Arabia, Japan and South Africa", // 2 "Korea, Thailand, Vietnam, Borneo and Indonesia", // 3 "Australia and New Zealand, Mexico, the Caribbean, and South America", // 4 "India, Africa, Russia and former USSR countries", // 5 "Peoples Republic of China", // 6 "Unused", "Airlines/Cruise Ships", "Expansion (often used as region free)" };
staticchar*region_set[] = { "No region set", // 0 "Region set", // 1 "Drive region is set. Additional restrictions required to make changes", // 2 "Region set permanently, but may be reset by vendor", // 3 };
REPORT_KEY_DATA_RPC_STATE region = {0}; CDB_REPORT_KEY report = {0};