mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
tst: winfsp-tests: ea_create_test
This commit is contained in:
parent
1aa2353ca6
commit
ef6df51b5e
@ -139,6 +139,7 @@ static void ea_check_ea(HANDLE Handle)
|
||||
UINT8 B[128];
|
||||
} GetEa;
|
||||
ULONG EaLength = 0;
|
||||
ULONG EaIndex;
|
||||
struct ea_check_ea_context Context;
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
@ -190,6 +191,13 @@ static void ea_check_ea(HANDLE Handle)
|
||||
ASSERT(1 == Context.EaCount[1]);
|
||||
ASSERT(0 == Context.EaCount[2]);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("bnameTwo") + 1),
|
||||
FALSE, &GetEa.V, EaLength, 0, FALSE);
|
||||
ASSERT(STATUS_BUFFER_OVERFLOW == Result);
|
||||
ASSERT(0 == Iosb.Information);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1),
|
||||
@ -259,6 +267,87 @@ static void ea_check_ea(HANDLE Handle)
|
||||
memset(&Context, 0, sizeof Context);
|
||||
Result = NtQueryEaFile(Handle, &Iosb, &Ea, sizeof Ea, FALSE, 0, 0, 0, FALSE);
|
||||
ASSERT(STATUS_NO_MORE_EAS == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 0;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, sizeof Ea,
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_NONEXISTENT_EA_ENTRY == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 1;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_BUFFER_TOO_SMALL == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 1;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1 + strlen("first")),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_BUFFER_OVERFLOW == Result);
|
||||
Result = FspFileSystemEnumerateEa(0, ea_check_ea_enumerate, &Context, &Ea.V, (ULONG)Iosb.Information);
|
||||
ASSERT(STATUS_SUCCESS == Result);
|
||||
ASSERT(1 == Context.Count);
|
||||
ASSERT(1 == Context.EaCount[0]);
|
||||
ASSERT(0 == Context.EaCount[1]);
|
||||
ASSERT(0 == Context.EaCount[2]);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 2;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("bnameTwo") + 1),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_BUFFER_TOO_SMALL == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 2;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("bnameTwo") + 1 + strlen("bnameTwo")),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_BUFFER_OVERFLOW == Result);
|
||||
Result = FspFileSystemEnumerateEa(0, ea_check_ea_enumerate, &Context, &Ea.V, (ULONG)Iosb.Information);
|
||||
ASSERT(STATUS_SUCCESS == Result);
|
||||
ASSERT(1 == Context.Count);
|
||||
ASSERT(0 == Context.EaCount[0]);
|
||||
ASSERT(1 == Context.EaCount[1]);
|
||||
ASSERT(0 == Context.EaCount[2]);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 3;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Cn3") + 1),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_BUFFER_TOO_SMALL == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 3;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Cn3") + 1 + strlen("third")),
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_SUCCESS == Result);
|
||||
Result = FspFileSystemEnumerateEa(0, ea_check_ea_enumerate, &Context, &Ea.V, (ULONG)Iosb.Information);
|
||||
ASSERT(STATUS_SUCCESS == Result);
|
||||
ASSERT(1 == Context.Count);
|
||||
ASSERT(0 == Context.EaCount[0]);
|
||||
ASSERT(0 == Context.EaCount[1]);
|
||||
ASSERT(1 == Context.EaCount[2]);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 4;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, sizeof Ea,
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_NO_MORE_EAS == Result);
|
||||
|
||||
memset(&Context, 0, sizeof Context);
|
||||
EaIndex = 5;
|
||||
Result = NtQueryEaFile(Handle, &Iosb,
|
||||
&Ea, sizeof Ea,
|
||||
FALSE, 0, 0, &EaIndex, FALSE);
|
||||
ASSERT(STATUS_NONEXISTENT_EA_ENTRY == Result);
|
||||
}
|
||||
|
||||
static void ea_create_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout)
|
||||
|
Loading…
x
Reference in New Issue
Block a user