mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:13:01 +00:00
[SC] Support the paramchange and netbind* control codes in the control command
This commit is contained in:
parent
9f0c54fcd3
commit
a0d412b77a
2 changed files with 26 additions and 6 deletions
|
@ -157,19 +157,35 @@ ScControl(LPCTSTR Server, // remote machine name
|
||||||
}
|
}
|
||||||
else if (!lstrcmpi(Command, _T("control")))
|
else if (!lstrcmpi(Command, _T("control")))
|
||||||
{
|
{
|
||||||
INT CtlValue;
|
INT ControlCode = 0;
|
||||||
|
|
||||||
if (ArgCount > 1)
|
if (ArgCount > 1)
|
||||||
{
|
{
|
||||||
ServiceName = *ServiceArgs++;
|
ServiceName = *ServiceArgs++;
|
||||||
ArgCount--;
|
ArgCount--;
|
||||||
|
|
||||||
CtlValue = _ttoi(ServiceArgs[0]);
|
if (!lstrcmpi(ServiceArgs[0], _T("paramchange")))
|
||||||
|
ControlCode = SERVICE_CONTROL_PARAMCHANGE;
|
||||||
|
else if (!lstrcmpi(ServiceArgs[0], _T("netbindadd")))
|
||||||
|
ControlCode = SERVICE_CONTROL_NETBINDADD;
|
||||||
|
else if (!lstrcmpi(ServiceArgs[0], _T("netbindremove")))
|
||||||
|
ControlCode = SERVICE_CONTROL_NETBINDREMOVE;
|
||||||
|
else if (!lstrcmpi(ServiceArgs[0], _T("netbindenable")))
|
||||||
|
ControlCode = SERVICE_CONTROL_NETBINDENABLE;
|
||||||
|
else if (!lstrcmpi(ServiceArgs[0], _T("netbinddisable")))
|
||||||
|
ControlCode = SERVICE_CONTROL_NETBINDDISABLE;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ControlCode = _ttoi(ServiceArgs[0]);
|
||||||
|
if ((ControlCode < 128) && (ControlCode > 255))
|
||||||
|
ControlCode = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ServiceArgs++;
|
ServiceArgs++;
|
||||||
ArgCount--;
|
ArgCount--;
|
||||||
|
|
||||||
if ((CtlValue >= 128) && (CtlValue <= 255))
|
if (ControlCode != 0)
|
||||||
Control(CtlValue,
|
Control(ControlCode,
|
||||||
ServiceName,
|
ServiceName,
|
||||||
ServiceArgs,
|
ServiceArgs,
|
||||||
ArgCount);
|
ArgCount);
|
||||||
|
|
|
@ -169,9 +169,13 @@ VOID CreateUsage(VOID)
|
||||||
VOID ControlUsage(VOID)
|
VOID ControlUsage(VOID)
|
||||||
{
|
{
|
||||||
_tprintf(_T("DESCRIPTION:\n")
|
_tprintf(_T("DESCRIPTION:\n")
|
||||||
_T(" Sends a CONTROL control request to a service.\n")
|
_T(" Sends a CONTROL code to a service.\n")
|
||||||
_T("USAGE:\n")
|
_T("USAGE:\n")
|
||||||
_T(" sc <server> control [service name] <value>\n"));
|
_T(" sc <server> control [service name] <value>\n")
|
||||||
|
_T(" <value> = user-defined control code\n")
|
||||||
|
_T(" <value> = <paramchange|\n")
|
||||||
|
_T(" netbindadd|netbindremove|\n")
|
||||||
|
_T(" netbindenable|netbinddisable>\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID SdShowUsage(VOID)
|
VOID SdShowUsage(VOID)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue