mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Shut MSVC warnings up
svn path=/trunk/; revision=20339
This commit is contained in:
parent
5159234db2
commit
742f2e36bf
3 changed files with 24 additions and 23 deletions
|
@ -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 @@ DWORD NumServices = 0;
|
|||
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 @@ Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
|
|||
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 @@ Query(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, BOOL bExtended)
|
|||
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 @@ QueryService(LPCTSTR ServiceName, BOOL bExtended)
|
|||
|
||||
|
||||
BOOL
|
||||
EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD ServiceState)
|
||||
EnumServices(DWORD ServiceType, DWORD ServiceState)
|
||||
{
|
||||
DWORD BufSize = 0;
|
||||
DWORD BytesNeeded = 0;
|
||||
|
@ -265,7 +267,7 @@ EnumServices(LPCTSTR ServiceName, DWORD ServiceType, DWORD ServiceState)
|
|||
VOID
|
||||
PrintService(BOOL bExtended)
|
||||
{
|
||||
int i;
|
||||
DWORD i;
|
||||
|
||||
for (i=0; i < NumServices; i++)
|
||||
{
|
||||
|
|
|
@ -21,8 +21,7 @@ DWORD ReportLastError(VOID)
|
|||
DWORD ErrorCode = GetLastError();
|
||||
if (ErrorCode != ERROR_SUCCESS)
|
||||
{
|
||||
if ((RetVal = FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
RetVal = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
|
@ -30,7 +29,9 @@ DWORD ReportLastError(VOID)
|
|||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL )))
|
||||
NULL );
|
||||
|
||||
if (RetVal != 0)
|
||||
{
|
||||
_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);
|
||||
}
|
||||
|
||||
return MainUsage();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue