2 * ReactOS SC - service control console program
6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 int DisplayServiceInfo(BOOL display_ex)
32 const char* type_str = "WIN32_SHARE_PROCESS";
33 const char* state_str = "RUNNING";
34 const char* flags_str = "RUNS_IN_SYSTEM_PROCESS";
35 const char* features_str = "NOT_STOPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN";
37 const char* ServiceName = "none";
38 const char* DisplayName = "none";
57 dprintf("\nSERVICE_NAME: %s\n", ServiceName);
58 dprintf("DISPLAY_NAME: %s\n", DisplayName);
59 dprintf("\tTYPE : %d %s\n", Type, type_str);
60 dprintf("\tSTATE : %d %s\n", State, state_str);
61 dprintf("\t : (%s)\n", features_str);
62 dprintf("\tWIN32_EXIT_CODE : %d (0x%01x)\n", Win32ExitCode, Win32ExitCode);
63 dprintf("\tSERVICE_EXIT_CODE : %d (0x%01x)\n", ServiceExitCode, ServiceExitCode);
64 dprintf("\tCHECKPOINT : 0x%01x\n", CheckPoint);
65 dprintf("\tWAIT_HINT : 0x%01x\n", WaitHint);
68 dprintf("\tPID : %d\n", Pid);
69 dprintf("\tFLAGS : %s\n", flags_str);
75 int EnumServicesInfo(void)
80 dprintf("Enum: entriesRead = %d\n", entriesRead);
81 dprintf("Enum: resumeIndex = %d\n", resumeIndex);
83 DisplayServiceInfo(1);
88 int sc_query(SC_HANDLE hSCManager, SC_CMDS sc_cmd, char* argv[])
94 case SC_CMD_QDESCRIPTION:
97 case SC_CMD_GETDISPLAYNAME:
98 case SC_CMD_GETKEYNAME:
99 dprintf("sc_query(%x, %d, %s) - command not implemented.\n", hSCManager, sc_cmd, argv[0]);
101 case SC_CMD_ENUMDEPEND:
102 return EnumServicesInfo();
103 // case SC_CMD_QUERYLOCK:
104 // return sc_QueryLock(hSCManager);
106 dprintf("sc_query(%x, %d, %s) - unknown command.\n", hSCManager, sc_cmd, argv[0]);