修改升级程序在查询进程信息时候的使用的权限
This commit is contained in:
parent
4fbe5577db
commit
952aaaa4c2
|
@ -5,6 +5,7 @@
|
||||||
#if defined(HG_CMP_MSC)
|
#if defined(HG_CMP_MSC)
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
|
#include <psapi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool AppIsRun(const std::string& appName)
|
bool AppIsRun(const std::string& appName)
|
||||||
|
@ -54,11 +55,10 @@ bool AppIsRun(const std::string& appName)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
WCHAR exeFullPath[1024] = { 0 };
|
WCHAR exeFullPath[1024] = { 0 };
|
||||||
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe.th32ProcessID);
|
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pe.th32ProcessID);
|
||||||
if (nullptr != hProcess)
|
if (nullptr != hProcess)
|
||||||
{
|
{
|
||||||
DWORD bufferLen = 1024;
|
::GetProcessImageFileNameW(hProcess, exeFullPath, 1024);
|
||||||
::QueryFullProcessImageName(hProcess, 0, exeFullPath, &bufferLen);
|
|
||||||
::CloseHandle(hProcess);
|
::CloseHandle(hProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ TARGET = HGUpgradeApp
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||||
LIBS += -ladvapi32
|
LIBS += -ladvapi32 -lpsapi
|
||||||
|
|
||||||
contains(QT_ARCH, i386) {
|
contains(QT_ARCH, i386) {
|
||||||
LIBS += -L../../../../sdk/lib/win/x86/Release -lHGBase -lHGVersion
|
LIBS += -L../../../../sdk/lib/win/x86/Release -lHGBase -lHGVersion
|
||||||
|
|
Loading…
Reference in New Issue