Changeset 2799 for trunk/src


Ignore:
Timestamp:
Feb 16, 2000, 12:39:20 AM (26 years ago)
Author:
bird
Message:

IOCtl exported services.
k32AllocMemEx.

Location:
trunk/src/win32k
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/Makefile

    r2729 r2799  
    11################################################################################
    2 # $Id: Makefile,v 1.22 2000-02-10 01:21:34 bird Exp $
     2# $Id: Makefile,v 1.23 2000-02-15 23:39:18 bird Exp $
    33#
    44# Copyright 1998-1999 knut st. osmundsen
     
    106106    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
    107107{dev32}.cpp{object}.obj:
     108    @$(ECHO) compiling 32bit: $<
     109    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     110
     111{k32}.asm{object}.obj:
     112    @$(ECHO) assembling:      $<
     113    @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst
     114{k32}.c{object}.obj:
     115    @$(ECHO) compiling 32bit: $<
     116    @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     117{k32}.cpp{object}.obj:
    108118    @$(ECHO) compiling 32bit: $<
    109119    @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<
     
    171181        object\myldrEnum32bitRelRecs.obj \
    172182        object\pe2lx.obj \
    173         object\ModuleBase.obj
     183        object\ModuleBase.obj \
     184        object\d32ElfIOCtl.obj \
     185        object\d32Win32kIOCtl.obj \
     186        object\k32AllocMemEx.obj
    174187
    175188
     
    276289################################################################################
    277290dep:
    278     $(PDWIN32_TOOLS)\fastdep -oObject $(CINCLUDES) misc\*.c* ldr\*.c* dev32\*.c* dev16\*.c* pe2lx\*.c* include\*.h
     291    $(PDWIN32_TOOLS)\fastdep -oObject $(CINCLUDES) misc\*.c* ldr\*.c* dev32\*.c* \
     292        dev16\*.c* pe2lx\*.c* k32\*.c* lib\*.c include\*.h
    279293
    280294object\asmutils.obj:            misc\asmutils.asm     include\devsegdf.inc
  • trunk/src/win32k/dev16/d16strat.c

    r1678 r2799  
    1 /* $Id: d16strat.c,v 1.3 1999-11-10 01:45:30 bird Exp $
     1/* $Id: d16strat.c,v 1.4 2000-02-15 23:39:18 bird Exp $
    22 *
    33 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr)
     
    3030#include "dev1632.h"
    3131#include "dev16.h"
     32#include "win32k.h"
    3233
    3334
     
    8889USHORT NEAR strategy(PRPH pRpH, unsigned short usDev)
    8990{
    90 
    9191    switch (pRpH->Cmd)
    9292    {
     
    145145            {
    146146                ULONG ulLin;
    147                 if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket), &ulLin) != NO_ERROR)
     147                if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
     148                                      &ulLin) != NO_ERROR)
    148149                    return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    149150                return CallGetOTEs32(ulLin);
     
    156157        }
    157158    }
     159    else if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)
     160    {
     161        RP32GENIOCTL rp32Init = {0};
     162        rp32Init.rph.Len = pRp->rph.Len;
     163        rp32Init.rph.Unit = pRp->rph.Unit;
     164        rp32Init.rph.Cmd = pRp->rph.Cmd;
     165        rp32Init.rph.Status = pRp->rph.Status;
     166        rp32Init.rph.Flags = pRp->rph.Flags;
     167        rp32Init.rph.Link = (ULONG)pRp->rph.Link;
     168        rp32Init.Category = pRp->Category;
     169        rp32Init.Function = pRp->Function;
     170        rp32Init.sfn = pRp->sfn;
     171        rp32Init.DataLen = pRp->DataLen;
     172        rp32Init.ParmLen = pRp->ParmLen;
     173
     174        if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
     175                              (PLIN)&rp32Init.DataPacket) != NO_ERROR)
     176            return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     177        if (DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket),
     178                              (PLIN)&rp32Init.ParmPacket) != NO_ERROR)
     179            return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     180
     181        if (pRp->Category == IOCTL_W32K_ELF)
     182            rc = CallElfIOCtl(SSToDS_16a(&rp32Init));
     183        else
     184            rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init));
     185
     186        return rc;
     187    }
     188
    158189
    159190    return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     
    169200USHORT dev1GenIOCtl(PRP_GENIOCTL pRp)
    170201{
    171     pRp = pRp;
     202    if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)
     203    {
     204        USHORT          rc;
     205        RP32GENIOCTL    rp32Init = {0};
     206        rp32Init.rph.Len = pRp->rph.Len;
     207        rp32Init.rph.Unit = pRp->rph.Unit;
     208        rp32Init.rph.Cmd = pRp->rph.Cmd;
     209        rp32Init.rph.Status = pRp->rph.Status;
     210        rp32Init.rph.Flags = pRp->rph.Flags;
     211        rp32Init.rph.Link = (ULONG)pRp->rph.Link;
     212        rp32Init.Category = pRp->Category;
     213        rp32Init.Function = pRp->Function;
     214        rp32Init.sfn = pRp->sfn;
     215        rp32Init.DataLen = pRp->DataLen;
     216        rp32Init.ParmLen = pRp->ParmLen;
     217
     218        if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket),
     219                              (PLIN)&rp32Init.DataPacket) != NO_ERROR)
     220            return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     221        if (DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket),
     222                              (PLIN)&rp32Init.ParmPacket) != NO_ERROR)
     223            return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
     224
     225        if (pRp->Category == IOCTL_W32K_ELF)
     226            rc = CallElfIOCtl(SSToDS_16a(&rp32Init));
     227        else
     228            rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init));
     229
     230        return rc;
     231    }
     232
    172233    return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER;
    173234}
  • trunk/src/win32k/dev32/devfirst.asm

    r1467 r2799  
    1 ; $Id: devfirst.asm,v 1.2 1999-10-27 02:02:54 bird Exp $
     1; $Id: devfirst.asm,v 1.3 2000-02-15 23:39:19 bird Exp $
    22;
    33; DevFirst - entrypoint and segment definitions
     
    3232    public _strategyAsm1
    3333    public _CallGetOTEs32
     34    public _CallElfIOCtl
     35    public _CallWin32kIOCtl
    3436    public _SSToDS_16a
    3537    public GetOS2KrnlMTE
     
    4143    extrn _TKSSBase16:dword
    4244    extrn GETOTES32:FAR
     45    extrn ELFIOCTL:FAR
     46    extrn WIN32KIOCTL:FAR
    4347    .286p
    4448    extrn _strategy:near
     
    8488; @cproto    USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
    8589; @returns   Same as GetOTEs32.
    86 ; @param     addressOTEBuf  32-bit pointer to request data.
     90; @param     address of OTEBuf  32-bit pointer to request data.
    8791; @status    completely implemented.
    8892; @author    knut st. osmundsen
     
    96100    retn
    97101_CallGetOTEs32 ENDP
     102
     103
     104
     105
     106;;
     107; Thunk procedure for .
     108; @cproto    USHORT NEAR CallElfIOCtl(void);
     109; @returns   Same as ElfIOCtl
     110; @param     address of IOCtl request packet (32-bit pointer).
     111; @status    completely implemented.
     112; @author    knut st. osmundsen
     113_CallElfIOCtl PROC NEAR
     114    ASSUME CS:CODE16
     115    push    ds
     116    push    word ptr [esp+6]            ; push high word.
     117    push    word ptr [esp+6]            ; push low word.
     118    call    far ptr FLAT:ELFIOCTL
     119    pop     ds
     120    retn
     121_CallElfIOCtl ENDP
     122
     123;;
     124; Thunk procedure for .
     125; @cproto    USHORT NEAR CallWin32kIOCtl(void);
     126; @returns   Same as Win32kIOCtl
     127; @param     address of IOCtl request packet (32-bit pointer).
     128; @status    completely implemented.
     129; @author    knut st. osmundsen
     130_CallWin32kIOCtl PROC NEAR
     131    ASSUME CS:CODE16
     132    push    ds
     133    push    word ptr [esp+6]            ; push high word.
     134    push    word ptr [esp+6]            ; push low word.
     135    call    far ptr FLAT:WIN32KIOCTL
     136    pop     ds
     137    retn
     138_CallWin32kIOCtl ENDP
     139
    98140
    99141
  • trunk/src/win32k/include/OS2KVM.h

    r2796 r2799  
    1 /* $Id: OS2KVM.h,v 1.1 2000-02-15 16:26:06 bird Exp $
     1/* $Id: OS2KVM.h,v 1.2 2000-02-15 23:39:19 bird Exp $
    22 *
    33 * OS/2 kernel VM functions.
     
    6363    ULONG   cbSize,
    6464    ULONG   SomeArg1,
    65     ULONG   flFlags1
    66     USHORT  hPTDA
    67     USHORT  usVMOwnerId
    68     USHORT  hMTE
    69     ULONG   flFlags2
     65    ULONG   flFlags1,
     66    USHORT  hPTDA,
     67    USHORT  usVMOwnerId,
     68    USHORT  hMTE,
     69    ULONG   flFlags2,
    7070    ULONG   SomeArg2,
    7171    PVMAC   pvmac);
  • trunk/src/win32k/include/OS2Krnl.h

    r2617 r2799  
    1 /* $Id: OS2Krnl.h,v 1.6 2000-02-03 21:22:30 bird Exp $
     1/* $Id: OS2Krnl.h,v 1.7 2000-02-15 23:39:19 bird Exp $
    22 *
    33 * OS/2 kernel structures, typedefs and macros.
     4 *
     5 * Top-level include file.
    46 *
    57 * Project Odin Software License can be found in LICENSE.TXT
     
    149151   USHORT         mte_usecnt;    /* (.EXE only) - use count */
    150152   CHAR           mte_modname[8];
    151 }MTE,*PMTE,**PPMTE;
     153} MTE,*PMTE,**PPMTE;
    152154
    153155
     
    232234#ifdef INCL_OS2KRNL_ALL
    233235    #define INCL_OS2KRNL_IO
     236    #define INCL_OS2KRNL_VM
    234237#endif
    235238
     
    238241#endif
    239242
    240 #endif
     243#ifdef INCL_OS2KRNL_VM
     244    #include <OS2KVM.h>
     245#endif
     246
     247#endif
  • trunk/src/win32k/include/dev16.h

    r1678 r2799  
    1 /* $Id: dev16.h,v 1.3 1999-11-10 01:45:32 bird Exp $
     1/* $Id: dev16.h,v 1.4 2000-02-15 23:39:19 bird Exp $
    22 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
    33 *
     
    113113USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
    114114USHORT NEAR CallVerifyProcTab32(void);
     115USHORT NEAR CallElfIOCtl(LIN pRpIOCtl);
     116USHORT NEAR CallWin32kIOCtl(LIN pRpIOCtl);
     117
    115118
    116119/*
  • trunk/src/win32k/include/dev1632.h

    r847 r2799  
    1 /* $Id: dev1632.h,v 1.1 1999-09-06 02:19:57 bird Exp $
     1/* $Id: dev1632.h,v 1.2 2000-02-15 23:39:19 bird Exp $
    22 * dev1632.h - Common header file for 16-bit and 32-bit C
    33 *
     
    3131} RP32INIT;
    3232
     33typedef struct _RP32GENIOCTL
     34{
     35    RPH32       rph;
     36    UCHAR       Category;
     37    UCHAR       Function;
     38    PVOID       ParmPacket;
     39    PVOID       DataPacket;
     40    USHORT      sfn;
     41    USHORT      ParmLen;
     42    USHORT      DataLen;
     43} RP32GENIOCTL, *PRP32GENIOCTL;
     44
     45
    3346#ifdef _OS2Krnl_h_
    3447
     
    3952    OTE             aObjects[MAXKRNLOBJECTS];
    4053} KRNLOBJTABLE, FAR * PKRNLOBJTABLE;
     54
     55#else
     56
     57#define PKRNLOBJTABLE void *
     58
    4159#endif
    4260
  • trunk/src/win32k/include/dev32.h

    r1678 r2799  
    1 /* $Id: dev32.h,v 1.4 1999-11-10 01:45:32 bird Exp $
     1/* $Id: dev32.h,v 1.5 2000-02-15 23:39:19 bird Exp $
    22 *
    33 * dev32 - header file for 32-bit part of the driver.
     
    1919 */
    2020#ifndef _dev1632_h_
    21     #define RP32INIT void
    22     #define PKRNLOBJTABLE void *
     21    #define RP32INIT        void
     22    #define PRP32INIT       void *
     23    #define RP32GENIOCTL    void
     24    #define PRP32GENIOCTL   void *
     25    #define PKRNLOBJTABLE   void *
    2326#endif
     27
    2428
    2529/*
     
    5458USHORT _loadds _Far32 _Pascal GetOTEs32(PKRNLOBJTABLE pOTEBuf);
    5559USHORT _loadds _Far32 _Pascal VerifyProcTab32(void);
     60USHORT _loadds _Far32 _Pascal ElfIOCtl(PRP32GENIOCTL pRpIOCtl);
     61USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl);
    5662#endif
    5763#ifdef _OS2Krnl_h_
  • trunk/src/win32k/include/k32.h

    r2796 r2799  
    1 /* $Id: k32.h,v 1.1 2000-02-15 16:26:05 bird Exp $
     1/* $Id: k32.h,v 1.2 2000-02-15 23:39:19 bird Exp $
    22 *
    33 * k32 - definitions.
     
    1212#define _k32_h_
    1313
     14#ifdef __cplusplus
     15extern "C" {
     16#endif
    1417
    1518/*******************************************************************************
    1619*   Exported Functions                                                         *
    1720*******************************************************************************/
    18 APIRET k32AllocMemEx(PPVOID ppb, ULONG cb, ULONG flag);
     21APIRET k32AllocMemEx(PPVOID ppb, ULONG cb, ULONG flag, ULONG ulCS, ULONG ulEIP);
    1922
    2023
     24#ifdef __cplusplus
     25}
    2126#endif
     27#endif
  • trunk/src/win32k/include/win32k.h

    r2796 r2799  
    1 /* $Id: win32k.h,v 1.1 2000-02-15 16:26:06 bird Exp $
     1/* $Id: win32k.h,v 1.2 2000-02-15 23:39:19 bird Exp $
    22 *
    33 * Top level make file for the Win32k library.
     
    2424 * K32 category - these are the functions found in the k32 directory.
    2525 */
    26 #define K32_DOSALLOCMEMEX       0x01
     26#define K32_ALLOCMEMEX          0x01
    2727
    2828
     
    3333
    3434
     35/*******************************************************************************
     36*   Structures and Typedefs                                                    *
     37*******************************************************************************/
     38/*
     39 * K32 category parameter structs
     40 */
     41typedef struct _k32AllocMemEx
     42{
     43    PVOID   pv;                         /* Pointer to allocated memory block */
     44                                        /* On input this holds the suggested */
     45                                        /* location of the block. */
     46    ULONG   cb;                         /* Blocksize (bytes) */
     47    ULONG   flFlags;                    /* Flags (equal to DosAllocMem flags) */
     48    ULONG   ulCS;                       /* Call CS */
     49    ULONG   ulEIP;                      /* Call EIP */
     50    ULONG   rc;                         /* Return code. */
     51} K32ALLOCMEMEX, *PK32ALLOCMEMEX;
     52
     53
     54
    3555
    3656#ifdef INCL_WIN32K_LIB
     
    3858*   External Functions                                                         *
    3959*******************************************************************************/
    40 APIRET APIENTRY  DosAllocMemEx(PPVOID ppb, ULONG cb, ULONG flag);
     60APIRET APIENTRY  DosAllocMemEx(PPVOID ppv, ULONG cb, ULONG flag);
    4161
    4262#endif
Note: See TracChangeset for help on using the changeset viewer.