Einzelnen Beitrag anzeigen

Benutzerbild von Reddog
Reddog

Registriert seit: 18. Jul 2004
Ort: Würzburg
56 Beiträge
 
#25

Re: Handle einer geladenen DLL in einem anderen Process find

  Alt 27. Jul 2004, 01:30
Delphi-Quellcode:
function MainProc(Param: DWORD): DWORD; stdcall;
begin
  LoadLibrary(...);
  while 1=1 do begin
  end;
end;
Delphi-Quellcode:
    ...

    SecAtt.nLength:= SizeOf(SECURITY_ATTRIBUTES);
    SecAtt.lpSecurityDescriptor:= nil;
    SecAtt.bInheritHandle:= True;
    HThread:= CreateRemoteThread(ProcessID, @SecAtt, 0, @MainProc, nil, THREAD_PRIORITY_NORMAL, TID);
    If HThread = 0 then
      RaiseLastOSError;

    ...
Hab ich da jetzt was falsch gemacht? Für HThread kommt immer 0 raus. Die ProcessID ist aber definiert und stimmt auch, hab mit SysInfo nachgekuckt.
All prime numbers are odd with the exception of two, which is an odd prime
  Mit Zitat antworten Zitat