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

Вниз

Как определить номер железа   Найти похожие ветки 

 
Херувим   (2001-12-29 13:29) [0]

Например серийный номер винта, id проца и т.п. Но не предлагайте мне определять номер томов...Это как 2 байта переслать, а вот номер винта...


 
skr   (2002-01-04 13:08) [1]

Есть такая книга "Аппаратные средства IBM PC" Михаил Гук
там вродебы есть адреса соответствующих портов, далее пишешшшш ASM вставку.... либо из реестра в win2k HLM\hardware\description\system\...
я не на что не претендую и в общем не особо много знаю но:
1-помоему в SDK вряд ли такие функции есть.
2-а нельзя ли защитить прогу другим способом?


 
SergVlad   (2002-01-04 16:15) [2]

Поищи в Инете
GetIdeDiskSerialNumber


 
Knight   (2002-01-04 17:11) [3]

Этого добра в ФАКе вагон...


 
Red Alert   (2002-01-04 17:54) [4]

На должно работать, единственно библиотеку на www.torry.ru
возьми, SmallPort называется.. Или какую другую, тогда функции переправишь..Единственное, давно писал, нашел в архиве, не знаю точно работает или нет..
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, SmallPort;

type
TForm1 = class(TForm)
Button1: TButton;
SmallPort1: TSmallPort;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;

PIDEInfo = ^TIDEInfo;
TIDEInfo = Record
Config, {General configuration bit-significant information}
Cyls, {Number of logical cylinders}
Unused, {Reserved}
Heads, {Number of logical heads}
BPT, {Number of unformatted bytes per track}
BPS, {Number of unformatted bytes per sector}
SPT : Word; {Number of logical sectors per logical track}
Vendor : Array [0..2] of Word; {Vendor specific}
Serial : Array [1..20] of Char; {Serial number. 20 ASCii characters, 0000H=not specified}
BufType, {Buffer type}
BufSize, {Buffer size in 512 byte increments. 0000H=not specified}
ECC : Word; {# of ECC bytes avail on read/write long cmds. 0000H=not spec.}
Revision : Array [1..8] of Char; {Firmware revision. 8 ASCii characters. 0000H=not specified}
Model : Array [1..40] of Char; {Model number. 40 ASCii characters. 0000H=not specified}
Features : Word; {Features information}
DwordIO : Word; {0001H=Can perform doubleword I/O}
Capabil : Word; {Capabilities}
Reserved : Word; {Reserved}
PIO : Word; {PIO data transfer information}
DMA : Word; {DMA data transfer information}
ExtValid : Word; {Extended data validation information}
CurrCyls, {Number of current logical cylinders}
CurrHeads, {Number of current logical heads}
CurrSect : Word; {Number of current logical sectors per track}
Capacity : LongInt; {Current capacity in sectors}
BlockMode : Word; {Multiple sectors transfer information}
LBACapacity : LongInt; {Total number of user addressable sectors. LBA mode only}
SingleDMA : Word; {Single word DMA transfer information}
MultiDMA : Word; {Multiword DMA transfer information}
AdvancedPIO : Word; {Advanced PIO Transfer information}
MinDMACycle : Word; {Minimum Multiword DMA Transfer Cycle Time Per Word in nsecs}
RecDMACycle : Word; {Manufacturer Recommended Multiword DMA Transfer Cycle Time}
MinPIOCycle : Word; {Minimum PIO Transfer Cycle Time Without Flow Control in nsecs}
MinIORDYPIOCycle : Word; {Minimum PIO Transfer Cycle Time With IORDY Flow Control in nsecs}
Filler : Array [1..374] of Byte;
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
info : array[0..255] of word; i : integer;
IDEInfo : PIDEInfo;
begin
{
procedure GetIdeInfo(Drive, IDEInfo)
New(IDEInfo);
While(SmallPort1.Port[$1f7] and $80 <>0) do;
begin

end;
}
SmallPort1.Opened:=True;
SmallPort1.port[$3f6]:= 2;
SmallPort1.port[$1f6]:= $A0;{+ (0 shl 4);}
SmallPort1.port[$1f7]:= $Ec;
While(SmallPort1.Port[$1f7] and $80 <>0) do;

for i:= 0 to 255 do
Info[i]:=swap(SmallPort1.PortW[$01f0]);
Move(Info,IDEInfo^,512);
for i:= 1 to 20 do
label1.Caption:=label1.Caption+IDEInfo^.Serial[i];
Dispose(IDEInfo);
SmallPort1.Opened:=False;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
SmallPort1.Opened:=False;
end;

end.


 
13-ый   (2002-01-09 22:52) [5]

опредаление номера винта (не тома) есть в факе на сайте
http://www.chertenok.km.ru/
для ide и для скази винтов


 
Animal   (2002-01-10 09:32) [6]

Пробовал с smallport, но почему-то не работает
где-то здесь:
..
Info[i]:=swap(SmallPort1.PortW[$01f0]);
Move(Info,IDEInfo^,512);
..
Выдается ошибка доступа к памяти...
(Access violation at address 799027dd in "....exe"
Write of address 00DF0872)
Как быть?


 
Red Alert   (2002-01-10 14:40) [7]

Вот так работает
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, SmallPort;

type
TForm1 = class(TForm)
Button1: TButton;
SmallPort1: TSmallPort;
Label1: TLabel;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;

PIDEInfo = ^TIDEInfo;
TIDEInfo = Record
Config, {General configuration bit-significant information}
Cyls, {Number of logical cylinders}
Unused, {Reserved}
Heads, {Number of logical heads}
BPT, {Number of unformatted bytes per track}
BPS, {Number of unformatted bytes per sector}
SPT : Word; {Number of logical sectors per logical track}
Vendor : Array [0..2] of Word; {Vendor specific}
Serial : Array [1..20] of Char; {Serial number. 20 ASCii characters, 0000H=not specified}
BufType, {Buffer type}
BufSize, {Buffer size in 512 byte increments. 0000H=not specified}
ECC : Word; {# of ECC bytes avail on read/write long cmds. 0000H=not spec.}
Revision : Array [1..8] of Char; {Firmware revision. 8 ASCii characters. 0000H=not specified}
Model : Array [1..40] of Char; {Model number. 40 ASCii characters. 0000H=not specified}
Features : Word; {Features information}
DwordIO : Word; {0001H=Can perform doubleword I/O}
Capabil : Word; {Capabilities}
Reserved : Word; {Reserved}
PIO : Word; {PIO data transfer information}
DMA : Word; {DMA data transfer information}
ExtValid : Word; {Extended data validation information}
CurrCyls, {Number of current logical cylinders}
CurrHeads, {Number of current logical heads}
CurrSect : Word; {Number of current logical sectors per track}
Capacity : LongInt; {Current capacity in sectors}
BlockMode : Word; {Multiple sectors transfer information}
LBACapacity : LongInt; {Total number of user addressable sectors. LBA mode only}
SingleDMA : Word; {Single word DMA transfer information}
MultiDMA : Word; {Multiword DMA transfer information}
AdvancedPIO : Word; {Advanced PIO Transfer information}
MinDMACycle : Word; {Minimum Multiword DMA Transfer Cycle Time Per Word in nsecs}
RecDMACycle : Word; {Manufacturer Recommended Multiword DMA Transfer Cycle Time}
MinPIOCycle : Word; {Minimum PIO Transfer Cycle Time Without Flow Control in nsecs}
MinIORDYPIOCycle : Word; {Minimum PIO Transfer Cycle Time With IORDY Flow Control in nsecs}
Filler : Array [1..374] of Byte;
end;

var
Form1: TForm1;
IDEInfo : TIDEInfo;
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
info : array[0..255] of word; i : integer;

begin
SmallPort1.Opened:=True;
SmallPort1.port[$3f6]:= 2;
SmallPort1.port[$1f6]:= $A0+ (0 shl 4);
SmallPort1.port[$1f7]:= $Ec;
While(SmallPort1.Port[$1f7] and $80 <>0) do;
for i:= 0 to 255 do
Info[i]:=swap(SmallPort1.PortW[$01f0]);

Move(Info, IdeInfo^, SizeOf(IdeInfo));
label1.Caption:=label1.Caption+IDEInfo^.Serial[i];
SmallPort1.Opened:=False;
label1.Caption:=label1.Caption;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
SmallPort1.Opened:=False;
end;

end.


 
Red Alert   (2002-01-10 14:44) [8]

И читай описание к компоненте, там драйвер надо кинуть
в windows\system



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

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

Наверх





Память: 0.48 MB
Время: 0.008 c
1-22763
koks
2002-03-27 09:59
2002.04.08
Ламерский вопрос - но в хелпе ничего нет нашел.


14-22824
Evgeny
2002-02-28 06:25
2002.04.08
Чужие окна


14-22801
Pete
2002-02-26 14:04
2002.04.08
Как редактировать свою анкету???


14-22818
Alexandr
2002-02-26 11:47
2002.04.08
две копии windows 98


3-22556
denys
2002-03-15 16:18
2002.04.08
array columns





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский