cs_pascal99
Messages postés24Date d'inscriptionmercredi 10 septembre 2003StatutMembreDernière intervention20 janvier 2009
-
4 nov. 2004 à 08:28
cs_pascal99
Messages postés24Date d'inscriptionmercredi 10 septembre 2003StatutMembreDernière intervention20 janvier 2009
-
16 nov. 2004 à 16:42
Bonjour,
Je n'arrive pas a utiliser la fonction VDMEnumTaskWOWEx de la DLL VDMDBG.
Cette fonction permet de connaître les processes 16bits tournant sur une machine par rapport à l'ID du process NTVDM.EXE
Function LoadVDMDBG: Boolean;
Function Enum16 (dwThreadId: Cardinal; hMod16: Word; hTask16: Word; pszModName, pszFileName: PSZ; lpUserDefined: LPARAM): Boolean; stdcall;
implementation
var hVDMDBG: THandle;
VDMEnumTaskWOWEx : TVDMEnumTaskWOWEx;
function LoadVDMDBG: Boolean;
begin
if hVDMDBG = 0 then
begin
hVDMDBG := LoadLibrary('VDMDBG.dll');
if hVDMDBG < 32 then
begin
hVDMDBG := 0;
Result := False;
Exit;
end;
@VDMEnumTaskWOWEx := GetProcAddress(hVDMDBG, 'VDMEnumTaskWOWEx');
end;
Result := True;
end;
function Enum16(dwThreadId: Cardinal; hMod16: Word; hTask16: Word; pszModName, pszFileName: PSZ; lpUserDefined: LPARAM): Boolean; stdcall;
begin
//ce que l'on souhaite faire avec le process 16bits par ex :
toto := ExtractFileName(pszFileName);
result := false;
end;
...
VDMDBGLoaded := LoadVDMDBG;
...
if (UpperCase(truc.nom) = 'NTVDM.EXE')
and VDMDBGLoaded then
begin
cEP16 := VDMEnumTaskWOWEx(truc.ID, Enum16, 0); // Enum 16-bit process ;
for i := 0 to cEP16-1 do //faire un truc avec
end;