[ros-kernel] regfile.c and ldr/*.c OBJ_CASE_INSENSITIVE
art yerkes
ayerkes at speakeasy.net
Tue Sep 21 17:57:12 CEST 2004
On Tue, 21 Sep 2004 22:22:12 +0200
Filip Navara <xnavara at volny.cz> wrote:
> art yerkes wrote:
>
> >Both of these areas in reactos open files with a 0 flags. This is ok on
> >VFAT it seems because our vfatfs never considers case in file name matches.
> >In the ext2 driver and possibly some others we will run into, though,
> >case matters if not disabled with OBJ_CASE_INSENSITIVE. I propose to
> >patch these calls to InitializeObjectAttributes to be case insensitive.
> >
> >Any objections?
> >
> No objections, but can you make the filenames lowercase in "cm.h"
> please? The EXT2 driver we use doesn't support case insensitive file
> name handling...
Well it didn't. After you left IRC I fixed that.
--
Hey, Adam Smith, keep your invisible hands to yourself!
-------------- next part --------------
diff -ur e2/inc/protos.h ./inc/protos.h
--- e2/inc/protos.h 2004-09-05 13:03:26.000000000 -0500
+++ ./inc/protos.h 2004-09-21 16:01:35.057404544 -0500
@@ -92,7 +92,8 @@
PtrExt2VCB PtrVCB,
PUNICODE_STRING PtrCurrentName,
PtrExt2FCB PtrParentFCB,
- ULONG *Type );
+ ULONG *Type,
+ BOOLEAN IgnoreCase );
extern ULONG STDCALL Ext2CreateFile(
PtrExt2IrpContext PtrIrpContext,
diff -ur e2/src/create.c ./src/create.c
--- e2/src/create.c 2004-09-05 13:51:40.000000000 -0500
+++ ./src/create.c 2004-09-21 16:48:06.908978592 -0500
@@ -294,7 +294,9 @@
OpenByFileId = ((RequestedOptions & FILE_OPEN_BY_FILE_ID) ? TRUE : FALSE);
PageFileManipulation = ((PtrIoStackLocation->Flags & SL_OPEN_PAGING_FILE) ? TRUE : FALSE);
OpenTargetDirectory = ((PtrIoStackLocation->Flags & SL_OPEN_TARGET_DIRECTORY) ? TRUE : FALSE);
- IgnoreCaseWhenChecking = ((PtrIoStackLocation->Flags & SL_CASE_SENSITIVE) ? TRUE : FALSE);
+ IgnoreCaseWhenChecking = ((PtrIoStackLocation->Flags & SL_CASE_SENSITIVE) ? FALSE : TRUE);
+
+ DebugTrace( DEBUG_TRACE_FILE_NAME, " === Create/Open was Case %s", IgnoreCaseWhenChecking ? "Insensitive" : "Sensitive" );
// Ensure that the operation has been directed to a valid VCB ...
PtrVCB = (PtrExt2VCB)(PtrIrpContext->TargetDeviceObject->DeviceExtension);
@@ -572,7 +574,7 @@
}
else // searching on the disk...
{
- CurrInodeNo = Ext2LocateFileInDisk( PtrVCB, &CurrentName, PtrCurrFCB, &Type );
+ CurrInodeNo = Ext2LocateFileInDisk( PtrVCB, &CurrentName, PtrCurrFCB, &Type, IgnoreCaseWhenChecking );
if( !CurrInodeNo )
{
//
@@ -1219,7 +1221,8 @@
PtrExt2VCB PtrVCB,
PUNICODE_STRING PtrCurrentName,
PtrExt2FCB PtrParentFCB,
- ULONG *Type )
+ ULONG *Type,
+ BOOLEAN IgnoreCase )
{
PtrExt2FCB PtrNewFCB = NULL;
@@ -1350,14 +1353,13 @@
for( i = 0, Found = TRUE ; i < PtrDirEntry->name_len ; i++ )
{
- if( PtrDirEntry->name[ i ] != PtrCurrentName->Buffer[ i ] )
- {
- Found = FALSE;
- break;
-
- }
+ if( PtrDirEntry->name[ i ] != PtrCurrentName->Buffer[ i ] &&
+ (!IgnoreCase || RtlUpperChar(PtrDirEntry->name[i]) != RtlUpperChar(PtrCurrentName->Buffer[i])) ) {
+ Found = FALSE;
+ break;
+
+ }
}
-
}
if( Found )
{
More information about the Ros-kernel
mailing list