From abdc65593f7b183fc3a81b4a5ced6e10bdd78cf3 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Sun, 4 Sep 2016 23:15:08 +0000 Subject: [PATCH] [KMTEST] - Add null-pointer test for RtlIsValidOemCharacter svn path=/trunk/; revision=72581 --- rostests/kmtests/rtl/RtlIsValidOemCharacter.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rostests/kmtests/rtl/RtlIsValidOemCharacter.c b/rostests/kmtests/rtl/RtlIsValidOemCharacter.c index 74c4d3be591..a9a5574067f 100644 --- a/rostests/kmtests/rtl/RtlIsValidOemCharacter.c +++ b/rostests/kmtests/rtl/RtlIsValidOemCharacter.c @@ -16,6 +16,7 @@ START_TEST(RtlIsValidOemCharacter) WCHAR tmp; BOOLEAN res; INT i; + NTSTATUS Status = STATUS_SUCCESS; res = RtlIsValidOemCharacter(&unicode_null); ok(res != FALSE, "UNICODE_NULL is valid char\n"); @@ -49,5 +50,18 @@ START_TEST(RtlIsValidOemCharacter) ok(res == FALSE, "Expected fail. '%C' [%d] is NOT valid char\n", InvalidChars[i], i); ok(tmp == RtlUpcaseUnicodeChar(InvalidChars[i]), "Expected upcase char for '%C' [%d]\n", InvalidChars[i], i); } + + _SEH2_TRY + { + RtlIsValidOemCharacter(NULL); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Get the exception code */ + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + ok(!NT_SUCCESS(Status), "Exception is expected but it did not occur\n"); } -- 2.17.1