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