C++ Get Username From Process

前端 未结 4 2054
小蘑菇
小蘑菇 2020-11-29 11:39

I have a process handle with

HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, THE_PROCESS_ID);

How can I get t

4条回答
  •  离开以前
    2020-11-29 11:54

    WMI should be able to tell you that information. Otherwise you need to rely on undocumented fun in ntdll.dll. It appears others have found solutions that don't use ntdll.dll -- use them rather than undocumented stuff.

提交回复
热议问题