[KMTESTS:NPFS] Fix 2 Clang-Cl warnings about ShareAccess
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Tue, 13 Feb 2018 12:05:35 +0000 (13:05 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 18 Feb 2018 13:14:52 +0000 (14:14 +0100)
"warning: variable 'ShareAccess' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]"

CORE-14306

modules/rostests/kmtests/npfs/NpfsHelpers.c

index 0086499..3dc9267 100644 (file)
@@ -103,6 +103,11 @@ NpCreatePipe(
         ShareAccess = FILE_SHARE_READ;
     else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX)
         ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
+    else
+    {
+        ASSERTMSG("Invalid NamedPipeConfiguration parameter value!", FALSE);
+        return STATUS_INVALID_PARAMETER_6;
+    }
 
     DefaultTimeout.QuadPart = -50 * 1000 * 10;
 
@@ -185,6 +190,11 @@ NpOpenPipe(
         ShareAccess = FILE_SHARE_READ;
     else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX)
         ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
+    else
+    {
+        ASSERTMSG("Invalid NamedPipeConfiguration parameter value!", FALSE);
+        return STATUS_INVALID_PARAMETER_3;
+    }
 
     return NpOpenPipeEx(ClientHandle,
                         PipePath,