ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2015
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
347 discussions
Start a n
N
ew thread
[pschweitzer] 69577: [FS_REC] Implement ExtX support in FS_REC, this allows it to autoload ext2fs.sys Starting with this revision, browsing ExtX volumes in ReactOS works without any other modificat...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Oct 17 22:39:13 2015 New Revision: 69577 URL:
http://svn.reactos.org/svn/reactos?rev=69577&view=rev
Log: [FS_REC] Implement ExtX support in FS_REC, this allows it to autoload ext2fs.sys Starting with this revision, browsing ExtX volumes in ReactOS works without any other modifications. Thanks to Peter Hater for his initial work and to Thomas for his reviews Added: trunk/reactos/drivers/filesystems/fs_rec/ext2.h (with props) Modified: trunk/reactos/drivers/filesystems/fs_rec/ext2.c Modified: trunk/reactos/drivers/filesystems/fs_rec/ext2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fs_rec…
============================================================================== --- trunk/reactos/drivers/filesystems/fs_rec/ext2.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fs_rec/ext2.c [iso-8859-1] Sat Oct 17 22:39:13 2015 @@ -4,11 +4,13 @@ * FILE: drivers/filesystems/fs_rec/ext2.c * PURPOSE: EXT2 Recognizer * PROGRAMMER: Eric Kohl + * Pierre Schweitzer (pierre(a)reactos.org) */ /* INCLUDES *****************************************************************/ #include "fs_rec.h" +#include "ext2.h" #define NDEBUG #include <debug.h> @@ -17,11 +19,10 @@ BOOLEAN NTAPI -FsRecIsExt2Volume(IN PVOID PackedBootSector) +FsRecIsExt2Volume(IN PEXT2_SUPER_BLOCK SuperBlock) { - UNREFERENCED_PARAMETER(PackedBootSector); - /* For now, always return failure... */ - return FALSE; + /* Just check for magic */ + return (SuperBlock->Magic == EXT2_SUPER_MAGIC); } NTSTATUS @@ -32,9 +33,9 @@ PIO_STACK_LOCATION Stack; NTSTATUS Status; PDEVICE_OBJECT MountDevice; - PVOID Bpb = NULL; + PEXT2_SUPER_BLOCK Spb = NULL; ULONG SectorSize; - LARGE_INTEGER Offset = {{0, 0}}; + LARGE_INTEGER Offset; BOOLEAN DeviceError = FALSE; PAGED_CODE(); @@ -51,16 +52,17 @@ MountDevice = Stack->Parameters.MountVolume.DeviceObject; if (FsRecGetDeviceSectorSize(MountDevice, &SectorSize)) { - /* Try to read the BPB */ + /* Try to read the superblock */ + Offset.QuadPart = 0x400; if (FsRecReadBlock(MountDevice, &Offset, - 512, + 0x400, SectorSize, - (PVOID)&Bpb, + (PVOID)&Spb, &DeviceError)) { /* Check if it's an actual EXT2 volume */ - if (FsRecIsExt2Volume(Bpb)) + if (FsRecIsExt2Volume(Spb)) { /* It is! */ Status = STATUS_FS_DRIVER_REQUIRED; @@ -68,7 +70,7 @@ } /* Free the boot sector if we have one */ - ExFreePool(Bpb); + ExFreePool(Spb); } else { Added: trunk/reactos/drivers/filesystems/fs_rec/ext2.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fs_rec…
============================================================================== --- trunk/reactos/drivers/filesystems/fs_rec/ext2.h (added) +++ trunk/reactos/drivers/filesystems/fs_rec/ext2.h [iso-8859-1] Sat Oct 17 22:39:13 2015 @@ -0,0 +1,46 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS File System Recognizer + * FILE: drivers/filesystems/fs_rec/ext2.h + * PURPOSE: EXT2 Header File + * PROGRAMMER: Pierre Schweitzer (pierre(a)reactos.org) + */ + +#include <pshpack1.h> +typedef struct _EXT2_SUPER_BLOCK { + ULONG InodesCount; + ULONG BlocksCount; + ULONG ReservedBlocksCount; + ULONG FreeBlocksCount; + ULONG FreeInodesCount; + ULONG FirstDataBlock; + ULONG LogBlockSize; + LONG LogFragSize; + ULONG BlocksPerGroup; + ULONG FragsPerGroup; + ULONG InodesPerGroup; + ULONG MountTime; + ULONG WriteTime; + USHORT MountCount; + SHORT MaxMountCount; + USHORT Magic; + USHORT State; + USHORT Errors; + USHORT MinorRevLevel; + ULONG LastCheck; + ULONG CheckInterval; + ULONG CreatorOS; + ULONG RevLevel; + USHORT DefResUid; + USHORT DefResGid; + // Partial +} EXT2_SUPER_BLOCK, *PEXT2_SUPER_BLOCK; +#include <poppack.h> + +C_ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, FreeInodesCount) == 0x10); +C_ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, BlocksPerGroup) == 0x20); +C_ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, WriteTime) == 0x30); +C_ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, LastCheck) == 0x40); +C_ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, DefResUid) == 0x50); + +#define EXT2_SUPER_MAGIC 0xEF53 Propchange: trunk/reactos/drivers/filesystems/fs_rec/ext2.h ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 2 months
1
0
0
0
[pschweitzer] 69576: [EXT2] [EXT2_NEW] Get rid of old ext2 driver and use new one
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Oct 17 22:35:20 2015 New Revision: 69576 URL:
http://svn.reactos.org/svn/reactos?rev=69576&view=rev
Log: [EXT2] [EXT2_NEW] Get rid of old ext2 driver and use new one Added: trunk/reactos/drivers/filesystems/ext2/ - copied from r69575, trunk/reactos/drivers/filesystems/ext2_new/ trunk/reactos/drivers/filesystems/ext2/inc/linux/ext2_fs.h - copied unchanged from r69573, trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h Removed: trunk/reactos/drivers/filesystems/ext2_new/ Modified: trunk/reactos/drivers/filesystems/CMakeLists.txt Modified: trunk/reactos/drivers/filesystems/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/CMakeL…
============================================================================== --- trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] Sat Oct 17 22:35:20 2015 @@ -1,7 +1,6 @@ add_subdirectory(cdfs) add_subdirectory(ext2) -#add_subdirectory(ext2_new) add_subdirectory(fastfat) #add_subdirectory(fastfat_new) add_subdirectory(fs_rec) @@ -10,3 +9,4 @@ add_subdirectory(npfs) add_subdirectory(ntfs) add_subdirectory(udfs) +add_subdirectory(registryfs)
9 years, 2 months
1
0
0
0
[pschweitzer] 69575: [PSDK] Mark (old) Linux partitions (notably extX volumes) as recognized by ReactOS in IsRecognizedPartition() This is only enabled when building ReactOS.Otherwise, it matches W...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Oct 17 22:32:13 2015 New Revision: 69575 URL:
http://svn.reactos.org/svn/reactos?rev=69575&view=rev
Log: [PSDK] Mark (old) Linux partitions (notably extX volumes) as recognized by ReactOS in IsRecognizedPartition() This is only enabled when building ReactOS.Otherwise, it matches Windows definition. Modified: trunk/reactos/include/psdk/ntdddisk.h trunk/reactos/include/psdk/winioctl.h Modified: trunk/reactos/include/psdk/ntdddisk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdddisk.h?re…
============================================================================== --- trunk/reactos/include/psdk/ntdddisk.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntdddisk.h [iso-8859-1] Sat Oct 17 22:32:13 2015 @@ -220,6 +220,10 @@ #define PARTITION_UNIX 0x63 #define VALID_NTFT 0xC0 #define PARTITION_NTFT 0x80 +#ifdef __REACTOS__ +#define PARTITION_OLD_LINUX 0x43 +#define PARTITION_LINUX 0x83 +#endif #define IsFTPartition( PartitionType ) \ (((PartitionType) & PARTITION_NTFT) && \ @@ -229,6 +233,24 @@ (((PartitionType) == PARTITION_EXTENDED) || \ ((PartitionType) == PARTITION_XINT13_EXTENDED)) +#ifdef __REACTOS__ +#define IsRecognizedPartition(PartitionType) ( \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT_12)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_HUGE)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_IFS)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT32)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT32_XINT13)) || \ + (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_XINT13)) || \ + ((PartitionType) == PARTITION_FAT_12) || \ + ((PartitionType) == PARTITION_FAT_16) || \ + ((PartitionType) == PARTITION_HUGE) || \ + ((PartitionType) == PARTITION_IFS) || \ + ((PartitionType) == PARTITION_FAT32) || \ + ((PartitionType) == PARTITION_FAT32_XINT13) || \ + ((PartitionType) == PARTITION_XINT13) || \ + ((PartitionType) == PARTITION_LINUX) || \ + ((PartitionType) == PARTITION_OLD_LINUX)) +#else #define IsRecognizedPartition(PartitionType) ( \ (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_FAT_12)) || \ (((PartitionType) & PARTITION_NTFT) && (((PartitionType) & ~0xC0) == PARTITION_HUGE)) || \ @@ -243,6 +265,7 @@ ((PartitionType) == PARTITION_FAT32) || \ ((PartitionType) == PARTITION_FAT32_XINT13) || \ ((PartitionType) == PARTITION_XINT13)) +#endif #if(_WIN32_WINNT >= 0x0500) #define GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY 0x10000000 Modified: trunk/reactos/include/psdk/winioctl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winioctl.h?re…
============================================================================== --- trunk/reactos/include/psdk/winioctl.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winioctl.h [iso-8859-1] Sat Oct 17 22:32:13 2015 @@ -192,8 +192,12 @@ #define PARTITION_PREP 0x41 #define PARTITION_LDM 0x42 #define PARTITION_UNIX 0x63 -#define PARTITION_NTFT 128 +#define PARTITION_NTFT 0x80 #define VALID_NTFT 0xC0 +#ifdef __REACTOS__ +#define PARTITION_OLD_LINUX 0x43 +#define PARTITION_LINUX 0x83 +#endif #define SERIAL_LSRMST_ESCAPE 0 #define SERIAL_LSRMST_LSR_DATA 1 #define SERIAL_LSRMST_LSR_NODATA 2 @@ -576,6 +580,25 @@ UCHAR FileRecordBuffer[1]; } NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER; +#ifdef __REACTOS__ +#define IsRecognizedPartition(t)\ + (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_IFS))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_HUGE))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\ + ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\ + ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\ + ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\ + ((t&~PARTITION_NTFT)==PARTITION_IFS)||\ + ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\ + ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\ + ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\ + ((t&~PARTITION_NTFT)==PARTITION_XINT13)||\ + ((t&~PARTITION_NTFT)==PARTITION_LINUX)||\ + ((t&~PARTITION_NTFT)==PARTITION_OLD_LINUX)) +#else #define IsRecognizedPartition(t)\ (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\ ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_16))||\ @@ -591,6 +614,7 @@ ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\ ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\ ((t&~PARTITION_NTFT)==PARTITION_XINT13)) +#endif #define IsContainerPartition(t)\ (((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\ ((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
9 years, 2 months
1
0
0
0
[pschweitzer] 69574: [EXT2_NEW] Fix Linux build
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Oct 17 22:29:09 2015 New Revision: 69574 URL:
http://svn.reactos.org/svn/reactos?rev=69574&view=rev
Log: [EXT2_NEW] Fix Linux build Added: trunk/reactos/drivers/filesystems/ext2_new/inc/linux/ext2_fs.h - copied unchanged from r69573, trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h Removed: trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h Modified: trunk/reactos/drivers/filesystems/ext2_new/src/ext4/ext4_jbd2.c Removed: trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2_n…
============================================================================== --- trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ext2_new/inc/linux/Ext2_fs.h (removed) @@ -1,638 +0,0 @@ -/* - * linux/include/linux/ext2_fs.h - * - * Copyright (C) 1992, 1993, 1994, 1995 - * Remy Card (card(a)masi.ibp.fr) - * Laboratoire MASI - Institut Blaise Pascal - * Universite Pierre et Marie Curie (Paris VI) - * - * from - * - * linux/include/linux/minix_fs.h - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -#ifndef _LINUX_EXT2_FS_H -#define _LINUX_EXT2_FS_H - -#include <linux/types.h> - -/* - * The second extended filesystem constants/structures - */ - -/* - * Define EXT2FS_DEBUG to produce debug messages - */ -#undef EXT2FS_DEBUG - -/* - * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files - */ -#define EXT2_PREALLOCATE -#define EXT2_DEFAULT_PREALLOC_BLOCKS 8 - -/* - * The second extended file system version - */ -#define EXT2FS_DATE "95/08/09" -#define EXT2FS_VERSION "0.5b" - -/* - * Debug code - */ -#ifdef EXT2FS_DEBUG -# define ext2_debug(f, a...) { \ - printk ("EXT2-fs DEBUG (%s, %d): %s:", \ - __FILE__, __LINE__, __FUNCTION__); \ - printk (f, ## a); \ - } -#else -//# define ext2_debug(f, a...) /**/ -#endif - -/* - * Special inode numbers - */ -#define EXT2_BAD_INO 1 /* Bad blocks inode */ -#define EXT2_ROOT_INO 2 /* Root inode */ -#define EXT2_ACL_IDX_INO 3 /* ACL inode */ -#define EXT2_ACL_DATA_INO 4 /* ACL inode */ -#define EXT2_BOOT_LOADER_INO 5 /* Boot loader inode */ -#define EXT2_UNDEL_DIR_INO 6 /* Undelete directory inode */ - -/* First non-reserved inode for old ext2 filesystems */ -#define EXT2_GOOD_OLD_FIRST_INO 11 - -/* - * The second extended file system magic number - */ -#define EXT2_SUPER_MAGIC 0xEF53 - -/* - * Maximal count of links to a file - */ -#define EXT2_LINK_MAX 32000 - -/* - * Macro-instructions used to manage several block sizes - */ -#define EXT2_MIN_BLOCK_SIZE 1024 -#define EXT2_MAX_BLOCK_SIZE 4096 -#define EXT2_MIN_BLOCK_LOG_SIZE 10 -#ifdef __KERNEL__ -# define EXT2_BLOCK_SIZE(s) ((s)->s_blocksize) -#else -# define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size) -#endif -#define EXT2_ACLE_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_acl_entry)) -#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32)) -#ifdef __KERNEL__ -# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) -#else -# define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) -#endif -#ifdef __KERNEL__ -#define EXT2_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_addr_per_block_bits) -#define EXT2_INODE_SIZE(s) ((s)->u.ext2_sb.s_inode_size) -#define EXT2_FIRST_INO(s) ((s)->u.ext2_sb.s_first_ino) -#else -#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ - EXT2_GOOD_OLD_INODE_SIZE : \ - (s)->s_inode_size) -#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \ - EXT2_GOOD_OLD_FIRST_INO : \ - (s)->s_first_ino) -#endif - -/* - * Macro-instructions used to manage fragments - */ -#define EXT2_MIN_FRAG_SIZE 1024 -#define EXT2_MAX_FRAG_SIZE 4096 -#define EXT2_MIN_FRAG_LOG_SIZE 10 -#ifdef __KERNEL__ -# define EXT2_FRAG_SIZE(s) ((s)->u.ext2_sb.s_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) ((s)->u.ext2_sb.s_frags_per_block) -#else -# define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size) -# define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s)) -#endif - -/* - * ACL structures - */ -struct ext2_acl_header /* Header of Access Control Lists */ -{ - __u32 aclh_size; - __u32 aclh_file_count; - __u32 aclh_acle_count; - __u32 aclh_first_acle; -}; - -struct ext2_acl_entry /* Access Control List Entry */ -{ - __u32 acle_size; - __u16 acle_perms; /* Access permissions */ - __u16 acle_type; /* Type of entry */ - __u16 acle_tag; /* User or group identity */ - __u16 acle_pad1; - __u32 acle_next; /* Pointer on next entry for the */ - /* same inode or on next free entry */ -}; - -/* - * Structure of a blocks group descriptor - */ -struct ext2_group_desc -{ - __u32 bg_block_bitmap; /* Blocks bitmap block */ - __u32 bg_inode_bitmap; /* Inodes bitmap block */ - __u32 bg_inode_table; /* Inodes table block */ - __u16 bg_free_blocks_count; /* Free blocks count */ - __u16 bg_free_inodes_count; /* Free inodes count */ - __u16 bg_used_dirs_count; /* Directories count */ - __u16 bg_pad; - __u32 bg_reserved[3]; -}; - -/* - * Macro-instructions used to manage group descriptors - */ -#ifdef __KERNEL__ -# define EXT2_BLOCKS_PER_GROUP(s) ((s)->u.ext2_sb.s_blocks_per_group) -# define EXT2_DESC_PER_BLOCK(s) ((s)->u.ext2_sb.s_desc_per_block) -# define EXT2_INODES_PER_GROUP(s) ((s)->u.ext2_sb.s_inodes_per_group) -# define EXT2_DESC_PER_BLOCK_BITS(s) ((s)->u.ext2_sb.s_desc_per_block_bits) -#else -# define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) -# define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc)) -# define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group) -#endif - -/* - * Constants relative to the data blocks - */ -#define EXT2_NDIR_BLOCKS 12 -#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS -#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) -#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) -#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) - -/* - * Inode flags - */ -#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ -#define EXT2_UNRM_FL 0x00000002 /* Undelete */ -#define EXT2_COMPR_FL 0x00000004 /* Compress file */ -#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ -#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ -#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ -#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ -#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ -/* Reserved for compression usage... */ -#define EXT2_DIRTY_FL 0x00000100 -#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ -#define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ -#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ -/* End compression flags --- maybe not all used */ -#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ -#define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ -#define EXT2_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */ -#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ -#define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ -#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ -#define EXT2_HUGE_FILE_FL 0x00040000 /* Set to each huge file */ -#define EXT2_EXTENTS_FL 0x00080000 /* Inode uses extents */ -#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ - -#define EXT2_FL_USER_VISIBLE 0x00001FFF /* User visible flags */ -#define EXT2_FL_USER_MODIFIABLE 0x000000FF /* User modifiable flags */ - -/* - * ioctl commands - */ -#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) -#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) -#define EXT2_IOC_GETVERSION _IOR('v', 1, long) -#define EXT2_IOC_SETVERSION _IOW('v', 2, long) - -/* - * Structure of an inode on the disk - */ -struct ext2_inode { - __u16 i_mode; /* File mode */ - __u16 i_uid; /* Low 16 bits of Owner Uid */ - __u32 i_size; /* Size in bytes */ - __u32 i_atime; /* Access time */ - __u32 i_ctime; /* Creation time */ - __u32 i_mtime; /* Modification time */ - __u32 i_dtime; /* Deletion Time */ - __u16 i_gid; /* Low 16 bits of Group Id */ - __u16 i_links_count; /* Links count */ - __u32 i_blocks; /* Blocks count */ - __u32 i_flags; /* File flags */ - union { - struct { - __u32 l_i_reserved1; - } linux1; - struct { - __u32 h_i_translator; - } hurd1; - struct { - __u32 m_i_reserved1; - } masix1; - } osd1; /* OS dependent 1 */ - __u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ - __u32 i_generation; /* File version (for NFS) */ - __u32 i_file_acl; /* File ACL */ - __u32 i_dir_acl; /* Directory ACL */ - __u32 i_faddr; /* Fragment address */ - union { - struct { - __u8 l_i_frag; /* Fragment number */ - __u8 l_i_fsize; /* Fragment size */ - __u16 i_pad1; - __u16 l_i_uid_high; /* these 2 fields */ - __u16 l_i_gid_high; /* were reserved2[0] */ - __u32 l_i_reserved2; - } linux2; - struct { - __u8 h_i_frag; /* Fragment number */ - __u8 h_i_fsize; /* Fragment size */ - __u16 h_i_mode_high; - __u16 h_i_uid_high; - __u16 h_i_gid_high; - __u32 h_i_author; - } hurd2; - struct { - __u8 m_i_frag; /* Fragment number */ - __u8 m_i_fsize; /* Fragment size */ - __u16 m_pad1; - __u32 m_i_reserved2[2]; - } masix2; - } osd2; /* OS dependent 2 */ - __le16 i_extra_isize; - __le16 i_pad1; -}; - -#if defined(__KERNEL__) || defined(__linux__) -#define i_reserved1 osd1.linux1.l_i_reserved1 -#define i_frag osd2.linux2.l_i_frag -#define i_fsize osd2.linux2.l_i_fsize -#define i_uid_low i_uid -#define i_gid_low i_gid -#define i_uid_high osd2.linux2.l_i_uid_high -#define i_gid_high osd2.linux2.l_i_gid_high -#define i_reserved2 osd2.linux2.l_i_reserved2 -#endif - -#ifdef __hurd__ -#define i_translator osd1.hurd1.h_i_translator -#define i_frag osd2.hurd2.h_i_frag; -#define i_fsize osd2.hurd2.h_i_fsize; -#define i_uid_high osd2.hurd2.h_i_uid_high -#define i_gid_high osd2.hurd2.h_i_gid_high -#define i_author osd2.hurd2.h_i_author -#endif - -#ifdef __masix__ -#define i_reserved1 osd1.masix1.m_i_reserved1 -#define i_frag osd2.masix2.m_i_frag -#define i_fsize osd2.masix2.m_i_fsize -#define i_reserved2 osd2.masix2.m_i_reserved2 -#endif - -/* - * File system states - */ -#define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ -#define EXT2_ERROR_FS 0x0002 /* Errors detected */ - -/* - * Mount flags - */ -#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */ -#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */ -#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */ -#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ -#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ -#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ -#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ -#define EXT2_MOUNT_NO_UID32 0x0200 /* Disable 32-bit UIDs */ - -#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt -#define set_opt(o, opt) o |= EXT2_MOUNT_##opt -#define test_opt(sb, opt) ((sb)->u.ext2_sb.s_mount_opt & \ - EXT2_MOUNT_##opt) -/* - * Maximal mount counts between two filesystem checks - */ -#define EXT2_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ -#define EXT2_DFL_CHECKINTERVAL 0 /* Don't use interval check */ - -/* - * Behaviour when detecting errors - */ -#define EXT2_ERRORS_CONTINUE 1 /* Continue execution */ -#define EXT2_ERRORS_RO 2 /* Remount fs read-only */ -#define EXT2_ERRORS_PANIC 3 /* Panic */ -#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE - -/* - * Structure of the super block - */ -struct ext2_super_block { - __u32 s_inodes_count; /* Inodes count */ - __u32 s_blocks_count; /* Blocks count */ - __u32 s_r_blocks_count; /* Reserved blocks count */ - __u32 s_free_blocks_count; /* Free blocks count */ - __u32 s_free_inodes_count; /* Free inodes count */ - __u32 s_first_data_block; /* First Data Block */ - __u32 s_log_block_size; /* Block size */ - __s32 s_log_frag_size; /* Fragment size */ - __u32 s_blocks_per_group; /* # Blocks per group */ - __u32 s_frags_per_group; /* # Fragments per group */ - __u32 s_inodes_per_group; /* # Inodes per group */ - __u32 s_mtime; /* Mount time */ - __u32 s_wtime; /* Write time */ - __u16 s_mnt_count; /* Mount count */ - __s16 s_max_mnt_count; /* Maximal mount count */ - __u16 s_magic; /* Magic signature */ - __u16 s_state; /* File system state */ - __u16 s_errors; /* Behaviour when detecting errors */ - __u16 s_minor_rev_level; /* minor revision level */ - __u32 s_lastcheck; /* time of last check */ - __u32 s_checkinterval; /* max. time between checks */ - __u32 s_creator_os; /* OS */ - __u32 s_rev_level; /* Revision level */ - __u16 s_def_resuid; /* Default uid for reserved blocks */ - __u16 s_def_resgid; /* Default gid for reserved blocks */ - /* - * These fields are for EXT2_DYNAMIC_REV superblocks only. - * - * Note: the difference between the compatible feature set and - * the incompatible feature set is that if there is a bit set - * in the incompatible feature set that the kernel doesn't - * know about, it should refuse to mount the filesystem. - * - * e2fsck's requirements are more strict; if it doesn't know - * about a feature in either the compatible or incompatible - * feature set, it must abort and not try to meddle with - * things it doesn't understand... - */ - __u32 s_first_ino; /* First non-reserved inode */ - __u16 s_inode_size; /* size of inode structure */ - __u16 s_block_group_nr; /* block group # of this superblock */ - __u32 s_feature_compat; /* compatible feature set */ - __u32 s_feature_incompat; /* incompatible feature set */ - __u32 s_feature_ro_compat; /* readonly-compatible feature set */ - __u8 s_uuid[16]; /* 128-bit uuid for volume */ - char s_volume_name[16]; /* volume name */ - char s_last_mounted[64]; /* directory where last mounted */ - __u32 s_algorithm_usage_bitmap; /* For compression */ - /* - * Performance hints. Directory preallocation should only - * happen if the EXT2_COMPAT_PREALLOC flag is on. - */ - __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ - __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ - __u16 s_padding1; - __u32 s_reserved[204]; /* Padding to the end of the block */ -}; - -#ifdef __KERNEL__ -#define EXT2_SB(sb) (&((sb)->u.ext2_sb)) -#else -/* Assume that user mode programs are passing in an ext2fs superblock, not - * a kernel struct super_block. This will allow us to call the feature-test - * macros from user land. */ -#define EXT2_SB(sb) (sb) -#endif - -/* - * Codes for operating systems - */ -#define EXT2_OS_LINUX 0 -#define EXT2_OS_HURD 1 -#define EXT2_OS_MASIX 2 -#define EXT2_OS_FREEBSD 3 -#define EXT2_OS_LITES 4 - -/* - * Revision levels - */ -#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */ -#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ - -#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV -#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV - -#define EXT2_GOOD_OLD_INODE_SIZE 128 - -/* - * Feature set definitions - */ - -#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) -#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) -#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ - ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) -#define EXT2_SET_COMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) -#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask) -#define EXT2_SET_INCOMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask) -#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask) -#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask) -#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ - EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask) - -#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 -#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 -#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 -#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 -#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 -#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 -#define EXT2_FEATURE_COMPAT_ANY 0xffffffff - -#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 -#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 -#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 -#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff - -#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 -#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 - -#define EXT2_FEATURE_COMPAT_SUPP 0 -#define EXT2_FEATURE_INCOMPAT_SUPP EXT2_FEATURE_INCOMPAT_FILETYPE -#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ - EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ - EXT2_FEATURE_RO_COMPAT_BTREE_DIR) -#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP -#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP - -/* - * Default values for user and/or group using reserved blocks - */ -#define EXT2_DEF_RESUID 0 -#define EXT2_DEF_RESGID 0 - -/* - * Structure of a directory entry - */ -#define EXT2_NAME_LEN 255 - -struct ext2_dir_entry { - __u32 inode; /* Inode number */ - __u16 rec_len; /* Directory entry length */ - __u16 name_len; /* Name length */ - char name[EXT2_NAME_LEN]; /* File name */ -}; - -/* - * The new version of the directory entry. Since EXT2 structures are - * stored in intel byte order, and the name_len field could never be - * bigger than 255 chars, it's safe to reclaim the extra byte for the - * file_type field. - */ -struct ext2_dir_entry_2 { - __u32 inode; /* Inode number */ - __u16 rec_len; /* Directory entry length */ - __u8 name_len; /* Name length */ - __u8 file_type; - char name[EXT2_NAME_LEN]; /* File name */ -}; - -/* - * Ext2 directory file types. Only the low 3 bits are used. The - * other bits are reserved for now. - */ -enum { - EXT2_FT_UNKNOWN, - EXT2_FT_REG_FILE, - EXT2_FT_DIR, - EXT2_FT_CHRDEV, - EXT2_FT_BLKDEV, - EXT2_FT_FIFO, - EXT2_FT_SOCK, - EXT2_FT_SYMLINK, - EXT2_FT_MAX -}; - -/* - * EXT2_DIR_PAD defines the directory entries boundaries - * - * NOTE: It must be a multiple of 4 - */ -#define EXT2_DIR_PAD 4 -#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) -#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ - ~EXT2_DIR_ROUND) - -#ifdef __KERNEL__ -/* - * Function prototypes - */ - -/* - * Ok, these declarations are also in <linux/kernel.h> but none of the - * ext2 source programs needs to include it so they are duplicated here. - */ -# define NORET_TYPE /**/ -# define ATTRIB_NORET __attribute__((noreturn)) -# define NORET_AND noreturn, - -/* balloc.c */ -extern int ext2_bg_has_super(struct super_block *sb, int group); -extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group); -extern int ext2_new_block (struct inode *, unsigned long, - __u32 *, __u32 *, int *); -extern void ext2_free_blocks (struct inode *, unsigned long, - unsigned long); -extern unsigned long ext2_count_free_blocks (struct super_block *); -extern void ext2_check_blocks_bitmap (struct super_block *); -extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, - unsigned int block_group, - struct buffer_head ** bh); - -/* dir.c */ -extern int ext2_add_link (struct dentry *, struct inode *); -extern ino_t ext2_inode_by_name(struct inode *, struct dentry *); -extern int ext2_make_empty(struct inode *, struct inode *); -extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct dentry *, struct page **); -extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); -extern int ext2_empty_dir (struct inode *); -extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); -extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *); - -/* fsync.c */ -extern int ext2_sync_file (struct file *, struct dentry *, int); -extern int ext2_fsync_inode (struct inode *, int); - -/* ialloc.c */ -extern struct inode * ext2_new_inode (const struct inode *, int); -extern void ext2_free_inode (struct inode *); -extern unsigned long ext2_count_free_inodes (struct super_block *); -extern void ext2_check_inodes_bitmap (struct super_block *); -extern unsigned long ext2_count_free (struct buffer_head *, unsigned); - -/* inode.c */ -extern void ext2_read_inode (struct inode *); -extern void ext2_write_inode (struct inode *, int); -extern void ext2_put_inode (struct inode *); -extern void ext2_delete_inode (struct inode *); -extern int ext2_sync_inode (struct inode *); -extern void ext2_discard_prealloc (struct inode *); -extern void ext2_truncate (struct inode *); - -/* ioctl.c */ -extern int ext2_ioctl (struct inode *, struct file *, unsigned int, - unsigned long); - -/* super.c */ -extern void ext2_error (struct super_block *, const char *, const char *, ...) - __attribute__ ((format (printf, 3, 4))); -extern NORET_TYPE void ext2_panic (struct super_block *, const char *, - const char *, ...) - __attribute__ ((NORET_AND format (printf, 3, 4))); -extern void ext2_warning (struct super_block *, const char *, const char *, ...) - __attribute__ ((format (printf, 3, 4))); -extern void ext2_update_dynamic_rev (struct super_block *sb); -extern void ext2_put_super (struct super_block *); -extern void ext2_write_super (struct super_block *); -extern int ext2_remount (struct super_block *, int *, char *); -extern struct super_block * ext2_read_super (struct super_block *,void *,int); -#ifndef __REACTOS__ -extern int ext2_statfs (struct super_block *, struct statfs *); -#endif - -/* - * Inodes and files operations - */ - -/* dir.c */ -extern struct file_operations ext2_dir_operations; - -/* file.c */ -extern struct inode_operations ext2_file_inode_operations; -extern struct file_operations ext2_file_operations; - -/* inode.c */ -extern struct address_space_operations ext2_aops; - -/* namei.c */ -extern struct inode_operations ext2_dir_inode_operations; - -/* symlink.c */ -extern struct inode_operations ext2_fast_symlink_inode_operations; - -#endif /* __KERNEL__ */ - -#endif /* _LINUX_EXT2_FS_H */ Modified: trunk/reactos/drivers/filesystems/ext2_new/src/ext4/ext4_jbd2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2_n…
============================================================================== --- trunk/reactos/drivers/filesystems/ext2_new/src/ext4/ext4_jbd2.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/ext2_new/src/ext4/ext4_jbd2.c [iso-8859-1] Sat Oct 17 22:29:09 2015 @@ -1,5 +1,5 @@ #include "ext2fs.h" -#include "linux\ext4.h" +#include "linux/ext4.h" static handle_t no_journal;
9 years, 2 months
1
0
0
0
[tfaber] 69573: [VIDEOPRT] - Don't try to incorrectly and unnecessarily parse multiple resource descriptors CORE-10146
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Oct 17 19:31:46 2015 New Revision: 69573 URL:
http://svn.reactos.org/svn/reactos?rev=69573&view=rev
Log: [VIDEOPRT] - Don't try to incorrectly and unnecessarily parse multiple resource descriptors CORE-10146 Modified: trunk/reactos/win32ss/drivers/videoprt/dispatch.c trunk/reactos/win32ss/drivers/videoprt/resource.c Modified: trunk/reactos/win32ss/drivers/videoprt/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/videoprt/d…
============================================================================== --- trunk/reactos/win32ss/drivers/videoprt/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/videoprt/dispatch.c [iso-8859-1] Sat Oct 17 19:31:46 2015 @@ -588,31 +588,28 @@ ResourceListSize); /* Get the interrupt level/vector - needed by HwFindAdapter sometimes */ - for (FullList = AllocatedResources->List; - FullList < AllocatedResources->List + AllocatedResources->Count; - FullList++) + FullList = AllocatedResources->List; + ASSERT(AllocatedResources->Count == 1); + INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n", + FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision); + + /* FIXME: Is this ASSERT ok for resources from the PNP manager? */ + ASSERT(FullList->InterfaceType == PCIBus); + ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber); + ASSERT(1 == FullList->PartialResourceList.Version); + ASSERT(1 == FullList->PartialResourceList.Revision); + for (Descriptor = FullList->PartialResourceList.PartialDescriptors; + Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count; + Descriptor++) { - INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n", - FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision); - - /* FIXME: Is this ASSERT ok for resources from the PNP manager? */ - ASSERT(FullList->InterfaceType == PCIBus); - ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber); - ASSERT(1 == FullList->PartialResourceList.Version); - ASSERT(1 == FullList->PartialResourceList.Revision); - for (Descriptor = FullList->PartialResourceList.PartialDescriptors; - Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count; - Descriptor++) + if (Descriptor->Type == CmResourceTypeInterrupt) { - if (Descriptor->Type == CmResourceTypeInterrupt) - { - DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level; - DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector; - if (Descriptor->ShareDisposition == CmResourceShareShared) - DeviceExtension->InterruptShared = TRUE; - else - DeviceExtension->InterruptShared = FALSE; - } + DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level; + DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector; + if (Descriptor->ShareDisposition == CmResourceShareShared) + DeviceExtension->InterruptShared = TRUE; + else + DeviceExtension->InterruptShared = FALSE; } } } Modified: trunk/reactos/win32ss/drivers/videoprt/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/videoprt/r…
============================================================================== --- trunk/reactos/win32ss/drivers/videoprt/resource.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/drivers/videoprt/resource.c [iso-8859-1] Sat Oct 17 19:31:46 2015 @@ -744,71 +744,68 @@ /* Return the slot number if the caller wants it */ if (Slot != NULL) *Slot = DeviceExtension->SystemIoBusNumber; - for (FullList = AllocatedResources->List; - FullList < AllocatedResources->List + AllocatedResources->Count; - FullList++) - { - INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n", - FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision); - - ASSERT(FullList->InterfaceType == PCIBus); - ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber); - ASSERT(1 == FullList->PartialResourceList.Version); - ASSERT(1 == FullList->PartialResourceList.Revision); - for (Descriptor = FullList->PartialResourceList.PartialDescriptors; - Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count; - Descriptor++) + FullList = AllocatedResources->List; + ASSERT(AllocatedResources->Count == 1); + INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n", + FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber, FullList->PartialResourceList.Version, FullList->PartialResourceList.Revision); + + ASSERT(FullList->InterfaceType == PCIBus); + ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber); + ASSERT(1 == FullList->PartialResourceList.Version); + ASSERT(1 == FullList->PartialResourceList.Revision); + for (Descriptor = FullList->PartialResourceList.PartialDescriptors; + Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count; + Descriptor++) + { + if ((Descriptor->Type == CmResourceTypeMemory || + Descriptor->Type == CmResourceTypePort) && + AssignedCount >= NumAccessRanges) { - if ((Descriptor->Type == CmResourceTypeMemory || - Descriptor->Type == CmResourceTypePort) && - AssignedCount >= NumAccessRanges) - { - ERR_(VIDEOPRT, "Too many access ranges found\n"); - return ERROR_NOT_ENOUGH_MEMORY; - } - if (Descriptor->Type == CmResourceTypeMemory) - { - INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n", - Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length); - AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start; - AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length; - AccessRanges[AssignedCount].RangeInIoSpace = 0; - AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */ - AccessRanges[AssignedCount].RangeShareable = - (Descriptor->ShareDisposition == CmResourceShareShared); - AccessRanges[AssignedCount].RangePassive = 0; - AssignedCount++; - } - else if (Descriptor->Type == CmResourceTypePort) - { - INFO_(VIDEOPRT, "Port range starting at 0x%04x length %d\n", - Descriptor->u.Port.Start.u.LowPart, Descriptor->u.Port.Length); - AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start; - AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length; - AccessRanges[AssignedCount].RangeInIoSpace = 1; - AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */ - AccessRanges[AssignedCount].RangeShareable = - (Descriptor->ShareDisposition == CmResourceShareShared); - AccessRanges[AssignedCount].RangePassive = 0; - if (Descriptor->Flags & CM_RESOURCE_PORT_10_BIT_DECODE) - AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_10_BIT_DECODE; - if (Descriptor->Flags & CM_RESOURCE_PORT_PASSIVE_DECODE) - AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_PASSIVE_DECODE; - AssignedCount++; - } - else if (Descriptor->Type == CmResourceTypeInterrupt) - { - DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level; - DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector; - if (Descriptor->ShareDisposition == CmResourceShareShared) - DeviceExtension->InterruptShared = TRUE; - else - DeviceExtension->InterruptShared = FALSE; - } + ERR_(VIDEOPRT, "Too many access ranges found\n"); + return ERROR_NOT_ENOUGH_MEMORY; } - } - - return NO_ERROR; + if (Descriptor->Type == CmResourceTypeMemory) + { + INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n", + Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length); + AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start; + AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length; + AccessRanges[AssignedCount].RangeInIoSpace = 0; + AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */ + AccessRanges[AssignedCount].RangeShareable = + (Descriptor->ShareDisposition == CmResourceShareShared); + AccessRanges[AssignedCount].RangePassive = 0; + AssignedCount++; + } + else if (Descriptor->Type == CmResourceTypePort) + { + INFO_(VIDEOPRT, "Port range starting at 0x%04x length %d\n", + Descriptor->u.Port.Start.u.LowPart, Descriptor->u.Port.Length); + AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start; + AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length; + AccessRanges[AssignedCount].RangeInIoSpace = 1; + AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */ + AccessRanges[AssignedCount].RangeShareable = + (Descriptor->ShareDisposition == CmResourceShareShared); + AccessRanges[AssignedCount].RangePassive = 0; + if (Descriptor->Flags & CM_RESOURCE_PORT_10_BIT_DECODE) + AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_10_BIT_DECODE; + if (Descriptor->Flags & CM_RESOURCE_PORT_PASSIVE_DECODE) + AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_PASSIVE_DECODE; + AssignedCount++; + } + else if (Descriptor->Type == CmResourceTypeInterrupt) + { + DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level; + DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector; + if (Descriptor->ShareDisposition == CmResourceShareShared) + DeviceExtension->InterruptShared = TRUE; + else + DeviceExtension->InterruptShared = FALSE; + } + } + + return NO_ERROR; } /*
9 years, 2 months
1
0
0
0
[akhaldi] 69572: [NOTEPAD] Set Lucida Console as the default font. By Ismael Ferreras Morezuelas. CORE-10316
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Oct 17 19:01:40 2015 New Revision: 69572 URL:
http://svn.reactos.org/svn/reactos?rev=69572&view=rev
Log: [NOTEPAD] Set Lucida Console as the default font. By Ismael Ferreras Morezuelas. CORE-10316 Modified: trunk/reactos/base/applications/notepad/settings.c Modified: trunk/reactos/base/applications/notepad/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/settings.c [iso-8859-1] Sat Oct 17 19:01:40 2015 @@ -173,7 +173,7 @@ Globals.lfFont.lfCharSet = 163; Globals.lfFont.lfClipPrecision = 2; Globals.lfFont.lfEscapement = 0; - _tcscpy(Globals.lfFont.lfFaceName, _T("Arial")); + _tcscpy(Globals.lfFont.lfFaceName, _T("Lucida Console")); Globals.lfFont.lfItalic = 0; Globals.lfFont.lfOrientation = 0; Globals.lfFont.lfOutPrecision = 3;
9 years, 2 months
1
0
0
0
[tfaber] 69571: [NTOS:OB] - Create kernel handles if requested by the caller in ObDuplicateObject CORE-10207
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Oct 17 18:37:49 2015 New Revision: 69571 URL:
http://svn.reactos.org/svn/reactos?rev=69571&view=rev
Log: [NTOS:OB] - Create kernel handles if requested by the caller in ObDuplicateObject CORE-10207 Modified: trunk/reactos/ntoskrnl/ob/obhandle.c Modified: trunk/reactos/ntoskrnl/ob/obhandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] Sat Oct 17 18:37:49 2015 @@ -2150,6 +2150,8 @@ PHANDLE_TABLE HandleTable; OBJECT_HANDLE_INFORMATION HandleInformation; ULONG AuditMask; + BOOLEAN KernelHandle = FALSE; + PAGED_CODE(); OBTRACE(OB_HANDLE_DEBUG, "%s - Duplicating handle: %p for %p into %p\n", @@ -2222,6 +2224,14 @@ return Status; } + /* Create a kernel handle if asked, but only in the system process */ + if (PreviousMode == KernelMode && + HandleAttributes & OBJ_KERNEL_HANDLE && + TargetProcess == PsInitialSystemProcess) + { + KernelHandle = TRUE; + } + /* Get the target handle table */ HandleTable = ObReferenceProcessHandleTable(TargetProcess); if (!HandleTable) @@ -2374,6 +2384,12 @@ /* Deference the object and set failure status */ ObDereferenceObject(SourceObject); Status = STATUS_INSUFFICIENT_RESOURCES; + } + + /* Mark it as a kernel handle if requested */ + if (KernelHandle) + { + NewHandle = ObMarkHandleAsKernelHandle(NewHandle); } /* Return the handle */
9 years, 2 months
1
0
0
0
[tfaber] 69570: [KMTESTS:OB] - Add a test showing that I was wrong and ZwDuplicateObject can get you a kernel handle after all CORE-10207
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Oct 17 17:41:43 2015 New Revision: 69570 URL:
http://svn.reactos.org/svn/reactos?rev=69570&view=rev
Log: [KMTESTS:OB] - Add a test showing that I was wrong and ZwDuplicateObject can get you a kernel handle after all CORE-10207 Modified: trunk/rostests/kmtests/ntos_ob/ObHandle.c Modified: trunk/rostests/kmtests/ntos_ob/ObHandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObHandle.…
============================================================================== --- trunk/rostests/kmtests/ntos_ob/ObHandle.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ob/ObHandle.c [iso-8859-1] Sat Oct 17 17:41:43 2015 @@ -24,6 +24,8 @@ #define KERNEL_HANDLE_FLAG ((ULONG_PTR)0xFFFFFFFF80000000) #define IsUserHandle(h) (((ULONG_PTR)(h) & KERNEL_HANDLE_FLAG) == 0) #define IsKernelHandle(h) (((ULONG_PTR)(h) & KERNEL_HANDLE_FLAG) == KERNEL_HANDLE_FLAG) + +static HANDLE SystemProcessHandle; static VOID @@ -81,6 +83,34 @@ CheckObject(Handle, 2UL, 1UL, 0UL, DIRECTORY_ALL_ACCESS); } } + + /* If TargetProcess is the System process, we do get a kernel handle */ + Status = ZwDuplicateObject(ZwCurrentProcess(), + Handle, + SystemProcessHandle, + &NewHandle, + DIRECTORY_ALL_ACCESS, + OBJ_KERNEL_HANDLE, + 0); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status), "DuplicateHandle failed\n")) + { + ok(IsKernelHandle(NewHandle), "New handle = %p\n", NewHandle); + CheckObject(NewHandle, 3UL, 2UL, 0, DIRECTORY_ALL_ACCESS); + CheckObject(Handle, 3UL, 2UL, 0UL, DIRECTORY_ALL_ACCESS); + + Status = ObCloseHandle(NewHandle, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + CheckObject(NewHandle, 3UL, 2UL, 0, DIRECTORY_ALL_ACCESS); + CheckObject(Handle, 3UL, 2UL, 0UL, DIRECTORY_ALL_ACCESS); + + if (IsKernelHandle(NewHandle)) + { + Status = ObCloseHandle(NewHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckObject(Handle, 2UL, 1UL, 0UL, DIRECTORY_ALL_ACCESS); + } + } } START_TEST(ObHandle) @@ -90,6 +120,19 @@ HANDLE KernelDirectoryHandle; HANDLE UserDirectoryHandle; + Status = ObOpenObjectByPointer(PsInitialSystemProcess, + OBJ_KERNEL_HANDLE, + NULL, + PROCESS_ALL_ACCESS, + *PsProcessType, + KernelMode, + &SystemProcessHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + if (skip(NT_SUCCESS(Status), "No handle for system process\n")) + { + SystemProcessHandle = NULL; + } + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, @@ -208,4 +251,9 @@ Status = ObCloseHandle((HANDLE)123, KernelMode); Status = ObCloseHandle((HANDLE)(123 | 0x80000000), KernelMode);*/ KmtEndSeh(STATUS_SUCCESS); + + if (SystemProcessHandle) + { + ObCloseHandle(SystemProcessHandle, KernelMode); + } }
9 years, 2 months
1
0
0
0
[tfaber] 69569: [NDIS] - ZwDuplicateObject always returns user handles, so don't use it when we want a kernel handle. CORE-10207
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Oct 17 16:24:14 2015 New Revision: 69569 URL:
http://svn.reactos.org/svn/reactos?rev=69569&view=rev
Log: [NDIS] - ZwDuplicateObject always returns user handles, so don't use it when we want a kernel handle. CORE-10207 Modified: trunk/reactos/drivers/network/ndis/ndis/config.c Modified: trunk/reactos/drivers/network/ndis/ndis/config.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Sat Oct 17 16:24:14 2015 @@ -215,14 +215,19 @@ PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext; PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext; HANDLE RootKeyHandle = WrapperContext->RegistryHandle; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING NoName = RTL_CONSTANT_STRING(L""); NDIS_DbgPrint(MAX_TRACE, ("Called\n")); *ConfigurationHandle = NULL; - *Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle, - NtCurrentProcess(), &KeyHandle, 0, 0, - DUPLICATE_SAME_ACCESS); + InitializeObjectAttributes(&ObjectAttributes, + &NoName, + OBJ_KERNEL_HANDLE, + RootKeyHandle, + NULL); + *Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &ObjectAttributes); if(!NT_SUCCESS(*Status)) { NDIS_DbgPrint(MIN_TRACE, ("Failed to open registry configuration for this miniport\n"));
9 years, 2 months
1
0
0
0
[tfaber] 69568: [KMTESTS:OB] - Move handle tests from ObReference to ObHandle where they belong
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Oct 17 16:11:12 2015 New Revision: 69568 URL:
http://svn.reactos.org/svn/reactos?rev=69568&view=rev
Log: [KMTESTS:OB] - Move handle tests from ObReference to ObHandle where they belong Modified: trunk/rostests/kmtests/ntos_ob/ObHandle.c trunk/rostests/kmtests/ntos_ob/ObReference.c Modified: trunk/rostests/kmtests/ntos_ob/ObHandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObHandle.…
============================================================================== --- trunk/rostests/kmtests/ntos_ob/ObHandle.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ob/ObHandle.c [iso-8859-1] Sat Oct 17 16:11:12 2015 @@ -6,8 +6,8 @@ */ #include <kmt_test.h> - -#include <ndk/obfuncs.h> +#define NDEBUG +#include <debug.h> #define CheckObject(Handle, Pointers, Handles, Attrib, Access) do \ { \ @@ -133,4 +133,79 @@ Status = ObCloseHandle(KernelDirectoryHandle, KernelMode); ok_eq_hex(Status, STATUS_SUCCESS); } + + /* Tests for closing handles */ + KmtStartSeh() + /* NtClose must accept everything */ + DPRINT("Closing null handle (NtClose)\n"); + Status = NtClose(NULL); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing null kernel handle (NtClose)\n"); + Status = NtClose((HANDLE)0x80000000); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing -1 handle (NtClose)\n"); + Status = NtClose((HANDLE)0x7FFFFFFF); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing -1 kernel handle (NtClose)\n"); + Status = NtClose((HANDLE)0xFFFFFFFF); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing 123 handle (NtClose)\n"); + Status = NtClose((HANDLE)123); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing 123 kernel handle (NtClose)\n"); + Status = NtClose((HANDLE)(123 | 0x80000000)); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + + /* ObCloseHandle with UserMode accepts everything */ + DPRINT("Closing null handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle(NULL, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing null kernel handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle((HANDLE)0x80000000, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing -1 handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle((HANDLE)0x7FFFFFFF, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing -1 kernel handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle((HANDLE)0xFFFFFFFF, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing 123 handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle((HANDLE)123, UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing 123 kernel handle (ObCloseHandle, UserMode)\n"); + Status = ObCloseHandle((HANDLE)(123 | 0x80000000), UserMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + + /* ZwClose only accepts 0 and -1 */ + DPRINT("Closing null handle (ZwClose)\n"); + Status = ZwClose(NULL); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing null kernel handle (ZwClose)\n"); + Status = ZwClose((HANDLE)0x80000000); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + /* INVALID_KERNEL_HANDLE, 0x7FFFFFFF + Status = ZwClose((HANDLE)0x7FFFFFFF);*/ + DPRINT("Closing -1 kernel handle (ZwClose)\n"); + Status = ZwClose((HANDLE)0xFFFFFFFF); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + /* INVALID_KERNEL_HANDLE, 0x7B, 1, 0, 0 + Status = ZwClose((HANDLE)123); + Status = ZwClose((HANDLE)(123 | 0x80000000));*/ + + /* ObCloseHandle with KernelMode accepts only 0 and -1 */ + DPRINT("Closing null handle (ObCloseHandle, KernelMode)\n"); + Status = ObCloseHandle(NULL, KernelMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + DPRINT("Closing null kernel handle (ObCloseHandle, KernelMode)\n"); + Status = ObCloseHandle((HANDLE)0x80000000, KernelMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + /* INVALID_KERNEL_HANDLE, 0x7FFFFFFF, 1, 0, 0 + Status = ObCloseHandle((HANDLE)0x7FFFFFFF, KernelMode);*/ + DPRINT("Closing -1 kernel handle (ObCloseHandle, KernelMode)\n"); + Status = ObCloseHandle((HANDLE)0xFFFFFFFF, KernelMode); + ok_eq_hex(Status, STATUS_INVALID_HANDLE); + /* INVALID_KERNEL_HANDLE, 0x7B, 1, 0, 0 + Status = ObCloseHandle((HANDLE)123, KernelMode); + Status = ObCloseHandle((HANDLE)(123 | 0x80000000), KernelMode);*/ + KmtEndSeh(STATUS_SUCCESS); } Modified: trunk/rostests/kmtests/ntos_ob/ObReference.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_ob/ObReferen…
============================================================================== --- trunk/rostests/kmtests/ntos_ob/ObReference.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_ob/ObReference.c [iso-8859-1] Sat Oct 17 16:11:12 2015 @@ -239,81 +239,6 @@ Status = ObReferenceObjectByPointer(NULL, 0, NULL, UserMode); Status = ObReferenceObjectByPointer(NULL, 0, NULL, KernelMode);*/ - KmtStartSeh() - /* TODO: this belongs in an ObHandle test if we ever have one */ - /* NtClose must accept everything */ - DPRINT("Closing null handle (NtClose)\n"); - Status = NtClose(NULL); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing null kernel handle (NtClose)\n"); - Status = NtClose((HANDLE)0x80000000); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing -1 handle (NtClose)\n"); - Status = NtClose((HANDLE)0x7FFFFFFF); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing -1 kernel handle (NtClose)\n"); - Status = NtClose((HANDLE)0xFFFFFFFF); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing 123 handle (NtClose)\n"); - Status = NtClose((HANDLE)123); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing 123 kernel handle (NtClose)\n"); - Status = NtClose((HANDLE)(123 | 0x80000000)); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - - /* ObCloseHandle with UserMode accepts everything */ - DPRINT("Closing null handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle(NULL, UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing null kernel handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle((HANDLE)0x80000000, UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing -1 handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle((HANDLE)0x7FFFFFFF, UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing -1 kernel handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle((HANDLE)0xFFFFFFFF, UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing 123 handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle((HANDLE)123, UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing 123 kernel handle (ObCloseHandle, UserMode)\n"); - Status = ObCloseHandle((HANDLE)(123 | 0x80000000), UserMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - - /* ZwClose only accepts 0 and -1 */ - DPRINT("Closing null handle (ZwClose)\n"); - Status = ZwClose(NULL); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing null kernel handle (ZwClose)\n"); - Status = ZwClose((HANDLE)0x80000000); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - /* INVALID_KERNEL_HANDLE, 0x7FFFFFFF - Status = ZwClose((HANDLE)0x7FFFFFFF);*/ - DPRINT("Closing -1 kernel handle (ZwClose)\n"); - Status = ZwClose((HANDLE)0xFFFFFFFF); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - /* INVALID_KERNEL_HANDLE, 0x7B, 1, 0, 0 - Status = ZwClose((HANDLE)123); - Status = ZwClose((HANDLE)(123 | 0x80000000));*/ - - /* ObCloseHandle with KernelMode accepts only 0 and -1 */ - DPRINT("Closing null handle (ObCloseHandle, KernelMode)\n"); - Status = ObCloseHandle(NULL, KernelMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - DPRINT("Closing null kernel handle (ObCloseHandle, KernelMode)\n"); - Status = ObCloseHandle((HANDLE)0x80000000, KernelMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - /* INVALID_KERNEL_HANDLE, 0x7FFFFFFF, 1, 0, 0 - Status = ObCloseHandle((HANDLE)0x7FFFFFFF, KernelMode);*/ - DPRINT("Closing -1 kernel handle (ObCloseHandle, KernelMode)\n"); - Status = ObCloseHandle((HANDLE)0xFFFFFFFF, KernelMode); - ok_eq_hex(Status, STATUS_INVALID_HANDLE); - /* INVALID_KERNEL_HANDLE, 0x7B, 1, 0, 0 - Status = ObCloseHandle((HANDLE)123, KernelMode); - Status = ObCloseHandle((HANDLE)(123 | 0x80000000), KernelMode);*/ - KmtEndSeh(STATUS_SUCCESS); - if (ObDirectoryObjectType) { ObDereferenceObject(ObDirectoryObjectType);
9 years, 2 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200