Ignore:
Timestamp:
Oct 1, 2000, 4:58:21 AM (25 years ago)
Author:
bird
Message:

Implemented tool for generating calltab for kernel imports. (mkcalltab)
Implemented API for accessing memory in another process. (*ProcessReadWrite)
Added kernel imports needed to implemented ProcessReadWrite.
Removed unused kernel imports.

Location:
trunk/src/win32k/include
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/include/OS2KPTDA.h

    r4164 r4347  
    1 /* $Id: OS2KPTDA.h,v 1.2 2000-09-02 21:07:59 bird Exp $
     1/* $Id: OS2KPTDA.h,v 1.3 2000-10-01 02:58:16 bird Exp $
    22 *
    33 * PTDA access functions.
     
    5353
    5454
    55 
    5655USHORT      ptdaGet_ptda_environ(PPTDA pPTDA);
     56HPTDA       ptdaGet_ptda_handle(PPTDA pPTDA);
    5757USHORT      ptdaGet_ptda_module(PPTDA pPTDA);
    5858HKSEMMTX    ptda_ptda_ptdasem(PPTDA pPTDA);
  • trunk/src/win32k/include/OS2KTK.h

    r4164 r4347  
    1 /* $Id: OS2KTK.h,v 1.2 2000-09-02 21:08:00 bird Exp $
     1/* $Id: OS2KTK.h,v 1.3 2000-10-01 02:58:16 bird Exp $
    22 *
    33 * OS2KTK - OS/2 Kernel Task.
     
    1717#define TK_FUSU_FATAL       0x3         /* Traps the task on failure. */
    1818#define TK_FUSU_NONFATAL    0x0         /* Returns error code to caller on failure. */
     19#define TK_FUSU_USER_SRC    0x10        /* Source buffer is in user memory. (TKSuFuBuff) */
     20#define TK_FUSU_USER_DST    0x20        /* Target buffer is in user memory. (TKSuFuBuff) */
    1921
    2022
     
    102104
    103105
     106/**
     107 * Copy user memory to user memory.
     108 * @returns   OS/2 return code. (NO_ERROR is success)
     109 * @param     pvTarget  Pointer to target (user) data area.
     110 * @param     pvSource  Pointer to source (user) data area.
     111 * @param     cb        Count of bytes to copy.
     112 * @param     fl        Flags.
     113 */
     114extern ULONG KRNLCALL   TKSuFuBuff(PVOID pvTarget, PVOID pvSource, ULONG cb, ULONG fl);
     115
     116
     117#ifdef INCL_OS2KRNL_PTDA
     118/**
     119 * PID to PTDA pointer.
     120 * @returns     OS/2 return code.
     121 * @param       pid     Process Identifier.
     122 * @param       ppPTDA  Pointer to the PTDA-pointer variabel which is to receive
     123 *                      the PTDA pointer on successful return.
     124 */
     125extern ULONG KRNLCALL  TKPidToPTDA(PID pid, PPPTDA ppPTDA);
    104126#endif
     127
     128#endif
  • trunk/src/win32k/include/OS2KVM.h

    r4227 r4347  
    1 /* $Id: OS2KVM.h,v 1.6 2000-09-08 21:34:11 bird Exp $
     1/* $Id: OS2KVM.h,v 1.7 2000-10-01 02:58:17 bird Exp $
    22 *
    33 * OS/2 kernel VM functions.
     
    1717*   Defined Constants And Macros                                               *
    1818*******************************************************************************/
     19
     20/*
     21 * From SG24-4640-00
     22 * Object flags. (ob_fs)
     23 */
     24#define OB_PSEUDO           0x8000      /* Pseudo-object */
     25#define OB_API              0x4000      /* API allocated object */
     26#define OB_LOCKWAIT         0x2000      /* Some thread to wake in VMUnlock */
     27#define OB_LALIAS           0x1000      /* Object has aliases */
     28#define OB_SHARED           0x0800      /* Object's contents are shared */
     29#define OB_UVIRT            0x0400      /* UVirt object */
     30#define OB_ZEROINIT         0x0200      /* Object is zero-initialized */
     31#define OB_RESIDENT         0x0100      /* Initial allocation was resident */
     32#define OB_LOWMEM           0x0040      /* Object is in low memory */
     33#define OB_GUARD            0x0080      /* Page attribute/permission flags */
     34#define OB_EXEC             0x0020      /* Executable */
     35#define OB_READ             0x0010      /* Read permission */
     36#define OB_USER             0x0008      /* User Storage */
     37#define OB_WRITE            0x0004      /* Write permission */
     38#define OB_HUGE             0x0002      /* Object is huge */
     39#define OB_SHRINKABLE       0x0001      /* Object is Shrinkable */
     40#define OB_DHSETMEM         0x0001      /* DevHlp_VMSetMems are allowed */
     41
     42
     43/*
     44 * From SG24-4640-00
     45 * ob_xflags
     46 */
     47#define VMOB_SLOCK_WAIT     0x01        /* Waiting on short term locks to clear */
     48#define VMOB_LLOCK_WAIT     0x02        /* Waiting on long term locks to clear */
     49#define VMOB_DISC_SEG       0x04        /* Object is part of a discardable seg */
     50#define VMOB_HIGHMEM        0x08        /* Object was allocated via dh_vmalloc */
     51
     52
    1953
    2054/*                                            v8086.h */
     
    67101#define VMA_ARENAHEAP       0x06000000UL  /* Heap Arena */
    68102#define VMA_ARENAHIGHA      0x00008000UL  /* High shared arena (Warp >= fp13) */
    69 #define VMA_ARENAHIGH   (options.ulBuild >= MERLINFP13 ? VMA_ARENAHIGHA : 0UL)
     103#define VMA_ARENAHIGH   (options.ulBuild >= AURORAGA ? VMA_ARENAHIGHA : 0UL)
    70104#define VMA_ARENAMASKW      0x06000000UL  /* Warp < fp13 Arena Mask */
    71105#define VMA_ARENAMASKA      0x06008000UL  /* Aurora Arena Mask */
    72 #define VMA_ARENAMASK   (options.ulBuild >= MERLINFP13 ? VMA_ARENAMASKA : VMA_ARENAMASKW)
     106#define VMA_ARENAMASK   (options.ulBuild >= AURORAGA ? VMA_ARENAMASKA : VMA_ARENAMASKW)
    73107
     108#define VMA_ALIGNSEL        0x10000000UL  /* Selector aligment */
    74109#define VMA_ALIGNPAGE       0x18000000UL  /* (VPMVMAC_ALIGNPAGE)      Page alignment */
    75110
     
    91126
    92127#define VMAF2_WRITE         0x00000002UL  /* PAG_WRITE */
     128
     129
     130/*
     131 * VMMapDebugAlias flags.
     132 */
     133#define VMMDA_ARENAPRIVATE  0           /* Create alias in private arena */
     134#define VMMDA_ARENASYSTEM   4           /* Create alias in system arena */
     135#define VMMDA_READONLY      1           /* Create readonly alias */
    93136
    94137
     
    123166    PVMAC   pvmac);
    124167
     168APIRET KRNLCALL VMFreeMem(
     169    ULONG   ulAddress,
     170    HPTDA   hPTDA,
     171    ULONG   flFlags);
     172
     173APIRET KRNLCALL VMMapDebugAlias(
     174    ULONG   flVMFlags,
     175    ULONG   ulAddress,
     176    ULONG   cbSize,
     177    HPTDA   hPTDA,
     178    PVMAC   pvmac);
     179
    125180APIRET KRNLCALL VMObjHandleInfo(
    126181    USHORT  usHob,
  • trunk/src/win32k/include/OS2Krnl.h

    r4164 r4347  
    1 /* $Id: OS2Krnl.h,v 1.8 2000-09-02 21:08:00 bird Exp $
     1/* $Id: OS2Krnl.h,v 1.9 2000-10-01 02:58:17 bird Exp $
    22 *
    33 * OS/2 kernel structures, typedefs and macros.
     
    265265#endif
    266266
     267#ifdef INCL_OS2KRNL_PTDA
     268    #include <OS2KPTDA.h>
     269#endif
     270
    267271#ifdef INCL_OS2KRNL_TK
    268272    #include <OS2KTK.h>
    269273#endif
    270274
    271 #ifdef INCL_OS2KRNL_PTDA
    272     #include <OS2KPTDA.h>
    273 #endif
    274 
    275275#ifdef INCL_OS2KRNL_TCB
    276276    #include <OS2KTCB.h>
  • trunk/src/win32k/include/k32.h

    r4164 r4347  
    1 /* $Id: k32.h,v 1.3 2000-09-02 21:08:02 bird Exp $
     1/* $Id: k32.h,v 1.4 2000-10-01 02:58:17 bird Exp $
    22 *
    33 * k32 - definitions.
     
    2323APIRET k32QueryOptionsStatus(PK32OPTIONS pOptions, PK32STATUS pStatus);
    2424APIRET k32SetOptions(PK32OPTIONS pOptions);
     25APIRET k32ProcessReadWrite(PID pid, ULONG cb, PVOID pvSource, PVOID pvTarget, BOOL fRead);
    2526
    2627
  • trunk/src/win32k/include/probkrnl.h

    r4185 r4347  
    1 /* $Id: probkrnl.h,v 1.15 2000-09-04 16:40:50 bird Exp $
     1/* $Id: probkrnl.h,v 1.16 2000-10-01 02:58:17 bird Exp $
    22 *
    33 * Include file for ProbKrnl.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define NBR_OF_KRNLIMPORTS      42      /* When this is changed make sure to   */
    19                                         /* update the arrays in d32init.c and  */
    20                                         /* probkrnl.c, make test faker in      */
    21                                         /* test.h and the appropriate fake.c   */
    22                                         /* fakea.asm.                          */
     18#define NBR_OF_KRNLIMPORTS      40      /* When this is changed make sure to   */
     19                                        /* update the aImportTab in probkrnl.c */
     20                                        /* and make test faker in test.h and   */
     21                                        /* the appropriate fake.c fakea.asm.   */
    2322#define MAX_LENGTH_NAME         32      /* Max length for the function. */
    2423
     
    2827#define EPT_VARIMPORT           0x02    /* variable/non-procedure 32bit */
    2928#define EPT_NOT_REQ             0x04    /* Not required flag. */
     29#define EPTNotReq(a)            (((a).fType & (EPT_NOT_REQ)) == EPT_NOT_REQ)
     30#define EPT_WRAPPED             0x40    /* Wrapped due - differs between builds */
     31#define EPTWrapped(a)           (((a).fType & (EPT_WRAPPED)) == EPT_WRAPPED)
    3032#define EPT_32BIT               0x00    /* 32 bit entry-point  */
    3133#define EPT_16BIT               0x80    /* 16 bit entry-point */
    3234#define EPT_BIT_MASK            0x80    /* Mask bit entry-point */
    33 #define EPT16BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_16BIT)
    34 #define EPT32BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_32BIT)
     35#define EPT16BitEntry(a)        (((a).fType & EPT_BIT_MASK) == EPT_16BIT)
     36#define EPT32BitEntry(a)        (((a).fType & EPT_BIT_MASK) == EPT_32BIT)
    3537
    3638/* 32bit types */
     
    3941#define EPT_PROCIMPORTNR32      (EPT_PROCIMPORT | EPT_32BIT | EPT_NOT_REQ)
    4042#define EPT_VARIMPORT32         (EPT_VARIMPORT | EPT_32BIT)
     43#define EPT32Proc(a)            (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC32)
     44#define EPT32ProcImport(a)      (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT32)
     45#define EPT32ProcImportNR(a)    (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR32)
     46#define EPT32VarImport(a)       (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT32)
    4147
    4248/* 16bit types */
    4349#define EPT_PROC16              (EPT_PROC | EPT_16BIT)        /* no implemented yet! */
    4450#define EPT_PROCIMPORT16        (EPT_PROCIMPORT | EPT_16BIT)  /* far proc in calltab with a far jmp. */
     51#define EPT_PROCIMPORTNR16      (EPT_PROCIMPORT | EPT_16BIT | EPT_NOT_REQ)
    4552#define EPT_VARIMPORT16         (EPT_VARIMPORT | EPT_16BIT)
     53#define EPT16Proc(a)            (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC16)
     54#define EPT16ProcImport(a)      (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT16)
     55#define EPT16ProcImportNR(a)    (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR16)
     56#define EPT16VarImport(a)       (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT16)
    4657
    4758
     
    6475   unsigned short int  cchName;         /* Length of the name (optmize search) (INPUT) */
    6576   unsigned char       achName[MAX_LENGTH_NAME]; /* Name (INPUT) */
     77   unsigned char       achExtra[4];     /* Parameter extra. */
    6678   unsigned long  int  offObject;       /* Offset into the object */
    6779   unsigned long  int  ulAddress;       /* 32-bit flat address */
  • trunk/src/win32k/include/test.h

    r4227 r4347  
    1 /* $Id: test.h,v 1.3 2000-09-08 21:34:11 bird Exp $
     1/* $Id: test.h,v 1.4 2000-10-01 02:58:17 bird Exp $
    22 *
    33 * Definitions and declarations for test moduls.
     
    1717#endif
    1818
     19/*******************************************************************************
     20*   Structures and Typedefs                                                    *
     21*******************************************************************************/
     22typedef struct _TstFaker
     23{
     24    unsigned   uAddress;
     25    int        fObj;                   /* 1 = CODE32, 2 = CODE16, 3 = DATA32, 4 = DATA16 */
     26} TSTFAKER, *PTSTFAKER, **PPTSTFAKER;
     27#ifdef NBR_OF_KRNLIMPORTS
     28extern TSTFAKER aTstFakers[NBR_OF_KRNLIMPORTS];
     29#endif
     30
     31/*******************************************************************************
     32*   Function Prototypes.                                                       *
     33*******************************************************************************/
    1934VOID  _Optlink ThunkStack32To16(VOID);  /* dh.asm */
    2035VOID  _Optlink ThunkStack16To32(VOID);  /* dh.asm */
     
    96111    ULONG   SomeArg2,
    97112    PVMAC   pvmac);
     113APIRET KRNLCALL fakeVMFreeMem(
     114    PVOID   pv,
     115    USHORT  hPTDA,
     116    ULONG   flFlags
     117    );
    98118APIRET KRNLCALL fakeVMObjHandleInfo(
    99119    USHORT  usHob,
     
    102122PMTE KRNLCALL fakeldrASMpMTEFromHandle(
    103123    HMTE  hMTE);
    104 ULONG LDRCALL   fakeldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful);
     124APIRET KRNLCALL fakeVMMapDebugAlias(
     125    ULONG   flVMFlags,
     126    ULONG   ulAddress,
     127    ULONG   cbSize,
     128    HPTDA   hPTDA,
     129    PVMAC   pvmac);
     130
     131ULONG LDRCALL   fakeldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful, ULONG lLibPath);
     132ULONG LDRCALL   fakeldrOpenPath_new(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful, ULONG lLibPath);
     133ULONG LDRCALL   fakeldrOpenPath_old(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful);
    105134ULONG LDRCALL   fakeLDRClearSem(void);
    106135ULONG LDRCALL   fakeldrFindModule(PCHAR pachFilename, USHORT cchFilename, USHORT usClass, PPMTE ppMTE);
     
    109138BOOL  KRNLCALL  fakeKSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
    110139VOID  KRNLCALL  fakeKSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
    111 extern KSEMMTX  fakeLDRSem;
     140extern KSEMMTX  fakeLdrSem;
    112141extern char *   fakeLDRLibPath;
    113142ULONG KRNLCALL  fakeTKFuBuff(PVOID pv, PVOID pvUsr, ULONG cb, ULONG fl);
    114143ULONG KRNLCALL  fakeTKSuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl);
    115144ULONG KRNLCALL  fakeTKFuBufLen(PLONG pcch, PVOID pvUsr, ULONG cchMax, ULONG fl, BOOL fDblNULL);
     145ULONG KRNLCALL  fakeTKSuFuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl);
     146ULONG KRNLCALL  fakeTKPidToPTDA(PID pid, PPPTDA ppPTDA);
    116147PMTE LDRCALL    fakeldrValidateMteHandle(HMTE hMTE);
    117148PSZ  SECCALL    fakeSecPathFromSFN(SFN hFile);
    118149void _Optlink   fakeg_tkExecPgm(void);    /* Not callable! (fakea.asm) */
    119 void _Optlink   fake_tkStartProcess(void);/* Not callable! (fakea.asm) */
     150void _Optlink   faketkStartProcess(void); /* Not callable! (fakea.asm) */
    120151void _Optlink   fakef_FuStrLenZ(void);    /* Not callable! (fakea.asm) */
    121152void _Optlink   fakef_FuStrLen(void);     /* Not callable! (fakea.asm) */
     
    126157extern USHORT   fakeptda_environ;
    127158extern KSEMMTX  fakeptda_ptdasem;
     159extern HMTE     fakeptda_handle;
    128160extern HMTE     fakeptda_module;
    129161extern PSZ      fakeptda_pBeginLIBPATH;
Note: See TracChangeset for help on using the changeset viewer.