Fix type of reserved_II in SDH_INDEX_DATA; resolve some magic constants

This commit is contained in:
szaka 2005-11-01 19:56:08 +00:00
parent 9f4b2b4a2c
commit 80923d64dd
2 changed files with 6 additions and 4 deletions

View File

@ -1882,7 +1882,7 @@ typedef struct {
u32 security_id; /* The security_id assigned to the descriptor. */
u64 offset_in_sds; /* Offset of the descriptor in SDS data stream */
u32 size_in_sds; /* Size of the descriptor in SDS data stream */
u64 reserved_II; /* Padding - always unicode "II" */
u32 reserved_II; /* Padding - always unicode "II" */
} __attribute__((__packed__)) SDH_INDEX_DATA;
/**

View File

@ -2871,8 +2871,10 @@ static int initialize_secure(char *sds, u32 sds_size, MFT_RECORD *m) {
SII_INDEX_DATA *sii_data;
sds_header = (SECURITY_DESCRIPTOR_HEADER*)sds;
sdh_size = cpu_to_le32(0x30);
sii_size = cpu_to_le32(0x28);
sdh_size = sizeof(INDEX_ENTRY_HEADER);
sdh_size += sizeof(SDH_INDEX_KEY) + sizeof(SDH_INDEX_DATA);
sii_size = sizeof(INDEX_ENTRY_HEADER);
sii_size += sizeof(SII_INDEX_KEY) + sizeof(SII_INDEX_DATA);
idx_entry_sdh = (INDEX_ENTRY*)calloc(1, sizeof(INDEX_ENTRY));
idx_entry_sii = (INDEX_ENTRY*)calloc(1, sizeof(INDEX_ENTRY));
err = 0;
@ -2896,7 +2898,7 @@ static int initialize_secure(char *sds, u32 sds_size, MFT_RECORD *m) {
sdh_data->offset_in_sds = sds_header->offset;
sdh_data->size_in_sds = sds_header->length;
sdh_data->reserved_II = cpu_to_le64(0x00490049);
sdh_data->reserved_II = cpu_to_le32(0x00490049);
//SII index entry
idx_entry_sii->data_offset = cpu_to_le16(0x14);