 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
T Davies Guest
|
Posted: Wed Jan 14, 2004 4:03 pm Post subject: Help on EPrivilege |
|
|
Hi
I am trying to upgrade a program (that I didn't write!) from D3 to D5 and
now get an EPrivilege exception with the following code:
procedure PortOut(IOAddr : word; Data : BYTE);
begin
asm
mov dx, IOAddr
mov al, Data
out dx,al
end;
end;
Can someone please help me and explain why I get the exception and more
importantly, how I can avoid it? (Note, the OS is also upgraded from 95 to
XP)
thanks in advance
Trevor
|
|
| Back to top |
|
 |
Maarten Wiltink Guest
|
Posted: Wed Jan 14, 2004 7:17 pm Post subject: Re: Help on EPrivilege |
|
|
"T Davies" <tdavies (AT) somta (DOT) co.za> wrote
| Quote: | I am trying to upgrade a program (that I didn't write!) from D3 to D5
and now get an EPrivilege exception with the following code:
procedure PortOut(IOAddr : word; Data : BYTE);
begin
asm
mov dx, IOAddr
mov al, Data
out dx,al
end;
end;
Can someone please help me and explain why I get the exception and
more importantly, how I can avoid it? (Note, the OS is also upgraded
from 95 to XP)
|
And _that_ is your problem. Windows NT family versions of Windows do
not allow you to mess with the hardware (I was going to say "your
hardware, but it's not. It's Windows' hardware nowadays).
If you have a device to control, get a device driver for it. User space
has simply lost access to the I/O bus.
Groetjes,
Maarten Wiltink
|
|
| Back to top |
|
 |
John Dammeyer Guest
|
Posted: Wed Jan 14, 2004 10:36 pm Post subject: Re: Help on EPrivilege |
|
|
Hi,
I use http://www.driverlinx.com/DownLoad/DlPortIO.htm which I found
was very easy to use in the Delphi Environment.
Cheers,
John
"Maarten Wiltink" <maarten (AT) kittensandcats (DOT) net> wrote:
| Quote: | "T Davies" <tdavies (AT) somta (DOT) co.za> wrote in message
news:Ku-dnaJsBaQf9ZjdRVn-gQ (AT) is (DOT) co.za...
I am trying to upgrade a program (that I didn't write!) from D3 to D5
and now get an EPrivilege exception with the following code:
procedure PortOut(IOAddr : word; Data : BYTE);
begin
asm
mov dx, IOAddr
mov al, Data
out dx,al
end;
end;
Can someone please help me and explain why I get the exception and
more importantly, how I can avoid it? (Note, the OS is also upgraded
from 95 to XP)
And _that_ is your problem. Windows NT family versions of Windows do
not allow you to mess with the hardware (I was going to say "your
hardware, but it's not. It's Windows' hardware nowadays).
If you have a device to control, get a device driver for it. User space
has simply lost access to the I/O bus.
Groetjes,
Maarten Wiltink
|
|
|
| Back to top |
|
 |
Jamie Guest
|
Posted: Wed Jan 14, 2004 11:00 pm Post subject: Re: Help on EPrivilege |
|
|
Look around the NeT . there is a Free Driver some where called
DirectIO.Sys that you can use to access directly the hardware.
if you can not find that then you can down load from MS the
DDK (device Driver Kit) and you also need VC++ to create a Port
driver. , then you can open it from Delphi using API calls
i think the OpenDriver Function may work for you.
T Davies wrote:
| Quote: | Hi
I am trying to upgrade a program (that I didn't write!) from D3 to D5 and
now get an EPrivilege exception with the following code:
procedure PortOut(IOAddr : word; Data : BYTE);
begin
asm
mov dx, IOAddr
mov al, Data
out dx,al
end;
end;
Can someone please help me and explain why I get the exception and more
importantly, how I can avoid it? (Note, the OS is also upgraded from 95 to
XP)
thanks in advance
Trevor
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|