MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ParseTableEntry

Method ParseTableEntry

WinArk/ServiceTable.cpp:131–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131int CServiceTable::ParseTableEntry(CString& s, char& mask, int& select, WinSys::ServiceInfo& info, int column) {
132 auto& pdata = info.GetStatusProcess();
133 auto& svcex = GetServiceInfoEx(info.GetName());
134 auto config = svcex.GetConfiguration();
135 switch (column) {
136 case 0:
137 s = info.GetName().c_str();
138 break;
139 case 1:
140 s = info.GetDisplayName().c_str();
141 break;
142 case 2:
143 s = ServiceStateToString(pdata.CurrentState);
144 break;
145 case 3:
146 s = ServiceTypeToString(pdata.Type);
147 break;
148 case 4:
149 if (pdata.ProcessId > 0) {
150 s.Format(L"%u (0x%X)", pdata.ProcessId, pdata.ProcessId);
151 }
152 break;
153 case 5:
154 s = pdata.ProcessId > 0 ? m_ProcMgr.GetProcessNameById(pdata.ProcessId).c_str() : L"";
155 break;
156 case 6:
157 s = config ? ServiceStartTypeToString(*config) : AccessDenied;
158 break;
159 case 7:
160 s = config ? CString(config->BinaryPathName.c_str()) : AccessDenied;
161 break;
162 case 8:
163 s = config ? CString(config->AccountName.c_str()) : AccessDenied;
164 break;
165 case 9:
166 s = config ? ErrorControlToString(config->ErrorControl) : AccessDenied;
167 break;
168 case 10:
169 s = svcex.GetDescription();
170 break;
171 case 11:
172 s = svcex.GetPrivileges();
173 break;
174 case 12:
175 s = svcex.GetTriggers();
176 break;
177 case 13:
178 s = config ? svcex.GetDependencies() : AccessDenied;
179 break;
180 case 14:
181 s = ServiceControlsAcceptedToString(pdata.ControlsAccepted);
182 break;
183 case 15:
184 s = svcex.GetSID();
185 break;
186 case 16:
187 s = ServiceSidTypeToString(svcex.GetSidType());
188 break;

Callers

nothing calls this directly

Calls 6

GetNameMethod · 0.80
GetConfigurationMethod · 0.80
GetProcessNameByIdMethod · 0.80
GetTriggersMethod · 0.80
GetSidTypeMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected