mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 17:00:31 +00:00
- Make CDFS work with msvc/ddk.
svn path=/trunk/; revision=20650
This commit is contained in:
parent
f3b9f7739f
commit
ee2a0b5cee
3 changed files with 24 additions and 19 deletions
|
@ -1,8 +1,8 @@
|
|||
#ifndef CDFS_H
|
||||
#define CDFS_H
|
||||
|
||||
#include <ntddk.h>
|
||||
#include <ntifs.h>
|
||||
#include <ntddk.h>
|
||||
#include <ntddcdrm.h>
|
||||
#include <ccros.h>
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
|||
#define VOLUME_PARTITION_DESCRIPTOR_TYPE 3
|
||||
#define VOLUME_DESCRIPTOR_SET_TERMINATOR 255
|
||||
|
||||
#include <pshpack1.h>
|
||||
struct _DIR_RECORD
|
||||
{
|
||||
UCHAR RecordLength; // 1
|
||||
|
@ -42,7 +43,8 @@ struct _DIR_RECORD
|
|||
ULONG VolumeSequenceNumber; // 29-32
|
||||
UCHAR FileIdLength; // 33
|
||||
UCHAR FileId[1]; // 34
|
||||
} __attribute__((packed));
|
||||
};
|
||||
#include <poppack.h>
|
||||
|
||||
typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD;
|
||||
|
||||
|
@ -54,12 +56,13 @@ typedef struct _DIR_RECORD DIR_RECORD, *PDIR_RECORD;
|
|||
|
||||
|
||||
/* Volume Descriptor header*/
|
||||
#include <pshpack1.h>
|
||||
struct _VD_HEADER
|
||||
{
|
||||
UCHAR VdType; // 1
|
||||
UCHAR StandardId[5]; // 2-6
|
||||
UCHAR VdVersion; // 7
|
||||
} __attribute__((packed));
|
||||
};
|
||||
|
||||
typedef struct _VD_HEADER VD_HEADER, *PVD_HEADER;
|
||||
|
||||
|
@ -93,8 +96,7 @@ struct _PVD
|
|||
|
||||
/* more data ... */
|
||||
|
||||
} __attribute__((packed));
|
||||
|
||||
};
|
||||
typedef struct _PVD PVD, *PPVD;
|
||||
|
||||
|
||||
|
@ -125,7 +127,8 @@ struct _SVD
|
|||
UCHAR PublisherIdentifier[128]; // 319-446
|
||||
|
||||
// more data ...
|
||||
} __attribute__((packed));
|
||||
};
|
||||
#include <poppack.h>
|
||||
|
||||
typedef struct _SVD SVD, *PSVD;
|
||||
|
||||
|
@ -171,6 +174,8 @@ typedef struct
|
|||
#define FCB_IS_VOLUME_STREAM 0x0002
|
||||
#define FCB_IS_VOLUME 0x0004
|
||||
|
||||
#define MAX_PATH 260
|
||||
|
||||
typedef struct _FCB
|
||||
{
|
||||
FSRTL_COMMON_FCB_HEADER RFCB;
|
||||
|
|
|
@ -381,12 +381,12 @@ CdfsGetNameInformation(PFCB Fcb,
|
|||
DPRINT("CdfsGetNameInformation() called\n");
|
||||
|
||||
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
|
||||
if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
Info->FileNameLength = Length;
|
||||
Info->NextEntryOffset =
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
|
||||
memcpy(Info->FileName, Fcb->ObjectName, Length);
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
|
@ -404,12 +404,12 @@ CdfsGetDirectoryInformation(PFCB Fcb,
|
|||
DPRINT("CdfsGetDirectoryInformation() called\n");
|
||||
|
||||
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
|
||||
if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
Info->FileNameLength = Length;
|
||||
Info->NextEntryOffset =
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
|
||||
memcpy(Info->FileName, Fcb->ObjectName, Length);
|
||||
|
||||
/* Convert file times */
|
||||
|
@ -447,7 +447,7 @@ CdfsGetDirectoryInformation(PFCB Fcb,
|
|||
static NTSTATUS
|
||||
CdfsGetFullDirectoryInformation(PFCB Fcb,
|
||||
PDEVICE_EXTENSION DeviceExt,
|
||||
PFILE_FULL_DIRECTORY_INFORMATION Info,
|
||||
PFILE_FULL_DIR_INFORMATION Info,
|
||||
ULONG BufferLength)
|
||||
{
|
||||
ULONG Length;
|
||||
|
@ -455,12 +455,12 @@ CdfsGetFullDirectoryInformation(PFCB Fcb,
|
|||
DPRINT("CdfsGetFullDirectoryInformation() called\n");
|
||||
|
||||
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
|
||||
if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
Info->FileNameLength = Length;
|
||||
Info->NextEntryOffset =
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
|
||||
memcpy(Info->FileName, Fcb->ObjectName, Length);
|
||||
|
||||
/* Convert file times */
|
||||
|
@ -500,7 +500,7 @@ CdfsGetFullDirectoryInformation(PFCB Fcb,
|
|||
static NTSTATUS
|
||||
CdfsGetBothDirectoryInformation(PFCB Fcb,
|
||||
PDEVICE_EXTENSION DeviceExt,
|
||||
PFILE_BOTH_DIRECTORY_INFORMATION Info,
|
||||
PFILE_BOTH_DIR_INFORMATION Info,
|
||||
ULONG BufferLength)
|
||||
{
|
||||
ULONG Length;
|
||||
|
@ -508,12 +508,12 @@ CdfsGetBothDirectoryInformation(PFCB Fcb,
|
|||
DPRINT("CdfsGetBothDirectoryInformation() called\n");
|
||||
|
||||
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
|
||||
if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + Length) > BufferLength)
|
||||
if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
|
||||
return(STATUS_BUFFER_OVERFLOW);
|
||||
|
||||
Info->FileNameLength = Length;
|
||||
Info->NextEntryOffset =
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIRECTORY_INFORMATION) + Length, 4);
|
||||
ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
|
||||
memcpy(Info->FileName, Fcb->ObjectName, Length);
|
||||
|
||||
/* Convert file times */
|
||||
|
@ -682,14 +682,14 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
|
|||
case FileFullDirectoryInformation:
|
||||
Status = CdfsGetFullDirectoryInformation(&TempFcb,
|
||||
DeviceExtension,
|
||||
(PFILE_FULL_DIRECTORY_INFORMATION)Buffer,
|
||||
(PFILE_FULL_DIR_INFORMATION)Buffer,
|
||||
BufferLength);
|
||||
break;
|
||||
|
||||
case FileBothDirectoryInformation:
|
||||
Status = CdfsGetBothDirectoryInformation(&TempFcb,
|
||||
DeviceExtension,
|
||||
(PFILE_BOTH_DIRECTORY_INFORMATION)Buffer,
|
||||
(PFILE_BOTH_DIR_INFORMATION)Buffer,
|
||||
BufferLength);
|
||||
break;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
static __inline
|
||||
int msf_to_lba (BYTE m, BYTE s, BYTE f)
|
||||
int msf_to_lba (UCHAR m, UCHAR s, UCHAR f)
|
||||
{
|
||||
return (((m * 60) + s) * 75 + f) - 150;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue