First try at implementing PathGetCharType().
diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c
index 6f35999..dac041a 100644
--- a/dlls/shlwapi/path.c
+++ b/dlls/shlwapi/path.c
@@ -1617,8 +1617,23 @@
*/
UINT WINAPI PathGetCharTypeA(UCHAR ch)
{
- FIXME("%c\n", ch);
- return 0;
+ UINT flags = 0;
+
+ TRACE("%c\n", ch);
+
+ /* We could use them in filenames, but this would confuse 'ls' */
+ if (iscntrl(ch))
+ return GCT_INVALID;
+ if ((ch == '*') || (ch=='?'))
+ return GCT_WILD;
+ if ((ch == '\\') || (ch=='/'))
+ return GCT_SEPARATOR;
+ flags = 0;
+ /* all normal characters, no lower case letters */
+ if ((ch > ' ') && (ch < 0x7f) && !islower(ch))
+ flags |= GCT_SHORTCHAR;
+ /* All other characters are valid in long filenames, even umlauts */
+ return flags | GCT_LFNCHAR;
}
/*************************************************************************
@@ -1626,8 +1641,8 @@
*/
UINT WINAPI PathGetCharTypeW(WCHAR ch)
{
- FIXME("%c\n", ch);
- return 0;
+ FIXME("%c, using ascii version\n", ch);
+ return PathGetCharTypeA(ch);
}
/*************************************************************************
diff --git a/include/shlwapi.h b/include/shlwapi.h
index 64f5a57..d8104d2 100644
--- a/include/shlwapi.h
+++ b/include/shlwapi.h
@@ -8,6 +8,13 @@
#endif /* defined(__cplusplus) */
+/* Mask returned by GetPathCharType */
+#define GCT_INVALID 0x0000
+#define GCT_LFNCHAR 0x0001
+#define GCT_SHORTCHAR 0x0002
+#define GCT_WILD 0x0004
+#define GCT_SEPARATOR 0x0008
+
/*
* The URL_ defines were determined by trial and error. If they become
* documented please check them and add the missing ones including: