Virtual memory under Win95

Dmitry Timoshkov dmitry at sloboda.ru
Fri Apr 20 08:05:30 CDT 2001


Hello all.

Could anybody with access to a Win95 machine run this simple program
and report the result?

void test(void)
{
    HANDLE hMapping;
    void *p;
    MEMORY_BASIC_INFORMATION info;
    DWORD dwRet;

    hMapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL,
        PAGE_READWRITE | SEC_RESERVE, 0, 0x0400f000, NULL);
    printf("hMapping = %04x\n", hMapping);
    p = MapViewOfFile(hMapping, FILE_MAP_READ ,0, 0, 0x00010000);
    printf("p = %p\n", p);
    UnmapViewOfFile(p);

    dwRet = VirtualQuery(p, &info, sizeof(info));
    printf("VirtualQuery(%p) ret=0x%lx\n"
        "BaseAddress = %p\n"
        "AllocationBase = %p\n"
        "AllocationProtect = 0x%08lx\n"
        "RegionSize = 0x%08x\n"
        "State = %08lx\n"
        "Protect = %08lx\n"
        "Type = %08lx\n",
        p, dwRet,
        info.BaseAddress,
        info.AllocationBase,
        info.AllocationProtect,
        info.RegionSize,
        info.State,
        info.Protect,
        info.Type);
}

Thanks in advance.






More information about the wine-devel mailing list