/*
- * PROJECT: ReactOS kernel-mode tests
- * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
- * PURPOSE: Test driver for kernel32 filesystem tests
- * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
+ * PROJECT: ReactOS kernel-mode tests
+ * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
+ * PURPOSE: Test driver for kernel32 filesystem tests
+ * COPYRIGHT: Copyright 2013-2017 Thomas Faber <thomas.faber@reactos.org>
*/
#include <kmt_test.h>
static UNICODE_STRING ExpectedExpression = RTL_CONSTANT_STRING(L"<not set>");
static WCHAR ExpressionBuffer[MAX_PATH];
+static BOOLEAN ExpectingSetAttributes = FALSE;
static ULONG ExpectedSetAttributes = -1;
+static BOOLEAN ExpectingQueryAttributes = FALSE;
static ULONG ReturnQueryAttributes = -1;
NTSTATUS
return STATUS_INVALID_PARAMETER;
ReturnQueryAttributes = *(PULONG)Buffer;
+ ExpectingQueryAttributes = TRUE;
DPRINT("IOCTL_RETURN_QUERY_ATTRIBUTES: %lu\n", ReturnQueryAttributes);
break;
}
return STATUS_INVALID_PARAMETER;
ExpectedSetAttributes = *(PULONG)Buffer;
+ ExpectingSetAttributes = TRUE;
DPRINT("IOCTL_EXPECT_SET_ATTRIBUTES: %lu\n", ExpectedSetAttributes);
break;
}
ok_eq_ulong(IoStackLocation->Parameters.QueryFile.FileInformationClass, FileBasicInformation);
if (IoStackLocation->Parameters.QueryFile.FileInformationClass == FileBasicInformation)
{
- ok(ReturnQueryAttributes != (ULONG)-1, "Unexpected QUERY_INFORMATION call\n");
+ ok(ExpectingQueryAttributes, "Unexpected QUERY_INFORMATION call\n");
BasicInfo = Irp->AssociatedIrp.SystemBuffer;
BasicInfo->CreationTime.QuadPart = 126011664000000000;
BasicInfo->LastAccessTime.QuadPart = 130899112800000000;
BasicInfo->ChangeTime.QuadPart = 130899112800000000;
BasicInfo->FileAttributes = ReturnQueryAttributes;
ReturnQueryAttributes = -1;
+ ExpectingQueryAttributes = FALSE;
Status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof(*BasicInfo);
}
ok_eq_ulong(IoStackLocation->Parameters.SetFile.FileInformationClass, FileBasicInformation);
if (IoStackLocation->Parameters.SetFile.FileInformationClass == FileBasicInformation)
{
- ok(ExpectedSetAttributes != (ULONG)-1, "Unexpected SET_INFORMATION call\n");
+ ok(ExpectingSetAttributes, "Unexpected SET_INFORMATION call\n");
BasicInfo = Irp->AssociatedIrp.SystemBuffer;
ok_eq_longlong(BasicInfo->CreationTime.QuadPart, 0LL);
ok_eq_longlong(BasicInfo->LastAccessTime.QuadPart, 0LL);
ok_eq_longlong(BasicInfo->ChangeTime.QuadPart, 0LL);
ok_eq_ulong(BasicInfo->FileAttributes, ExpectedSetAttributes);
ExpectedSetAttributes = -1;
+ ExpectingSetAttributes = FALSE;
Status = STATUS_SUCCESS;
}