Author: cfinck
Date: Wed Nov 16 14:59:01 2016
New Revision: 73239
URL:
http://svn.reactos.org/svn/reactos?rev=73239&view=rev
Log:
[LOCALSPL_APITEST]
Fix some NULL vs. INVALID_HANDLE_VALUE checks.
Now localspl_apitest.exe should properly quit when it cannot find its DLL.
Modified:
trunk/rostests/apitests/localspl/tests.c
Modified: trunk/rostests/apitests/localspl/tests.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/localspl/tests.c…
==============================================================================
--- trunk/rostests/apitests/localspl/tests.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/localspl/tests.c [iso-8859-1] Wed Nov 16 14:59:01 2016
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Local Spooler API Tests
* LICENSE: GNU GPLv2 or any later version as published by the Free Software
Foundation
* PURPOSE: Test list
- * COPYRIGHT: Copyright 2015 Colin Finck <colin(a)reactos.org>
+ * COPYRIGHT: Copyright 2015-2016 Colin Finck <colin(a)reactos.org>
*/
/*
@@ -45,7 +45,7 @@
DWORD cbRead;
DWORD cbWritten;
HANDLE hCommandPipe = INVALID_HANDLE_VALUE;
- HANDLE hFind = NULL;
+ HANDLE hFind = INVALID_HANDLE_VALUE;
HANDLE hOutputPipe = INVALID_HANDLE_VALUE;
PWSTR p;
SC_HANDLE hSC = NULL;
@@ -77,7 +77,7 @@
// Check if the corresponding DLL file exists.
hFind = FindFirstFileW(wszFilePath, &fd);
- if (!hFind)
+ if (hFind == INVALID_HANDLE_VALUE)
{
skip("My DLL file \"%S\" does not exist!\n", wszFilePath);
goto Cleanup;
@@ -187,13 +187,13 @@
bSuccessful = TRUE;
Cleanup:
- if (hCommandPipe)
+ if (hCommandPipe != INVALID_HANDLE_VALUE)
CloseHandle(hCommandPipe);
- if (hOutputPipe)
+ if (hOutputPipe != INVALID_HANDLE_VALUE)
CloseHandle(hOutputPipe);
- if (hFind)
+ if (hFind != INVALID_HANDLE_VALUE)
FindClose(hFind);
if (hService)