Ignore:
Timestamp:
Jul 10, 2001, 6:41:10 PM (24 years ago)
Author:
bird
Message:

Use PTDA not PID and allways take loader sem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/misc/PerTaskW32kData.c

    r6230 r6296  
    1 /* $Id: PerTaskW32kData.c,v 1.1 2001-07-08 03:09:03 bird Exp $
     1/* $Id: PerTaskW32kData.c,v 1.2 2001-07-10 16:39:19 bird Exp $
    22 *
    33 * Per Task (Win32k) Data.
     
    1717#define INCL_OS2KRNL_VM                 /* OS2KRNL: Virtual Memory Management */
    1818#define INCL_OS2KRNL_TK                 /* OS2KRNL: Task Stuff */
     19#define INCL_OS2KRNL_PTDA
    1920
    2021/*******************************************************************************
     
    5253 * If it doesn't exist we'll allocate a new one.
    5354 * @returns Pointer to task data structure.
    54  * @param   pid     Process id. 0 means current pid.
     55 *          Might be NULL (see fCreate).
     56 * @param   pPTDA   Pointer to PTDA for the task.
     57 * @param   fCreate TRUE:  Create structure if not found.
     58 *                  FALSE: Return NULL if not found.
    5559 * @status  completely implemented.
    5660 * @author  knut st. osmundsen (kosmunds@csc.no)
    57  * @remark  Do we need a Get function which doesn't make a node if no data was found?
    5861 */
    59 PPTD    GetTaskData(PID pid)
     62PPTD    GetTaskData(PPTDA pPTDA, BOOL fCreate)
    6063{
    6164    PPTD    pptd;
    62     if (pid == 0)
    63         pid = InternalGetPid();
    64     pptd = (PPTD)(void*)AVLGet(&pPTDTree, pid);
    65     if (!pptd)
     65    if (pPTDA == 0)
     66        pPTDA = ptdaGetCur();
     67    pptd = (PPTD)(void*)AVLGet(&pPTDTree, (AVLKEY)pPTDA);
     68    if (!pptd && fCreate)
    6669    {
    6770        pptd = rmalloc(sizeof(*pptd));
     
    7275        }
    7376        memset(pptd, 0, sizeof(*pptd));
    74         pptd->core.Key = pid;
     77        pptd->core.Key = (AVLKEY)pPTDA;
    7578        AVLInsert(&pPTDTree, &pptd->core);
    7679    }
     
    8184/**
    8285 * Remove the give process id.
    83  * @param   pid     Process id to remove. 0 means current pid.
     86 * @param   pPTDA   Pointer to PTDA for the task.
    8487 * @status  completely implemented.
    8588 * @author  knut st. osmundsen (kosmunds@csc.no)
    8689 */
    87 void    RemoveTaskData(PID pid)
     90void    RemoveTaskData(PPTDA pPTDA)
    8891{
    8992    PPTD  pptd;
    90     if (pid == 0)
    91         pid = InternalGetPid();
    92     pptd = (PPTD)(void*)AVLRemove(&pPTDTree, pid);
     93    if (pPTDA == 0)
     94        pPTDA = ptdaGetCur();
     95    pptd = (PPTD)(void*)AVLRemove(&pPTDTree, (AVLKEY)pPTDA);
    9396    if (pptd)
    9497    {
    9598        /* perhaps free data here... */
     99        if (*(PULONG)(void*)&pptd->lockOdin32Env)
     100        {
     101            D32Hlp_VMUnLock(&pptd->lockOdin32Env);
     102            memset(&pptd->lockOdin32Env, 0, sizeof(pptd->lockOdin32Env));
     103        }
     104        pptd->pszzOdin32Env = NULL;
    96105        rfree(pptd);
    97106    }
Note: See TracChangeset for help on using the changeset viewer.