Lines Matching refs:pHeader

274  * @param   pHeader    Pointer to the header to convert.
276 static bool qedHdrConvertToHostEndianess(PQedHeader pHeader)
278 pHeader->u32Magic = RT_LE2H_U32(pHeader->u32Magic);
279 pHeader->u32ClusterSize = RT_LE2H_U32(pHeader->u32ClusterSize);
280 pHeader->u32TableSize = RT_LE2H_U32(pHeader->u32TableSize);
281 pHeader->u32HeaderSize = RT_LE2H_U32(pHeader->u32HeaderSize);
282 pHeader->u64FeatureFlags = RT_LE2H_U64(pHeader->u64FeatureFlags);
283 pHeader->u64CompatFeatureFlags = RT_LE2H_U64(pHeader->u64CompatFeatureFlags);
284 pHeader->u64AutoresetFeatureFlags = RT_LE2H_U64(pHeader->u64AutoresetFeatureFlags);
285 pHeader->u64OffL1Table = RT_LE2H_U64(pHeader->u64OffL1Table);
286 pHeader->u64Size = RT_LE2H_U64(pHeader->u64Size);
287 pHeader->u32OffBackingFilename = RT_LE2H_U32(pHeader->u32OffBackingFilename);
288 pHeader->u32BackingFilenameSize = RT_LE2H_U32(pHeader->u32BackingFilenameSize);
290 if (RT_UNLIKELY(pHeader->u32Magic != QED_MAGIC))
292 if (RT_UNLIKELY( pHeader->u32ClusterSize < QED_CLUSTER_SIZE_MIN
293 || pHeader->u32ClusterSize > QED_CLUSTER_SIZE_MAX))
295 if (RT_UNLIKELY( pHeader->u32TableSize < QED_TABLE_SIZE_MIN
296 || pHeader->u32TableSize > QED_TABLE_SIZE_MAX))
298 if (RT_UNLIKELY(pHeader->u64Size % 512 != 0))
309 * @param pHeader Pointer to the header to convert.
311 static void qedHdrConvertFromHostEndianess(PQEDIMAGE pImage, PQedHeader pHeader)
313 pHeader->u32Magic = RT_H2LE_U32(QED_MAGIC);
314 pHeader->u32ClusterSize = RT_H2LE_U32(pImage->cbCluster);
315 pHeader->u32TableSize = RT_H2LE_U32(pImage->cbTable / pImage->cbCluster);
316 pHeader->u32HeaderSize = RT_H2LE_U32(1);
317 pHeader->u64FeatureFlags = RT_H2LE_U64(pImage->pszBackingFilename ? QED_FEATURE_BACKING_FILE : UINT64_C(0));
318 pHeader->u64CompatFeatureFlags = RT_H2LE_U64(UINT64_C(0));
319 pHeader->u64AutoresetFeatureFlags = RT_H2LE_U64(UINT64_C(0));
320 pHeader->u64OffL1Table = RT_H2LE_U64(pImage->offL1Table);
321 pHeader->u64Size = RT_H2LE_U64(pImage->cbSize);
322 pHeader->u32OffBackingFilename = RT_H2LE_U32(pImage->offBackingFilename);
323 pHeader->u32BackingFilenameSize = RT_H2LE_U32(pImage->cbBackingFilename);
965 * @param pHeader The header to use for checking.
972 static int qedCheckImage(PQEDIMAGE pImage, PQedHeader pHeader)
983 pImage->cbCluster = pHeader->u32ClusterSize;
984 cbTable = pHeader->u32TableSize * pHeader->u32ClusterSize;
1017 pvClusterBitmap = RTMemAllocZ(cbFile / pHeader->u32ClusterSize / 8);
1027 if (!qedIsTblOffsetValid(pHeader->u64OffL1Table, cbFile, cbTable, pHeader->u32ClusterSize))
1031 pImage->pszFilename, pHeader->u64OffL1Table);
1037 pHeader->u64OffL1Table, paL1Tbl, cbTable);
1048 offClusterStart = qedByte2Cluster(pImage, pHeader->u64OffL1Table);
1049 bool fSet = qedClusterBitmapCheckAndSet(pvClusterBitmap, offClusterStart, offClusterStart + pHeader->u32TableSize);
1060 if (!qedIsTblOffsetValid(paL1Tbl[iL1], cbFile, cbTable, pHeader->u32ClusterSize))
1070 fSet = qedClusterBitmapCheckAndSet(pvClusterBitmap, offClusterStart, offClusterStart + pHeader->u32TableSize);
1096 if (!qedIsClusterOffsetValid(paL2Tbl[iL2], cbFile, pHeader->u32ClusterSize))