mirror of
https://github.com/tnodir/fort
synced 2024-11-15 03:26:01 +00:00
UI: ServiceInfoManager: Don't monitor tracked services
This commit is contained in:
parent
2534be2c71
commit
ad8b983bda
@ -66,6 +66,11 @@ bool checkIsSvcHostService(const RegKey &svcReg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quint16 getServiceTrackFlags(const RegKey &svcReg)
|
||||||
|
{
|
||||||
|
return svcReg.value(serviceTrackFlagsKey).toUInt();
|
||||||
|
}
|
||||||
|
|
||||||
void fillServiceInfoList(QVector<ServiceInfo> &infoList, const RegKey &servicesReg,
|
void fillServiceInfoList(QVector<ServiceInfo> &infoList, const RegKey &servicesReg,
|
||||||
const ENUM_SERVICE_STATUS_PROCESSW *service, DWORD serviceCount, bool displayName,
|
const ENUM_SERVICE_STATUS_PROCESSW *service, DWORD serviceCount, bool displayName,
|
||||||
int &runningCount)
|
int &runningCount)
|
||||||
@ -81,7 +86,7 @@ void fillServiceInfoList(QVector<ServiceInfo> &infoList, const RegKey &servicesR
|
|||||||
if (!checkIsSvcHostService(svcReg))
|
if (!checkIsSvcHostService(svcReg))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const quint16 trackFlags = svcReg.value(serviceTrackFlagsKey).toUInt();
|
const quint16 trackFlags = getServiceTrackFlags(svcReg);
|
||||||
|
|
||||||
ServiceInfo info;
|
ServiceInfo info;
|
||||||
info.isRunning = (service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING);
|
info.isRunning = (service->ServiceStatusProcess.dwCurrentState == SERVICE_RUNNING);
|
||||||
@ -186,7 +191,7 @@ void ServiceInfoManager::trackService(const QString &serviceName)
|
|||||||
svcReg.setValue(serviceTypeOldKey, shareType);
|
svcReg.setValue(serviceTypeOldKey, shareType);
|
||||||
svcReg.setValue(serviceTypeKey, 0x10); // Own process
|
svcReg.setValue(serviceTypeKey, 0x10); // Own process
|
||||||
|
|
||||||
svcReg.setValue(serviceTrackFlagsKey, ServiceInfo::RegImagePath | ServiceInfo::RegType);
|
svcReg.setValue(serviceTrackFlagsKey, ServiceInfo::TrackImagePath | ServiceInfo::TrackType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServiceInfoManager::revertService(const QString &serviceName)
|
void ServiceInfoManager::revertService(const QString &serviceName)
|
||||||
@ -213,6 +218,9 @@ void ServiceInfoManager::revertService(const QString &serviceName)
|
|||||||
void ServiceInfoManager::monitorServices(const QVector<ServiceInfo> &serviceInfoList)
|
void ServiceInfoManager::monitorServices(const QVector<ServiceInfo> &serviceInfoList)
|
||||||
{
|
{
|
||||||
for (const ServiceInfo &serviceInfo : serviceInfoList) {
|
for (const ServiceInfo &serviceInfo : serviceInfoList) {
|
||||||
|
if ((serviceInfo.trackFlags & ServiceInfo::TrackImagePath) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
setupServiceMonitor(serviceInfo.serviceName);
|
setupServiceMonitor(serviceInfo.serviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,6 +279,11 @@ void ServiceInfoManager::onServicesCreated(const QStringList &serviceNames)
|
|||||||
if (!checkIsSvcHostService(svcReg))
|
if (!checkIsSvcHostService(svcReg))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const quint16 trackFlags = getServiceTrackFlags(svcReg);
|
||||||
|
|
||||||
|
if ((trackFlags & ServiceInfo::TrackImagePath) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
setupServiceMonitor(serviceName);
|
setupServiceMonitor(serviceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
class ServiceInfo
|
class ServiceInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum RegTrackFlag { RegImagePath = 0x01, RegType = 0x02 };
|
enum TrackFlag { TrackImagePath = 0x01, TrackType = 0x02 };
|
||||||
|
|
||||||
enum Type : quint16 {
|
enum Type : quint16 {
|
||||||
TypeUnknown = 0,
|
TypeUnknown = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user