+libcaptive/fs/name.c
authorshort <>
Wed, 20 Nov 2002 14:08:43 +0000 (14:08 +0000)
committershort <>
Wed, 20 Nov 2002 14:08:43 +0000 (14:08 +0000)
 - +FsRtlDoesNameContainWildCards()

src/libcaptive/fs/name.c [new file with mode: 0644]

diff --git a/src/libcaptive/fs/name.c b/src/libcaptive/fs/name.c
new file mode 100644 (file)
index 0000000..b5839e2
--- /dev/null
@@ -0,0 +1,54 @@
+/* $Id$
+ * reactos filesystem name strings functions emulation of libcaptive
+ * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include "reactos/ddk/fsfuncs.h"       /* self */
+#include <glib/gmessages.h>
+#include "captive/unicode.h"
+#include "reactos/unicode.h"   /* for ANSI_* */
+
+
+/**
+ * FsRtlDoesNameContainWildCards:
+ * @Name: Filename to check for wildcards.
+ * %NULL value is forbidden.
+ * Non-zero terminated #PUNICODE_STRING is permitted.
+ *
+ * Check if @Name contains wildcard markers as its substring(s).
+ *
+ * Returns: %TRUE if @Name contains "*", "?", %ANSI_DOS_STAR, %ANSI_DOS_DOT or %ANSI_DOS_QM.
+ */
+BOOLEAN FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name_nonconst)
+{
+const UNICODE_STRING *cName=Name_nonconst;
+const WCHAR *wcp;
+
+       g_return_val_if_fail(captive_validate_UnicodeString_noterm(cName),FALSE);
+
+       for (wcp=cName->Buffer;wcp<cName->Buffer+(cName->Length/sizeof(*cName->Buffer));*wcp++)
+               if (0
+                               || *wcp=='*'
+                               || *wcp=='?'
+                               || *wcp==ANSI_DOS_STAR
+                               || *wcp==ANSI_DOS_DOT
+                               || *wcp==ANSI_DOS_QM)
+                       return TRUE;
+       return FALSE;
+}