如何在Windows XP中写入I / O端口? (Delphi7) [英] How to write to I/O ports in Windows XP? (Delphi7)

查看:204
本文介绍了如何在Windows XP中写入I / O端口? (Delphi7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试写入端口0x60和0x64,没有运气。

I am trying to write to ports 0x60 and 0x64, with no luck.

Delphi代码:

procedure PortOut(IOport: WORD; Value: BYTE); assembler; register;
asm
  XCHG DX,AX
  OUT DX,AL
end;

在调用PortOut时,我得到一个EPrivilege 特权指令异常,因为 IN OUT 只能执行为Ring0。

Upon calling PortOut, I get an EPrivilege Privileged instruction exception, because IN and OUT may only execute as Ring0.

I想知道我如何获得Ring0权限我的应用程序,或者如何使用一些现有的外部库写入端口0x60和0x64。

I would like to know how I can get Ring0 privileges my an application or how I could write to ports 0x60 and 0x64 using some existing external library.

推荐答案

查看来自Geek Hideout的IO.DLL


IO.DLL允许无缝端口I / O
操作Windows
95/98 / NT / 2000 / XP使用相同的
库。

IO.DLL allows seamless port I/O operations for Windows 95/98/NT/2000/XP using the same library.

这是一个例子:并行端口I / O使用Delphi V 6.0

这篇关于如何在Windows XP中写入I / O端口? (Delphi7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆