AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

DLL Problem

Ein Thema von JnZn558 · begonnen am 15. Aug 2010 · letzter Beitrag vom 15. Aug 2010
 
JnZn558

Registriert seit: 22. Aug 2004
98 Beiträge
 
#1

DLL Problem

  Alt 15. Aug 2010, 00:57
my dll hier
Delphi-Quellcode:
library ProcessLib;


uses
  SysUtils, Windows, TlHelp32{, PsAPI};

//{$R *.res}


function QueryFullProcessImageName( hProcess: THandle;
                                    dwFlags: DWORD;
                                    lpExeName: PChar;
                                    nSize: PDWORD ): BOOL; stdcall; external
                                    kernel32 name 'QueryFullProcessImageName' +
                                    {$IFDEF UNICODE} 'W{$ELSE} 'A{$ENDIF};

function GetPathFromProcID( dwProcID: Cardinal ): string;
var
  hProcess: THandle;
  nLen: Cardinal;
  szPath: array[ 0..MAX_PATH ] of Char;

begin
  FillChar( szPath, MAX_PATH, 0 );
  hProcess := OpenProcess( PROCESS_QUERY_INFORMATION,
                           False,
                           dwProcID );
  Result := '';
  if hProcess <> 0 then
  begin
    // das ist 32 bit funktion
    //dwRet := GetModuleFileNameEx( hProcess, 0, szPath, MAX_PATH );
    //if dwRet = ERROR_PARTIAL_COPY then
    // das geht auch unter 64 bit
    //GetProcessImageFileName( hProcess, szPath, MAX_PATH );
    nLen := MAX_PATH;
    if QueryFullProcessImageName( hProcess, 0, szPath, @nLen ) then
      Result := string( szPath ) ;
  end;
  CloseHandle( hProcess );
end;


exports
  GetPathFromProcID;

begin
end.
my prog, das die funktion aufruft
Items[ i ].SubItems.Add( GetPathFromProcID( PE32[ i ].th32ProcessID ) ); nach aufruf dieser funktion in meinem prog, laeuft zwar gut, aber es wird nicht richtig beendet. d.h. ich muss es in delphi program reset klicken um es richtig zu beenden.

ausserdem tritt ein exception auf.

Code:
Debugger Fault Notification

prog.exe raised too many consecutive exceptions. access violation at 0x000214bd: write of address 0x01eb3b84. process stopped. use step or run to continue
Peace on the world

Geändert von JnZn558 (15. Aug 2010 um 11:37 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:48 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