title: Why do I get nonsense from GetModuleFileNameEx on 64-bit Windows 8?
body: <p>I have this </p>
  
  <pre><code>function NazwaProcesu(const uchwyt: Thandle): string;
  var
    pid: DWORD;
    hProcess: Thandle;
    sciezka: array [0..MAX_PATH - 1] of char;
  begin
    GetWindowThreadProcessId(uchwyt, pid);
    hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE, pid);
    if hProcess &lt;&gt; 0 then
      try
        GetModuleFileNameEx(hProcess, 0, sciezka, MAX_PATH)
      finally
        Result := sciezka;
        CloseHandle(hProcess);
      end;
  end;
  </code></pre>
  
  <p>On windows 7 32 bit no problems. On Win 8 x64 i have this:</p>
  
  <p><img src="https://i.stack.imgur.com/LeS0c.png" alt="enter image description here"></p>
  
  <p>where last 3 entries should be explorer.exe, i guess. Thanks for help.</p>