* Eric Kohl
*/
-//
-// IFS Headers
-//
#include <ntifs.h>
-#include <ntdddisk.h>
-#include <ntddcdrm.h>
-//
-// Tag for memory allocations
-//
+/* Tag for memory allocations */
#define FSREC_TAG 'cRsF'
-//
-// UDFS Offsets
-//
+/* UDFS Offsets */
#define UDFS_VRS_START_OFFSET 32768
#define UDFS_AVDP_SECTOR 256
-//
-// Non-standard rounding macros
-//
+/* Non-standard rounding macros */
#define ROUND_UP(n, align) \
ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#define ROUND_DOWN(n, align) \
(((ULONG)n) & ~((align) - 1l))
-//
-// Conversion types and macros taken from internal ntifs headers
-//
+/* Conversion types and macros taken from internal ntifs headers */
typedef union _UCHAR1
{
UCHAR Uchar[1];
CopyUchar4(&(Bios)->LargeSectors, &(Pbios)->LargeSectors[0] ); \
}
-//
-// Packed versions of the BPB and Boot Sector
-//
+/* Packed versions of the BPB and Boot Sector */
typedef struct _PACKED_BIOS_PARAMETER_BLOCK
{
UCHAR BytesPerSector[2];
UCHAR SystemId[8];
} PACKED_BOOT_SECTOR, *PPACKED_BOOT_SECTOR;
-//
-// Unpacked version of the BPB
-//
+/* Unpacked version of the BPB */
typedef struct BIOS_PARAMETER_BLOCK
{
USHORT BytesPerSector;
USHORT BackupBootSector;
} BIOS_PARAMETER_BLOCK, *PBIOS_PARAMETER_BLOCK;
-//
-// UDFS Structures
-//
+/* UDFS Structures */
#include <pshpack1.h>
typedef struct _TAG
{
} AVDP, *PAVDP;
#include <poppack.h>
-//
-// Filesystem Types
-//
+/* Filesystem Types */
typedef enum _FILE_SYSTEM_TYPE
{
FS_TYPE_UNUSED,
FS_TYPE_EXT2,
} FILE_SYSTEM_TYPE, *PFILE_SYSTEM_TYPE;
-//
-// FS Recognizer State
-//
+/* FS Recognizer State */
typedef enum _FS_REC_STATE
{
Pending,
Unloading
} FS_REC_STATE, *PFS_REC_STATE;
-//
-// Device extension
-//
+/* Device extension */
typedef struct _DEVICE_EXTENSION
{
FS_REC_STATE State;
PDEVICE_OBJECT Alternate;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
-//
-// Prototypes
-//
+/* Prototypes */
NTSTATUS
NTAPI
FsRecCdfsFsControl(