Author: ekohl
Date: Tue Jun 14 22:00:34 2016
New Revision: 71640
URL:
http://svn.reactos.org/svn/reactos?rev=71640&view=rev
Log:
[SC]
Add some error and success messages to the config and description commands.
Modified:
trunk/reactos/base/applications/sc/config.c
trunk/reactos/base/applications/sc/description.c
Modified: trunk/reactos/base/applications/sc/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sc/confi…
==============================================================================
--- trunk/reactos/base/applications/sc/config.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/sc/config.c [iso-8859-1] Tue Jun 14 22:00:34 2016
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/sc/config.c
- * PURPOSE: Set the service configuration
+ * PURPOSE: Query/Set the service configuration
* COPYRIGHT: Copyright 2016 Eric Kohl
*
*/
@@ -28,6 +28,7 @@
SC_MANAGER_CONNECT);
if (hManager == NULL)
{
+ _tprintf(_T("[SC] OpenSCManager FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -35,6 +36,7 @@
hService = OpenService(hManager, ServiceName, SERVICE_QUERY_CONFIG);
if (hService == NULL)
{
+ _tprintf(_T("[SC] OpenService FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -46,6 +48,7 @@
{
if (cbBytesNeeded == 0)
{
+ _tprintf(_T("[SC] QueryServiceConfig FAILED %lu:\n\n"),
GetLastError());
bResult = FALSE;
goto done;
}
@@ -55,6 +58,7 @@
if (pServiceConfig == NULL)
{
SetLastError(ERROR_OUTOFMEMORY);
+ _tprintf(_T("[SC] HeapAlloc FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -64,9 +68,12 @@
cbBytesNeeded,
&cbBytesNeeded))
{
- bResult = FALSE;
- goto done;
- }
+ _tprintf(_T("[SC] QueryServiceConfig FAILED %lu:\n\n"),
GetLastError());
+ bResult = FALSE;
+ goto done;
+ }
+
+ _tprintf(_T("[SC] QueryServiceConfig SUCCESS\n\n"));
_tprintf(_T("SERVICE_NAME: %s\n"), ServiceName);
_tprintf(_T(" TYPE : %-3lx "),
pServiceConfig->dwServiceType);
Modified: trunk/reactos/base/applications/sc/description.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sc/descr…
==============================================================================
--- trunk/reactos/base/applications/sc/description.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/sc/description.c [iso-8859-1] Tue Jun 14 22:00:34
2016
@@ -26,6 +26,7 @@
SC_MANAGER_CONNECT);
if (hManager == NULL)
{
+ _tprintf(_T("[SC] OpenSCManager FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -33,6 +34,7 @@
hService = OpenService(hManager, ServiceName, SERVICE_QUERY_CONFIG);
if (hService == NULL)
{
+ _tprintf(_T("[SC] OpenService FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -45,6 +47,7 @@
{
if (cbBytesNeeded == 0)
{
+ _tprintf(_T("[SC] QueryServiceConfig2 FAILED %lu:\n\n"),
GetLastError());
bResult = FALSE;
goto done;
}
@@ -54,6 +57,7 @@
if (pServiceDescription == NULL)
{
SetLastError(ERROR_OUTOFMEMORY);
+ _tprintf(_T("[SC] HeapAlloc FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -64,9 +68,12 @@
cbBytesNeeded,
&cbBytesNeeded))
{
+ _tprintf(_T("[SC] QueryServiceConfig2 FAILED %lu:\n\n"),
GetLastError());
bResult = FALSE;
goto done;
}
+
+ _tprintf(_T("[SC] QueryServiceConfig2 SUCCESS\n\n"));
_tprintf(_T("SERVICE_NAME: %s\n"), ServiceName);
_tprintf(_T(" DESCRIPTION : %s\n"),
@@ -105,6 +112,7 @@
SC_MANAGER_CONNECT);
if (hManager == NULL)
{
+ _tprintf(_T("[SC] OpenSCManager FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -112,6 +120,7 @@
hService = OpenService(hManager, ServiceName, SERVICE_CHANGE_CONFIG);
if (hService == NULL)
{
+ _tprintf(_T("[SC] OpenService FAILED %lu:\n\n"), GetLastError());
bResult = FALSE;
goto done;
}
@@ -122,9 +131,12 @@
SERVICE_CONFIG_DESCRIPTION,
(LPBYTE)&ServiceDescription))
{
+ _tprintf(_T("[SC] ChangeServiceConfig2 FAILED %lu:\n\n"),
GetLastError());
bResult = FALSE;
goto done;
}
+
+ _tprintf(_T("[SC] ChangeServiceConfig2 SUCCESS\n\n"));
done:
if (bResult == FALSE)