From d43aa2dd364709b08c8c89657cfc324bdc6b5eab Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 2 Dec 2012 16:42:54 +0000 Subject: [PATCH] [FASTFAT] Handle special cases with search patterns in DoQuery(). This may (should?) fix kernel32_winetest::path test Ref: WDK svn path=/trunk/; revision=57789 --- reactos/drivers/filesystems/fastfat/dir.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/dir.c b/reactos/drivers/filesystems/fastfat/dir.c index 9195b3bb02b..9522cb1d88f 100644 --- a/reactos/drivers/filesystems/fastfat/dir.c +++ b/reactos/drivers/filesystems/fastfat/dir.c @@ -427,7 +427,15 @@ DoQuery(PVFAT_IRP_CONTEXT IrpContext) #endif FileInformationClass = Stack->Parameters.QueryDirectory.FileInformationClass; - if (pSearchPattern) + /* Allocate search pattern in case: + * -> We don't have one already in context + * -> We have been given an input pattern + * -> The pattern length is not null + * -> The pattern buffer is not null + * Otherwise, we'll fall later and allocate a match all (*) pattern + */ + if (pSearchPattern && + pSearchPattern->Length != 0 && pSearchPattern->Buffer != NULL) { if (!pCcb->SearchPattern.Buffer) { @@ -606,4 +614,4 @@ VfatDirectoryControl(PVFAT_IRP_CONTEXT IrpContext) return Status; } -/* EOF */ \ No newline at end of file +/* EOF */