怎么用WINIO去读FFFFFFFF这个地址?
怎么用WINIO去读FFFFFFFF这个地址? 贴一个WINIO自带的例子:#include <windows.h>
#include <stdio.h>
#include "winio.h"
void main()
{
DWORD dwPortVal;
DWORD dwMemVal;
bool bResult;
HANDLE hPhysicalMemory;
PBYTE pbLinAddr;
// Call InitializeWinIo to initialize the WinIo library.
bResult = InitializeWinIo();
if (bResult)
{
// Under Windows NT/2000/XP, after calling InitializeWinIo,
// you can call _inp/_outp instead of using GetPortVal/SetPortVal
GetPortVal(0x378, &dwPortVal, 4);
SetPortVal(0x378, 10, 4);
// Map physical addresses 0xA0000 - 0xAFFFF into the linear address space
// of the application. The value returned from the call to MapPhysToLin is
// a linear address corresponding to physical address 0xA0000. In case of
// an error, the return value is NULL.
pbLinAddr = MapPhysToLin((PBYTE)0xA0000, 65536, &hPhysicalMemory);
if (pbLinAddr)
{
// Now we can use pbLinAddr to access physical address 0xA0000
*pbLinAddr = 10;
// When you're done with pbLinAddr, call UnmapPhysicalMemory
UnmapPhysicalMemory(hPhysicalMemory, pbLinAddr);
}
// Instead of using MapPhysToLin, we can use GetPhysLong/SetPhysLong
GetPhysLong((PBYTE)0xA0000, &dwMemVal);
SetPhysLong((PBYTE)0xA0000, 10);
// When you're done using WinIo, call ShutdownWinIo
ShutdownWinIo();
}
else
{
printf("Error during initialization of WinIo.\n");
exit(1);
}
} 楼上的有试过吗?楼主所说的 地址超过2G了哦 我目前也是2G之后就不行了 WinIO是有2G的限制,因为2G~4G之间属于系统部分,Microsoft是不会让用户自己乱搞的。 此问题已解决,请用附件改过的WinIo库,就可以访问到>2G的memory了
[ 本帖最后由 happybasic 于 2008-12-24 11:00 编辑 ] 向happybasic 表达一下自己的无线敬意!! 谢谢2#和6#:handshake 谁来翻译/解释一下~
END USER LICENSE AGREEMENT
Software License Agreement for WinIo
The following terms apply to all files associated with the software unless explicitly disclaimed in individual files.
IMPORTANT- PLEASE READ CAREFULLY: BY INSTALLING THE SOFTWARE (AS DEFINED BELOW), OR COPYING THE SOFTWARE, YOU (EITHER ON BEHALF OF YOURSELF AS AN INDIVIDUAL OR ON BEHALF OF AN ENTITY AS ITS AUTHORIZED REPRESENTATIVE) AGREE TO ALL OF THE TERMS OF THIS END USER LICENSE AGREEMENT ("AGREEMENT") REGARDING YOUR USE OF THE SOFTWARE. IF YOU DO NOT AGREE WITH ALL OF THE TERMS OF THIS AGREEMENT, DO NOT INSTALL, COPY OR OTHERWISE USE THE SOFTWARE.
1. GRANT OF LICENSE: Subject to the terms below, Yariv Kaplan ("AUTHOR") hereby grants you a non-exclusive, non-transferable, non-assignable license to install and to use the downloadable version of WinIo ("SOFTWARE").
a. Redistributable Code. You may reproduce and distribute the object code form of the SOFTWARE solely in conjunction with, and as part of, your application ("Permitted Application"); provided that you comply with the following:
If you redistribute any portion of the Redistributable Code, you agree that: (i) you will only distribute the Redistributable Code in conjunction with, and as part of, your Permitted Application which adds significant functionality to the Redistributable Code and that distribution of the Permitted Application does not compete with the AUTHOR's distribution of the SOFTWARE; (ii) you will include a valid copyright notice on your Permitted Application; (iii) you will not permit further redistribution of the Redistributable Code; and (iv) you will indemnify, hold harmless, and defend the AUTHOR from and against any claims or lawsuits, including attorneys' fees, that arise or result from the use or distribution of your Permitted Application.
b. License to use Source Code. You may not sell, lease, rent, transfer or sublicense the source code of this SOFTWARE.
2. MODIFICATION: SOFTWARE Source Code may be modified without the prior written permission of the AUTHOR. Any modifications made to the SOFTWARE will continue to be subject to the terms and conditions of this AGREEMENT.
3. COPYRIGHT: All rights, title, and copyrights in and to the SOFTWARE and any copies of the SOFTWARE are owned by the AUTHOR. The SOFTWARE is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE like any other copyrighted material.
4. TITLE: You acknowledge that no title to the intellectual property in the SOFTWARE is transferred to you. Title, ownership, rights, and intellectual property rights in and to the SOFTWARE shall remain the exclusive property of the AUTHOR. The SOFTWARE is protected by copyright laws of the United States and international treaties.
5. LIMITATION OF LIABILITY: You must assume the entire risk of using the SOFTWARE.
IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 刚收到一位在用我改过的WinIo的网友提醒说我可能在违反license ... 很晕的说,他先下了,再提醒我.... 对,向happybasic 表达一下自己的无线敬意!!他人很好~ 原帖由 happybasic 于 2008-12-24 11:21 发表 http://www.ufoit.com/bbs/images/common/back.gif
刚收到一位在用我改过的WinIo的网友提醒说我可能在违反license ... 很晕的说,他先下了,再提醒我....
winio早已经不维护了,他自己有bug还不许别人修改吗。
原来的作者误以为_LARGE_INTEGER的QuartPart是个无符号数了。:lol 我路过,,我是菜鸟, 原帖由 happybasic 于 2008-12-13 17:07 发表 http://www.ufoit.com/bbs/images/common/back.gif
此问题已解决,请用附件修改过的WinIo库,就可以访问到>2G的memory了
请问现在这个修改过的winIo库还有吗?好像删除了 已经找到了,感谢各位~ pStartPhysAddress.QuadPart = (ULONGLONG)pPhysAddress &....... 也在为读取2G以上的地址所困扰,谢谢
所说的附件呢?
[ 本帖最后由 iwillbeback008 于 2011-5-26 20:31 编辑 ]
页:
[1]