Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  4 450

•  TDictionary Custom Sort  6 483

•  Fast Watermark Sources  6 281

•  3D Designer  9 224

•  Sik Screen Capture  6 615

•  Patch Maker  6 994

•  Айболит (remote control)  6 998

•  ListBox Drag & Drop  5 867

•  Доска для игры Реверси  97 059

•  Графические эффекты  7 198

•  Рисование по маске  6 501

•  Перетаскивание изображений  5 365

•  Canvas Drawing  5 741

•  Рисование Луны  5 454

•  Поворот изображения  4 981

•  Рисование стержней  3 535

•  Paint on Shape  2 803

•  Генератор кроссвордов  3 669

•  Головоломка Paletto  2 959

•  Теорема Монжа об окружностях  3 763

•  Пазл Numbrix  2 481

•  Заборы и коммивояжеры  3 166

•  Игра HIP  2 132

•  Игра Go (Го)  2 066

•  Симулятор лифта  2 438

•  Программа укладки плитки  2 113

•  Генератор лабиринта  2 584

•  Проверка числового ввода  2 264

•  HEX View  2 591

•  Физический маятник  2 202

 
скрыть

Delphi Sources

Получить список загруженных драйверов под NT



Оформил: DeeCo

{ 
  This code takes advantage of the undocumented NtQuerySystemInformation 
  API to obtain a list of loaded drivers under Windows NT. 

  Dieser Code verwendet die undokumentiere NtQuerySystemInformation API Funktion 
  um eine Liste aller geladenen Treiber unter Windows NT zu ermitteln. 
}

 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 + #0$D#0$A+'Address: $' + IntToHex(DWORD(driverInfo^.Address), 8) +
         'Name: "' + (driverInfo^.Name) + '"';
       Inc(driverInfo);
     end;
     Delete(Result, 1, 2);
     FreeMem(buf);
   end;

   procedure TForm1.Button1Click(Sender: TObject);
   begin
     ListBox1.Items.Add(GetDriverInfo)
   end;


   // Thanks to Madshi for helping me translate from C++ Code 
  // Original Code (C++) : 
  //                             NtDriverList v1.0 
  //                      Copyright 1998, 1999 Yariv Kaplan 
  //                             WWW.INTERNALS.COM 

Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте