Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2005.01.02;
Скачать: [xml.tar.bz2];

Вниз

Узнать имя DLL которую загрузил мой процесс   Найти похожие ветки 

 
paa   (2004-11-16 08:52) [0]

Пришло событие что процесс загрузил какую то Dllку.
Как узнать имя этой DLLки?


 
Digitman ©   (2004-11-16 09:18) [1]


> Пришло событие что процесс загрузил какую то Dllку


событие не "приходит" и не "уходит", оно происходит (или наступает)

что за событие ? подробней..


 
paa   (2004-11-16 09:48) [2]

событие LOAD_DLL_DEBUG_EVENT:


 
Digitman ©   (2004-11-16 10:11) [3]

typedef struct _LOAD_DLL_DEBUG_INFO { // lddi  
   HANDLE hFile;  
   LPVOID lpBaseOfDll;
   DWORD  dwDebugInfoFileOffset;
   DWORD  nDebugInfoSize;
   LPVOID lpImageName;
   WORD fUnicode;
} LOAD_DLL_DEBUG_INFO;

lpImageName

Points to the filename associated with hFile. This member may be NULL, or it may contain the address of a string pointer in the address space of the process being debugged. That address may, in turn, either be NULL or point to the actual filename. If fUnicode is a nonzero value, the name string is Unicode; otherwise, it is ANSI.

This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *
lpImageName (in the address space of the process being debugged) is NULL. Specifically, this release of Windows NT will never provide an image name for a create process event, and it will not likely pass an image name for the first DLL event. This version of Windows NT will also never provide this information in the case of debugging events that originate from a call to the DebugActiveProcess function.

fUnicode

Indicates whether a filename specified by lpImageName is Unicode or ANSI. A nonzero value for this member indicates Unicode; zero indicates ANSI.


 
VMcL ©   (2004-11-16 10:13) [4]

LOAD_DLL_DEBUG_INFO.lpImageName


 
paa   (2004-11-16 10:58) [5]

не получается в строковую переменную получить имя DLL,
что делать с lpImageName?


 
Digitman ©   (2004-11-16 11:12) [6]


> paa   (16.11.04 10:58) [5]


что значит "не получается" ?


 
VMcL ©   (2004-11-16 11:32) [7]

>>paa  (16.11.04 10:58) [5]

Если fUnicode = 0, то привести lpImageName к PAnsiChar, иначе привести к PWideChar.


 
paa   (2004-11-16 11:53) [8]

>Если fUnicode = 0, то привести lpImageName к PAnsiChar, иначе привести к PWideChar.

делаю так:
var NameDll:string
...
...
if Event.LoadDll.fUnicode = 0 then
               NameDll:=PAnsiChar(Event.LoadDll.lpImageName)
else
               NameDll:=PWideChar(Event.LoadDll.lpImageName);

в lpImageName=$7FFDE014, а  переменной NameDll="";


 
Digitman ©   (2004-11-16 12:16) [9]

var
NameDll:String;

if Event.LoadDll.fUnicode = 0 then
NameDll:=StrPas(PChar(Event.LoadDll.lpImageName))
else
 NameDll:=WideCharToString(PWideChar(Event.LoadDll.lpImageName));


 
paa   (2004-11-16 12:30) [10]

> Digitman ©   (16.11.04 12:16) [9]

И так не получается, но все равно спасибо!
Как говорится "будем искать"!


 
Digitman ©   (2004-11-16 12:50) [11]

если lpImageName <> nil, то оно содержит не прямую, а косвенную ссылку на строку, поэтому требуется доп.разыменование :

var
pImageName: Pointer;
NameDll:String;

with Event.LoadDll do
if Assigned(lpImageName) then
 begin
  pImageName := Pointer(lpImageName^);
  if Assigned(pImageName) then
   if fUnicode = 0 then
    NameDll:=StrPas(PChar(pImageName))
   else
    NameDll:=WideCharToString(PWideChar(pImageName));
 end;

цитата из справки :

This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *lpImageName (in the address space of the process being debugged) is NULL



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2005.01.02;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.035 c
1-1103479224
softmaster
2004-12-19 21:00
2005.01.02
Проблема с формой


14-1102541741
Piter
2004-12-09 00:35
2005.01.02
Вопросы по VMWare


4-1100620136
webpauk
2004-11-16 18:48
2005.01.02
WM_NCHITTEST


1-1103451288
idiliya
2004-12-19 13:14
2005.01.02
Как создавать thumbnails для больших изображений?


3-1102061042
pkm
2004-12-03 11:04
2005.01.02
Не по теме, но на другие темы форума не могу зайти: ошбка!!!





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский