标题就是内容!
一年前我提过类似的问题,但是没有得到答案,因此旧事重提:)
如果解决了,100分立即送上!再多点也行!
如果给不出标准答案,相关的资料也可以。

解决方案 »

  1.   

    obtain a list of loaded drivers under Windows NT?

      This code takes advantage of the undocumented NtQuerySystemInformation 
      API to obtain a list of loaded drivers under Windows NT. 
    }
    const
      DRIVER_INFORMATION = 11;type
      TPDWord = ^DWORD;  TDriverInfo = packed record
        Address: Pointer;
        Unknown1: DWORD;
        Unknown2: DWORD;
        EntryIndex: DWORD;
        Unknown4: DWORD;
        Name: array[0..MAX_PATH + 3] of Char;
      end;var
      NtQuerySystemInformation: function(infoClass: DWORD;
        buffer: Pointer;
        bufSize: DWORD;
        returnSize: TPDword): DWORD; stdcall = nil;function GetDriverInfo: string;
    var
      temp, Index, numBytes, numEntries: DWORD;
      buf               : TPDword;
      driverInfo        : ^TDriverInfo;
    begin
      if @NtQuerySystemInformation = nil then
        NtQuerySystemInformation := GetProcAddress(GetModuleHandle('ntdll.dll'),
          'NtQuerySystemInformation');    // Obtain required buffer size
      NtQuerySystemInformation(DRIVER_INFORMATION, @temp, 0, @numBytes);
        // Allocate buffer
      buf := AllocMem(numBytes * 2);  NtQuerySystemInformation(DRIVER_INFORMATION, buf, numBytes * 2, @numBytes);
      numEntries := buf^;
      driverInfo := Pointer(DWORD(buf) + 12);
      Result := '';
      for Index := 1 to numEntries do
      begin
        Result := Result + #$D#$A + 'Address: $' + IntToHex(DWORD(driverInfo^.Address), 8) +
          'Name: "' + (driverInfo^.Name) + '"';
        Inc(driverInfo);
      end;
      Delete(Result, 1, 2);
      FreeMem(buf);
    end;
      

  2.   

    remove a Dll from memory?function KillDll(aDllName: string): Boolean; 
    var 
      hDLL: THandle; 
      aName: array[0..10] of char; 
      FoundDLL: Boolean; 
    begin 
      StrPCopy(aName, aDllName); 
      FoundDLL := False; 
      repeat 
        hDLL := GetModuleHandle(aName); 
        if hDLL = 0 then 
          Break; 
        FoundDLL := True; 
        FreeLibrary(hDLL); 
      until False; 
      if FoundDLL then 
        MessageDlg('Success!', mtInformation, [mbOK], 0) 
      else 
        MessageDlg('DLL not found!', mtInformation, [mbOK], 0); 
    end;
      

  3.   

    感谢楼上的朋友。
    不过你的第一段代码获得的是loaded drivers 的信息,并不是所有dll的信息。
    谁能再提供些资料呢?
    回复的保证都有分。
      

  4.   

    C++代码还是算了吧 转换为delphi的也是麻烦事
      

  5.   

    用PsAPI/ToolHelp
    列举每个进程,再列举DLL比较麻烦:)http://lysoft.7u7.net
      

  6.   

    ly_liuyang(Liu Yang):
    你的网站我看了,有一个东西是不是?
    LY Task Manager --- 可以查看进程相关DLL信息的简单任务管理器^_^
    不过你只给出了exe,没有给出源程序呀,现在不都讲源码开放吗?^_^
      

  7.   

    to  q112(黄色月亮) :
    一般这种在SDK跟DDK方面做事的代码, c++(貌似都是c的代码)跟delphi并没有太大的区别,直接转换是很容易的;
    一般MSDN或者其它开源社区里的c代码可以直接paste到delphi里改几个关键字就是了。
      

  8.   

    为什么要终止DLL啊?首先一个DLL可能由多个进程引用,你把DLL的代码从内存中洗掉,别的程序应该出错的吧,这是你想看到的吗?你果你不想DLL中代码被执行,可以把EXE的掉用NOP掉。
    或者自己写一个DLL模拟上个DLL的输出函数。
      

  9.   

    Aiirii(ari-爱的眼睛) 把C++代码贴出来看看啊!