This commit is contained in:
love-code-yeyixiao 2024-05-17 22:28:29 +08:00
parent a614a85091
commit 06cde1cd04
1 changed files with 3 additions and 3 deletions

View File

@ -1968,15 +1968,15 @@ DWORD GetParentPIDAndName(DWORD ProcessID, LPTSTR lpszBuffer_Parent_Name, PDWORD
DWORD dwParentID = 0; DWORD dwParentID = 0;
if (NT_SUCCESS(status)) { if (NT_SUCCESS(status)) {
dwParentID = (LONG_PTR)pbi.Reserved3; dwParentID = (LONG_PTR)pbi.InheritedFromUniqueProcessId;
if (NULL != lpszBuffer_Parent_Name) { if (NULL != lpszBuffer_Parent_Name) {
HANDLE hParentProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwParentID); HANDLE hParentProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwParentID);
if (hParentProcess) { if (hParentProcess) {
DWORD bufs; DWORD bufs;
BOOL ret = QueryFullProcessImageName(hParentProcess, 0, lpszBuffer_Parent_Name, &bufs); BOOL ret = GetProcessImageFileNameW(hParentProcess, lpszBuffer_Parent_Name, 255);