mirror of
https://github.com/reactos/reactos.git
synced 2025-06-09 03:10:18 +00:00
[NTFS]
Don't bother comparing names if they have null length svn path=/trunk/; revision=69001
This commit is contained in:
parent
02a238acf4
commit
bff1ce32bc
1 changed files with 18 additions and 4 deletions
|
@ -87,22 +87,36 @@ FindAttribute(PDEVICE_EXTENSION Vcb,
|
||||||
ULONG NameLength,
|
ULONG NameLength,
|
||||||
PNTFS_ATTR_CONTEXT * AttrCtx)
|
PNTFS_ATTR_CONTEXT * AttrCtx)
|
||||||
{
|
{
|
||||||
|
BOOLEAN Found;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
FIND_ATTR_CONTXT Context;
|
FIND_ATTR_CONTXT Context;
|
||||||
PNTFS_ATTR_RECORD Attribute;
|
PNTFS_ATTR_RECORD Attribute;
|
||||||
|
|
||||||
DPRINT("FindAttribute(%p, %p, 0x%x, %S, %u, %p)\n", Vcb, MftRecord, Type, Name, NameLength, AttrCtx);
|
DPRINT("FindAttribute(%p, %p, 0x%x, %S, %u, %p)\n", Vcb, MftRecord, Type, Name, NameLength, AttrCtx);
|
||||||
|
|
||||||
|
Found = FALSE;
|
||||||
Status = FindFirstAttribute(&Context, Vcb, MftRecord, FALSE, &Attribute);
|
Status = FindFirstAttribute(&Context, Vcb, MftRecord, FALSE, &Attribute);
|
||||||
while (NT_SUCCESS(Status))
|
while (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
if (Attribute->Type == Type && Attribute->NameLength == NameLength)
|
if (Attribute->Type == Type && Attribute->NameLength == NameLength)
|
||||||
|
{
|
||||||
|
if (NameLength != 0)
|
||||||
{
|
{
|
||||||
PWCHAR AttrName;
|
PWCHAR AttrName;
|
||||||
|
|
||||||
AttrName = (PWCHAR)((PCHAR)Attribute + Attribute->NameOffset);
|
AttrName = (PWCHAR)((PCHAR)Attribute + Attribute->NameOffset);
|
||||||
DPRINT("%.*S, %.*S\n", Attribute->NameLength, AttrName, NameLength, Name);
|
DPRINT("%.*S, %.*S\n", Attribute->NameLength, AttrName, NameLength, Name);
|
||||||
if (RtlCompareMemory(AttrName, Name, NameLength << 1) == (NameLength << 1))
|
if (RtlCompareMemory(AttrName, Name, NameLength << 1) == (NameLength << 1))
|
||||||
|
{
|
||||||
|
Found = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Found = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Found)
|
||||||
{
|
{
|
||||||
/* Found it, fill up the context and return. */
|
/* Found it, fill up the context and return. */
|
||||||
DPRINT("Found context\n");
|
DPRINT("Found context\n");
|
||||||
|
|
Loading…
Reference in a new issue