Changeset 4068 for branches


Ignore:
Timestamp:
Aug 22, 2000, 5:00:22 AM (25 years ago)
Author:
bird
Message:

More code is completed.
Test stuff is broken. (Missing fake functions/variables for the new functions.)

Location:
branches
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/Makefile

    r4017 r4068  
    11################################################################################
    2 # $Id: Makefile,v 1.43.4.4 2000-08-15 06:15:55 bird Exp $
     2# $Id: Makefile,v 1.43.4.5 2000-08-22 03:00:16 bird Exp $
    33#
    44# Win32k makefile.
     
    343343    $(WIN32KOBJ)\d32Win32kIOCtl.obj \
    344344    $(WIN32KOBJ)\k32AllocMemEx.obj \
    345     $(WIN32KOBJ)\mytkExecPgm.obj
     345    $(WIN32KOBJ)\mytkExecPgm.obj\
     346    $(WIN32KOBJ)\mytkStartProcess.obj
    346347
    347348
  • branches/GRACE/src/win32k/dev16/probkrnl.c

    r4065 r4068  
    1 /* $Id: probkrnl.c,v 1.20.4.8 2000-08-21 22:59:34 bird Exp $
     1/* $Id: probkrnl.c,v 1.20.4.9 2000-08-22 03:00:16 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    103103    {FALSE, -1, 11, "_VMGetOwner",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 12 */
    104104    {FALSE, -1, 11, "g_tkExecPgm",          -1,  -1,  -1,  -1, EPT_PROC32},        /* 13 */
    105     {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 14 */
    106     {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
    107     {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 16 */
    108     {FALSE, -1, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 17 */
    109     {FALSE, -1, 18, "_VMPseudoHandleMap",   -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 18 */
    110     {FALSE, -1, 12, "_ldrOpenPath",         -1,  -1,  -1,  -1, EPT_PROC32},        /* 19 */
    111     {FALSE, -1, 12, "_LDRClearSem",         -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 20 */
    112     {FALSE, -1, 14, "_ldrFindModule",       -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 21 */
    113     {FALSE, -1, 17, "_KSEMRequestMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 22 */
    114     {FALSE, -1, 17, "_KSEMReleaseMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 23 */
    115     {FALSE, -1,  7, "_LdrSem",              -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 24 */
    116     {FALSE, -1, 11, "_LDRLibPath",          -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 25 */
    117     {FALSE, -1,  9, "_TKSuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 26 */
    118     {FALSE, -1,  9, "_TKFuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 27 */
    119     {FALSE, -1, 11, "_TKFuBufLen",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 28 */
    120     {FALSE, -1, 21, "_ldrValidateMteHandle",-1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 29 */
    121     {FALSE, -1,  8, "_pTCBCur",             -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 30 */
    122     {FALSE, -1,  9, "_pPTDACur",            -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 31 */
    123     {FALSE, -1, 10, "ptda_start",           -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 32 */
    124     {FALSE, -1, 12, "ptda_environ",         -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 33 */
    125     {FALSE, -1, 11, "ptda_module",          -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 34 */
    126     {FALSE, -1, 18, "ptda_pBeginLIBPATH",   -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 35 */
    127     {FALSE, -1, 16, "_ldrpFileNameBuf",     -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 36 */
     105    {FALSE, -1, 16, "g_tkStartProcess",     -1,  -1,  -1,  -1, EPT_PROC32},        /* 14 */
     106    {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 15 */
     107    {FALSE, -1, 10, "f_FuStrLen",           -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 16 */
     108    {FALSE, -1,  8, "f_FuBuff",             -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 17 */
     109    {FALSE, -1, 16, "_VMObjHandleInfo",     -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 18 */
     110    {FALSE, -1, 18, "_VMPseudoHandleMap",   -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 19 */
     111    {FALSE, -1, 12, "_ldrOpenPath",         -1,  -1,  -1,  -1, EPT_PROC32},        /* 20 */
     112    {FALSE, -1, 12, "_LDRClearSem",         -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 21 */
     113    {FALSE, -1, 14, "_ldrFindModule",       -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 22 */
     114    {FALSE, -1, 17, "_KSEMRequestMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 23 */
     115    {FALSE, -1, 17, "_KSEMReleaseMutex",    -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 24 */
     116    {FALSE, -1, 15, "_KSEMQueryMutex",      -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 25 */
     117    {FALSE, -1,  9, "_KSEMInit",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 26 */
     118    {FALSE, -1,  7, "_LdrSem",              -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 27 */
     119    {FALSE, -1, 11, "_LDRLibPath",          -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 28 */
     120    {FALSE, -1,  9, "_TKSuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 29 */
     121    {FALSE, -1,  9, "_TKFuBuff",            -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 30 */
     122    {FALSE, -1, 11, "_TKFuBufLen",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 31 */
     123    {FALSE, -1, 21, "_ldrValidateMteHandle",-1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 32 */
     124    {FALSE, -1,  8, "_pTCBCur",             -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 33 */
     125    {FALSE, -1,  9, "_pPTDACur",            -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 34 */
     126    {FALSE, -1, 10, "ptda_start",           -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 35 */
     127    {FALSE, -1, 12, "ptda_environ",         -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 36 */
     128    {FALSE, -1, 11, "ptda_module",          -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 37 */
     129    {FALSE, -1, 18, "ptda_pBeginLIBPATH",   -1,  -1,  -1,  -1, EPT_VARIMPORT16},   /* 38 */
     130    {FALSE, -1, 16, "_ldrpFileNameBuf",     -1,  -1,  -1,  -1, EPT_VARIMPORT32},   /* 39 */
    128131
    129132};
     
    16671670        int         i;
    16681671
    1669         printf16("/* $Id: probkrnl.c,v 1.20.4.8 2000-08-21 22:59:34 bird Exp $\n"
     1672        printf16("/* $Id: probkrnl.c,v 1.20.4.9 2000-08-22 03:00:16 bird Exp $\n"
    16701673                 "*\n"
    16711674                 "* Autogenerated kernel symbol database.\n"
  • branches/GRACE/src/win32k/include/LdrCalls.h

    r4065 r4068  
    1 /* $Id: LdrCalls.h,v 1.3.4.5 2000-08-21 22:59:38 bird Exp $
     1/* $Id: LdrCalls.h,v 1.3.4.6 2000-08-22 03:00:19 bird Exp $
    22 *
    33 * Prototypes for the loader overrided function.
     
    192192 *            OS2 errorcode on failure. (ERROR_INTERRUPT?)
    193193 */
    194 #define LDRRequestSem()   KSEMRequestMutex((HKMTX)pLdrSem, (ULONG)-1)
     194#define LDRRequestSem()   KSEMRequestMutex(pLdrSem, (ULONG)-1)
    195195
    196196
     
    199199 */
    200200#ifdef _OS2KSEM_h_
    201 extern HKMTX *  pLdrSem;
     201extern PKSEMMTX    pLdrSem;
    202202#endif
    203203
  • branches/GRACE/src/win32k/include/OS2KSEM.h

    r3829 r4068  
    1 /* $Id: OS2KSEM.h,v 1.1 2000-07-16 22:21:19 bird Exp $
     1/* $Id: OS2KSEM.h,v 1.1.2.1 2000-08-22 03:00:18 bird Exp $
    22 *
    33 * OS/2 kernel Semaphore functions.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define KSEM_INDEFINITE_WAIT     -1L
    19 #define KSEM_IMMEDIATE_RETURN     0L
     18#define KSEM_INDEFINITE_WAIT       -1L
     19#define KSEM_IMMEDIATE_RETURN       0L
     20
     21/*
     22 * Semaphore type. ( Used with the generic KSEM routines. )
     23 */
     24#define KSEM_EVENT                  0
     25#define KSEM_MUTEX                  1
     26#define KSEM_SHARED                 2
     27
     28/*
     29 * Sempahore flags. (according to SG24-4640-00)
     30 */
     31#define KSEM_DEFAULT                0
     32#define KSEM_NOINTERRUPT            1
     33#define KSEM_WRITE                  2
     34#define KSEM_DISPLAYID              4
     35#define KSEM_NOBLOCKED              8
    2036
    2137
     
    2339*   Structures and Typedefs                                                    *
    2440*******************************************************************************/
    25 typedef ULONG  HKSEM;                   /* Handle to kernel semaphore. */
    26 typedef HKSEM  PHKSEM;                  /* Pointer to kernel semaphore handle. */
    27 typedef HKSEM  HKMTX;                   /* Handle to kernel mutex semaphore. */
    28 typedef HKSEM  HKEV;                    /* Handle to kernel event semaphore. */
     41/* (This is according to SG24-4640-00.) */
     42
     43typedef struct _KSEMSHR
     44{
     45    /**
     46     * Astrict 16 is byte while retail 12 is bytes.
     47     * We'll reserve 20 bytes just to be sure!.
     48     */
     49    char achDummy[20];
     50}   KSEMSHR,
     51   *PKSEMSHR,
     52   *HKSEMSHR;                           /* Handle to kernel shared semphore. */
     53typedef HKSEMSHR * PHKSEMSHR;
     54
     55
     56typedef struct _KSEMMTX
     57{
     58    /**
     59     * Astrict is 12 byte while retail is 8 bytes.
     60     * We'll reserve 20 bytes just to be sure!
     61     */
     62    char achDummy[20];
     63}   KSEMMTX,
     64   *PKSEMMTX,
     65   *HKSEMMTX;                           /* Handle to kernel mutex semaphore. */
     66typedef HKSEMMTX * PHKSEMMTX;
     67
     68
     69typedef struct _KSEMEVT
     70{
     71    /**
     72     * Astrict is 16 byte while retail is 12 bytes.
     73     * We'll reserve 20 bytes just to be sure!
     74     */
     75    char achDummy[20];
     76}   KSEMEVT,
     77   *PKSEMEVT,
     78   *HKSEMEVT;                           /* Handle to kernel event sempahore. */
     79typedef HKSEMEVT * PHKSEMEVT;
     80
     81
     82typedef union _KSEM
     83{
     84    KSEMSHR shr;
     85    KSEMMTX mtx;
     86    KSEMEVT evt;
     87} KSEM, *PKSEM, *HKSEM;                 /* Generic kernel semaphore handle. */
     88typedef HKSEM * PHKSEM;
    2989
    3090
     
    3494/*
    3595 * Mutex semaphores.
    36  * NOTE! Only is KSEMRequestMutex currently is imported!
    3796 */
    38 extern ULONG KRNLCALL KSEMRequestMutex(HKMTX hkmtx, ULONG ulTimeout);
    39 extern VOID  KRNLCALL KSEMReleaseMutex(HKMTX hkmtx);
    40 extern ULONG KRNLCALL KSEMQueryMutex(HKMTX hkmtx, PUSHORT pus);
     97extern ULONG KRNLCALL KSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
     98extern VOID  KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx);
     99extern ULONG KRNLCALL KSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
    41100
    42101
     
    48107extern VOID  KRNLCALL KSEMPostEvent(HKEV hkevent);
    49108extern ULONG KRNLCALL KSEMWaitEvent(HKEV hkevent);
     109#endif
    50110
    51111/*
    52112 * Some other KSEM prefixed functions - parameters's not that obvious...
    53113 */
     114#if 0
    54115extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2);
    55116extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type);
     
    57118extern ULONG KRNLCALL KSEMRequestShared(HKSEM hksem, ULONG);
    58119extern VOID  KRNLCALL KSEMDestroy(HKSEM hksem);
    59 extern VOID  KRNLCALL KSEMInit(HKSEM hksem, ULONG p1, ULONG p2);
     120#endif
     121extern VOID  KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     122#if 0
    60123extern VOID  KRNLCALL KSEMQuery(HKSEM hksem, ULONG p2)
    61124extern VOID  KRNLCALL KSEMRelease(HKSEM hksem);
  • branches/GRACE/src/win32k/include/ldr.h

    r4065 r4068  
    1 /* $Id: ldr.h,v 1.5.4.4 2000-08-21 22:59:38 bird Exp $
     1/* $Id: ldr.h,v 1.5.4.5 2000-08-22 03:00:19 bird Exp $
    22 *
    33 * ldr - Our loader "subsystem" public header file.
     
    217217#define CCHFILENAME     261             /* This is defined in mytkExecPgm.asm too. */
    218218#define CCHARGUMENTS   1536             /* This is defined in mytkExecPgm.asm too. */
    219 extern char         fLdrSemTaken;
    220219extern const char   fTkExecPgm;
    221220extern char         achTkExecPgmFilename[CCHFILENAME];
  • branches/GRACE/src/win32k/include/pe2lx.h

    r4065 r4068  
    1 /* $Id: pe2lx.h,v 1.9.4.3 2000-08-21 22:59:38 bird Exp $
     1/* $Id: pe2lx.h,v 1.9.4.4 2000-08-22 03:00:19 bird Exp $
    22 *
    33 * Pe2Lx class declarations. Ring 0 and Ring 3
     
    7575    BOOL    isExe();
    7676    BOOL    isDll();
    77     static HMTE getKernel32SFN()        {   return sfnKernel32;   }
     77    static SFN getKernel32SFN()        {   return sfnKernel32;   }
    7878    static VOID setKernel32SFN(SFN sfn) {   sfnKernel32 = sfn;    }
    7979    static VOID invalidateOdin32Path();
  • branches/GRACE/src/win32k/include/probkrnl.h

    r4065 r4068  
    1 /* $Id: probkrnl.h,v 1.13.4.6 2000-08-21 22:59:39 bird Exp $
     1/* $Id: probkrnl.h,v 1.13.4.7 2000-08-22 03:00:20 bird Exp $
    22 *
    33 * Include file for ProbKrnl.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define NBR_OF_KRNLIMPORTS      37      /* When this is changed make sure to   */
     18#define NBR_OF_KRNLIMPORTS      40      /* When this is changed make sure to   */
    1919                                        /* update the arrays in d32init.c and  */
    2020                                        /* probkrnl.c */
  • branches/GRACE/src/win32k/ldr/ldr.cpp

    r4065 r4068  
    1 /* $Id: ldr.cpp,v 1.7.4.2 2000-08-21 22:59:39 bird Exp $
     1/* $Id: ldr.cpp,v 1.7.4.3 2000-08-22 03:00:20 bird Exp $
    22 *
    33 * ldr.cpp - Loader helpers.
     
    1414#define INCL_DOSERRORS
    1515#define INCL_NOPMAPI
    16 
     16#define INCL_OS2KRNL_SEM
    1717
    1818/*******************************************************************************
     
    238238    }
    239239
    240     /*
    241      * Increment the object counters.
    242      */
    243     switch (fFlags & MOD_TYPE_MASK)
    244     {
    245         case MOD_TYPE_PE2LX:  Pe2Lx::cLoadedModules++;
    246 #ifdef DEBUG
    247         /*case MOD_TYPE_ELF2LX: Elf2Lx::cElf2Lx++;*/
    248         default:
    249             kprintf(("addModule: fFlags don't have any MOD_TYPE_* (%x).\n", fFlags));
    250 #endif
    251     }
    252 
    253240    return NO_ERROR;
    254241}
     
    290277        case MOD_TYPE_PE2LX:
    291278            delete pMod->Data.pPe2Lx;
    292             Pe2Lx::cLoadedModules--;
    293279            break;
    294280/*
    295281        case MOD_TYPE_ELF2LX:
    296             Elf2Lx::cLoadedModules--;
    297282            break;
    298283*/
  • branches/GRACE/src/win32k/ldr/myldrOpen.cpp

    r4046 r4068  
    1 /* $Id: myldrOpen.cpp,v 1.10.4.4 2000-08-19 14:37:15 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.10.4.5 2000-08-22 03:00:21 bird Exp $
    22 *
    33 * myldrOpen - ldrOpen.
     
    116116        {
    117117            kprintf(("myldrOpen-%d: rmalloc(640) failed\n", cNesting));
    118             goto semcleanup;
     118            goto ret;
    119119        }
    120120
     
    640640    #endif
    641641
    642 semcleanup:
    643     /*
    644      * We have to clean the smaphore which was taken by mytkExecPgm here
    645      * because we might not return before the new child is finsished
    646      * executing.
    647      * It is not risk in releasing the semphore here since it's taken
    648      * three times now. First by tkExecPgm then by LDROpenExe.
    649      */
    650     if (isLdrStateExecPgm() && fLdrSemTaken)
    651     {
    652         KSEMReleaseMutex((HKMTX)pLdrSem);
    653         fLdrSemTaken = 0;
    654     }
    655 
     642ret:
    656643    /** @sketch
    657644     *  Return rc.
  • branches/GRACE/src/win32k/pe2lx/pe2lx.cpp

    r4065 r4068  
    1 /* $Id: pe2lx.cpp,v 1.18.4.5 2000-08-21 22:59:40 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.18.4.6 2000-08-22 03:00:22 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    170170    {NULL,                                 NULL} /* end-of-list entry */
    171171};
     172
     173LONG            Pe2Lx::cLoadedModules;  /* Count of existing objects. Updated by constructor and destructor. */
     174const char *    Pe2Lx::pszOdin32Path;   /* Odin32 base path (include a slash). */
     175SFN             Pe2Lx::sfnKernel32;     /* Odin32 Kernel32 filehandle. */
    172176
    173177
     
    46924696BOOL Pe2Lx::initOdin32Path()
    46934697{
     4698    #if 0
    46944699    APIRET rc;
    46954700    PMTE   pMTE;
     
    47544759
    47554760    return rc == NO_ERROR;
     4761    #else
     4762    return FALSE;
     4763    #endif
    47564764}
    47574765
  • branches/GRACE/src/win32k/win32k.vpj

    r4065 r4068  
    11[COMPILER]
    22MACRO=odin32_maketagfile();\n
    3 FILTEREXPANSION=1 1 1 1 0 0 0 0 1 0 0 0 0 1
     3FILTEREXPANSION=1 1 0 0 0 0 0 0 1 0 0 0 0 1
    44compile=concur|capture|clear|:Compile:&Compile,nmake %n.obj
    55make=concur|capture|clear|:Build:&Build,nmake
     
    102102ldr\myldrRead.cpp
    103103ldr\mytkExecPgm.asm
     104ldr\mytkStartProcess.asm
    104105ldr\myVMAllocMem.cpp
    105106lib\libDosAllocMemEx.c
     
    143144test\init.asm
    144145test\win32ktst.c
     146[ASSOCIATION]
     147[STATE]
     148SCREEN: 1600 1200 176 176 1244 800 0 0 M 0 0 0 0 1275 898
     149CWD: H:\CODING\WORK\ODIN32\src\win32k
     150BUFFER: BN="F:\VSLICK40\OS2\vrestore.slk"
     151BI: MA=1 254 1  TABS=1 9  WWS=3 IWT=0 ST=0 IN=0 BW=0 US=0 RO=0 SE=0 SN=0 BIN=0 MN=Fundamental   HM=0 MF=1
     152VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=22 HT=0 HN=0 HF=0 HC=4
     153BUFFER: BN="H:\coding\work\odin32\src\win32k\libconv.c"
     154BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=0
     155VIEW: LN=.11148 CL=33 LE=0 CX=32 CY=37 WI=5 BI=17 HT=0 HN=0 HF=0 HC=4
     156BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\dev16\probkrnl.c"
     157BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=0
     158VIEW: LN=.5619 CL=30 LE=0 C CY=1 WI=5 BI=9 HT=0 HN=0 HF=0 HC=4
     159BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c"
     160BI: MA=1 74 1  TABS=1 5  WWS=1 IWT=0 ST=0 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=C  HM=0 MF=872
     161VIEW: LN=.6408 CL=13 LE=0 CX=12 CY=38 WI=5 BI=10 HT=0 HN=0 HF=0 HC=4
     162WINDOW: 26 25 967 704 -1 -1 M  WF=0 WT=2 "System Monospaced,10,0,1"
     163BUFFER: BN="H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c"
     164VIEW: LN=.6119 CL=76 LE=0 CX=75 CY=29 WI=194 BI=10 HT=0 HN=0 HF=0 HC=4
     165FILEHIST: 5
     166F:\VSLICK40\OS2\vrestore.slk
     167H:\coding\work\odin32\src\win32k\libconv.c
     168H:\coding\work\odin32\src\win32k\makefile
     169H:\CODING\WORK\ODIN32\src\win32k\include\test.h
     170H:\CODING\WORK\ODIN32\src\win32k\test\win32ktst.c
     171PRINTER: 2
    145172
     173
  • branches/Grace/src/win32k/ldr/mytkExecPgm.asm

    r4065 r4068  
    1 ; $Id: mytkExecPgm.asm,v 1.10.4.4 2000-08-21 22:59:40 bird Exp $
     1; $Id: mytkExecPgm.asm,v 1.10.4.5 2000-08-22 03:00:21 bird Exp $
    22;
    33; mytkExecPgm - tkExecPgm overload
     
    5454    extrn _TKFuBuff@16:PROC
    5555
    56 
    5756    ;
    5857    ; LDR semaphore
    5958    ;
    60     extrn  pLDRSem:DWORD
    61     extrn  _KSEMRequestMutex@8:PROC
    62     extrn  _LDRClearSem@0:PROC
     59    extrn pLdrSem:DWORD
     60    extrn _LDRClearSem@0:PROC
     61    extrn _KSEMRequestMutex@8:PROC
     62    extrn _KSEMQueryMutex@8:PROC
    6363
    6464    ;
     
    7777    extrn D32Hlp_VirtToLin:PROC
    7878
     79    ;
     80    ; TKSSBase (32-bit)
     81    ;
     82    extrn pulTKSSBase32:DWORD
    7983
    8084;
     
    8488    public tkExecPgmCopyEnv
    8589
    86     public fLdrSemTaken
    8790    public fTkExecPgm
    8891    public achTkExecPgmFilename
     
    101104; (and you'll have to be behind the loader semaphore of course!)
    102105DATA16 SEGMENT
    103 fLdrSemTaken            db 0            ; 0 - Loader Semaphore not taken
    104                                         ; 1 - Loader semaphore is taken and will be freed at exit.
    105106fTkExecPgm              db 0            ; 0 - achTkExecPgmFilename and achTkExecPgmArguments is INVALID
    106107                                        ; 1 - achTkExecPgmFilename and achTkExecPgmArguments is VALID.
     
    221222    ASSUME  DS:FLAT, ES:FLAT
    222223
    223     mov     eax, pLDRSem                ; Load pointer to pLDRSem
    224     or      eax, eax                    ; Check NULL pointer.
    225     je      tkepgm_backout              ; BACKOUT on NULL pointer. (paranoia)
     224    mov     eax, pLdrSem                ; Get pointer to the loader semaphore.
     225    or      eax, eax                    ; Check if null. (paranoia)
     226    jz      tkepgm_backout              ; Fail if null.
    226227
    227228    push    0ffffffffh                  ; Wait indefinitely.
    228     push    eax                         ; LDRSem handle.
     229    push    eax                         ; Push LdrSem address (which is the handle).
    229230    call    near ptr FLAT:_KSEMRequestMutex@8
    230231    or      eax, eax                    ; Check if failed.
    231232    jnz     tkepgm_backout              ; Backout on failure.
    232     mov     fLdrSemTaken, 1             ; Marks that the loader semaphore is taken
    233233
    234234
     
    328328
    329329    ;
    330     ; Clear loader semaphore.
     330    ; Clear loader semaphore?
    331331    ; and clear loader state, current exe module and tkExecPgm global data flag.
    332332    ;
    333     cmp     fLdrSemTaken, 0             ; is the semaphore still taken?
    334     je      tkepgm_callbehindret        ; jmp if not taken.
     333    push    0                           ; Usage count variable.
     334    mov     eax, pulTKSSBase32          ; Get TKSSBase
     335    mov     eax, [eax]
     336    add     eax, esp                    ; Added TKSSBase to the usage count pointer
     337    push    eax                         ; Push address of usage count pointer.
     338    push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     339    call    _KSEMQueryMutex@8
     340    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
     341    je      tkepgm_callbehindret        ; jmp if not taken by us (FALSE).
     342    pop     eax                         ; Pops usage count.
     343    or      eax, eax                    ; Check usage count.
     344    jz      tkepgm_callbehindret        ; jmp if 0 (=free).
    335345    mov     ulLDRState, 0               ; Clears loaderstate. (LDRSTATE_UNKNOWN)
    336346    mov     pExeModule, 0               ; Sets the exemodule pointer to NULL.
    337347    mov     fTkExecPgm, 0               ; Marks global data invalid.
    338348    call    near ptr FLAT:_LDRClearSem@0
    339     mov     fLdrSemTaken, 0             ; Loader semaphore is not taken any longer!
    340349
    341350    ;
  • branches/Grace/src/win32k/ldr/mytkStartProcess.asm

    r4065 r4068  
    1 ; $Id: mytkStartProcess.asm,v 1.1.2.1 2000-08-21 22:59:40 bird Exp $
     1; $Id: mytkStartProcess.asm,v 1.1.2.2 2000-08-22 03:00:22 bird Exp $
    22;
    33; tkStartProcess overloader. Needed to clear the loader semaphore
     
    2020;   Imported Functions and variables.
    2121;
     22
    2223    ;
    2324    ; LDR semaphore
    2425    ;
    25     extrn  pLDRSem:DWORD
    26     extrn  _KSEMRequestMutex@8:PROC
    27     extrn  _LDRClearSem@0:PROC
     26    extrn pLdrSem:DWORD
     27    extrn _LDRClearSem@0:PROC
     28    extrn _KSEMRequestMutex@8:PROC
     29    extrn _KSEMQueryMutex@8:PROC
    2830
    2931    ;
     
    3335
    3436    ;
     37    ; mytkExecPgm stuff.
    3538    ;
    36     ;
    37     extrn fLdrSemTaken:BYTE
    3839    extrn fTkExecPgm:BYTE
    3940
     
    4445
    4546    ;
    46     ;   Exported symbols
     47    ; TKSSBase (32-bit)
    4748    ;
     49    extrn pulTKSSBase32:DWORD
     50
     51    ;
     52    ; Calltable entry for tkStartProcess
     53    ;
     54    extrn _g_tkStartProcess:PROC
     55
     56;
     57;   Exported symbols
     58;
    4859    public mytkStartProcess
    4960
    5061
    5162CODE32 SEGMENT
     63
     64;;
     65; Overloads tkStartProcess. If the loader semahore is taken by us we'll release it.
     66; @returns
     67; @param
     68; @uses      eax, ecx, edx
     69; @sketch
     70; @status
     71; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     72; @remark
    5273mytkStartProcess PROC NEAR
    5374    ASSUME CS:CODE32, DS:FLAT, ES:NOTHING, SS:NOTHING
    5475
    5576    ;
    56     ; Check if the loader semphore is take.
     77    ; Check if the loader semphore is take by us.
    5778    ; Clear it (and other vars) if it is.
    5879    ;
    59     cmp     fLdrSemTaken, 0
    60     jz      finished
     80    push    eax
     81    push    ecx
     82    push    edx
    6183
     84    push    0                           ; Usage count variable.
     85    mov     eax, pulTKSSBase32          ; Get TKSSBase
     86    mov     eax, [eax]
     87    add     eax, esp                    ; Added TKSSBase to the usage count pointer
     88    push    eax                         ; Push address of usage count pointer.
     89    push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     90    call    _KSEMQueryMutex@8
     91    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
     92    jz      mtksp_ret                   ; jmp if not taken by us (FALSE).
     93    pop     eax                         ; Pops usage count.
     94    or      eax, eax                    ; Check usage count.
     95    jz      mtksp_ret                   ; jmp if 0 (=free).
    6296    mov     ulLDRState, 0               ; Clears loaderstate. (LDRSTATE_UNKNOWN)
    6397    mov     pExeModule, 0               ; Sets the exemodule pointer to NULL.
    6498    mov     fTkExecPgm, 0               ; Marks global data invalid.
     99    cmp     eax, 1                      ; If usage count > 1 then issue a release. (should not happen here)
     100    je      mtksp_ret                   ; jmp if usage count < 2. (tkStartProcess or tkExecPgm will free the last usage).
    65101    call    near ptr FLAT:_LDRClearSem@0
    66     mov     fLdrSemTaken, 0             ; Loader semaphore is not taken any longer!
    67102
    68 finished:
    69     call    ktStartProcess
    70     ret
     103mtksp_ret:
     104    pop     edx
     105    pop     ecx
     106    pop     eax
     107    jmp    _g_tkStartProcess
    71108mytkStartProcess ENDP
    72109
Note: See TracChangeset for help on using the changeset viewer.