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/dev32/d32Win32kOpenClose.c

    r6215 r6296  
    1 /* $Id: d32Win32kOpenClose.c,v 1.1 2001-07-08 02:53:18 bird Exp $
     1/* $Id: d32Win32kOpenClose.c,v 1.2 2001-07-10 16:39:16 bird Exp $
    22 *
    33 * Open and Close handlers for the Win32k driver.
     
    1616#define INCL_NOPMAPI
    1717#define INCL_OS2KRNL_TK
     18#define INCL_OS2KRNL_SEM
     19#define INCL_OS2KRNL_LDR
    1820#define INCL_OS2KRNL_PTDA
    1921
     
    5254USHORT _loadds _Far32 _Pascal Win32kOpen(PRP32OPENCLOSE pRpOpen)
    5355{
    54     PPTD pptd = GetTaskData(0);
     56    APIRET  rc;
     57    PPTD    pptd;
     58
     59    /*
     60     * Take Loader semaphore as that currently protects everything in this driver...
     61     */
     62    rc = LDRRequestSem();
     63    if (rc != NO_ERROR)
     64    {
     65        kprintf(("Win32kOpen: LDRRequestSem failed with rc = %d\n", rc));
     66        //return rc;
     67    }
     68
     69    pptd = GetTaskData(0, TRUE);
    5570    if (pptd)
    5671        pptd->cUsage++;
    5772
    5873    pRpOpen = pRpOpen;
     74    LDRClearSem();
    5975    return STATUS_DONE;
    6076}
     
    7086USHORT _loadds _Far32 _Pascal Win32kClose(PRP32OPENCLOSE pRpClose)
    7187{
    72     PPTD pptd = GetTaskData(0);
     88    APIRET  rc;
     89    PPTD    pptd;
     90
     91    /*
     92     * Take Loader semaphore as that currently protects everything in this driver...
     93     */
     94    rc = LDRRequestSem();
     95    if (rc != NO_ERROR)
     96    {
     97        kprintf(("Win32kClose: LDRRequestSem failed with rc = %d\n", rc));
     98        //return rc;
     99    }
     100
     101    pptd = GetTaskData(0, FALSE);
    73102    if (pptd)
    74103    {
    75104        if (pptd->cUsage > 0)
    76         {
    77             APIRET  rc;
    78             if (    pptd->pszzOdin32Env != NULL
    79                 && (rc = D32Hlp_VMUnLock(&pptd->lockOdin32Env)) != NO_ERROR
    80                 )
    81             {
    82                 kprintf(("Win32kClose: VMUnLock failed with rc=%d\n", rc));
    83             }
    84105            pptd->cUsage--;
    85         }
    86106        if (pptd->cUsage == 0)
    87107            RemoveTaskData(0);
    88108    }
    89109    pRpClose = pRpClose;
     110
     111    LDRClearSem();
    90112    return STATUS_DONE;
    91113}
Note: See TracChangeset for help on using the changeset viewer.