Shut MSVC warnings up
Modified: trunk/reactos/subsys/system/sc/query.c
Modified: trunk/reactos/subsys/system/sc/sc.c
Modified: trunk/reactos/subsys/system/sc/usage.c
_____
Modified: trunk/reactos/subsys/system/sc/query.c
--- trunk/reactos/subsys/system/sc/query.c 2005-12-26 20:14:24 UTC
(rev 20338)
+++ trunk/reactos/subsys/system/sc/query.c 2005-12-26 20:40:45 UTC
(rev 20339)
@@ -16,9 +16,12 @@
#include "sc.h"
+#define DEBUG
+#include <debug.h>
+
/* 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 */
@@ -29,11 +32,10 @@
BOOL
Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
{
-
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);
@@ -43,11 +45,11 @@
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)
- EnumServices(NULL, SERVICE_WIN32, SERVICE_ACTIVE);
+ EnumServices(SERVICE_WIN32, SERVICE_ACTIVE);
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"));
@@ -61,9 +63,9 @@
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)
- EnumServices(NULL, SERVICE_WIN32, SERVICE_STATE_ALL);
+ EnumServices(SERVICE_WIN32, SERVICE_STATE_ALL);
else
{
_tprintf(_T("\nERROR following \"state=\"!\n"));
@@ -202,7 +204,7 @@
BOOL
-EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD
ServiceState)
+EnumServices(DWORD ServiceType, DWORD ServiceState)
{
DWORD BufSize = 0;
DWORD BytesNeeded = 0;
@@ -265,7 +267,7 @@
VOID
PrintService(BOOL bExtended)
{
- int i;
+ DWORD i;
for (i=0; i < NumServices; i++)
{
_____
Modified: trunk/reactos/subsys/system/sc/sc.c
--- trunk/reactos/subsys/system/sc/sc.c 2005-12-26 20:14:24 UTC (rev
20338)
+++ trunk/reactos/subsys/system/sc/sc.c 2005-12-26 20:40:45 UTC (rev
20339)
@@ -21,16 +21,17 @@
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);
@@ -169,8 +170,6 @@
ServiceName = argv[2];
return ScControl(MachineName, Command, ServiceName, &argv[3],
argc);
}
-
- return MainUsage();
}
_____
Modified: trunk/reactos/subsys/system/sc/usage.c
--- trunk/reactos/subsys/system/sc/usage.c 2005-12-26 20:14:24 UTC
(rev 20338)
+++ trunk/reactos/subsys/system/sc/usage.c 2005-12-26 20:40:45 UTC
(rev 20339)
@@ -13,7 +13,7 @@
INT MainUsage(VOID)
{
- TCHAR c;
+ INT c;
_tprintf(_T("DESCRIPTION:\n")
_T("\tSC is a command line program used for communicating with\n")