C++ Get Username From Process
I have a process handle with

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

How can I get the username of the user that is running the process?

I am using unmanaged code (no .NET).
C++ Get Username From Process
===

I have a process handle with

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

How can I get the username of the user that is running the process?

I am using unmanaged code (no .NET).