Ignore:
Timestamp:
Mar 18, 2021, 8:57:36 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from Paul's uniaud32next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/include/stacktoflat.h

    r32 r679  
    2626#define __STACKTOFLAT_H__
    2727
    28 extern ULONG TKSSBase;
    29 #pragma aux TKSSBase "_TKSSBase"
    30 
    31 extern ULONG GetTKSSBase();
    32 #pragma aux GetTKSSBase "GetTKSSBase" \
    33   value [eax];
    34 
    35 #ifdef KEE
    3628extern ULONG stacksel;          //16 bits stack selector
    3729#pragma aux stacksel "stacksel"
     
    3931extern ULONG stackbase;         //32 bits stackbase
    4032#pragma aux stackbase "stackbase"
    41 #endif
    4233
    43 #ifdef FLATSTACK
    44 
    45 #ifdef KEE
    4634//Convert 16:16 stack based address to 0:32 flat addresss
    4735#define __Stack16ToFlat(addr)   (LINEAR)((ULONG)(addr&0xffff) + stackbase)
    48 #else
    49 //Convert 16:16 stack based address to 0:32 flat addresss
    50 #define __Stack16ToFlat(addr)   (LINEAR)((((ULONG)addr)&0xffff) + *(ULONG *)TKSSBase)
    51 #endif
    52 
    53 //stack is already flat
    54 #define __Stack32ToFlat(addr)   (LINEAR)addr
    55 
    56 #else
    57 //Convert 16:16 stack based address to 0:32 flat addresss
    58 #define __Stack16ToFlat(addr)   (LINEAR)((((ULONG)addr)&0xffff) + *(ULONG *)TKSSBase)
    59 
    60 //Convert 16:16 stack based address to 0:32 flat addresss
    61 #define __Stack32ToFlat(addr)   (LINEAR)((((ULONG)addr)&0xffff) + *(ULONG *)TKSSBase)
    62 #endif
    6336
    6437// Convert 16:16 pointer to 16:32
     
    11588#define FLATPTR(a)      GETFLATPTR((char FAR48 *)a)
    11689
    117 #ifdef KEE
    11890#define FlatToSel(addr32)       ((stacksel << 16) | (((ULONG)addr32 - stackbase) & 0xffff))
    119 #else
    120 //Only valid for stack based pointer!!
    121 ULONG FlatToSel(ULONG addr32);
    122 #endif
    12391
    12492#endif
Note: See TracChangeset for help on using the changeset viewer.