Changeset 5110 for trunk/src


Ignore:
Timestamp:
Feb 11, 2001, 4:27:25 PM (25 years ago)
Author:
bird
Message:

Added new fake stuff. Lots of variables - mostly just stubbed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/test/fake.c

    r5086 r5110  
    1 /* $Id: fake.c,v 1.7 2001-02-10 11:11:48 bird Exp $
     1/* $Id: fake.c,v 1.8 2001-02-11 15:27:25 bird Exp $
    22 *
    33 * Fake stubs for the ldr and kernel functions we imports or overloads.
     
    101101    0xDEAD
    102102};
     103
     104
     105/*
     106 * More fake variables.
     107 */
     108ULONG fakeSMcDFInuse;
     109ULONG fakesmFileSize;
     110ULONG fakeSMswapping;
     111ULONG fakesmcBrokenDF;
     112ULONG fakepgPhysPages;
     113ULONG fakeSMcInMemFile;
     114ULONG fakeSMCFGMinFree;
     115ULONG fakesmcGrowFails;
     116ULONG fakePGSwapEnabled;
     117ULONG fakepgcPageFaults;
     118ULONG fakeSMCFGSwapSize;
     119ULONG fakepgResidentPages;
     120ULONG fakepgSwappablePages;
     121ULONG fakepgDiscardableInmem;
     122ULONG fakepgDiscardablePages;
     123ULONG fakeSMMinFree;
     124ULONG fakepgcPageFaultsActive;
     125ULONG fakepgPhysMax;
     126ULONG fakeVirtualAddressLimit;
     127
     128VMAH  fakeahvmShr;
     129VMAH  fakeahvmSys;
     130VMAH  fakeahvmhShr;
     131
    103132
    104133
     
    166195    rc = DosQueryHeaderInfo(NULLHANDLE, 0, szLibPath, sizeof(szLibPath), QHINF_LIBPATH);
    167196    rc = DosQueryExtLIBPATH(szEndLibPath, END_LIBPATH);
     197
     198    if (_usFakeVerMinor < 45)
     199        fakeVirtualAddressLimit = 0xFFFFFFFF;
     200    else
     201        fakeVirtualAddressLimit = 0x80000000;
     202
     203
     204    if (fakeVirtualAddressLimit != 0xFFFFFFFF)
     205    {   /* high memory supported */
     206        fakeahvmSys.ah_laddrMax = 0xFFFE0000;
     207        fakeahvmSys.ah_laddrMin = 0x80000000;
     208        fakeahvmShr.ah_laddrMin = 0x08000000;
     209        fakeahvmhShr.ah_laddrMin = 0x70000000;
     210    }
     211    else
     212    {   /* high memory not supported */
     213        fakeahvmSys.ah_laddrMax = 0xFFFE0000;
     214        fakeahvmSys.ah_laddrMin = 0x40000000;
     215        fakeahvmShr.ah_laddrMin = 0x08000000;
     216        fakeahvmhShr.ah_laddrMin = 0xffffffff;
     217    }
    168218
    169219    rc = rc;
     
    20152065}
    20162066
     2067
     2068/**
     2069 * Returns the number of bytes of physical memory available.
     2070 */
     2071ULONG KRNLCALL fakePGPhysAvail(void)
     2072{
     2073    DUMMY();
     2074    printf("fakePGPhysAvail                        - returns 0x234563\n");
     2075    return 0x234563;
     2076}
     2077
     2078
     2079/**
     2080 * Returns the number of pageframes currently in use.
     2081 */
     2082ULONG KRNLCALL fakePGPhysPresent(void)
     2083{
     2084    DUMMY();
     2085    printf("fakePGPhysPresent                      - returns 0x123534\n");
     2086    return 0x123534;
     2087}
     2088
     2089
     2090/**
     2091 * This function seems to find the top of the private arena.
     2092 * And for high arena kernels (AURORA and W3SMP?) it is modified
     2093 * to calc the top of the high private arena, given flFlag = 4.
     2094 * --
     2095 * This function is really intented for resizing / recaling the size of
     2096 * the shared arena(s). But, it's useful for finding the highest used
     2097 * private arena(s).
     2098 * @param   flFlags             VMRSBF_* flags.
     2099 * @param   pulSentinelAddress  Pointer to return variable (optional).
     2100 */
     2101VOID    KRNLCALL fakevmRecalcShrBound(
     2102    ULONG   flFlags,
     2103    PULONG  pulSentinelAddress)
     2104{
     2105    ULONG ulRet;
     2106    DUMMY();
     2107
     2108    if ((flFlags & 6) == 0)
     2109    {   /* shared  tiled memory */
     2110        ulRet = 128*1024*1024;
     2111    }
     2112    else
     2113    {
     2114        ulRet = 0x2c000000;
     2115        if (_usFakeVerMinor < 45)        /* bad emulation for Warp 3 SMP - FIXME */
     2116            printf("fakePGPhysPresent                      - error: bad flags for non-highmem OS/2 versionn");
     2117    }
     2118
     2119    if (pulSentinelAddress)
     2120        *pulSentinelAddress = ulRet;
     2121
     2122    printf("fakePGPhysPresent                      - returns %x - flFlags=0x%02x, pulSentinelAddress=0x%08x\n",
     2123           ulRet, flFlags, pulSentinelAddress);
     2124
     2125    return;
     2126}
     2127
     2128
Note: See TracChangeset for help on using the changeset viewer.