PDA

Click to See Complete Forum and Search --> : Acess to hardware in W2000/NT through c++ dll in delphi...


jesper
Mar 18th, 2001, 09:47 AM
hi, i have very big (for me) problem. i want to write dll in c++ which i can use to acces to hardware in win2000.
in W95/98 i used two functions in delphi - GetPort and SetPort for writing and reading from address. But if i want run this prog in win2000, it appears "Privileg instruction".

function GetPort( P : WORD ) : Byte; assembler;

asm

MOV DX, P;

IN AL, DX;

end;

procedure SetPort( P : WORD; Value : Byte ); assembler;

asm

MOV DX, P;

MOV AL, Value;

OUT DX, AL;

end;

please, do you know how to let my program run correctly ??????

Thanks in advance. Standa

parksie
Mar 18th, 2001, 11:16 AM
Win2000 is designed for stability, so direct hardware access is forbidden. You'll need to use the API -- see MSDN for details.

jesper
Mar 18th, 2001, 11:19 AM
Yes i know about Win2000 stability. But, can yuo say me something more concretly ???

parksie
Mar 18th, 2001, 11:27 AM
You're using port access, so obviously you need specific hardware access. What hardware is it? NT provides APIs for all the different hardware devices.

jesper
Mar 18th, 2001, 11:40 AM
thank you, but API ??
i need only to send one byte to hardware port and receive very small value. It is old ISA card. Where can i find it in MSDN???

parksie
Mar 18th, 2001, 11:50 AM
I really can't help much further than point you at MSDN :( You might want to look at the driver development kit for NT, since drivers are allowed direct hardware access (obviously :p). If you wrote a driver for your card then you'd be able to use it. What card is it?

jesper
Mar 19th, 2001, 06:36 AM
it is very simple A/D convertor.....

parksie
Mar 19th, 2001, 12:02 PM
Supplier? Manufacturer? Model number?