Shut MSVC warnings up
authorGed Murphy <gedmurphy@reactos.org>
Mon, 26 Dec 2005 20:40:45 +0000 (20:40 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Mon, 26 Dec 2005 20:40:45 +0000 (20:40 +0000)
svn path=/trunk/; revision=20339

reactos/subsys/system/sc/query.c
reactos/subsys/system/sc/sc.c
reactos/subsys/system/sc/usage.c

index f4ab2f0..456c0a2 100644 (file)
 
 #include "sc.h"
 
 
 #include "sc.h"
 
+#define DEBUG
+#include <debug.h>
+
 /* local function decs */
 VOID PrintService(BOOL bExtended);
 /* local function decs */
 VOID PrintService(BOOL bExtended);
-BOOL EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD ServiceState);
+BOOL EnumServices(DWORD ServiceType, DWORD ServiceState);
 BOOL QueryService(LPCTSTR ServiceName, BOOL bExtended);
 
 /* global variables */
 BOOL QueryService(LPCTSTR ServiceName, BOOL bExtended);
 
 /* global variables */
@@ -29,11 +32,10 @@ DWORD NumServices = 0;
 BOOL
 Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
 {
 BOOL
 Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
 {
-            
     if (! ServiceName) /* display all running services and drivers */
     {
         /* get default values */
     if (! ServiceName) /* display all running services and drivers */
     {
         /* get default values */
-        EnumServices(NULL, SERVICE_WIN32, SERVICE_ACTIVE);
+        EnumServices(SERVICE_WIN32, SERVICE_ACTIVE);
         
         /* print default values */
         PrintService(bExtended);
         
         /* print default values */
         PrintService(bExtended);
@@ -43,11 +45,11 @@ Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
         LPCTSTR Type = *ServiceArgs;
         
         if (_tcsicmp(Type, _T("driver")) == 0)
         LPCTSTR Type = *ServiceArgs;
         
         if (_tcsicmp(Type, _T("driver")) == 0)
-            EnumServices(NULL, SERVICE_DRIVER, SERVICE_ACTIVE);
+            EnumServices(SERVICE_DRIVER, SERVICE_ACTIVE);
         else if (_tcsicmp(Type, _T("service")) == 0)
         else if (_tcsicmp(Type, _T("service")) == 0)
-            EnumServices(NULL, SERVICE_WIN32, SERVICE_ACTIVE);
+            EnumServices(SERVICE_WIN32, SERVICE_ACTIVE);
         else if (_tcsicmp(Type, _T("all")) == 0)
         else if (_tcsicmp(Type, _T("all")) == 0)
-            EnumServices(NULL, SERVICE_DRIVER|SERVICE_WIN32, SERVICE_ACTIVE);
+            EnumServices(SERVICE_DRIVER|SERVICE_WIN32, SERVICE_ACTIVE);
         else
         {
             _tprintf(_T("\nERROR following \"type=\"!\n"));
         else
         {
             _tprintf(_T("\nERROR following \"type=\"!\n"));
@@ -61,9 +63,9 @@ Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
         LPCTSTR State = *ServiceArgs;
 
         if (_tcsicmp(State, _T("inactive")) == 0)
         LPCTSTR State = *ServiceArgs;
 
         if (_tcsicmp(State, _T("inactive")) == 0)
-            EnumServices(NULL, SERVICE_WIN32, SERVICE_INACTIVE);
+            EnumServices(SERVICE_WIN32, SERVICE_INACTIVE);
         else if (_tcsicmp(State, _T("all")) == 0)
         else if (_tcsicmp(State, _T("all")) == 0)
-            EnumServices(NULL, SERVICE_WIN32, SERVICE_STATE_ALL);
+            EnumServices(SERVICE_WIN32, SERVICE_STATE_ALL);
         else
         {
             _tprintf(_T("\nERROR following \"state=\"!\n"));
         else
         {
             _tprintf(_T("\nERROR following \"state=\"!\n"));
@@ -202,7 +204,7 @@ QueryService(LPCTSTR ServiceName, BOOL bExtended)
 
 
 BOOL
 
 
 BOOL
-EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD ServiceState)
+EnumServices(DWORD ServiceType, DWORD ServiceState)
 {
     DWORD BufSize = 0;
     DWORD BytesNeeded = 0;
 {
     DWORD BufSize = 0;
     DWORD BytesNeeded = 0;
@@ -265,7 +267,7 @@ EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD ServiceState)
 VOID
 PrintService(BOOL bExtended)
 {
 VOID
 PrintService(BOOL bExtended)
 {
-    int i;
+    DWORD i;
     
     for (i=0; i < NumServices; i++)
     {
     
     for (i=0; i < NumServices; i++)
     {
index 98691f8..de8333d 100644 (file)
@@ -21,16 +21,17 @@ DWORD ReportLastError(VOID)
     DWORD ErrorCode = GetLastError();
     if (ErrorCode != ERROR_SUCCESS) 
     {
     DWORD ErrorCode = GetLastError();
     if (ErrorCode != ERROR_SUCCESS) 
     {
-        if ((RetVal = FormatMessage(
-                FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                FORMAT_MESSAGE_FROM_SYSTEM |
-                FORMAT_MESSAGE_IGNORE_INSERTS,
-                NULL,
-                ErrorCode,
-                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
-                (LPTSTR) &lpMsgBuf,
-                0,
-                NULL )))
+        RetVal = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                               FORMAT_MESSAGE_FROM_SYSTEM |
+                               FORMAT_MESSAGE_IGNORE_INSERTS,
+                               NULL,
+                               ErrorCode,
+                               MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
+                               (LPTSTR) &lpMsgBuf,
+                               0,
+                               NULL );
+
+        if (RetVal != 0)
         {
             _tprintf(_T("%s"), (LPTSTR)lpMsgBuf);
 
         {
             _tprintf(_T("%s"), (LPTSTR)lpMsgBuf);
 
@@ -169,8 +170,6 @@ int _tmain(int argc, LPCTSTR argv[])
             ServiceName = argv[2];
         return ScControl(MachineName, Command, ServiceName, &argv[3], argc);
     }
             ServiceName = argv[2];
         return ScControl(MachineName, Command, ServiceName, &argv[3], argc);
     }
-
-    return MainUsage();
 }
 
 
 }
 
 
index 813ed9e..8c745c4 100644 (file)
@@ -13,7 +13,7 @@
 
 INT MainUsage(VOID)
 {
 
 INT MainUsage(VOID)
 {
-    TCHAR c;
+    INT c;
 
     _tprintf(_T("DESCRIPTION:\n")
     _T("\tSC is a command line program used for communicating with\n")
 
     _tprintf(_T("DESCRIPTION:\n")
     _T("\tSC is a command line program used for communicating with\n")