gpt4 book ai didi

windows - 如何在 Windows XP 中写入 I/O 端口? (德尔福7)

转载 作者:可可西里 更新时间:2023-11-01 13:27:52 26 4
gpt4 key购买 nike

我正在尝试写入端口 0x60 和 0x64,但没有成功。

德尔福代码:

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

在调用 PortOut 时,我得到一个 EPrivilege Privileged instruction 异常,因为 INOUT 可能只作为 Ring0 执行。

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

最佳答案

看看 IO.DLL from Geek Hideout .

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

这是一个例子:Parallel Port I/O Using Delphi V 6.0

关于windows - 如何在 Windows XP 中写入 I/O 端口? (德尔福7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2167579/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com