mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 19:48:38 -05:00 
			
		
		
		
	tst: winfsp-tests: ea_create_test
This commit is contained in:
		| @@ -151,6 +151,30 @@ static void ea_check_ea(HANDLE Handle) | |||||||
|     ASSERT(1 == Context.EaCount[1]); |     ASSERT(1 == Context.EaCount[1]); | ||||||
|     ASSERT(1 == Context.EaCount[2]); |     ASSERT(1 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|  |     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); | ||||||
|  |     Result = NtQueryEaFile(Handle, &Iosb, &Ea, sizeof Ea, TRUE, 0, 0, 0, TRUE); | ||||||
|  |     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(1 == Context.EaCount[0]); | ||||||
|  |     ASSERT(0 == Context.EaCount[1]); | ||||||
|  |     ASSERT(0 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|  |     memset(&Context, 0, sizeof Context); | ||||||
|  |     Result = NtQueryEaFile(Handle, &Iosb, &Ea, sizeof Ea, TRUE, 0, 0, 0, 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(1 == Context.EaCount[1]); | ||||||
|  |     ASSERT(0 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|     memset(&GetEa, 0, sizeof GetEa); |     memset(&GetEa, 0, sizeof GetEa); | ||||||
|     GetEa.V.EaNameLength = (UCHAR)strlen("bnameTwo"); |     GetEa.V.EaNameLength = (UCHAR)strlen("bnameTwo"); | ||||||
|     lstrcpyA(GetEa.V.EaName, "bnameTwo"); |     lstrcpyA(GetEa.V.EaName, "bnameTwo"); | ||||||
| @@ -166,6 +190,12 @@ static void ea_check_ea(HANDLE Handle) | |||||||
|     ASSERT(1 == Context.EaCount[1]); |     ASSERT(1 == Context.EaCount[1]); | ||||||
|     ASSERT(0 == Context.EaCount[2]); |     ASSERT(0 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|  |     memset(&Context, 0, sizeof Context); | ||||||
|  |     Result = NtQueryEaFile(Handle, &Iosb, | ||||||
|  |         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1), | ||||||
|  |         FALSE, 0, 0, 0, TRUE); | ||||||
|  |     ASSERT(STATUS_BUFFER_TOO_SMALL == Result); | ||||||
|  |  | ||||||
|     memset(&Context, 0, sizeof Context); |     memset(&Context, 0, sizeof Context); | ||||||
|     Result = NtQueryEaFile(Handle, &Iosb, |     Result = NtQueryEaFile(Handle, &Iosb, | ||||||
|         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1 + strlen("first")), |         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Aname1") + 1 + strlen("first")), | ||||||
| @@ -190,6 +220,12 @@ static void ea_check_ea(HANDLE Handle) | |||||||
|     ASSERT(0 == Context.EaCount[1]); |     ASSERT(0 == Context.EaCount[1]); | ||||||
|     ASSERT(0 == Context.EaCount[2]); |     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, 0, 0, 0, FALSE); | ||||||
|  |     ASSERT(STATUS_BUFFER_TOO_SMALL == Result); | ||||||
|  |  | ||||||
|     memset(&Context, 0, sizeof Context); |     memset(&Context, 0, sizeof Context); | ||||||
|     Result = NtQueryEaFile(Handle, &Iosb, |     Result = NtQueryEaFile(Handle, &Iosb, | ||||||
|         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("bnameTwo") + 1 + strlen("bnameTwo")), |         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("bnameTwo") + 1 + strlen("bnameTwo")), | ||||||
| @@ -202,6 +238,12 @@ static void ea_check_ea(HANDLE Handle) | |||||||
|     ASSERT(1 == Context.EaCount[1]); |     ASSERT(1 == Context.EaCount[1]); | ||||||
|     ASSERT(0 == Context.EaCount[2]); |     ASSERT(0 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|  |     memset(&Context, 0, sizeof Context); | ||||||
|  |     Result = NtQueryEaFile(Handle, &Iosb, | ||||||
|  |         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Cn3") + 1), | ||||||
|  |         FALSE, 0, 0, 0, FALSE); | ||||||
|  |     ASSERT(STATUS_BUFFER_TOO_SMALL == Result); | ||||||
|  |  | ||||||
|     memset(&Context, 0, sizeof Context); |     memset(&Context, 0, sizeof Context); | ||||||
|     Result = NtQueryEaFile(Handle, &Iosb, |     Result = NtQueryEaFile(Handle, &Iosb, | ||||||
|         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Cn3") + 1 + strlen("third")), |         &Ea, (ULONG)(FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName) + strlen("Cn3") + 1 + strlen("third")), | ||||||
| @@ -213,6 +255,10 @@ static void ea_check_ea(HANDLE Handle) | |||||||
|     ASSERT(0 == Context.EaCount[0]); |     ASSERT(0 == Context.EaCount[0]); | ||||||
|     ASSERT(0 == Context.EaCount[1]); |     ASSERT(0 == Context.EaCount[1]); | ||||||
|     ASSERT(1 == Context.EaCount[2]); |     ASSERT(1 == Context.EaCount[2]); | ||||||
|  |  | ||||||
|  |     memset(&Context, 0, sizeof Context); | ||||||
|  |     Result = NtQueryEaFile(Handle, &Iosb, &Ea, sizeof Ea, FALSE, 0, 0, 0, FALSE); | ||||||
|  |     ASSERT(STATUS_NO_MORE_EAS == Result); | ||||||
| } | } | ||||||
|  |  | ||||||
| static void ea_create_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout) | static void ea_create_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeout) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user