longze 发表于 2008-3-29 08:37:22

怎么用WINIO去读FFFFFFFF这个地址?

怎么用WINIO去读FFFFFFFF这个地址?

amty.wang 发表于 2008-4-7 23:12:35

贴一个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);
}
}

c_cfan 发表于 2008-9-23 14:49:10

楼上的有试过吗?楼主所说的 地址超过2G了哦

happybasic 发表于 2008-9-24 20:00:29

我目前也是2G之后就不行了

Alexander 发表于 2008-12-12 21:45:50

WinIO是有2G的限制,因为2G~4G之间属于系统部分,Microsoft是不会让用户自己乱搞的。

happybasic 发表于 2008-12-13 17:07:47

此问题已解决,请用附件改过的WinIo库,就可以访问到>2G的memory了

[ 本帖最后由 happybasic 于 2008-12-24 11:00 编辑 ]

weednet 发表于 2008-12-18 15:36:12

向happybasic 表达一下自己的无线敬意!!

xtdumpling 发表于 2008-12-23 22:24:04

谢谢2#和6#:handshake

happybasic 发表于 2008-12-24 11:19:55

谁来翻译/解释一下~
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.

happybasic 发表于 2008-12-24 11:21:14

刚收到一位在用我改过的WinIo的网友提醒说我可能在违反license ... 很晕的说,他先下了,再提醒我....

watercai123 发表于 2009-1-16 00:42:09

对,向happybasic 表达一下自己的无线敬意!!他人很好~

qdk0901 发表于 2009-2-14 22:41:35

原帖由 happybasic 于 2008-12-24 11:21 发表 http://www.ufoit.com/bbs/images/common/back.gif
刚收到一位在用我改过的WinIo的网友提醒说我可能在违反license ... 很晕的说,他先下了,再提醒我....

winio早已经不维护了,他自己有bug还不许别人修改吗。

原来的作者误以为_LARGE_INTEGER的QuartPart是个无符号数了。:lol

lzwfy 发表于 2009-6-14 14:57:16

我路过,,我是菜鸟,

madsys 发表于 2010-3-23 16:09:06

原帖由 happybasic 于 2008-12-13 17:07 发表 http://www.ufoit.com/bbs/images/common/back.gif
此问题已解决,请用附件修改过的WinIo库,就可以访问到>2G的memory了

请问现在这个修改过的winIo库还有吗?好像删除了

madsys 发表于 2010-3-23 16:29:29

已经找到了,感谢各位~

Faintsnow 发表于 2010-3-31 11:40:16

pStartPhysAddress.QuadPart = (ULONGLONG)pPhysAddress &.......

iwillbeback008 发表于 2011-5-26 20:29:37

也在为读取2G以上的地址所困扰,谢谢

所说的附件呢?

[ 本帖最后由 iwillbeback008 于 2011-5-26 20:31 编辑 ]
页: [1]
查看完整版本: 怎么用WINIO去读FFFFFFFF这个地址?