58 if (!
Name.Length)
return;
61 FirstPosition =
Name.Length;
62 for (
i = 0;
i <
Name.Length;
i++)
70 else if (
Name.Buffer[
i] ==
'\\')
92 if (FirstPosition < (
Name.Length))
123 for (
i = 0;
i <
Name->Length;
i++)
164 USHORT BackTrackingBuffer[16], OldBackTrackingBuffer[16] = {0};
165 PUSHORT BackTrackingSwap, BackTracking = BackTrackingBuffer, OldBackTracking = OldBackTrackingBuffer;
168 USHORT ExpressionPosition, NamePosition = 0, MatchingChars = 1;
169 USHORT NameChar = 0, ExpressionChar;
217 NamePosition = (
Name->Length - IntExpression.
Length) /
sizeof(
CHAR);
224 while (MatchingChars < NamePosition)
231 if (MatchingChars > NamePosition)
237 (
Name->Buffer + NamePosition),
243 for (; !EndOfName; MatchingChars = BackTrackingPosition)
246 OldBackTrackingPosition = BackTrackingPosition = 0;
248 if (NamePosition >=
Name->Length)
251 if (MatchingChars && OldBackTracking[MatchingChars - 1] ==
Expression->Length * 2)
259 NameChar =
Name->Buffer[NamePosition] +
260 (0x100 *
Name->Buffer[NamePosition + 1]);
261 NamePosition +=
sizeof(
USHORT);
265 NameChar =
Name->Buffer[NamePosition];
266 NamePosition +=
sizeof(
UCHAR);
270 while (MatchingChars > OldBackTrackingPosition)
272 ExpressionPosition = (OldBackTracking[OldBackTrackingPosition++] + 1) / 2;
277 ExpressionPosition +=
Offset;
281 BackTracking[BackTrackingPosition++] =
Expression->Length * 2;
286 if (BackTrackingPosition > BackTrackingBufferSize - 3)
290 ASSERT((BackTracking == BackTrackingBuffer) || (BackTracking == OldBackTrackingBuffer));
291 ASSERT((OldBackTracking == BackTrackingBuffer) || (OldBackTracking == OldBackTrackingBuffer));
294 BackTrackingBufferSize =
Expression->Length * 2 + 1;
298 2 * BackTrackingBufferSize *
sizeof(
USHORT),
300 if (AllocatedBuffer ==
NULL)
302 DPRINT1(
"Failed to allocate BackTracking buffer. BackTrackingBufferSize = =x%lx\n",
303 BackTrackingBufferSize);
314 BackTracking = AllocatedBuffer;
322 OldBackTracking = &BackTracking[BackTrackingBufferSize];
328 ExpressionChar =
Expression->Buffer[ExpressionPosition] +
329 (0x100 *
Expression->Buffer[ExpressionPosition + 1]);
334 ExpressionChar =
Expression->Buffer[ExpressionPosition];
339 if (ExpressionChar == NameChar && !EndOfName)
341 BackTracking[BackTrackingPosition++] = (ExpressionPosition +
Offset) * 2;
344 else if (ExpressionChar ==
'?' && !EndOfName)
346 BackTracking[BackTrackingPosition++] = (ExpressionPosition +
Offset) * 2;
349 else if (ExpressionChar ==
'*')
351 BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
352 BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1;
360 if (!EndOfName && NameChar ==
'.')
382 if (EndOfName || NameChar !=
'.' || !DontSkipDot)
383 BackTracking[BackTrackingPosition++] = ExpressionPosition * 2;
385 BackTracking[BackTrackingPosition++] = (ExpressionPosition * 2) + 1;
391 if (EndOfName)
continue;
394 BackTracking[BackTrackingPosition++] = (ExpressionPosition +
Offset) * 2;
399 if (EndOfName || NameChar ==
'.')
continue;
401 BackTracking[BackTrackingPosition++] = (ExpressionPosition +
Offset) * 2;
410 while (MatchingChars > OldBackTrackingPosition &&
411 BackTracking[
Position] > OldBackTracking[OldBackTrackingPosition])
413 ++OldBackTrackingPosition;
419 BackTrackingSwap = BackTracking;
420 BackTracking = OldBackTracking;
421 OldBackTracking = BackTrackingSwap;
425 Result = MatchingChars && (OldBackTracking[MatchingChars - 1] ==
Expression->Length * 2);
430 if (AllocatedBuffer !=
NULL)
477 if (!DbcsName.Length)
481 if (
WildCardsPermissible && (DbcsName.Length == 1 || DbcsName.Length == 2) && DbcsName.Buffer[0] ==
'.')
483 if (DbcsName.Length == 2)
485 if (DbcsName.Buffer[1] ==
'.')
500 DbcsName.Buffer = DbcsName.Buffer + 1;
501 DbcsName.Length = DbcsName.Length - 1;
502 DbcsName.MaximumLength = DbcsName.MaximumLength - 1;
534 for (
i = 0;
i < DbcsName.Length;
i++)
552 if (DbcsName.Length > 12)
558 for (
i = 0;
i < DbcsName.Length;
i++)
563 if (!LastDot && (
i >= 7))
566 if (
i == (DbcsName.Length - 1))
577 else if (DbcsName.Buffer[
i] ==
'.')
587 if (
i == (DbcsName.Length - 1) ||
i == 0)
591 if ((DbcsName.Length - 1) -
i > 3)
594 if ((
i > 0) && DbcsName.Buffer[
i - 1] ==
' ')
598 else if (DbcsName.Buffer[
i] ==
' ' &&
i == (DbcsName.Length - 1))
603 if (!LastDot && (
i >= 8))
648 if (!DbcsName.Length)
652 if (
WildCardsPermissible && (DbcsName.Length == 1 || DbcsName.Length == 2) && DbcsName.Buffer[0] ==
'.')
654 if (DbcsName.Length == 2)
656 if (DbcsName.Buffer[1] ==
'.')
671 DbcsName.Buffer = DbcsName.Buffer + 1;
672 DbcsName.Length = DbcsName.Length - 1;
673 DbcsName.MaximumLength = DbcsName.MaximumLength - 1;
703 if (DbcsName.Length > 255)
706 for (
i = 0;
i < DbcsName.Length;
i++)
711 if (
i == (DbcsName.Length - 1))
721 else if ((DbcsName.Buffer[
i] ==
' ' || DbcsName.Buffer[
i] ==
'.') &&
i == (DbcsName.Length - 1))
BOOLEAN NTAPI FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
BOOLEAN NTAPI FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN WildCardsPermissible, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible)
VOID NTAPI FsRtlDissectDbcs(IN ANSI_STRING Name, OUT PANSI_STRING FirstPart, OUT PANSI_STRING RemainingPart)
BOOLEAN NTAPI FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, IN PANSI_STRING Name)
BOOLEAN NTAPI FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN WildCardsPermissible, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible)
#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR)
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _In_ BOOLEAN _In_ BOOLEAN PathNamePermissible
#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD)
_Must_inspect_result_ _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN LeadingBackslashPermissible
_Out_ PANSI_STRING _Out_ PANSI_STRING RemainingPart
#define FsRtlIsAnsiCharacterWild(C)
#define FsRtlIsAnsiCharacterLegalFat(C, WILD)
_Out_ PANSI_STRING FirstPart
_Must_inspect_result_ _In_ BOOLEAN WildCardsPermissible
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define RtlEqualMemory(dst, src, len)
#define ExFreePoolWithTag(_P, _T)
BOOLEAN NlsMbOemCodePageTag
_In_ ULONG _In_ ULONG Offset
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define POOL_RAISE_IF_ALLOCATION_FAILURE