* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: create.c,v 1.73 2004/08/28 22:19:12 navaraf Exp $
+/* $Id: create.c,v 1.74 2004/08/31 16:08:37 navaraf Exp $
*
* PROJECT: ReactOS kernel
* FILE: drivers/fs/vfat/create.c
PVOID Context = NULL;
PVOID Page;
PVFATFCB rcFcb;
- BOOLEAN FoundLong;
- BOOLEAN FoundShort = FALSE;
+ BOOLEAN Found;
UNICODE_STRING PathNameU;
BOOLEAN WildCard;
- PWCHAR curr, last;
DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n",
Parent, FileToFindU, DirContext->DirIndex);
DirContext->LongNameU.Length = 0;
DirContext->ShortNameU.Length = 0;
- /* FIXME: Use FsRtlDoesNameContainWildCards */
- WildCard = FALSE;
- curr = FileToFindU->Buffer;
- last = FileToFindU->Buffer + FileToFindU->Length / sizeof(WCHAR);
- while (curr < last)
- {
- if (*curr == L'?' || *curr == L'*')
- {
- WildCard = TRUE;
- break;
- }
- curr++;
- }
+ WildCard = FsRtlDoesNameContainWildCards(FileToFindU);
if (WildCard == FALSE)
{
DirContext->DirIndex++;
continue;
}
- DirContext->LongNameU.Buffer[DirContext->LongNameU.Length / sizeof(WCHAR)] = 0;
- DirContext->ShortNameU.Buffer[DirContext->ShortNameU.Length / sizeof(WCHAR)] = 0;
if (WildCard)
{
- /* FIXME: Use FsRtlIsNameInExpression */
- if (DirContext->LongNameU.Length > 0 &&
- wstrcmpjoki (DirContext->LongNameU.Buffer, FileToFindU->Buffer))
- {
- FoundLong = TRUE;
- }
- else
- {
- FoundLong = FALSE;
- }
- if (FoundLong == FALSE)
- {
- /* FIXME: Use FsRtlIsNameInExpression */
- FoundShort = wstrcmpjoki (DirContext->ShortNameU.Buffer, FileToFindU->Buffer);
- }
- else
- {
- FoundShort = FALSE;
- }
+ Found = FsRtlIsNameInExpression(FileToFindU, &DirContext->LongNameU, TRUE, NULL) ||
+ FsRtlIsNameInExpression(FileToFindU, &DirContext->ShortNameU, TRUE, NULL);
}
else
{
- FoundLong = RtlEqualUnicodeString(&DirContext->LongNameU, FileToFindU, TRUE);
- if (FoundLong == FALSE)
- {
- FoundShort = RtlEqualUnicodeString(&DirContext->ShortNameU, FileToFindU, TRUE);
- }
+ /* FIXME: Use FsRtlAreNamesEqual */
+ Found = RtlEqualUnicodeString(&DirContext->LongNameU, FileToFindU, TRUE) ||
+ RtlEqualUnicodeString(&DirContext->ShortNameU, FileToFindU, TRUE);
}
- if (FoundLong || FoundShort)
+ if (Found)
{
if (WildCard)
{
-/* $Id: string.c,v 1.12 2003/10/11 17:51:56 hbirr Exp $
+/* $Id: string.c,v 1.13 2004/08/31 16:08:38 navaraf Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
{
return wcschr(long_illegals, c) ? TRUE : FALSE;
}
-
-BOOLEAN wstrcmpjoki(PWSTR s1, PWSTR s2)
-/*
- * FUNCTION: Compare two wide character strings, s2 with jokers (* or ?)
- * return TRUE if s1 like s2
- */
-{
- while ((*s2==L'*')||(*s2==L'?')||(RtlUpcaseUnicodeChar(*s1)==RtlUpcaseUnicodeChar(*s2)))
- {
- if ((*s1)==0 && (*s2)==0)
- return(TRUE);
- if(*s2=='*')
- {
- s2++;
- while (*s1)
- if (wstrcmpjoki(s1,s2)) return TRUE;
- else s1++;
- }
- else
- {
- s1++;
- s2++;
- }
- }
- if ((*s2)==L'.')
- {
- for (;((*s2)==L'.')||((*s2)==L'*')||((*s2)==L'?');s2++) {}
- }
- if ((*s1)==0 && (*s2)==0)
- return(TRUE);
- return(FALSE);
-}
-
-
-
-
-