Einzelnen Beitrag anzeigen

flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#4

AW: How know what process is using a determinated file through NtQueryInformationFile

  Alt 9. Apr 2018, 12:55
Hi there, i have to admit that i dont understand everthing yet, especially the "NtQueryInformationFile" call.
If you want to iterate files and folders i could give you a way shorter method.
I want that when next file is verified and be the same(s) previous process(es) using this file, not show yours exe name.

My last attempt:

Delphi-Quellcode:
var
 currPid, oldPid : LongWord; // Global

...

for I := 0 to High(P.ProcessIdList) do
  begin
    if P.ProcessIdList[I] = pe.th32ProcessID then
    begin
      oldPid := currPid;
      currPid := pe.th32ProcessID;
      if currPid <> oldPid then
        Form1.mmo1.Lines.Add(pe.szExeFile);
      Break;
    end;
  end;
  Mit Zitat antworten Zitat