| 232 | |
| 233 | |
| 234 | bool CDriverTable::CompareItems(const WinSys::DriverInfo& s1, const WinSys::DriverInfo& s2, int col, bool asc) { |
| 235 | |
| 236 | // Name, DisplayName, State, Type, StartType, BinaryPath, Description |
| 237 | switch (static_cast<DriverColumn>(col)) |
| 238 | { |
| 239 | case DriverColumn::Name: |
| 240 | return SortHelper::SortStrings(s1.GetName(), s2.GetName(), asc); |
| 241 | case DriverColumn::DisplayName: |
| 242 | return SortHelper::SortStrings(s1.GetDisplayName(), s2.GetDisplayName(), asc); |
| 243 | case DriverColumn::State: |
| 244 | return SortHelper::SortStrings( |
| 245 | ServiceStateToString(s1.GetStatusProcess().CurrentState), |
| 246 | ServiceStateToString(s2.GetStatusProcess().CurrentState), |
| 247 | asc); |
| 248 | case DriverColumn::Type: |
| 249 | return SortHelper::SortNumbers(s1.GetStatusProcess().Type, s2.GetStatusProcess().Type, asc); |
| 250 | case DriverColumn::StartType: |
| 251 | return SortHelper::SortStrings( |
| 252 | ServiceStartTypeToString(*GetServiceInfoEx(s1.GetName()).GetConfiguration()), |
| 253 | ServiceStartTypeToString(*GetServiceInfoEx(s2.GetName()).GetConfiguration()), |
| 254 | asc |
| 255 | ); |
| 256 | case DriverColumn::BinaryPath: |
| 257 | return SortHelper::SortStrings( |
| 258 | GetServiceInfoEx(s1.GetName()).GetConfiguration()->BinaryPathName, |
| 259 | GetServiceInfoEx(s2.GetName()).GetConfiguration()->BinaryPathName, |
| 260 | asc |
| 261 | ); |
| 262 | case DriverColumn::Description: |
| 263 | return SortHelper::SortStrings( |
| 264 | GetServiceInfoEx(s1.GetName()).GetDescription(), |
| 265 | GetServiceInfoEx(s2.GetName()).GetDescription(), |
| 266 | asc |
| 267 | ); |
| 268 | } |
| 269 | |
| 270 | return false; |
| 271 | } |
| 272 | |
| 273 | LRESULT CDriverTable::OnKernelRoutine(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { |
| 274 | int selected = m_Table.data.selected; |
nothing calls this directly
no test coverage detected