Changeset 5224 for trunk/src/win32k/lib


Ignore:
Timestamp:
Feb 21, 2001, 8:47:59 AM (25 years ago)
Author:
bird
Message:

CallGate changes.

Location:
trunk/src/win32k/lib
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/lib/libDosAllocMemEx.c

    r5201 r5224  
    1 /* $Id: libDosAllocMemEx.c,v 1.7 2001-02-20 04:57:28 bird Exp $
     1/* $Id: libDosAllocMemEx.c,v 1.8 2001-02-21 07:47:58 bird Exp $
    22 *
    33 * DosAllocMemEx - Extened Edition of DosAllocMem.
    44 *                 Allows you to suggest an address of the memory.
    55 *
    6  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    2424#include <os2.h>
    2525#include "win32k.h"
    26 
    27 
    28 /*******************************************************************************
    29 *   Global Variables                                                           *
    30 *******************************************************************************/
    31 extern BOOL     fInited;
    32 extern HFILE    hWin32k;
    33 
     26#include "libPrivate.h"
    3427
    3528
     
    4538        ULONG         cbData = 0UL;
    4639
     40        Param.hdr.cb = sizeof(Param);
     41        Param.hdr.rc = ERROR_NOT_SUPPORTED;
    4742        Param.ppv = ppv;
    4843        Param.cb = cb;
    4944        Param.flFlags = flag;
    50         Param.rc = 0;
    5145        Param.ulCS = libHelperGetCS();
    5246        Param.ulEIP = *(PULONG)((int)(&ppv) - 4);
    5347
     48        if (usCGSelector)
     49            return libCallThruCallGate(K32_ALLOCMEMEX, &Param);
    5450        rc = DosDevIOCtl(hWin32k,
    5551                         IOCTL_W32K_K32,
     
    5854                         "", 1, &cbData);
    5955        if (rc == NO_ERROR)
    60         {
    61             rc = Param.rc;
    62         }
     56            rc = Param.hdr.rc;
    6357    }
    6458    else
  • trunk/src/win32k/lib/libInit.c

    r4787 r5224  
    1 /* $Id: libInit.c,v 1.3 2000-12-11 06:53:54 bird Exp $
     1/* $Id: libInit.c,v 1.4 2001-02-21 07:47:58 bird Exp $
    22 *
    33 * Inits the Win32k library functions.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2323#include <os2.h>
    2424
     25#include "win32k.h"
     26#include "libPrivate.h"
    2527
    2628/*******************************************************************************
     
    5658
    5759        fInited = rc == NO_ERROR;
     60
     61        /*
     62         * Get the callgate selector.
     63         */
     64        if (fInited)
     65        {
     66            K32QUERYCALLGATE    Param;
     67            ULONG               cbParam = sizeof(Param);
     68            ULONG               cbData = 0UL;
     69
     70            Param.hdr.cb    = sizeof(Param);
     71            Param.hdr.rc    = ERROR_NOT_SUPPORTED;
     72            Param.pusCGSelector = &usCGSelector;
     73
     74            rc = DosDevIOCtl(hWin32k,
     75                             IOCTL_W32K_K32,
     76                             K32_QUERYCALLGATE,
     77                             &Param, sizeof(Param), &cbParam,
     78                             "", 1, &cbData);
     79            if (rc != NO_ERROR || Param.hdr.rc != NO_ERROR)
     80            {
     81                usCGSelector = 0;       /* Just to be 100% it isn't set on a failure */
     82                                        /* since we checks if it's 0 to see if it's usable */
     83                rc = NO_ERROR;          /* This isn't a fatal error, we may still use the IOCtls. */
     84            }
     85        }
    5886    }
    5987    else
  • trunk/src/win32k/lib/libTerm.c

    r4787 r5224  
    1 /* $Id: libTerm.c,v 1.3 2000-12-11 06:53:54 bird Exp $
     1/* $Id: libTerm.c,v 1.4 2001-02-21 07:47:58 bird Exp $
    22 *
    33 * Terminates the Win32k library functions.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2222*******************************************************************************/
    2323#include <os2.h>
    24 
    25 
    26 /*******************************************************************************
    27 *   Global Variables                                                           *
    28 *******************************************************************************/
    29 extern BOOL        fInited;
    30 extern HFILE       hWin32k;
     24#include "libPrivate.h"
    3125
    3226
  • trunk/src/win32k/lib/libW32kHandleSystemEvent.c

    r5167 r5224  
    1 /* $Id: libW32kHandleSystemEvent.c,v 1.1 2001-02-18 14:46:31 bird Exp $
     1/* $Id: libW32kHandleSystemEvent.c,v 1.2 2001-02-21 07:47:58 bird Exp $
    22 *
    33 * libW32kHandleSystemEvent - Override system events like Ctrl-Alt-Delete
     
    2424#include <os2.h>
    2525#include "win32k.h"
    26 
    27 
    28 /*******************************************************************************
    29 *   Global Variables                                                           *
    30 *******************************************************************************/
    31 extern BOOL     fInited;
    32 extern HFILE    hWin32k;
     26#include "libPrivate.h"
    3327
    3428
     
    6458        ULONG                   cbData = 0UL;
    6559
    66         Param.ulEvent = ulEvent;
    67         Param.hev = hev;
    68         Param.fHandle = fHandle;
    69         Param.rc = ERROR_INVALID_PARAMETER;
     60        Param.hdr.cb    = sizeof(Param);
     61        Param.hdr.rc    = ERROR_NOT_SUPPORTED;
     62        Param.ulEvent   = ulEvent;
     63        Param.hev       = hev;
     64        Param.fHandle   = fHandle;
    7065
     66        if (usCGSelector)
     67            return libCallThruCallGate(K32_HANDLESYSTEMEVENT, &Param);
    7168        rc = DosDevIOCtl(hWin32k,
    7269                         IOCTL_W32K_K32,
     
    7673
    7774        if (rc == NO_ERROR)
    78             rc = Param.rc;
     75            rc = Param.hdr.rc;
    7976    }
    8077    else
  • trunk/src/win32k/lib/libW32kProcessReadWrite.c

    r4347 r5224  
    1 /* $Id: libW32kProcessReadWrite.c,v 1.1 2000-10-01 02:58:20 bird Exp $
     1/* $Id: libW32kProcessReadWrite.c,v 1.2 2001-02-21 07:47:58 bird Exp $
    22 *
    33 * libW32kProcessReadWrite  -  Read or write to another process.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2323#include <os2.h>
    2424#include "win32k.h"
    25 
    26 
    27 /*******************************************************************************
    28 *   Global Variables                                                           *
    29 *******************************************************************************/
    30 extern BOOL     fInited;
    31 extern HFILE    hWin32k;
    32 
     25#include "libPrivate.h"
    3326
    3427
     
    5548        ULONG               cbData = 0UL;
    5649
     50        Param.hdr.cb    = sizeof(Param);
     51        Param.hdr.rc    = ERROR_NOT_SUPPORTED;
    5752        Param.pid       = pid;
    5853        Param.cb        = cb;
     
    6055        Param.pvTarget  = pvTarget;
    6156        Param.fRead     = fRead;
    62         Param.rc = ERROR_INVALID_PARAMETER;
    6357
     58        if (usCGSelector)
     59            return libCallThruCallGate(K32_PROCESSREADWRITE, &Param);
    6460        rc = DosDevIOCtl(hWin32k,
    6561                         IOCTL_W32K_K32,
     
    6965
    7066        if (rc == NO_ERROR)
    71             rc = Param.rc;
     67            rc = Param.hdr.rc;
    7268    }
    7369    else
  • trunk/src/win32k/lib/libW32kQueryOTEs.c

    r4164 r5224  
    1 /* $Id: libW32kQueryOTEs.c,v 1.2 2000-09-02 21:08:11 bird Exp $
     1/* $Id: libW32kQueryOTEs.c,v 1.3 2001-02-21 07:47:59 bird Exp $
    22 *
    33 * libW32kQueryOTEs - Get's the object table entries (OTEs) for a given
    44 *                    module (given by a module handle).
    55 *
    6  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    2424#include <os2.h>
    2525#include "win32k.h"
    26 
    27 
    28 /*******************************************************************************
    29 *   Global Variables                                                           *
    30 *******************************************************************************/
    31 extern BOOL     fInited;
    32 extern HFILE    hWin32k;
     26#include "libPrivate.h"
    3327
    3428
     
    5347        ULONG           cbData = 0UL;
    5448
    55         Param.hMTE = hMTE;
    56         Param.pQOte = pQOte;
     49        Param.hdr.cb = sizeof(Param);
     50        Param.hdr.rc = ERROR_NOT_SUPPORTED;
     51        Param.hMTE   = hMTE;
     52        Param.pQOte  = pQOte;
    5753        Param.cbQOte = cbQOte;
    58         Param.rc = ERROR_INVALID_PARAMETER;
    5954
     55        if (usCGSelector)
     56            return libCallThruCallGate(K32_QUERYOTES, &Param);
    6057        rc = DosDevIOCtl(hWin32k,
    6158                         IOCTL_W32K_K32,
     
    6562
    6663        if (rc == NO_ERROR)
    67             rc = Param.rc;
     64            rc = Param.hdr.rc;
    6865    }
    6966    else
  • trunk/src/win32k/lib/libW32kQuerySystemMemInfo.c

    r5108 r5224  
    1 /* $Id: libW32kQuerySystemMemInfo.c,v 1.1 2001-02-11 15:24:04 bird Exp $
     1/* $Id: libW32kQuerySystemMemInfo.c,v 1.2 2001-02-21 07:47:59 bird Exp $
    22 *
    33 * libW32kQuerySystemMemInfo - Collects more or less useful information on the
     
    2424#include <os2.h>
    2525#include "win32k.h"
    26 
    27 
    28 /*******************************************************************************
    29 *   Global Variables                                                           *
    30 *******************************************************************************/
    31 extern BOOL     fInited;
    32 extern HFILE    hWin32k;
     26#include "libPrivate.h"
    3327
    3428
     
    5448        ULONG                   cbData = 0UL;
    5549
    56         Param.pMemInfo = pMemInfo;
    57         Param.rc = ERROR_INVALID_PARAMETER;
     50        Param.hdr.cb    = sizeof(Param);
     51        Param.hdr.rc    = ERROR_NOT_SUPPORTED;
     52        Param.pMemInfo  = pMemInfo;
    5853
     54        if (usCGSelector)
     55            return libCallThruCallGate(K32_QUERYSYSTEMMEMINFO, &Param);
    5956        rc = DosDevIOCtl(hWin32k,
    6057                         IOCTL_W32K_K32,
     
    6461
    6562        if (rc == NO_ERROR)
    66             rc = Param.rc;
     63            rc = Param.hdr.rc;
    6764    }
    6865    else
  • trunk/src/win32k/lib/libWin32kInstalled.c

    r4164 r5224  
    1 /* $Id: libWin32kInstalled.c,v 1.2 2000-09-02 21:08:11 bird Exp $
     1/* $Id: libWin32kInstalled.c,v 1.3 2001-02-21 07:47:59 bird Exp $
    22 *
    33 * libWin32kInstalled - checks if Win32k is installed or not.
     
    2121#include <os2.h>
    2222#include "win32k.h"
    23 
    24 
    25 /*******************************************************************************
    26 *   Global Variables                                                           *
    27 *******************************************************************************/
    28 extern BOOL     fInited;
     23#include "libPrivate.h"
    2924
    3025
  • trunk/src/win32k/lib/libWin32kQueryOptionsStatus.c

    r4164 r5224  
    1 /* $Id: libWin32kQueryOptionsStatus.c,v 1.2 2000-09-02 21:08:12 bird Exp $
     1/* $Id: libWin32kQueryOptionsStatus.c,v 1.3 2001-02-21 07:47:59 bird Exp $
    22 *
    33 * libWin32kQueryOptionsStatus - Queries the options and/or the status of
    44 *                               Win32k.sys driver.
    55 *
    6  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     6 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    2424#include <os2.h>
    2525#include "win32k.h"
    26 
    27 
    28 /*******************************************************************************
    29 *   Global Variables                                                           *
    30 *******************************************************************************/
    31 extern BOOL     fInited;
    32 extern HFILE    hWin32k;
     26#include "libPrivate.h"
    3327
    3428
     
    7165        ULONG           cbData = 0UL;
    7266
     67        Param.hdr.cb    = sizeof(Param);
     68        Param.hdr.rc    = ERROR_NOT_SUPPORTED;
    7369        Param.pOptions  = pOptions;
    7470        Param.pStatus   = pStatus;
    75         Param.rc = ERROR_INVALID_PARAMETER;
    7671
     72        if (usCGSelector)
     73            return libCallThruCallGate(K32_QUERYOPTIONSSTATUS, &Param);
    7774        rc = DosDevIOCtl(hWin32k,
    7875                         IOCTL_W32K_K32,
     
    8279
    8380        if (rc == NO_ERROR)
    84             rc = Param.rc;
     81            rc = Param.hdr.rc;
    8582    }
    8683    else
  • trunk/src/win32k/lib/libWin32kSetOptions.c

    r5131 r5224  
    1 /* $Id: libWin32kSetOptions.c,v 1.3 2001-02-14 12:46:56 bird Exp $
     1/* $Id: libWin32kSetOptions.c,v 1.4 2001-02-21 07:47:59 bird Exp $
    22 *
    33 * libWin32kSetOptions - Sets the changable options of win32k.sys the options.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     5 * Copyright (c) 2000-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2323#include <os2.h>
    2424#include "win32k.h"
    25 
    26 
    27 /*******************************************************************************
    28 *   Global Variables                                                           *
    29 *******************************************************************************/
    30 extern BOOL     fInited;
    31 extern HFILE    hWin32k;
     25#include "libPrivate.h"
    3226
    3327
     
    6559        ULONG           cbData = 0UL;
    6660
     61        Param.hdr.cb    = sizeof(Param);
     62        Param.hdr.rc    = ERROR_NOT_SUPPORTED;
    6763        Param.pOptions  = pOptions;
    68         Param.rc = ERROR_INVALID_PARAMETER;
    6964
     65        if (usCGSelector)
     66            return libCallThruCallGate(K32_SETOPTIONS, &Param);
    7067        rc = DosDevIOCtl(hWin32k,
    7168                         IOCTL_W32K_K32,
     
    7572
    7673        if (rc == NO_ERROR)
    77             rc = Param.rc;
     74            rc = Param.hdr.rc;
    7875    }
    7976    else
  • trunk/src/win32k/lib/makefile

    r5168 r5224  
    1 # $Id: makefile,v 1.11 2001-02-18 14:49:04 bird Exp $
     1# $Id: makefile,v 1.12 2001-02-21 07:47:59 bird Exp $
    22
    33#
     
    4646$(OBJDIR)\libW32kQuerySystemMemInfo.obj \
    4747$(OBJDIR)\libW32kProcessReadWrite.obj \
    48 $(OBJDIR)\libGetCS.obj
     48$(OBJDIR)\libGetCS.obj \
     49$(OBJDIR)\libCallThruCallGate.obj
    4950
    5051
Note: See TracChangeset for help on using the changeset viewer.