home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / zkuste / konfig / download / msic / D7 / MSI_ResourcesDlg.pas < prev    next >
Pascal/Delphi Source File  |  2003-08-19  |  3KB  |  99 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {         MiTeC System Information Component            }
  4. {                Resource Overview                      }
  5. {           version 8.1 for Delphi 5,6,7                }
  6. {                                                       }
  7. {       Copyright ⌐ 1997,2003 Michal Mutl               }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11.  
  12. {$INCLUDE MITEC_DEF.INC}
  13.  
  14. unit MSI_ResourcesDlg;
  15.  
  16. interface
  17.  
  18. uses
  19.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  20.   Dialogs, StdCtrls, ExtCtrls, ComCtrls, MiTeC_NTDDK;
  21.  
  22. type
  23.   TdlgResources = class(TForm)
  24.     Panel: TPanel;
  25.     Panel2: TPanel;
  26.     bOK: TButton;
  27.     Panel3: TPanel;
  28.     DMAList: TListView;
  29.     Panel4: TPanel;
  30.     IRQList: TListView;
  31.     pMem: TPanel;
  32.     MemList: TListView;
  33.     Panel6: TPanel;
  34.     PortList: TListView;
  35.     Panel7: TPanel;
  36.     DSDList: TListView;
  37.     GroupBox1: TGroupBox;
  38.     lIntfType: TLabel;
  39.     lBusNumber: TLabel;
  40.     lVersion: TLabel;
  41.     lRevision: TLabel;
  42.   private
  43.   public
  44.   end;
  45.  
  46. procedure ShowResourcesDlg(ATitle: string; ADR: TDeviceResources);
  47.  
  48. var
  49.   dlgResources: TdlgResources;
  50.  
  51. implementation
  52.  
  53. {$R *.dfm}
  54.  
  55. procedure ShowResourcesDlg;
  56. var
  57.   i: Integer;
  58. begin
  59.   with TdlgResources.Create(Application.MainForm) do begin
  60.     Caption:=ATitle;
  61.     lIntfType.Caption:=Format('Interface Type: %s',[DeviceIntfTypeStr(ADR.InterfaceType)]);
  62.     lBusNumber.Caption:=Format('Bus Number: %d',[ADR.BusNumber]);
  63.     lVersion.Caption:=Format('Version: %d',[ADR.Version]);
  64.     lRevision.Caption:=Format('Revision: %d',[ADR.Revision]);
  65.     for i:=0 to High(ADR.Resources) do
  66.       case ADR.Resources[i].Typ of
  67.         CmResourceTypePort: with PortList.Items.Add do begin
  68.           Caption:=Format('0x%8.8x',[ADR.Resources[i].Port.Start.QuadPart]);
  69.           SubItems.Add(Format('0x%x',[ADR.Resources[i].Port.Length]));
  70.           SubItems.Add(Format('%s',[PortTypeStr(ADR.Resources[i].Flags)]));
  71.         end;
  72.         CmResourceTypeInterrupt: with IRQList.Items.Add do begin
  73.           Caption:=Format('%d',[ADR.Resources[i].Interrupt.Vector]);
  74.           SubItems.Add(Format('%d',[ADR.Resources[i].Interrupt.Level]));
  75.           SubItems.Add(Format('0x%x',[ADR.Resources[i].Interrupt.Affinity]));
  76.           SubItems.Add(Format('%s',[InterruptTypeStr(ADR.Resources[i].Flags)]));
  77.         end;
  78.         CmResourceTypeMemory: with MemList.Items.Add do begin
  79.           Caption:=Format('0x%8.8x',[ADR.Resources[i].Memory.Start.QuadPart]);
  80.           SubItems.Add(Format('0x%x',[ADR.Resources[i].Memory.Length]));
  81.           SubItems.Add(Format('%s',[MemoryAccessStr(ADR.Resources[i].Flags)]));
  82.         end;
  83.         CmResourceTypeDma: with DMAList.Items.Add do begin
  84.           Caption:=Format('%d',[ADR.Resources[i].DMA.Channel]);
  85.           SubItems.Add(Format('%d',[ADR.Resources[i].DMA.Port]));
  86.         end;
  87.         CmResourceTypeDeviceSpecific: with DSDList.Items.Add do begin
  88.           Caption:=Format('0x%x',[ADR.Resources[i].DeviceSpecificData.Reserved1]);
  89.           SubItems.Add(Format('0x%x',[ADR.Resources[i].DeviceSpecificData.Reserved2]));
  90.           SubItems.Add(Format('0x%x',[ADR.Resources[i].DeviceSpecificData.DataSize]));
  91.         end;
  92.       end;
  93.     ShowModal;
  94.     Free;
  95.   end;
  96. end;
  97.  
  98. end.
  99.