Started testing. Couple of code mods to get 'sc start ...' working.

svn path=/trunk/; revision=18982
This commit is contained in:
Ged Murphy 2005-11-04 00:20:17 +00:00
parent 13415bb36a
commit c743bc7da5
2 changed files with 7 additions and 5 deletions

View file

@ -52,7 +52,7 @@ INT ScControl(LPTSTR MachineName, LPCTSTR Command, TCHAR **Args)
_tprintf(_T("Remote service control is not yet implemented\n")); _tprintf(_T("Remote service control is not yet implemented\n"));
return 2; return 2;
} }
/*
hSCManager = OpenSCManager(MachineName, NULL, SC_MANAGER_ALL_ACCESS); hSCManager = OpenSCManager(MachineName, NULL, SC_MANAGER_ALL_ACCESS);
if (hSCManager == NULL) if (hSCManager == NULL)
{ {
@ -60,7 +60,7 @@ INT ScControl(LPTSTR MachineName, LPCTSTR Command, TCHAR **Args)
ReportLastError(); ReportLastError();
return -1; return -1;
} }
*/
if (_tcsicmp(Command, _T("query")) == 0) if (_tcsicmp(Command, _T("query")) == 0)
Query(Args, FALSE); Query(Args, FALSE);
@ -71,7 +71,7 @@ INT ScControl(LPTSTR MachineName, LPCTSTR Command, TCHAR **Args)
else if (_tcsicmp(Command, _T("start")) == 0) else if (_tcsicmp(Command, _T("start")) == 0)
{ {
if (*Args) if (*Args)
Start(3, Args); Start(0, Args);
else else
StartUsage(); StartUsage();
} }

View file

@ -21,13 +21,15 @@ BOOL Start(INT ArgCount, TCHAR **Args)
/* testing */ /* testing */
printf("service to start - %s\n\n", ServiceName); _tprintf(_T("service to start - %s\n\n"), ServiceName);
printf("Arguments :\n"); _tprintf(_T("Arguments :\n"));
while (*ServiceArgs) while (*ServiceArgs)
{ {
printf("%s\n", *ServiceArgs); printf("%s\n", *ServiceArgs);
ServiceArgs++; ServiceArgs++;
} }
if (! *ServiceArgs)
ServiceArgs = NULL;
/* get a handle to the service requested for starting */ /* get a handle to the service requested for starting */
hSc = OpenService(hSCManager, ServiceName, SERVICE_ALL_ACCESS); hSc = OpenService(hSCManager, ServiceName, SERVICE_ALL_ACCESS);