Author: dchapyshev
Date: Sun Jul 26 15:16:19 2009
New Revision: 42232
URL:
http://svn.reactos.org/svn/reactos?rev=42232&view=rev
Log:
- Use documented structure instead array
- Add some defines
Added:
trunk/reactos/drivers/filesystems/fs_rec/udfs.h (with props)
Modified:
trunk/reactos/drivers/filesystems/fs_rec/fs_rec.h
trunk/reactos/drivers/filesystems/fs_rec/udfs.c
Modified: trunk/reactos/drivers/filesystems/fs_rec/fs_rec.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fs_rec…
==============================================================================
--- trunk/reactos/drivers/filesystems/fs_rec/fs_rec.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fs_rec/fs_rec.h [iso-8859-1] Sun Jul 26 15:16:19
2009
@@ -13,6 +13,8 @@
#include <ntifs.h>
#include <ntdddisk.h>
#include <ntddcdrm.h>
+
+#include "udfs.h"
//
// Tag for memory allocations
Modified: trunk/reactos/drivers/filesystems/fs_rec/udfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fs_rec…
==============================================================================
--- trunk/reactos/drivers/filesystems/fs_rec/udfs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fs_rec/udfs.c [iso-8859-1] Sun Jul 26 15:16:19 2009
@@ -20,9 +20,10 @@
FsRecIsUdfsVolume(IN PDEVICE_OBJECT DeviceObject,
IN ULONG SectorSize)
{
- PUCHAR Buffer = NULL;
+ PVOLSTRUCTDESC VolumeStructDesc = NULL;
LARGE_INTEGER Offset;
ULONG State = 0;
+ PAGED_CODE();
Offset.QuadPart = UDFS_VRS_START_OFFSET;
while (TRUE)
@@ -31,7 +32,7 @@
&Offset,
SectorSize,
SectorSize,
- (PVOID)&Buffer,
+ (PVOID)&VolumeStructDesc,
NULL))
{
break;
@@ -41,28 +42,27 @@
{
case 0:
- if ((Buffer[1] == 'B') &&
- (Buffer[2] == 'E') &&
- (Buffer[3] == 'A') &&
- (Buffer[4] == '0') &&
- (Buffer[5] == '1'))
+ if (!strncmp((const char*)VolumeStructDesc->Ident,
+ VSD_STD_ID_BEA01,
+ VSD_STD_ID_LEN))
{
State = 1;
}
else
{
- ExFreePool(Buffer);
+ ExFreePool(VolumeStructDesc);
return FALSE;
}
break;
case 1:
- if ((Buffer[1] == 'N') &&
- (Buffer[2] == 'S') &&
- (Buffer[3] == 'R') &&
- (Buffer[4] == '0') &&
- ((Buffer[5] == '2') || (Buffer[5] == '3')))
+ if (!strncmp((const char*)VolumeStructDesc->Ident,
+ VSD_STD_ID_NSR03,
+ VSD_STD_ID_LEN) ||
+ !strncmp((const char*)VolumeStructDesc->Ident,
+ VSD_STD_ID_NSR02,
+ VSD_STD_ID_LEN))
{
State = 2;
}
@@ -70,13 +70,11 @@
case 2:
- if ((Buffer[1] == 'T') &&
- (Buffer[2] == 'E') &&
- (Buffer[3] == 'A') &&
- (Buffer[4] == '0') &&
- (Buffer[5] == '1'))
+ if (!strncmp((const char*)VolumeStructDesc->Ident,
+ VSD_STD_ID_TEA01,
+ VSD_STD_ID_LEN))
{
- ExFreePool(Buffer);
+ ExFreePool(VolumeStructDesc);
return TRUE;
}
break;
@@ -85,12 +83,12 @@
Offset.QuadPart += SectorSize;
if (Offset.QuadPart == UDFS_AVDP_SECTOR)
{
- ExFreePool(Buffer);
+ ExFreePool(VolumeStructDesc);
return FALSE;
}
}
- ExFreePool(Buffer);
+ ExFreePool(VolumeStructDesc);
return TRUE;
}
Added: trunk/reactos/drivers/filesystems/fs_rec/udfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fs_rec…
==============================================================================
--- trunk/reactos/drivers/filesystems/fs_rec/udfs.h (added)
+++ trunk/reactos/drivers/filesystems/fs_rec/udfs.h [iso-8859-1] Sun Jul 26 15:16:19 2009
@@ -1,0 +1,29 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS File System Recognizer
+ * FILE: drivers/filesystems/fs_rec/udfs.h
+ * PURPOSE: UDFS Header File
+ * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org)
+ */
+
+/* Standard Identifier (EMCA 167r2 2/9.1.2) */
+#define VSD_STD_ID_NSR02 "NSR02" /* (3/9.1) */
+
+/* Standard Identifier (ECMA 167r3 2/9.1.2) */
+#define VSD_STD_ID_BEA01 "BEA01" /* (2/9.2) */
+#define VSD_STD_ID_BOOT2 "BOOT2" /* (2/9.4) */
+#define VSD_STD_ID_CD001 "CD001" /* (ECMA-119) */
+#define VSD_STD_ID_CDW02 "CDW02" /* (ECMA-168) */
+#define VSD_STD_ID_NSR03 "NSR03" /* (3/9.1) */
+#define VSD_STD_ID_TEA01 "TEA01" /* (2/9.3) */
+
+/* Volume Structure Descriptor (ECMA 167r3 2/9.1) */
+#define VSD_STD_ID_LEN 5
+typedef struct _VOLSTRUCTDESC
+{
+ UCHAR Type;
+ UCHAR Ident[VSD_STD_ID_LEN];
+ UCHAR Version;
+ UCHAR Data[2041];
+} VOLSTRUCTDESC, *PVOLSTRUCTDESC;
+
Propchange: trunk/reactos/drivers/filesystems/fs_rec/udfs.h
------------------------------------------------------------------------------
svn:eol-style = native