Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   How can i close handle remote? (CloseHandle remote) (https://www.delphipraxis.net/189854-how-can-i-close-handle-remote-closehandle-remote.html)

DelphiBerlin 30. Jul 2016 15:57

How can i close handle remote? (CloseHandle remote)
 
Hello

Are possible close a remote handle of another process?
Example: I'm trying with this command

Delphi-Quellcode:
hProcess : THandle ;
begin
    hProcess := OpenProcess (PROCESSS_ALL_ACESS, false, RemotePID) ;
    CloseHandle (RemoteHandleID) {$1C}
   CloseHandle (hProcess) ;
end;
But the problem is, this works only on my process, closed the handle only on my process and don't killed the handle on the remote process {$1C}

Thank you! :lol:

himitsu 31. Jul 2016 10:56

AW: How can i close handle remote? (CloseHandle remote)
 
Das geht einfach garnicht.
Das ist genauso, wie ein Pointer nur im eigenen Prozess gültig ist. (seit es zum Glück das prozess-eigene VirtualMemory gibt)

Handle sind immer nur im eigenen Prozess gültig und können auch nur dort geschlossen werden.
Einige Handle sind sogar nur im erstellenden Thread gültig und Zugriffe außerhalb sind nicht möglich (bzw. bereiten Probleme).

Mit einem Hook in den Prozess rein und dann von drinnen schließen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz