mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOSKRNL] Unify buffer size calculation in FsRtlIs{Name,Dbcs}InExpression
It better captures the intent now in FsRtlIsNameInExpressionPrivate and fixes a slight overallotion by 4 bytes in FsRtlIsDbcsInExpression. While at it, use the ANSI_DOS_DOT macro in the Dbcs version. CORE-15902
This commit is contained in:
parent
6eadbfb7e7
commit
695e00fbbd
2 changed files with 3 additions and 3 deletions
|
@ -291,7 +291,7 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||||
ASSERT((OldBackTracking == BackTrackingBuffer) || (OldBackTracking == OldBackTrackingBuffer));
|
ASSERT((OldBackTracking == BackTrackingBuffer) || (OldBackTracking == OldBackTrackingBuffer));
|
||||||
|
|
||||||
/* Calculate buffer size */
|
/* Calculate buffer size */
|
||||||
BackTrackingBufferSize = (Expression->Length + 1) * 2;
|
BackTrackingBufferSize = Expression->Length * 2 + 1;
|
||||||
|
|
||||||
/* Allocate memory for both back-tracking buffers */
|
/* Allocate memory for both back-tracking buffers */
|
||||||
AllocatedBuffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
AllocatedBuffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||||
|
@ -386,7 +386,7 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* Check DOS_DOT */
|
/* Check DOS_DOT */
|
||||||
else if (ExpressionChar == DOS_DOT)
|
else if (ExpressionChar == ANSI_DOS_DOT)
|
||||||
{
|
{
|
||||||
if (EndOfName) continue;
|
if (EndOfName) continue;
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||||
ASSERT((OldBackTracking == BackTrackingBuffer) || (OldBackTracking == OldBackTrackingBuffer));
|
ASSERT((OldBackTracking == BackTrackingBuffer) || (OldBackTracking == OldBackTrackingBuffer));
|
||||||
|
|
||||||
/* Calculate buffer size */
|
/* Calculate buffer size */
|
||||||
BackTrackingBufferSize = Expression->Length + 1;
|
BackTrackingBufferSize = Expression->Length / sizeof(WCHAR) * 2 + 1;
|
||||||
|
|
||||||
/* Allocate memory for both back-tracking buffers */
|
/* Allocate memory for both back-tracking buffers */
|
||||||
AllocatedBuffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
AllocatedBuffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE,
|
||||||
|
|
Loading…
Reference in a new issue