Implemented FsRtlDissectName().

svn path=/trunk/; revision=7101
This commit is contained in:
Eric Kohl 2003-12-17 20:27:06 +00:00
parent 1fc5217c9b
commit 4f2ee03f8d
2 changed files with 82 additions and 39 deletions

View file

@ -1,6 +1,6 @@
#ifndef __INCLUDE_DDK_FSFUNCS_H #ifndef __INCLUDE_DDK_FSFUNCS_H
#define __INCLUDE_DDK_FSFUNCS_H #define __INCLUDE_DDK_FSFUNCS_H
/* $Id: fsfuncs.h,v 1.21 2003/10/11 20:40:21 navaraf Exp $ */ /* $Id: fsfuncs.h,v 1.22 2003/12/17 20:27:06 ekohl Exp $ */
#define FlagOn(x,f) ((x) & (f)) #define FlagOn(x,f) ((x) & (f))
#include <ntos/fstypes.h> #include <ntos/fstypes.h>
@ -153,14 +153,12 @@ FsRtlDissectDbcs (
DWORD Unknown2, DWORD Unknown2,
DWORD Unknown3 DWORD Unknown3
); );
VOID
STDCALL VOID STDCALL
FsRtlDissectName ( FsRtlDissectName (IN UNICODE_STRING Name,
DWORD Unknown0, OUT PUNICODE_STRING FirstPart,
DWORD Unknown1, OUT PUNICODE_STRING RemainingPart);
DWORD Unknown2,
DWORD Unknown3
);
BOOLEAN BOOLEAN
STDCALL STDCALL
FsRtlDoesDbcsContainWildCards ( FsRtlDoesDbcsContainWildCards (

View file

@ -1,4 +1,4 @@
/* $Id: name.c,v 1.7 2003/07/10 16:43:10 ekohl Exp $ /* $Id: name.c,v 1.8 2003/12/17 20:26:28 ekohl Exp $
* *
* reactos/ntoskrnl/fs/name.c * reactos/ntoskrnl/fs/name.c
* *
@ -25,16 +25,13 @@ PUCHAR * FsRtlLegalAnsiCharacterArray = NULL;
* *
* @unimplemented * @unimplemented
*/ */
BOOLEAN BOOLEAN STDCALL
STDCALL FsRtlAreNamesEqual (IN PUNICODE_STRING Name1,
FsRtlAreNamesEqual ( IN PUNICODE_STRING Name2,
IN PUNICODE_STRING Name1, IN BOOLEAN IgnoreCase,
IN PUNICODE_STRING Name2, IN PWCHAR UpcaseTable OPTIONAL)
IN BOOLEAN IgnoreCase,
IN PWCHAR UpcaseTable OPTIONAL
)
{ {
return FALSE; return FALSE;
} }
@ -43,22 +40,74 @@ FsRtlAreNamesEqual (
* FsRtlDissectName@16 * FsRtlDissectName@16
* *
* DESCRIPTION * DESCRIPTION
* Dissects a given path name into first and remaining part.
* *
* ARGUMENTS * ARGUMENTS
* Name
* Unicode string to dissect.
*
* FirstPart
* Pointer to user supplied UNICODE_STRING, that will
* later point to the first part of the original name.
*
* RemainingPart
* Pointer to user supplied UNICODE_STRING, that will
* later point to the remaining part of the original name.
* *
* RETURN VALUE * RETURN VALUE
* None
* *
* @unimplemented * EXAMPLE
* Name: \test1\test2\test3
* FirstPart: test1
* RemainingPart: test2\test3
*
* @implemented
*/ */
VOID VOID STDCALL
STDCALL FsRtlDissectName (IN UNICODE_STRING Name,
FsRtlDissectName ( OUT PUNICODE_STRING FirstPart,
DWORD Unknown0, OUT PUNICODE_STRING RemainingPart)
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{ {
USHORT NameOffset = 0;
USHORT NameLength = 0;
USHORT Length;
FirstPart->Length = 0;
FirstPart->MaximumLength = 0;
FirstPart->Buffer = NULL;
RemainingPart->Length = 0;
RemainingPart->MaximumLength = 0;
RemainingPart->Buffer = NULL;
if (Name.Length == 0)
return;
/* Skip leading backslash */
if (Name.Buffer[0] == L'\\')
NameOffset++;
Length = Name.Length / sizeof(WCHAR);
/* Search for next backslash or end-of-string */
while ((NameOffset + NameLength <= Length) &&
(Name.Buffer[NameOffset + NameLength] != L'\\'))
{
NameLength++;
}
FirstPart->Length = NameLength * sizeof(WCHAR);
FirstPart->MaximumLength = NameLength * sizeof(WCHAR);
FirstPart->Buffer = &Name.Buffer[NameOffset];
NameOffset += (NameLength + 1);
if (NameOffset < Length)
{
RemainingPart->Length = (Length - NameOffset) * sizeof(WCHAR);
RemainingPart->MaximumLength = (Length - NameOffset) * sizeof(WCHAR);
RemainingPart->Buffer = &Name.Buffer[NameOffset];
}
} }
@ -95,7 +144,7 @@ FsRtlDoesNameContainWildCards (IN PUNICODE_STRING Name)
return FALSE; return FALSE;
/* Check for wildcards */ /* Check for wildcards */
if ((*Ptr < '@') && if ((*Ptr < L'@') &&
(*Ptr == L'\"' || *Ptr == L'*' || *Ptr == L'<' || (*Ptr == L'\"' || *Ptr == L'*' || *Ptr == L'<' ||
*Ptr == L'>' || *Ptr == L'?')) *Ptr == L'>' || *Ptr == L'?'))
return TRUE; return TRUE;
@ -123,17 +172,13 @@ FsRtlDoesNameContainWildCards (IN PUNICODE_STRING Name)
* *
* @unimplemented * @unimplemented
*/ */
BOOLEAN BOOLEAN STDCALL
STDCALL FsRtlIsNameInExpression (IN PUNICODE_STRING Expression,
FsRtlIsNameInExpression ( IN PUNICODE_STRING Name,
IN PUNICODE_STRING Expression, IN BOOLEAN IgnoreCase,
IN PUNICODE_STRING Name, IN PWCHAR UpcaseTable OPTIONAL)
IN BOOLEAN IgnoreCase,
IN PWCHAR UpcaseTable OPTIONAL
)
{ {
return FALSE; return FALSE;
} }
/* EOF */ /* EOF */