3 * reactos/ntoskrnl/fs/dbcsname.c
9 /* DATA ********************************************************************/
11 static UCHAR LegalAnsiCharacterArray
[] =
47 FSRTL_WILD_CHARACTER
, /* `"', 0x22 */
55 FSRTL_WILD_CHARACTER
, /* `*', 0x2a */
73 FSRTL_WILD_CHARACTER
, /* `<', 0x3c */
75 FSRTL_WILD_CHARACTER
, /* `>', 0x3e */
76 FSRTL_WILD_CHARACTER
, /* `?', 0x3f */
77 FSRTL_WILD_CHARACTER
, /* `@', 0x40 */
143 PUCHAR EXPORTED FsRtlLegalAnsiCharacterArray
= LegalAnsiCharacterArray
;
146 /* FUNCTIONS ***************************************************************/
148 /**********************************************************************
150 * FsRtlDissectDbcs@16
152 * Dissects a given path name into first and remaining part.
156 * ANSI string to dissect.
159 * Pointer to user supplied ANSI_STRING, that will
160 * later point to the first part of the original name.
163 * Pointer to user supplied ANSI_STRING, that will
164 * later point to the remaining part of the original name.
170 * Name: \test1\test2\test3
172 * RemainingPart: test2\test3
177 FsRtlDissectDbcs(IN ANSI_STRING Name
,
178 OUT PANSI_STRING FirstPart
,
179 OUT PANSI_STRING RemainingPart
)
184 /* Initialize the Outputs */
185 RtlZeroMemory(&FirstPart
, sizeof(ANSI_STRING
));
186 RtlZeroMemory(&RemainingPart
, sizeof(ANSI_STRING
));
188 /* Bail out if empty */
189 if (!Name
.Length
) return;
191 /* Ignore backslash */
192 if (Name
.Buffer
[0] == '\\') {
198 /* Loop until we find a backslash */
199 for (FirstLoop
= i
;i
< Name
.Length
;i
++) {
200 if (Name
.Buffer
[i
] != '\\') break;
201 if (FsRtlIsLeadDbcsCharacter(Name
.Buffer
[i
])) i
++;
204 /* Now we have the First Part */
205 FirstPart
->Length
= (i
-FirstLoop
);
206 FirstPart
->MaximumLength
= FirstPart
->Length
; /* +2?? */
207 FirstPart
->Buffer
= &Name
.Buffer
[FirstLoop
];
209 /* Make the second part if something is still left */
211 RemainingPart
->Length
= (Name
.Length
- (i
+1));
212 RemainingPart
->MaximumLength
= RemainingPart
->Length
; /* +2?? */
213 RemainingPart
->Buffer
= &Name
.Buffer
[i
+1];
220 /**********************************************************************
222 * FsRtlDoesDbcsContainWildCards@4
233 FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name
)
237 /* Check every character */
238 for (i
=0;i
< Name
->Length
;i
++) {
240 /* First make sure it's not the Lead DBCS */
241 if (FsRtlIsLeadDbcsCharacter(Name
->Buffer
[i
])) {
243 } else if (FsRtlIsAnsiCharacterWild(Name
->Buffer
[i
])) {
244 /* Now return if it has a Wilcard */
249 /* We didn't return above...so none found */
253 /**********************************************************************
255 * FsRtlIsDbcsInExpression@8
267 FsRtlIsDbcsInExpression (
276 /**********************************************************************
278 * FsRtlIsFatDbcsLegal@20
290 FsRtlIsFatDbcsLegal (
302 /**********************************************************************
304 * FsRtlIsHpfsDbcsLegal@20
316 FsRtlIsHpfsDbcsLegal (