- Timestamp:
- Sep 27, 2001, 5:08:35 AM (24 years ago)
- Location:
- branches/splittup/src/win32k
- Files:
-
- 62 deleted
- 59 edited
-
Makefile (modified) (11 diffs)
-
Xx2Lx.mak (modified) (2 diffs)
-
calltrees.txt (modified) (1 diff)
-
clfix.c (deleted)
-
configure.cmd (modified) (3 diffs)
-
dev16/SymDB.c (deleted)
-
dev16/d16globl.c (modified) (3 diffs)
-
dev16/d16init.c (modified) (7 diffs)
-
dev16/d16strat.c (modified) (7 diffs)
-
dev16/extract.c (deleted)
-
dev16/mkcalltab.c (deleted)
-
dev16/probkrnl.c (deleted)
-
dev16/vprntf16.c (modified) (5 diffs)
-
dev32/d32CallGate.asm (modified) (3 diffs)
-
dev32/d32ElfIOCtl.c (deleted)
-
dev32/d32Events.asm (modified) (2 diffs)
-
dev32/d32Win32kIOCtl.c (modified) (2 diffs)
-
dev32/d32Win32kOpenClose.c (modified) (4 diffs)
-
dev32/d32globals.c (modified) (2 diffs)
-
dev32/d32hlp.asm (deleted)
-
dev32/d32init.c (modified) (17 diffs)
-
dev32/devfirst.asm (modified) (9 diffs)
-
dev32/devlast.asm (modified) (4 diffs)
-
fastdep.c (deleted)
-
include/OS2KIO.h (deleted)
-
include/OS2KLDR.h (deleted)
-
include/OS2KPG.h (deleted)
-
include/OS2KPTDA.h (deleted)
-
include/OS2KSEC.h (deleted)
-
include/OS2KSEM.h (deleted)
-
include/OS2KSM.h (deleted)
-
include/OS2KTCB.h (deleted)
-
include/OS2KTK.h (deleted)
-
include/OS2KVM.h (deleted)
-
include/OS2Krnl.h (deleted)
-
include/PerTaskW32kData.h (modified) (2 diffs)
-
include/avl.h (deleted)
-
include/cout.h (deleted)
-
include/dev16.h (modified) (5 diffs)
-
include/dev1632.h (modified) (2 diffs)
-
include/dev32.h (modified) (4 diffs)
-
include/dev32hlp.h (deleted)
-
include/env.h (deleted)
-
include/errors.h (deleted)
-
include/ldr.h (modified) (4 diffs)
-
include/log.h (deleted)
-
include/macros.h (deleted)
-
include/malloc.h (deleted)
-
include/new.h (deleted)
-
include/options.h (modified) (9 diffs)
-
include/probkrnl.h (deleted)
-
include/ptda.h (deleted)
-
include/rmalloc.h (deleted)
-
include/smalloc.h (deleted)
-
include/sprintf.h (deleted)
-
include/sym.h (deleted)
-
include/test.h (modified) (2 diffs)
-
include/types.h (deleted)
-
include/vprintf.h (deleted)
-
include/yield.h (deleted)
-
k32/k32AllocMemEx.cpp (modified) (5 diffs)
-
k32/k32HandleSystemEvent.cpp (modified) (3 diffs)
-
k32/k32KillProcessEx.cpp (modified) (3 diffs)
-
k32/k32ProcessReadWrite.cpp (modified) (3 diffs)
-
k32/k32QueryCallGate.cpp (modified) (2 diffs)
-
k32/k32QueryOTEs.cpp (modified) (3 diffs)
-
k32/k32QueryOptionsStatus.cpp (modified) (10 diffs)
-
k32/k32QuerySystemMemInfo.cpp (modified) (4 diffs)
-
k32/k32SetEnvironment.cpp (modified) (4 diffs)
-
k32/k32SetOptions.cpp (modified) (10 diffs)
-
ldr/ModuleBase.cpp (modified) (3 diffs)
-
ldr/ldr.cpp (modified) (17 diffs)
-
ldr/myLDRGetProcAddr.cpp (modified) (4 diffs)
-
ldr/myLDRQAppType.cpp (modified) (3 diffs)
-
ldr/myVMAllocMem.cpp (modified) (4 diffs)
-
ldr/myldrCheckInternalName.cpp (modified) (4 diffs)
-
ldr/myldrClose.cpp (modified) (4 diffs)
-
ldr/myldrEnum32bitRelRecs.cpp (modified) (4 diffs)
-
ldr/myldrFindModule.cpp (modified) (6 diffs)
-
ldr/myldrGetFileName.asm (modified) (2 diffs)
-
ldr/myldrOpen.cpp (modified) (5 diffs)
-
ldr/myldrOpenPath.cpp (modified) (4 diffs)
-
ldr/myldrOpenPatha.asm (modified) (6 diffs)
-
ldr/myldrRead.cpp (modified) (4 diffs)
-
ldr/myldrSetVMflags.cpp (modified) (4 diffs)
-
ldr/myldrWasLoadModuled.cpp (modified) (4 diffs)
-
ldr/mytkExecPgm.asm (modified) (5 diffs)
-
ldr/mytkStartProcess.asm (modified) (4 diffs)
-
ldr/xx2lxmain.cpp (modified) (2 diffs)
-
libconv.c (deleted)
-
makedesc.cmd (deleted)
-
misc/OS2KPTDA.c (deleted)
-
misc/OS2KTCB.c (deleted)
-
misc/PerTaskW32kData.c (modified) (7 diffs)
-
misc/abort.c (deleted)
-
misc/asmutils.asm (deleted)
-
misc/avl.c (deleted)
-
misc/buffer.asm (deleted)
-
misc/cout.cpp (deleted)
-
misc/env.c (deleted)
-
misc/heaptest.c (deleted)
-
misc/locks.asm (deleted)
-
misc/log.c (deleted)
-
misc/makefile (deleted)
-
misc/malloc.c (deleted)
-
misc/malloc_old.c (deleted)
-
misc/new.cpp (deleted)
-
misc/ptda.c (deleted)
-
misc/rmalloc.c (deleted)
-
misc/rmalloc_avl.c (deleted)
-
misc/smalloc_avl.c (deleted)
-
misc/stricmp.c (deleted)
-
misc/vprintf.c (deleted)
-
misc/vsprintf.c (deleted)
-
misc/yield.c (deleted)
-
pe2lx/pe2lx.cpp (modified) (6 diffs)
-
test/fake.c (modified) (2 diffs)
-
win32k.def (modified) (1 diff)
-
win32k.mak (modified) (14 diffs)
-
win32k.tools.mk (modified) (8 diffs)
-
win32k.vpj (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/splittup/src/win32k/Makefile
r6637 r6841 1 # $Id: Makefile,v 1.71 2001-09-05 09:29:06bird Exp $1 # $Id: Makefile,v 1.71.2.1 2001-09-27 03:08:07 bird Exp $ 2 2 3 3 # … … 29 29 # 30 30 !include makefile.inc 31 !if [..\..\tools\bin\Exists.cmd $( WIN32KINCLUDE)\OS2Krnl.h] == 131 !if [..\..\tools\bin\Exists.cmd $(KKRNLLIBINCLUDE)\OS2Krnl.h] == 1 32 32 ! if [echo Bad makefile.inc - Reconfiguring Win32k... & configure.cmd -noninteractive] 33 33 ! endif … … 42 42 # 43 43 SUBDIRS = \ 44 .\kKrnlLib \ 44 45 .\lib \ 45 46 .\rexx \ … … 52 53 all: 53 54 !if "$(DDKPATH)" == "" || "$(MSCPATH)" == "" || "$(TOOLKIT)" == "" || "$(VACPATH)" == "" 55 $(DODIRS) "lib" $(MAKE_CMD) 54 56 $(MAKE_CMD) -f xx2lx.mak 55 $(DODIRS) "lib" $(MAKE_CMD)56 57 !else 58 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) 57 59 $(MAKE_CMD) -f win32k.mak 58 60 $(MAKE_CMD) -f xx2lx.mak 59 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD)60 61 !endif 61 62 … … 69 70 70 71 $(WIN32KBIN)\win32ktst.exe win32ktst.exe win32ktst \ 71 $(WIN32KBIN)\extact.exe extract.exe extract \72 $(WIN32KBIN)\mkcalltab.exe mkcalltab.exe mkcalltab \73 72 $(WIN32KBIN)\libconv.exe libconv.exe libconv \ 74 73 clfix.exe: .force … … 80 79 $(MAKE_CMD) -f win32k.mak $(WIN32KINCLUDE)\$(@B).inc 81 80 82 $(WIN32KBASE)\ldr\calltaba.asm ldr\calltaba.asm: .force83 $(MAKE_CMD) -f $(WIN32KBASE)\ldr\calltaba.asm84 85 $(WIN32KBASE)\test\TstFakers.c test\TstFakers.c: .force86 $(MAKE_CMD) -f $(WIN32KBASE)\test\TstFakers.c87 88 81 win32kcc.exe win32kcc: 89 82 $(DODIRS) "utils" $(MAKE_CMD) … … 94 87 # 95 88 lib: 96 $(DODIRS) ".\ lib" $(MAKE_CMD) lib89 $(DODIRS) ".\KrnlLib .\lib" $(MAKE_CMD) lib 97 90 98 91 … … 107 100 $(ODIN32_BIN)\win32k.ddp 108 101 !if "$(WIN32KBIN)" != "" 109 $(RM) $(WIN32KBIN)\* .*102 $(RM) $(WIN32KBIN)\* 110 103 !endif 111 104 !if "$(WIN32KOBJ)" != "" 112 $(RM) $(WIN32KOBJ)\*obj* \ 113 $(WIN32KOBJ)\*lnk* \ 114 $(WIN32KOBJ)\*res* \ 115 $(WIN32KOBJ)\*lib* \ 116 $(WIN32KOBJ)\*def* 105 $(RM) $(WIN32KOBJ)\* 117 106 !endif 118 107 !if "$(WIN32KLIST)" != "" 119 $(RM) $(WIN32KLIST)\*lst* \ 120 $(WIN32KLIST)\*.s* \ 121 $(WIN32KLIST)\*as* 108 $(RM) $(WIN32KLIST)\* 122 109 !endif 123 !if "$(WIN32KBASE)" != "" 124 $(RM) $(WIN32KBASE)\ldr\calltaba.asm $(WIN32KBASE)\test\TstFakers.c 110 !if "$(WIN32KINCLUDE)" != "" 111 $(RM) $(WIN32KBIN)\options.inc \ 112 $(WIN32KBIN)\api.inc \ 113 $(WIN32KBIN)\win32k.inc 125 114 !endif 126 115 $(DODIRS) "$(SUBDIRS)" $(MAKE_CMD) clean … … 131 120 # 132 121 dep: 122 $(RM) .depend 133 123 $(ODIN32_TOOLS)\fastdep @<< 134 -o$$(WIN32KOBJ) $(CINCLUDES) -xldr\calltaba.asm -xtest\TstFakers.c124 -o$$(WIN32KOBJ) $(CINCLUDES) 135 125 misc\*.c* ldr\*.c* dev32\*.c* pe2lx\*.c* k32\*.c* elf2lx\*.c* test\*.c* 136 126 -objobj_tst 137 127 misc\*.c* ldr\*.c* dev32\*.c* pe2lx\*.c* k32\*.c* elf2lx\*.c* test\*.c* 138 128 $(WIN32KINCLUDE)\*.h 129 $(KKRNLLIBINCLUDE)\*.h 139 130 << 140 131 $(ODIN32_TOOLS)\fastdep @<< 141 132 -a+ -o$$(WIN32KOBJ) -I$(WIN32KINCLUDE) -I$(DDKPATH)\inc 142 -xldr\calltaba.asm -xtest\TstFakers.c143 133 dev16\*.asm ldr\*.asm misc\*.asm dev32\*.asm pe2lx\*.asm k32\*.asm elf2lx\*.asm test\*.asm 144 134 $(WIN32KINCLUDE)\*.inc … … 169 159 ..\..\tools\bin\StateUpd.exe -Dll:Win32k dev16 dev32 misc ldr elf2lx mmf k32 170 160 ..\..\tools\bin\StateUpd.exe -Dll:Pe2Lx Pe2Lx 171 172 # 173 # Documentation generation - require SDS - http://www.ii.uib.no/~stig/ 174 # (Old SDS 0.33 - don't work anylonger.) 175 # 176 lxdoc: 177 cpp2sds -o DocsA\ -i include\modulebase.h include\pe2lx.h ldr\modulebase.cpp pe2lx\pe2lx.cpp 178 cd DocsA 179 exp sds2doc -ai *.sds 180 181 fulldoc: 182 exp cpp2sds -o DocsA\ -i include\*.h *.cpp ldr\*.cpp misc\*.cpp pe2lx\*.cpp 183 cd DocsA 184 exp sds2doc -ai *.sds 161 $(DODIRS) ".\kKrnlLib" $(MAKE_CMD) $@ 185 162 186 163 … … 196 173 $(COMMONRULES:clean dep lib all=): 197 174 198 -
branches/splittup/src/win32k/Xx2Lx.mak
r5293 r6841 1 # $Id: Xx2Lx.mak,v 1.1 2001-03-11 16:37:17bird Exp $1 # $Id: Xx2Lx.mak,v 1.1.2.1 2001-09-27 03:08:06 bird Exp $ 2 2 3 3 # … … 33 33 # Tools and Flags Addjustments 34 34 # 35 CINCLUDES = -I$(WIN32KINCLUDE) $(CINCLUDES)35 CINCLUDES = -I$(WIN32KINCLUDE) -I$(KKRNLLIBINCLUDE) $(CINCLUDES) 36 36 CDEFINES = $(CDEFINES) -DRING3 -DXX2LX 37 37 !if "$(VAC3)" == "1" || "$(VAC36)" == "1" -
branches/splittup/src/win32k/calltrees.txt
r2933 r6841 1 OBSOLETE! (Sep 27 2001 2:01am) 2 1 3 A overview of the win32k device driver. 2 4 ---------------------------------------- -
branches/splittup/src/win32k/configure.cmd
r5945 r6841 1 /* $Id: configure.cmd,v 1.21 2001-06-10 01:43:36 bird Exp $1 /* $Id: configure.cmd,v 1.21.2.1 2001-09-27 03:08:06 bird Exp $ 2 2 * 3 3 * Configuration script. … … 37 37 when (ch = '?' | ch = 'H' | substr(sArg, 1, 2) = '-H') then 38 38 do 39 say 'Odin32 Configure.cmd. $Revision: 1.21 $.'39 say 'Odin32 Configure.cmd. $Revision: 1.21.2.1 $.' 40 40 say 'syntax: Configure.cmd [-n] [-w]' 41 41 say ' -n Noninteractive.' … … 74 74 call lineout sIncFile, 'WIN32KELF2LX =' sWin32kBase'\elf2lx' 75 75 call lineout sIncFile, 'WIN32KINCLUDE =' sWin32kBase'\include' 76 call lineout sIncFile, 'KKRNLLIBINCLUDE =' sWin32kBase'\kKrnlLib\include' 76 77 call lineout sIncFile, 'WIN32KK32 =' sWin32kBase'\k32' 77 78 call lineout sIncFile, 'WIN32KLDR =' sWin32kBase'\ldr' -
branches/splittup/src/win32k/dev16/d16globl.c
r5000 r6841 1 /* $Id: d16globl.c,v 1.4 2001-01-21 07:54:37bird Exp $1 /* $Id: d16globl.c,v 1.4.2.1 2001-09-27 03:08:10 bird Exp $ 2 2 * 3 3 * d16globals - global data (16-bit) 4 4 * 5 * Copyright (c) 1999 knut st. osmundsen5 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 20 20 #include "devSegDf.h" 21 21 #include "options.h" 22 #include "log.h"23 22 24 23 … … 30 29 * Uninitialized variables ends up in DATA32. */ 31 30 PFN Device_Help = NULL; 32 ULONG TKSSBase16 = 0;33 USHORT R0FlatCS16 = 0;34 USHORT R0FlatDS16 = 0;35 31 BOOL fInitTime = TRUE; 36 struct options32 struct Win32kOptions 37 33 DATA16_GLOBAL options = DEFAULT_OPTION_ASSIGMENTS; 38 34 39 35 CHAR szBuildDate[] = {__DATE__}; 40 36 CHAR szBuildTime[] = {__TIME__}; 41 CHAR szWin32kIni[160] = {"\win32k.ini"};42 37 -
branches/splittup/src/win32k/dev16/d16init.c
r6431 r6841 1 /* $Id: d16init.c,v 1.12 2001-07-31 21:36:37bird Exp $1 /* $Id: d16init.c,v 1.12.2.1 2001-09-27 03:08:10 bird Exp $ 2 2 * 3 3 * d16init - init routines for both drivers. … … 6 6 * completed. CodeEnd and DataEnd should not be set here.? 7 7 * 8 * Copyright (c) 1999-200 0 knut st. osmundsen (knut.stange.osmundsen@mynd.no)8 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 9 9 * 10 10 * Project Odin Software License can be found in LICENSE.TXT … … 37 37 38 38 #include "devSegDf.h" 39 #undef DATA16_INIT39 /*#undef DATA16_INIT 40 40 #define DATA16_INIT 41 41 #undef CODE16_INIT 42 #define CODE16_INIT 43 #include "probkrnl.h" 42 #define CODE16_INIT*/ 44 43 #include "dev1632.h" 45 44 #include "dev16.h" 46 45 #include "vprntf16.h" 47 #include "log.h"48 46 #include "options.h" 49 #include "errors.h"50 47 51 52 /** 53 * init function - device 0. 54 * Does nothing else than setting the device_help variable and 55 * fill the request packet. 56 * @returns Status word. 57 * @param pRpIn Pointer to input request packet. Actually the same memory as pRpOut but another struct. 58 * @param pRpOut Pointer to output request packet. Actually the same memory as pRpIn but another struct. 59 * @remark pRpIn and pRpOut points to the same memory. 60 */ 61 USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut) 62 { 63 APIRET rc; 64 Device_Help = pRpIn->DevHlpEP; 65 66 /* 67 * Does this work at Ring-3 (inittime)? 68 * If this work we could be saved from throuble! 69 */ 70 rc = initGetDosTableData(); 71 if (rc != NO_ERROR) 72 printf16("win32k - elf$: initGetDosTableData failed with rc=%d\n", rc); 73 74 pRpOut->BPBArray = NULL; 75 pRpOut->CodeEnd = (USHORT)&CODE16_INITSTART; 76 pRpOut->DataEnd = (USHORT)&DATA16_INITSTART; 77 pRpOut->Unit = 0; 78 pRpOut->rph.Status = STATUS_DONE; 79 return STATUS_DONE; 80 } 48 #include "kKLInitHlp.h" 81 49 82 50 … … 90 58 * @remark pRpIn and pRpOut points to the same memory. 91 59 */ 92 USHORT NEAR dev 1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut)60 USHORT NEAR devInit(PRPINITIN pRpIn, PRPINITOUT pRpOut) 93 61 { 94 APIRETrc;95 D16R0INITPARAM param;96 D16R0INITDATA data = {0};97 HFILE h Dev0= 0;62 ULONG rc; 63 KKLR0INITPARAM param; 64 KKLR0INITDATA data = {0UL}; 65 HFILE hKrnlLib = 0; 98 66 USHORT usAction = 0; 99 67 NPSZ npszErrMsg = NULL; 100 const char * npszErrMsg2 = NULL;101 68 102 69 /* 103 * Probe kernel data. 70 * Open and send a Ring-0 init packet to kKrnlHlp. 71 * If this succeeds win32k$ init succeeds. 104 72 */ 105 rc = ProbeKernel(pRpIn); 73 rc = DosOpen(KKL_DEVICE_NAME, &hKrnlLib, &usAction, 0UL, FILE_NORMAL, 74 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 75 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 76 0UL); 106 77 if (rc == NO_ERROR) 107 78 { 108 79 /* 109 * Open and send a Ring-0 init packet to elf$. 110 * If this succeeds win32k$ init succeeds. 80 * Create new 32-bit init packet - Parameter pointer is thunked. 111 81 */ 112 rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL, 113 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 114 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 115 0UL); 116 if (rc == NO_ERROR) 117 { 118 param.pRpInitIn = pRpIn; 119 rc = DosDevIOCtl(&data, ¶m, D16_IOCTL_RING0INIT, D16_IOCTL_CAT, hDev0); 82 RP32INIT rp32init; 83 RP32INIT FAR * fprp32init = &rp32init; 84 85 _fmemcpy(fprp32init, pRpIn, sizeof(RPINITIN)); 86 if (( pRpIn->InitArgs == NULL 87 || !(rc = DevHelp_VirtToLin(SELECTOROF(rp32init.InitArgs), OFFSETOF(rp32init.InitArgs), (PLIN)&rp32init.InitArgs)) 88 ) 89 && !(rc = DevHelp_VirtToLin(SELECTOROF(fprp32init), OFFSETOF(fprp32init), (PLIN)¶m.ulParam)) 90 ) 91 { /* call 32-bit init routine and set 32 bit rc. */ 92 param.pfn = GetR0InitPtr(); 93 rc = DosDevIOCtl(&data, ¶m, KKL_IOCTL_RING0INIT, KKL_IOCTL_CAT, hKrnlLib); 120 94 if (rc == NO_ERROR) 121 95 { 122 if (data.u sRcInit32== NO_ERROR)96 if (data.ulRc == NO_ERROR) 123 97 { 124 98 if (!options.fQuiet) … … 129 103 { 130 104 /* set correct error message and rc */ 131 rc = data.usRcInit32; 132 npszErrMsg = "Ring-0 initiation failed. rc=%x\n"; 133 if (rc >= ERROR_D32_FIRST && rc <= ERROR_D32_LAST) 134 npszErrMsg2 = 135 GetErrorMsg( 136 data.usRcInit32 137 + ERROR_PROB_SYM_D32_FIRST 138 - ERROR_D32_FIRST 139 ); 105 rc = data.ulRc; 106 npszErrMsg = "Ring-0 initiation failed. rc=%ld\n"; 140 107 } 141 108 } 142 109 else 143 npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%d\n"; 144 DosClose(hDev0); 110 npszErrMsg = "Ring-0 init: DosDevIOCtl failed. rc=%ld\n"; 145 111 } 146 112 else 147 npszErrMsg = "Ring-0 init: DosOpen failed. rc=%d\n"; 113 npszErrMsg = "Ring-0 init: Argument thunking failed. rc=%ld\n"; 114 115 DosClose(hKrnlLib); 148 116 } 149 117 else 150 npszErrMsg = ""; /* ProbeKrnl do its own complaining, but we need something here to indicate failure. */ 118 npszErrMsg = "Ring-0 init: DosOpen failed. rc=%ld\n"; 119 151 120 152 121 /* … … 164 133 { 165 134 printf16(npszErrMsg, rc); 166 if (npszErrMsg2)167 printf16("%s\n", npszErrMsg2);168 135 pRpOut->Status = pRpOut->rph.Status = STATUS_DONE | STERR | ERROR_I24_GEN_FAILURE; 169 136 } … … 177 144 } 178 145 179 180 181 /**182 * R0 16-bit initiation.183 * This gets TKSSBase, thunks parameters and calls R0 32-bit initiation function.184 * @returns Status word. We don't fail on R0Init32 but forwards the result185 * using the usRcInit32.186 * @param pRp Generic IO Control request packet.187 */188 USHORT NEAR R0Init16(PRP_GENIOCTL pRp)189 {190 USHORT usRc = STATUS_DONE;191 APIRET rc;192 193 /* First we're to get the DosTable2 stuff. */194 rc = initGetDosTableData();195 if (rc == NO_ERROR)196 {197 ULONG cPages;198 char hLockParm[12] = {0};199 ULONG ulLinParm;200 char hLockData[12] = {0};201 ULONG ulLinData;202 203 /*204 * Thunk the request packet and lock userdata.205 */206 if (!DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), &ulLinParm)207 &&208 !DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket), &ulLinData)209 )210 {211 if (!(rc = DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,212 ulLinParm, sizeof(D16R0INITPARAM),213 (LIN)~0UL, SSToDS_16(&hLockParm[0]), &cPages))214 &&215 !DevHelp_VMLock(VMDHL_LONG | VMDHL_WRITE,216 ulLinData, sizeof(D16R0INITDATA),217 (LIN)~0UL, SSToDS_16(&hLockData[0]), &cPages)218 )219 {220 /*221 * -data and param is locked (do we need to lock the request packet too ?).-222 * Create new 32-bit init packet - Parameter pointer is thunked.223 */224 RP32INIT rp32init;225 226 _fmemcpy(&rp32init, ((PD16R0INITPARAM)pRp->ParmPacket)->pRpInitIn, sizeof(RPINITIN));227 if (((PD16R0INITPARAM)pRp->ParmPacket)->pRpInitIn->InitArgs == NULL ||228 !DevHelp_VirtToLin(SELECTOROF(rp32init.InitArgs), OFFSETOF(rp32init.InitArgs), (PLIN)&rp32init.InitArgs)229 )230 { /* call 32-bit init routine and set 32 bit rc. */231 usRc = CallR0Init32(SSToDS_16(&rp32init));232 ((PD16R0INITDATA)pRp->DataPacket)->usRcInit32 = usRc;233 234 /* set status to done (success). (R0Init32 RC is return as usRcInit32.) */235 usRc = STATUS_DONE;236 }237 else238 usRc |= STERR | ERROR_I24_INVALID_PARAMETER;239 240 241 /*242 * finished - unlock data and parm;243 */244 DevHelp_VMUnLock((LIN)SSToDS_16(&hLockParm[0]));245 DevHelp_VMUnLock((LIN)SSToDS_16(&hLockData[0]));246 }247 else248 usRc |= STERR | ERROR_I24_INVALID_PARAMETER;249 }250 else251 usRc |= STERR | ERROR_I24_INVALID_PARAMETER;252 }253 else254 usRc |= STERR | ERROR_I24_GEN_FAILURE;255 256 return usRc;257 }258 259 260 261 /**262 * Gets the data we need from the DosTables.263 * This data is TKSSBase16, R0FlatCS16 and R0FlatDS16.264 * @returns Same as DevHelp_GetDosVar.265 * @status completely implemented.266 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)267 * @remark If you are not sure if TKSSBase16 is set or not, call this.268 * After R0Init16 is called TKSSBase16 _is_ set.269 * IMPORTANT! This function must _not_ be called after the initiation of the second device driver!!!270 * (Since this is init code not present after init...)271 */272 USHORT NEAR initGetDosTableData(void)273 {274 APIRET rc;275 PDOSTABLE pDT;276 PDOSTABLE2 pDT2;277 278 if (TKSSBase16 != 0)279 return NO_ERROR;280 /*281 _asm {282 int 3;283 }284 */285 286 /* First we're to get the DosTable2 stuff. */287 rc = DevHelp_GetDOSVar(9, 0, &pDT);288 if (rc == NO_ERROR)289 {290 pDT2 = (PDOSTABLE2)((char FAR *)pDT + pDT->cul*4 + 1);291 TKSSBase16 = (ULONG)pDT2->pTKSSBase;292 R0FlatCS16 = (USHORT)pDT2->R0FlatCS;293 R0FlatDS16 = (USHORT)pDT2->R0FlatDS;294 }295 return rc;296 }297 -
branches/splittup/src/win32k/dev16/d16strat.c
r6220 r6841 1 /* $Id: d16strat.c,v 1.12 2001-07-08 02:57:42bird Exp $1 /* $Id: d16strat.c,v 1.12.2.1 2001-09-27 03:08:11 bird Exp $ 2 2 * 3 3 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr) … … 39 39 * Global Variables * 40 40 *******************************************************************************/ 41 extern DDHDR _far aDevHdrs[2]; 42 DDHDR aDevHdrs[2] = /* This is the first piece data in the driver!!!!!!! */ 41 DDHDR aDevHdrs[1] = /* This is the first piece data in the driver!!!!!!! */ 43 42 { 44 {45 &aDevHdrs[1], /* NextHeader */46 DEVLEV_3 | DEV_30 | DEV_CHAR_DEV, /* SDevAtt */47 (unsigned short)(void _near *)strategyAsm0, /* StrategyEP */48 0, /* InterruptEP */49 "elf$ ", /* DevName */50 0, /* SDevProtCS */51 0, /* SDevProtDS */52 0, /* SDevRealCS */53 0, /* SDevRealDS */54 DEV_16MB | DEV_IOCTL2 /* SDevCaps */55 },56 43 { 57 44 ~0UL, /* NextHeader */ 58 45 DEVLEV_3 | DEV_30 | DEV_CHAR_DEV, /* SDevAtt */ 59 (unsigned short)(void _near *)strategyAsm 1,/* StrategyEP */46 (unsigned short)(void _near *)strategyAsm, /* StrategyEP */ 60 47 0, /* InterruptEP */ 61 48 "win32k$ ", /* DevName */ … … 73 60 * Internal Functions * 74 61 *******************************************************************************/ 75 USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp); 76 USHORT NEAR dev1GenIOCtl(PRP_GENIOCTL pRp); 62 USHORT NEAR devGenIOCtl(PRP_GENIOCTL pRp); 77 63 78 64 … … 81 67 * @returns Status word. 82 68 * @param pRpH Pointer to request packed header. (Do not change the pointer!) 83 * @parma usDev Device number.84 69 * @remark This function is called from the entrypoint in dev1st.asm 85 70 */ 86 USHORT NEAR strategy(PRPH pRpH , unsigned short usDev)71 USHORT NEAR strategy(PRPH pRpH) 87 72 { 88 73 switch (pRpH->Cmd) … … 90 75 case CMDInit: /* INIT command */ 91 76 if (fInitTime) 92 { 93 if (usDev == 0) 94 return dev0Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH); 95 return dev1Init((PRPINITIN)pRpH, (PRPINITOUT)pRpH); 96 } 77 return devInit((PRPINITIN)pRpH, (PRPINITOUT)pRpH); 97 78 break; 98 79 99 80 case CMDGenIOCTL: /* Generic IOCTL */ 100 if (usDev == 0) 101 return dev0GenIOCtl((PRP_GENIOCTL)pRpH); 102 return dev1GenIOCtl((PRP_GENIOCTL)pRpH); 81 return devGenIOCtl((PRP_GENIOCTL)pRpH); 103 82 104 83 case CMDOpen: /* device open */ 105 84 case CMDClose: /* device close */ 106 if (usDev == 1) 107 { 108 RP32OPENCLOSE rp32OpenClose = {0}; 109 rp32OpenClose.rph.Len = pRpH->Len; 110 rp32OpenClose.rph.Unit = pRpH->Unit; 111 rp32OpenClose.rph.Cmd = pRpH->Cmd; 112 rp32OpenClose.rph.Status = pRpH->Status; 113 rp32OpenClose.rph.Flags = pRpH->Flags; 114 rp32OpenClose.rph.Link = (ULONG)pRpH->Link; 115 rp32OpenClose.sfn = ((PRP_OPENCLOSE)pRpH)->sfn; 116 if (pRpH->Cmd == CMDOpen) 117 return CallWin32kOpen(SSToDS_16a(&rp32OpenClose)); 118 return CallWin32kClose(SSToDS_16a(&rp32OpenClose)); 119 } 120 return STATUS_DONE; 85 { 86 RP32OPENCLOSE rp32OpenClose = {0}; 87 rp32OpenClose.rph.Len = pRpH->Len; 88 rp32OpenClose.rph.Unit = pRpH->Unit; 89 rp32OpenClose.rph.Cmd = pRpH->Cmd; 90 rp32OpenClose.rph.Status = pRpH->Status; 91 rp32OpenClose.rph.Flags = pRpH->Flags; 92 rp32OpenClose.rph.Link = (ULONG)pRpH->Link; 93 rp32OpenClose.sfn = ((PRP_OPENCLOSE)pRpH)->sfn; 94 if (pRpH->Cmd == CMDOpen) 95 return CallWin32kOpen(SSToDS_16a(&rp32OpenClose)); 96 return CallWin32kClose(SSToDS_16a(&rp32OpenClose)); 97 } 121 98 122 99 case CMDDeInstall: /* De-Install driver */ … … 132 109 133 110 /** 134 * Generic I/O Control - device 0. 135 * This will only handle the request for Ring-0 initiation. 136 * @returns Status word. 137 * @param pRp Request packet. 138 */ 139 USHORT NEAR dev0GenIOCtl(PRP_GENIOCTL pRp) 140 { 141 USHORT rc; 142 143 if (pRp->Category == D16_IOCTL_CAT) 144 { 145 switch (pRp->Function) 146 { 147 /* 148 * This is the IOCtl which does the R0-initiation of the device driver. 149 * Only available at init time... 150 */ 151 case D16_IOCTL_RING0INIT: 152 if (fInitTime) 153 { 154 rc = R0Init16(pRp); 155 return rc; 156 } 157 break; 158 159 /* 160 * This is the IOCtl collects info of the running kernel. 161 * Only available at init time. 162 * 163 * Since this IOCtl is issued before R0-Init is done, we'll have to 164 * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull. 165 */ 166 case D16_IOCTL_GETKRNLINFO: 167 if (fInitTime) 168 { 169 ULONG ulLin; 170 if (fInitTime && TKSSBase16 == 0) 171 initGetDosTableData(); 172 if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket), 173 &ulLin) != NO_ERROR) 174 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 175 return CallGetKernelInfo32(ulLin); 176 } 177 break; 178 179 /* 180 * This is the IOCtl verifies the data in the ImportTab. 181 * Only available at init time. 182 * 183 * Since this IOCtl is issued before R0-Init is done, we'll have to 184 * init TKSSBase for both 16-bit and 32-bit code and be a bit carefull. 185 */ 186 case D16_IOCTL_VERIFYIMPORTTAB: 187 if (fInitTime) 188 { 189 if (TKSSBase16 == 0) 190 initGetDosTableData(); 191 rc = CallVerifyImportTab32(); 192 if (pRp->DataPacket) 193 ((PD16VERIFYIMPORTTABDATA)pRp->DataPacket)->usRc = rc; 194 return STATUS_DONE; 195 } 196 break; 197 } 198 } 199 else if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF) 200 { 201 RP32GENIOCTL rp32Init = {0}; 202 rp32Init.rph.Len = pRp->rph.Len; 203 rp32Init.rph.Unit = pRp->rph.Unit; 204 rp32Init.rph.Cmd = pRp->rph.Cmd; 205 rp32Init.rph.Status = pRp->rph.Status; 206 rp32Init.rph.Flags = pRp->rph.Flags; 207 rp32Init.rph.Link = (ULONG)pRp->rph.Link; 208 rp32Init.Category = pRp->Category; 209 rp32Init.Function = pRp->Function; 210 rp32Init.sfn = pRp->sfn; 211 rp32Init.DataLen = pRp->DataLen; 212 rp32Init.ParmLen = pRp->ParmLen; 213 214 if (DevHelp_VirtToLin(SELECTOROF(pRp->DataPacket), OFFSETOF(pRp->DataPacket), 215 (PLIN)&rp32Init.DataPacket) != NO_ERROR) 216 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 217 if (DevHelp_VirtToLin(SELECTOROF(pRp->ParmPacket), OFFSETOF(pRp->ParmPacket), 218 (PLIN)&rp32Init.ParmPacket) != NO_ERROR) 219 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 220 221 if (pRp->Category == IOCTL_W32K_ELF) 222 rc = CallElfIOCtl(SSToDS_16a(&rp32Init)); 223 else 224 rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init)); 225 226 return rc; 227 } 228 229 230 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 231 } 232 233 234 /** 235 * Generic I/O Control - device 0. 111 * Generic I/O Control. 236 112 * This will forward requests to 32-bit counterpart. 237 113 * @returns Status word. 238 114 * @param pRp Request packet. 239 115 */ 240 USHORT NEAR dev 1GenIOCtl(PRP_GENIOCTL pRp)116 USHORT NEAR devGenIOCtl(PRP_GENIOCTL pRp) 241 117 { 242 if (pRp->Category == IOCTL_W32K_K32 || pRp->Category == IOCTL_W32K_ELF)118 if (pRp->Category == IOCTL_W32K_K32) 243 119 { 244 USHORT rc;245 120 RP32GENIOCTL rp32Init = {0}; 246 121 rp32Init.rph.Len = pRp->rph.Len; … … 263 138 return STATUS_DONE | STERR | ERROR_I24_INVALID_PARAMETER; 264 139 265 if (pRp->Category == IOCTL_W32K_ELF) 266 rc = CallElfIOCtl(SSToDS_16a(&rp32Init)); 267 else 268 rc = CallWin32kIOCtl(SSToDS_16a(&rp32Init)); 269 270 return rc; 140 return CallWin32kIOCtl(SSToDS_16a(&rp32Init)); 271 141 } 272 142 -
branches/splittup/src/win32k/dev16/vprntf16.c
r5529 r6841 1 /* $Id: vprntf16.c,v 1.6 2001-04-16 23:05:31bird Exp $1 /* $Id: vprntf16.c,v 1.6.2.1 2001-09-27 03:08:12 bird Exp $ 2 2 * 3 3 * vprintf and printf - 16-bit. … … 41 41 #ifdef RING0 42 42 #include "options.h" 43 #define COMPORT 0x2f8 43 44 #include "conio.h" 44 45 #endif … … 487 488 if (ch == '\n') 488 489 { 489 while (!(inp( options.usCom+ 5) & 0x20)); /* Waits for the port to be ready. */490 outp( options.usCom, chReturn); /* Put the char. */490 while (!(inp(COMPORT + 5) & 0x20)); /* Waits for the port to be ready. */ 491 outp(COMPORT, chReturn); /* Put the char. */ 491 492 } 492 while (!(inp( options.usCom+ 5) & 0x20)); /* Waits for the port to be ready. */493 outp( options.usCom, ch); /* Put the char. */493 while (!(inp(COMPORT + 5) & 0x20)); /* Waits for the port to be ready. */ 494 outp(COMPORT, ch); /* Put the char. */ 494 495 /* Yield(); - no 16-bit yield */ 495 496 } … … 531 532 for (ul = 0; ul < cch; ul++) 532 533 { 533 while (!(inp( options.usCom+ 5) & 0x20)); /* Waits for the port to be ready. */534 outp( options.usCom, psz[ul]); /* Put the char. */534 while (!(inp(COMPORT + 5) & 0x20)); /* Waits for the port to be ready. */ 535 outp(COMPORT, psz[ul]); /* Put the char. */ 535 536 } 536 537 … … 540 541 if (psz[cch] == '\n') 541 542 { 542 while (!(inp( options.usCom+ 5) & 0x20)); /* Waits for the port to be ready. */543 outp( options.usCom, chReturn); /* Put the char. */544 while (!(inp( options.usCom+ 5) & 0x20)); /* Waits for the port to be ready. */545 outp( options.usCom, chNewLine); /* Put the char. */543 while (!(inp(COMPORT + 5) & 0x20)); /* Waits for the port to be ready. */ 544 outp(COMPORT, chReturn); /* Put the char. */ 545 while (!(inp(COMPORT + 5) & 0x20)); /* Waits for the port to be ready. */ 546 outp(COMPORT, chNewLine); /* Put the char. */ 546 547 cchYield ++; 547 548 } -
branches/splittup/src/win32k/dev32/d32CallGate.asm
r6280 r6841 1 ; $Id: d32CallGate.asm,v 1.5 2001-07-10 05:19:33bird Exp $1 ; $Id: d32CallGate.asm,v 1.5.2.1 2001-09-27 03:08:12 bird Exp $ 2 2 ; 3 3 ; 32-bit CallGate used to communitcate fast between Ring-3 and Ring-0. … … 39 39 ; 40 40 extrn _Device_Help:dword 41 extrn pulTKSSBase32:dword41 extrn _TKSSBase:dword 42 42 43 43 extrn KMEnterKmodeSEF:near … … 316 316 mov ecx, acbK32Params[eax*4] ; ecx <- size of parameter packet. 317 317 sub esp, ecx ; Reserve stack space for the parameter packet. 318 mov eax, [pulTKSSBase32] ; Calculate the FLAT address of esp. 319 mov eax, [eax] 318 mov eax, _TKSSBase ; Calculate the FLAT address of esp. 320 319 add eax, esp ; eax <- flat address of ss:esp 321 320 push ecx ; Save the size. -
branches/splittup/src/win32k/dev32/d32Events.asm
r5247 r6841 1 ; $Id: d32Events.asm,v 1.2 2001-02-23 02:57:53 bird Exp $1 ; $Id: d32Events.asm,v 1.2.2.1 2001-09-27 03:08:13 bird Exp $ 2 2 ; 3 3 ; d32Events - Code for overriding system events. … … 25 25 ; 26 26 extrn aSysEventsOverrides:dword 27 extrn _TKSSBase16:dword28 27 extrn dh_SendEvent:near 29 28 extrn dh_SendEvent_sel:word -
branches/splittup/src/win32k/dev32/d32Win32kIOCtl.c
r5224 r6841 1 /* $Id: d32Win32kIOCtl.c,v 1.7 2001-02-21 07:44:57bird Exp $1 /* $Id: d32Win32kIOCtl.c,v 1.7.2.1 2001-09-27 03:08:13 bird Exp $ 2 2 * 3 3 * Win32k driver IOCtl handler function. … … 24 24 *******************************************************************************/ 25 25 #include <os2.h> 26 #include <OS2Krnl.h> 27 #include <kKrnlLib.h> 26 28 27 29 #include "devSegDf.h" 28 30 #include "dev1632.h" 29 31 #include "dev32.h" 30 #include "OS2Krnl.h"31 32 #include "Win32k.h" 32 33 #include "k32.h" 33 #include "log.h"34 #include "asmutils.h"35 34 36 35 -
branches/splittup/src/win32k/dev32/d32Win32kOpenClose.c
r6296 r6841 1 /* $Id: d32Win32kOpenClose.c,v 1.2 2001-07-10 16:39:16bird Exp $1 /* $Id: d32Win32kOpenClose.c,v 1.2.2.1 2001-09-27 03:08:13 bird Exp $ 2 2 * 3 3 * Open and Close handlers for the Win32k driver. … … 19 19 #define INCL_OS2KRNL_LDR 20 20 #define INCL_OS2KRNL_PTDA 21 #define INCL_KKL_AVL 22 #define INCL_KKL_LOG 21 23 22 24 #define NO_WIN32K_LIB_FUNCTIONS … … 27 29 *******************************************************************************/ 28 30 #include <os2.h> 31 #include <OS2Krnl.h> 32 #include <kKrnlLib.h> 29 33 30 34 #include "devSegDf.h" … … 32 36 #include "dev1632.h" 33 37 #include "dev32.h" 34 #include "OS2Krnl.h"35 38 #include "Win32k.h" 36 #include "log.h"37 #include "asmutils.h"38 #include "avl.h"39 39 #include "PerTaskW32kData.h" 40 40 -
branches/splittup/src/win32k/dev32/d32globals.c
r5224 r6841 1 /* $Id: d32globals.c,v 1.6 2001-02-21 07:44:57bird Exp $1 /* $Id: d32globals.c,v 1.6.2.1 2001-09-27 03:08:13 bird Exp $ 2 2 * 3 3 * d32globals - global data (32-bit) 4 4 * 5 * Copyright (c) 1999 knut st. osmundsen5 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 22 22 * Global Variables * 23 23 *******************************************************************************/ 24 /* 25 * This is the pointer to the TK(TasK)SS(Stack Segment) FLAT Base address variable. 26 * It is used by the SSToDS macro to convert stack based addresses to FLAT ds 27 * based addressed. 28 */ 29 PULONG pulTKSSBase32; 24 /* currently there is nothing here! */ 30 25 -
branches/splittup/src/win32k/dev32/d32init.c
r6278 r6841 1 /* $Id: d32init.c,v 1.41 2001-07-10 05:18:04 bird Exp $1 /* $Id: d32init.c,v 1.41.2.1 2001-09-27 03:08:14 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 12 12 * Defined Constants * 13 13 *******************************************************************************/ 14 /*15 * Calltab entry sizes.16 */17 #define OVERLOAD16_ENTRY 0x18 /* This is intentionally 4 bytes larger than the one defined in calltaba.asm. */18 #define OVERLOAD32_ENTRY 0x1419 #define IMPORT16_ENTRY 0x0820 #define IMPORTH16_ENTRY 0x0821 #define IMPORT32_ENTRY 0x0822 #define VARIMPORT_ENTRY 0x1023 24 #if 025 #define kprintf2(a) kprintf26 #else27 #define kprintf2(a) (void)028 #endif29 30 14 #define INCL_DOSERRORS 31 15 #define INCL_NOPMAPI … … 33 17 #define INCL_OS2KRNL_ALL 34 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 35 20 36 21 /******************************************************************************* … … 38 23 *******************************************************************************/ 39 24 #include <os2.h> 25 #include <OS2Krnl.h> 26 #include <kKrnlLib.h> 40 27 41 28 #include <string.h> 42 29 43 30 #include "devSegDf.h" 44 #include "OS2Krnl.h"45 31 #include "options.h" 46 32 #include "dev1632.h" 47 33 #include "dev32.h" 48 34 #include "dev32hlp.h" 49 #include "probkrnl.h"50 #include "log.h"51 #include "asmutils.h"52 #include "malloc.h"53 35 #include "ldr.h" 54 #include "macros.h"55 #include "errors.h"56 57 #ifdef R3TST58 #include "test.h"59 #define x86DisableWriteProtect() 060 #define x86RestoreWriteProtect(a) (void)061 #endif62 36 63 37 … … 70 44 static char * apszInfoLevel[] = {"INFOLEVEL_QUIET", "INFOLEVEL_ERROR", "INFOLEVEL_WARNING", "INFOLEVEL_INFO", "INFOLEVEL_INFOALL", "!invalid!"}; 71 45 #endif 72 PMTE pKrnlMTE = NULL;73 PSMTE pKrnlSMTE = NULL;74 POTE pKrnlOTE = NULL;75 46 76 47 … … 79 50 *******************************************************************************/ 80 51 ULONG readnum(const char *pszNum); 81 _Inline int ModR_M_32bit(char bModRM); 82 _Inline int ModR_M_16bit(char bModRM); 83 int interpretFunctionProlog32(char *pach, BOOL fOverload); 84 int interpretFunctionProlog16(char *pach, BOOL fOverload); 85 int importTabInit(void); 86 #ifdef R3TST 87 PMTE GetOS2KrnlMTETst(void); 88 void R3TstFixImportTab(void); 89 #endif 90 PSZ SECCALL nopSecPathFromSFN(SFN hFile); 91 92 93 94 /* externs located in 16-bit data segement in ProbKrnl.c */ 95 extern ULONG _TKSSBase16; 96 extern USHORT _R0FlatCS16; 97 extern USHORT _R0FlatDS16; 98 99 /* extern(s) located in calltab.asm */ 100 extern char callTab[1]; 101 extern char callTab16[1]; 102 extern unsigned auFuncs[NBR_OF_KRNLIMPORTS]; 103 104 105 /** 52 53 54 /* 106 55 * Ring-0, 32-bit, init function. 107 56 * @returns Status word. … … 117 66 * @author knut st. osmundsen 118 67 */ 119 U SHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit)68 ULONG _System R0Init(RP32INIT *pRpInit) 120 69 { 121 70 char * pszTmp2; 122 71 char * pszTmp; 123 ULONG ul;124 72 APIRET rc; 125 73 LOCKHANDLE lockhandle; 126 127 pulTKSSBase32 = (PULONG)_TKSSBase16;128 74 129 75 /*---------------------*/ … … 148 94 break; 149 95 150 case 'c':151 case 'C': /* -C[1|2|3|4] or -Com:[1|2|3|4] - com-port no, def:-C2 */152 pszTmp2 = strpbrk(pszTmp, ":=/- ");153 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))154 pszTmp2++;155 else156 pszTmp2 = pszTmp + 1;157 ul = readnum(pszTmp2);158 switch (ul)159 {160 case 1: options.usCom = OUTPUT_COM1; break;161 case 2: options.usCom = OUTPUT_COM2; break;162 case 3: options.usCom = OUTPUT_COM3; break;163 case 4: options.usCom = OUTPUT_COM4; break;164 }165 break;166 167 96 case 'd': 168 97 case 'D': … … 202 131 else 203 132 options.fForcePreload = FALSE; 204 break;205 206 case 'h':207 case 'H': /* Heap options */208 pszTmp2 = strpbrk(pszTmp, ":=/- ");209 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))210 {211 ul = readnum(pszTmp2 + 1);212 if (ul > 0x1000UL && ul < 0x2000000UL) /* 4KB < ul < 32MB */213 {214 if (strnicmp(pszTmp, "heapm", 5) == 0)215 options.cbSwpHeapMax = ul;216 else217 options.cbSwpHeapInit = ul;218 }219 }220 133 break; 221 134 … … 284 197 && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y'); 285 198 } 286 else287 { /* ResHeap options */288 if (pszTmp2 != NULL && (*pszTmp2 == ':' || *pszTmp2 == '='))289 {290 ul = readnum(pszTmp2 + 1);291 if (ul > 0x1000UL && ul < 0x700000UL) /* 4KB < ul < 7MB */292 {293 if (strnicmp(pszTmp, "resheapm", 8) == 0)294 options.cbResHeapMax = ul;295 else296 options.cbResHeapInit = ul;297 }298 }299 }300 199 break; 301 200 302 201 case 's': 303 case 'S': /* Sym:<filename> or Script:<Yes|No> or Smp */ 304 /* SMP kernel */ 305 pszTmp2 = strpbrk(pszTmp, ":=/- "); 306 if (pszTmp[1] == 'c' || pszTmp[1] == 'C') 307 { 308 options.fUNIXScript = 309 pszTmp2 != NULL 310 && (int)(pszTmp2-pszTmp) < cch-1 311 && (*pszTmp2 == ':' || *pszTmp2 == '=') 312 && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y'); 313 } 202 case 'S': /* Script:<Yes|No> */ 203 pszTmp2 = strpbrk(pszTmp, ":=/- "); 204 options.fUNIXScript = 205 pszTmp2 != NULL 206 && (int)(pszTmp2-pszTmp) < cch-1 207 && (*pszTmp2 == ':' || *pszTmp2 == '=') 208 && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y'); 314 209 break; 315 210 … … 339 234 pszTmp = strpbrk(pszTmp, "-/"); 340 235 } 341 342 /* heap min/max corrections */343 if (options.cbSwpHeapInit > options.cbSwpHeapMax)344 options.cbSwpHeapMax = options.cbSwpHeapInit;345 if (options.cbResHeapInit > options.cbResHeapMax)346 options.cbResHeapMax = options.cbResHeapInit;347 236 348 237 /* Log option summary */ … … 358 247 else 359 248 kprintf(("\tlogging disabled\n")); 360 kprintf(("\tCom port no.%03xh\n", options.usCom)); 361 362 kprintf(("\tKernel: v%d.%d build %d%c type ", 363 options.usVerMajor, 364 options.usVerMinor, 365 options.ulBuild, 366 (options.fKernel & KF_REV_MASK) 367 ? ((options.fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1 368 : ' ' 369 )); 370 if (options.fKernel & KF_SMP) 371 kprintf(("SMP ")); 372 else if (options.fKernel & KF_W4) 373 kprintf(("W4 ")); 374 else 375 kprintf(("UNI ")); 376 if (options.fKernel & KF_DEBUG) 377 kprintf(("DEBUG\n")); 378 else 379 kprintf(("\n")); 380 381 kprintf(("\tfPE=%d (%s)\n", options.fPE, apszPE[MIN(options.fPE, 5)])); 382 kprintf(("\tfPEOneObject=%d (%s)\n", options.fPEOneObject, apszPEOneObject[MIN(options.fPEOneObject, 3)])); 383 kprintf(("\tulInfoLevel=%d (%s)\n", options.ulInfoLevel, apszInfoLevel[MIN(options.ulInfoLevel, 5)])); 249 250 kprintf(("\tfPE=%d (%s)\n", options.fPE, apszPE[KMIN(options.fPE, 5)])); 251 kprintf(("\tfPEOneObject=%d (%s)\n", options.fPEOneObject, apszPEOneObject[KMIN(options.fPEOneObject, 3)])); 252 kprintf(("\tulInfoLevel=%d (%s)\n", options.ulInfoLevel, apszInfoLevel[KMIN(options.ulInfoLevel, 5)])); 384 253 kprintf(("\tfElf=%d\n", options.fElf)); 385 254 kprintf(("\tfUNIXScript=%d\n", options.fUNIXScript)); … … 387 256 kprintf(("\tfJAVA=%d\n", options.fJava)); 388 257 kprintf(("\tfNoLoader=%d\n", options.fNoLoader)); 389 kprintf(("\tcbSwpHeapInit=0x%08x cbSwpHeapMax=0x%08x\n",390 options.cbSwpHeapInit, options.cbSwpHeapMax));391 kprintf(("\tcbResHeapInit=0x%08x cbResHeapMax=0x%08x\n",392 options.cbResHeapInit, options.cbResHeapMax));393 258 kprintf(("Options - Summary - End\n")); 394 259 #endif /* debug */ … … 399 264 * init sub-parts 400 265 */ 401 /* heap */402 if (heapInit(options.cbResHeapInit, options.cbResHeapMax,403 options.cbSwpHeapInit, options.cbSwpHeapMax) != NO_ERROR)404 return ERROR_D32_HEAPINIT_FAILED;405 406 266 /* loader */ 407 if (ldrInit() != NO_ERROR) 408 return ERROR_D32_LDR_INIT_FAILED; 409 410 /* functionoverrides */ 411 if ((rc = importTabInit()) != NO_ERROR) 412 return (USHORT)rc; 267 if ((rc = ldrInit()) != NO_ERROR) 268 return rc; 413 269 414 270 /* apis */ 415 271 #if 0 416 272 if ((rc = APIInit()) != NO_ERROR) 417 return (USHORT)rc;273 return rc; 418 274 #endif 419 275 … … 423 279 { 424 280 kprintf(("R0Init32: InitCallGate failed with rc=%d\n", rc)); 425 return (USHORT)rc;281 return rc; 426 282 } 427 283 #endif … … 442 298 /* 32-bit data segment */ 443 299 memset(SSToDS(&lockhandle), 0, sizeof(lockhandle)); 444 rc = D32Hlp_VMLock2( callTab,445 &CONST32_ROEND - (char*)callTab,300 rc = D32Hlp_VMLock2(&DATA32START, 301 &CONST32_ROEND - &DATA32START, 446 302 VMDHL_LONG | VMDHL_WRITE, 447 303 SSToDS(&lockhandle)); … … 496 352 } 497 353 498 499 /**500 * Get kernel OTEs501 * This function set pKrnlMTE, pKrnlSMTE and pKrnlOTE.502 * @returns Strategy return code:503 * STATUS_DONE on success.504 * STATUS_DONE | STERR | errorcode on failure.505 * @param pKrnlInfo Pointer to output buffer.506 * If NULL only the three global variables are set.507 * @status completely implemented and tested.508 * @author knut st. osmundsen509 * @remark Called from IOCtl.510 * WARNING! This function is called before the initroutine (R0INIT)!511 */512 USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo)513 {514 int i;515 USHORT usRc;516 517 /* VerifyImportTab32 is called before the initroutine! */518 pulTKSSBase32 = (PULONG)_TKSSBase16;519 520 /* Find the kernel OTE table */521 #ifndef R3TST522 pKrnlMTE = GetOS2KrnlMTE();523 #else524 pKrnlMTE = GetOS2KrnlMTETst();525 #endif526 if (pKrnlMTE != NULL)527 {528 pKrnlSMTE = pKrnlMTE->mte_swapmte;529 if (pKrnlSMTE != NULL)530 {531 if (pKrnlSMTE->smte_objcnt <= MAXKRNLOBJECTS)532 {533 pKrnlOTE = pKrnlSMTE->smte_objtab;534 if (pKrnlOTE != NULL)535 {536 BOOL fKrnlTypeOk;537 538 /*539 * Thats all?540 */541 if (pKrnlInfo == NULL)542 return NO_ERROR;543 544 pKrnlInfo->cObjects = (unsigned char)pKrnlSMTE->smte_objcnt;545 546 /*547 * Copy OTEs548 */549 for (i = 0; i < pKrnlInfo->cObjects; i++)550 {551 memcpy((void*)&pKrnlInfo->aObjects[i], &pKrnlOTE[i], sizeof(OTE));552 kprintf2(("GetKernelInfo32: %d base=0x%08x size=0x%08x flags=0x%08x\n",553 i, pKrnlOTE[i].ote_base, pKrnlOTE[i].ote_size, pKrnlOTE[i].ote_flags));554 }555 usRc = 0;556 557 /*558 * Search for internal revision stuff AND 'SAB KNL?' signature in the two first objects.559 */560 fKrnlTypeOk = FALSE;561 pKrnlInfo->fKernel = 0;562 pKrnlInfo->ulBuild = 0;563 for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)564 {565 const char *psz = (const char*)pKrnlOTE[i].ote_base;566 const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */567 568 while (psz < pszEnd)569 {570 if (strncmp(psz, "Internal revision ", 18) == 0 && (psz[18] >= '0' && psz[18] <= '9'))571 {572 int j;573 kprintf2(("GetKernelInfo32: found internal revision: '%s'\n", psz));574 575 /* skip to end of "Internal revision " string. */576 psz += 18;577 578 /* Read number*/579 while ((*psz >= '0' && *psz <= '9') || *psz == '.')580 {581 if (*psz != '.')582 pKrnlInfo->ulBuild = (unsigned short)(pKrnlInfo->ulBuild * 10 + (*psz - '0'));583 psz++;584 }585 586 /* Check if build number seems valid. */587 if ( !(pKrnlInfo->ulBuild >= 8254 && pKrnlInfo->ulBuild < 8383) /* Warp 3 fp 32 -> fp 60 */588 && !(pKrnlInfo->ulBuild >= 9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */589 && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14100) /* Warp 4.5 GA -> fp 40 */590 && !(pKrnlInfo->ulBuild >= 6600 && pKrnlInfo->ulBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */591 )592 {593 kprintf(("GetKernelInfo32: info summary: Build %d is invalid - invalid fixpack?\n", pKrnlInfo->ulBuild));594 usRc = ERROR_D32_INVALID_BUILD;595 break;596 }597 598 /* Check for any revision flag */599 if ((*psz >= 'A' && *psz <= 'Z') || (*psz >= 'a' && *psz <= 'z'))600 {601 pKrnlInfo->fKernel |= (USHORT)((*psz - (*psz >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);602 psz++;603 }604 if (*psz == ',') /* This is ignored! */605 *psz++;606 607 /* If this is an Aurora/Warp 4.5 or Warp 3 kernel there is more info! */608 if (psz[0] == '_' && (psz[1] == 'S' || psz[1] == 's')) /* _SMP */609 pKrnlInfo->fKernel |= KF_SMP;610 else611 if (*psz != ','612 && ( (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4') /* _W4 */613 || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4') /* _UNI4 */614 )615 )616 pKrnlInfo->fKernel |= KF_W4 | KF_UNI;617 else618 pKrnlInfo->fKernel |= KF_UNI;619 620 621 /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */622 if (!fKrnlTypeOk)623 {624 j = 3;625 while (j < 5)626 {627 /* There should be no iopl object preceding the debugger data object. */628 if ((pKrnlOTE[j].ote_flags & OBJIOPL) != 0)629 break;630 /* Is this is? */631 if ((pKrnlOTE[j].ote_flags & OBJINVALID) == 0632 && (pKrnlOTE[j].ote_flags & (OBJREAD | OBJWRITE)) == (OBJREAD | OBJWRITE)633 && strncmp((char*)pKrnlOTE[j].ote_base, "DEBUG", 5) == 0)634 {635 pKrnlInfo->fKernel |= KF_DEBUG;636 break;637 }638 j++;639 }640 }641 642 /* Display info */643 kprintf(("GetKernelInfo32: info summary: Build %d, fKernel=0x%x\n",644 pKrnlInfo->ulBuild, pKrnlInfo->fKernel));645 646 /* Break out */647 break;648 }649 650 /*651 * Look for the SAB KNL? signature to check which kernel type we're652 * dealing with. This could also be reached thru the selector found653 * in the first element for the SAS_tables_area array.654 */655 if (!fKrnlTypeOk && strncmp(psz, "SAB KNL", 7) == 0)656 {657 fKrnlTypeOk = TRUE;658 if (psz[7] == 'D')659 pKrnlInfo->fKernel |= KF_ALLSTRICT;660 else if (psz[7] == 'B')661 pKrnlInfo->fKernel |= KF_HALFSTRICT;662 else if (psz[7] != 'R')663 fKrnlTypeOk = FALSE;664 }665 666 /* next */667 psz++;668 } /* while loop searching for "Internal revision " */669 } /* for loop on objects 0-1. */670 671 /* Set error code if not found */672 if (pKrnlInfo->ulBuild == 0)673 {674 usRc = ERROR_D32_BUILD_INFO_NOT_FOUND;675 kprintf(("GetKernelInfo32: Internal revision was not found!\n"));676 }677 }678 else679 usRc = ERROR_D32_NO_OBJECT_TABLE;680 }681 else682 usRc = ERROR_D32_TOO_MANY_OBJECTS;683 }684 else685 usRc = ERROR_D32_NO_SWAPMTE;686 }687 else688 usRc = ERROR_D32_GETOS2KRNL_FAILED;689 690 if (usRc != NO_ERROR)691 kprintf(("GetKernelInfo32: failed. usRc = %d\n", usRc));692 693 return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE));694 }695 696 697 698 /**699 * Functions which cacluates the instructionsize given a ModR/M byte.700 * @returns Number of bytes to add to cb and pach.701 * @param bModRM ModR/M byte.702 * @status completely implemented.703 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)704 */705 int ModR_M_32bit(char bModRM)706 {707 if ((bModRM & 0xc0) == 0x80 /* ex. mov ax,[ebp+11145543h] */708 || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */709 { /* 32-bit displacement */710 return 5 + ((bModRM & 0x7) == 0x4); // + SIB711 }712 else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */713 { /* 8-bit displacement */714 return 2 + ((bModRM & 0x7) == 0x4); // + SIB715 }716 /* no displacement (only /r byte) */717 return 1;718 }719 720 721 /**722 * Functions which cacluates the instructionsize given a ModR/M byte.723 * @returns Number of bytes to add to cb and pach.724 * @param bModRM ModR/M byte.725 * @status completely implemented.726 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)727 */728 int ModR_M_16bit(char bModRM)729 {730 if ((bModRM & 0xc0) == 0x80 /* ex. mov ax,[ebp+11145543h] */731 || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */732 { /* 16-bit displacement */733 return 4;734 }735 else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */736 { /* 8-bit displacement */737 return 2;738 }739 /* no displacement (only /r byte) */740 return 1;741 }742 743 744 745 746 747 /**748 * 32-bit! Interpret function prolog to find where to jmp back.749 * @returns Length of prolog need to be copied - which is also the offset of750 * where the jmp instr should be placed.751 * On error it returns 0.752 * @param pach Pointer to prolog.753 * @param fOverload TRUE: Function is to be overloaded.754 * FALSE: Function is to be imported.755 */756 int interpretFunctionProlog32(char *pach, BOOL fOverload)757 {758 int cb = -3;759 kprintf2(("interpretFunctionProlog32(0x%08x, %d):\n"760 "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"761 "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",762 pach, fOverload,763 pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],764 pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));765 766 /*767 * check for the well known prolog (the only that is supported now)768 * which is:769 * push ebp770 * mov ebp,esp771 * or772 * push ebp773 * mov eax, dword ptr [xxxxxxxx]774 * or775 * sub esp, imm8776 * push ebx777 * push edi778 *779 * These are allowed when not overloading:780 * mov eax, imm32781 * jmp short782 * or783 * mov eax, imm32784 * push ebp785 * or786 * mov ecx, r/m32787 * or788 * jmp dword789 * or790 * sub esp, imm8791 * or792 * call ptr16:32793 * or794 * enter imm16, imm8 (2.1x)795 * or796 * mov eax, imm32 (2.1x)797 * <anything>798 * or799 * xor r32, r/m32800 * or801 * mov eax, msoff32802 * or803 * push edi804 * mov eax, dword ptr [xxxxxxxx]805 * or806 * movzx esp, sp807 * or808 * call rel32809 * popf810 */811 if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* the two first prologs */812 ||813 (pach[0] == 0x83 && pach[3] == 0x53 && pach[4] == 0x57) /* the third prolog */814 ||815 (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55) && !fOverload) /* the two next prologs */816 ||817 (pach[0] == 0x8B && !fOverload) /* the next prolog */818 ||819 (pach[0] == 0xFF && !fOverload) /* the next prolog */820 ||821 (pach[0] == 0x83 && !fOverload) /* the next prolog */822 ||823 (pach[0] == 0x9a && !fOverload) /* the next prolog */824 ||825 (pach[0] == 0xc8) /* the next prolog */826 ||827 (pach[0] == 0xB8 && !fOverload) /* the next prolog */828 ||829 (pach[0] == 0x33 && !fOverload) /* the next prolog */830 ||831 (pach[0] == 0xa1 && !fOverload) /* the next prolog */832 ||833 (pach[0] == 0x57 && pach[1] == 0x8b && !fOverload) /* the next prolog */834 ||835 (pach[0] == 0x0f && pach[1] == 0xb7 && pach[2] == 0xe4 && !fOverload) /* the next prolog */836 ||837 (pach[0] == 0xe8 && pach[5] == 0x9d && !fOverload) /* the next prolog */838 /* push ebx839 * push edi840 * push imm32841 */842 || (pach[0] == 0x53 && pach[1] == 0x57 && pach[2] == 0x68 && !fOverload)843 /* push ebx844 * push edi845 * push esi846 * mov /r847 */848 || (pach[0] == 0x53 && pach[1] == 0xe8 && !fOverload)849 /* push ebx850 * push edi851 * push esi852 * mov /r853 */854 || (pach[0] == 0x53 && pach[1] == 0x57 && pach[2] == 0x56 && pach[3] == 0x8b && !fOverload)855 /* pop eax856 * push imm8857 * push eax858 * jmp imm32859 */860 || (pach[0] == 0x58 && pach[1] == 0x6a && pach[3] == 0x50 && pach[4] == 0xe9 && !fOverload)861 /* push imm32862 * call imm32863 */864 || (pach[0] == 0x68 && pach[5] == 0xe8 && !fOverload)865 )866 {867 BOOL fForce = FALSE;868 int cbWord = 4;869 cb = 0;870 while (cb < 5 || fForce) /* 5 is the size of a jump instruction. */871 {872 int cb2;873 if (!fForce && cbWord != 4)874 cbWord = 4;875 fForce = FALSE;876 switch (*pach)877 {878 case 0x0f:879 if (pach[1] != 0xb7 && pach[2] != 0xe4) /* movzx esp, sp */880 {881 kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));882 return -11;883 }884 pach += 2;885 cb += 2;886 break;887 888 889 /* simple one byte prefixes */890 case 0x2e: /* cs segment override */891 case 0x36: /* ss segment override */892 case 0x3e: /* ds segment override */893 case 0x26: /* es segment override */894 case 0x64: /* fs segment override */895 case 0x65: /* gs segment override */896 fForce = TRUE;897 break;898 899 case 0x66: /* 16 bit */900 fForce = TRUE;901 cbWord = 2;902 break;903 904 /* simple one byte instructions e*/905 case 0x50: /* push eax */906 case 0x51: /* push ecx */907 case 0x52: /* push edx */908 case 0x53: /* push ebx */909 case 0x54: /* push esp */910 case 0x55: /* push ebp */911 case 0x56: /* push esi */912 case 0x57: /* push edi */913 case 0x58: /* pop eax */914 case 0x59: /* pop ecx */915 case 0x5a: /* pop edx */916 case 0x5b: /* pop ebx */917 case 0x06: /* push es */918 case 0x0e: /* push cs */919 case 0x1e: /* push ds */920 case 0x16: /* push ss */921 break;922 923 /* simple two byte instructions */924 case 0xb0: /* mov al, imm8 */925 case 0xb1: /* mov cl, imm8 */926 case 0xb2: /* mov dl, imm8 */927 case 0xb3: /* mov bl, imm8 */928 case 0xb4: /* mov ah, imm8 */929 case 0xb5: /* mov ch, imm8 */930 case 0xb6: /* mov dh, imm8 */931 case 0xb7: /* mov bh, imm8 */932 case 0x2c: /* sub al, imm8 */933 case 0x34: /* xor al, imm8 */934 case 0x3c: /* cmp al, imm8 */935 case 0x6a: /* push <byte> */936 case 0xa0: /* mov al, moffs8 */937 case 0xa2: /* mov moffs8, al */938 pach++;939 cb++;940 break;941 942 /* simple five byte instructions */943 case 0xb8: /* mov eax, imm32 */944 case 0xb9: /* mov ecx, imm32 */945 case 0xba: /* mov edx, imm32 */946 case 0xbb: /* mov ebx, imm32 */947 case 0xbc: /* mov esx, imm32 */948 case 0xbd: /* mov ebx, imm32 */949 case 0xbe: /* mov esi, imm32 */950 case 0xbf: /* mov edi, imm32 */951 case 0xe9: /* jmp rel32 */952 case 0x2d: /* sub eax, imm32 */953 case 0x35: /* xor eax, imm32 */954 case 0x3d: /* cmp eax, imm32 */955 case 0x68: /* push <dword> */956 case 0xa1: /* mov eax, moffs16 */957 case 0xa3: /* mov moffs16, eax */958 pach += cbWord;959 cb += cbWord;960 break;961 962 /* fixed five byte instructions */963 case 0xe8: /* call imm32 */964 pach += 4;965 cb += 4;966 break;967 968 /* complex sized instructions - "/r" */969 case 0x30: /* xor r/m8, r8 */970 case 0x31: /* xor r/m32, r32 */971 case 0x32: /* xor r8, r/m8 */972 case 0x33: /* xor r32, r/m32 */973 case 0x38: /* cmp r/m8, r8 */974 case 0x39: /* cmp r/m32, r32 */975 case 0x3a: /* cmp r8, r/m8 */976 case 0x3b: /* cmp r32, r/m32 */977 case 0x28: /* sub r/m8, r8 */978 case 0x29: /* sub r/m32, r32 */979 case 0x2a: /* sub r8, r/m8 */980 case 0x2b: /* sub r32, r/m32 */981 case 0x8b: /* mov /r */982 case 0x8d: /* lea /r */983 cb += cb2 = ModR_M_32bit(pach[1]);984 pach += cb2;985 break;986 987 /* complex sized instruction - "/5 ib" */988 case 0x80: /* 5: sub r/m8, imm8 7: cmp r/m8, imm8 */989 case 0x83: /* 5: sub r/m32, imm8 7: cmp r/m32, imm8 */990 if ((pach[1] & 0x38) == (5<<3)991 || (pach[1] & 0x38) == (7<<3)992 )993 {994 cb += cb2 = 1 + ModR_M_32bit(pach[1]); /* 1 is the size of the imm8 */995 pach += cb2;996 }997 else998 {999 kprintf(("interpretFunctionProlog32: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1000 return -3;1001 }1002 break;1003 1004 /* complex sized instruction - "/digit id" */1005 case 0x81: /* sub r/m32, imm32 + more instructions! */1006 if ((pach[1] & 0x38) == (5<<3) /* sub r/m32, imm32 */1007 || (pach[1] & 0x38) == (7<<3) /* cmp r/m32, imm32 */1008 )1009 {1010 cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */1011 pach += cb2;1012 }1013 else1014 {1015 kprintf(("interpretFunctionProlog32: unknown instruction (-2) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1016 return -2;1017 }1018 break;1019 1020 case 0x9a: /* call ptr16:32 */1021 cb += cb2 = 6;1022 pach += cb2;1023 break;1024 1025 case 0xc8: /* enter imm16, imm8 */1026 cb += cb = 3;1027 pach += cb2;1028 break;1029 1030 /*1031 * jmp /digit1032 */1033 case 0xff:1034 cb += cb2 = cbWord + ModR_M_32bit(pach[1]); /* cbWord is the size of the imm32/imm16 */1035 pach += cb2;1036 break;1037 1038 default:1039 kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1040 return 0;1041 }1042 pach++;1043 cb++;1044 }1045 }1046 else1047 {1048 kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",1049 pach[0], pach[1], pach[2], pach[3], pach[4], pach[5]));1050 cb = 0;1051 }1052 return cb;1053 }1054 1055 1056 /**1057 * 16-bit! Interpret function prolog to find where to jmp back.1058 * @returns Length of prolog need to be copied - which is also the offset of1059 * where the jmp instr should be placed.1060 * On error it returns 0.1061 * @param pach Pointer to prolog.1062 * @param fOverload TRUE: Function is to be overloaded.1063 * FALSE: Function is to be imported.1064 */1065 int interpretFunctionProlog16(char *pach, BOOL fOverload)1066 {1067 int cb = -7;1068 1069 kprintf2(("interpretFunctionProlog16(0x%08x, %d):\n"1070 "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n"1071 "\t%02x %02x %02x %02x - %02x %02x %02x %02x\n",1072 pach, fOverload,1073 pach[0], pach[1], pach[2], pach[3], pach[4], pach[5], pach[6], pach[7],1074 pach[8], pach[9], pach[10],pach[11],pach[12],pach[13],pach[14],pach[15]));1075 /*1076 * Check for the well known prolog (the only that is supported now)1077 * which is:1078 */1079 if ((*pach == 0x6A && !fOverload) /* push 2 (don't check for the 2) */1080 ||1081 *pach == 0x60 /* pushf */1082 ||1083 (*pach == 0x53 && pach[1] == 0x51) /* push bx, push cx */1084 ||1085 (*pach == 0x8c && pach[1] == 0xd8) /* mov ax, ds */1086 ||1087 (*pach == 0xb8) /* mov ax, imm16 */1088 )1089 {1090 BOOL fForce;1091 int cOpPrefix = 0;1092 cb = 0;1093 while (cb < 5 || fForce) /* 5 is the size of a 16:16 far jump instruction. */1094 {1095 int cb2;1096 fForce = FALSE;1097 switch (*pach)1098 {1099 case 0x06: /* push es */1100 case 0x0e: /* push cs */1101 case 0x1e: /* push ds */1102 case 0x16: /* push ss */1103 break;1104 1105 case 0x0f: /* push gs and push fs */1106 if (pach[1] != 0xA0 && pach[1] != 0xA8)1107 {1108 kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1109 return -11;1110 }1111 pach++;1112 cb++;1113 break;1114 1115 case 0x50: /* push ax */1116 case 0x51: /* push cx */1117 case 0x52: /* push dx */1118 case 0x53: /* push bx */1119 case 0x54: /* push sp */1120 case 0x55: /* push bp */1121 case 0x56: /* push si */1122 case 0x57: /* push di */1123 case 0x60: /* pusha */1124 break;1125 1126 /* simple three byte instructions */1127 case 0xb8: /* mov eax, imm16 */1128 case 0xb9: /* mov ecx, imm16 */1129 case 0xba: /* mov edx, imm16 */1130 case 0xbb: /* mov ebx, imm16 */1131 case 0xbc: /* mov esx, imm16 */1132 case 0xbd: /* mov ebx, imm16 */1133 case 0xbe: /* mov esi, imm16 */1134 case 0xbf: /* mov edi, imm16 */1135 case 0x2d: /* sub eax, imm16 */1136 case 0x35: /* xor eax, imm16 */1137 case 0x3d: /* cmp eax, imm16 */1138 case 0x68: /* push <dword> */1139 case 0xa1: /* mov eax, moffs16 */1140 case 0xa3: /* mov moffs16, eax */1141 if (cOpPrefix > 0) /* FIXME see 32-bit interpreter. */1142 {1143 pach += 2;1144 cb += 2;1145 }1146 pach += 2;1147 cb += 2;1148 break;1149 1150 case 0x2e: /* cs segment override */1151 case 0x36: /* ss segment override */1152 case 0x3e: /* ds segment override */1153 case 0x26: /* es segment override */1154 case 0x64: /* fs segment override */1155 case 0x65: /* gs segment override */1156 fForce = TRUE;1157 if (cOpPrefix > 0)1158 cOpPrefix++;1159 break;1160 1161 case 0x66:1162 cOpPrefix = 2; /* it's decremented once before it's used. */1163 fForce = TRUE;1164 break;1165 1166 case 0x6a: /* push <byte> */1167 case 0x3c: /* mov al, imm8 */1168 pach++;1169 cb++;1170 break;1171 1172 case 0x8b: /* mov /r */1173 case 0x8c: /* mov r/m16,Sreg (= mov /r) */1174 case 0x8e: /* mov Sreg, r/m16 (= mov /r) */1175 if ((pach[1] & 0xc0) == 0x80 /* ex. mov ax,bp+1114h */1176 || ((pach[1] & 0xc0) == 0 && (pach[1] & 0x7) == 6)) /* ex. mov bp,0ff23h */1177 { /* 16-bit displacement */1178 if (cOpPrefix > 0)1179 {1180 pach += 2;1181 cb += 2;1182 }1183 pach += 3;1184 cb += 3;1185 }1186 else1187 if ((pach[1] & 0xc0) == 0x40) /* ex. mov ax,[si]+4fh */1188 { /* 8-bit displacement */1189 pach += 2;1190 cb += 2;1191 }1192 else1193 { /* no displacement (only /r byte) */1194 pach++;1195 cb++;1196 }1197 break;1198 1199 /* complex sized instruction - "/5 ib" */1200 case 0x80: /* 5: sub r/m8, imm8 7: cmp r/m8, imm8 */1201 case 0x83: /* 5: sub r/m16, imm8 7: cmp r/m16, imm8 */1202 if ((pach[1] & 0x38) == (5<<3)1203 || (pach[1] & 0x38) == (7<<3)1204 )1205 {1206 cb += cb2 = 1 + ModR_M_16bit(pach[1]); /* 1 is the size of the imm8 */1207 pach += cb2;1208 }1209 else1210 {1211 kprintf(("interpretFunctionProlog16: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1212 return -3;1213 }1214 break;1215 1216 case 0x9a: /* call ptr16:16 */1217 cb += cb2 = 4;1218 pach += cb2;1219 break;1220 1221 default:1222 kprintf(("interpretFunctionProlog16: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1223 return 0;1224 }1225 pach++;1226 cb++;1227 if (cOpPrefix > 0)1228 cOpPrefix--;1229 }1230 }1231 else1232 kprintf(("interpretFunctionProlog16: unknown prolog 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));1233 1234 1235 fOverload = fOverload;1236 return cb;1237 }1238 1239 1240 /**1241 * Verifies the aImportTab.1242 * @returns 16-bit errorcode where the high byte is the procedure number which1243 * the error occured on and the low byte the error code.1244 * @remark Called from IOCtl.1245 * WARNING! This function is called before the initroutine (R0INIT)!1246 */1247 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void)1248 {1249 USHORT usRc;1250 int i;1251 int cb;1252 int cbmax;1253 1254 /* VerifyImporTab32 is called before the initroutine! */1255 pulTKSSBase32 = (PULONG)_TKSSBase16;1256 1257 /* Check that pKrnlOTE is set */1258 usRc = GetKernelInfo32(NULL);1259 if (usRc != NO_ERROR)1260 return usRc;1261 1262 /*1263 * Verify aImportTab.1264 */1265 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)1266 {1267 /*1268 * Debug info1269 */1270 kprintf2(("VerifyImportTab32: procedure no.%d is being checked: %s addr=0x%08x iObj=%d offObj=%d\n",1271 i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,1272 aImportTab[i].iObject, aImportTab[i].offObject));1273 1274 /* Verify that it is found */1275 if (!aImportTab[i].fFound)1276 {1277 if (EPTNotReq(aImportTab[i]))1278 continue;1279 else1280 {1281 kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));1282 return (USHORT)(ERROR_D32_PROC_NOT_FOUND | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);1283 }1284 }1285 1286 /* Verify read/writeable. */1287 if ( aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt /* object index valid? */1288 || aImportTab[i].ulAddress < pKrnlOTE[aImportTab[i].iObject].ote_base /* address valid? */1289 || aImportTab[i].ulAddress + 16 > (pKrnlOTE[aImportTab[i].iObject].ote_base +1290 pKrnlOTE[aImportTab[i].iObject].ote_size) /* address valid? */1291 || aImportTab[i].ulAddress - aImportTab[i].offObject1292 != pKrnlOTE[aImportTab[i].iObject].ote_base /* offObject ok? */1293 )1294 {1295 kprintf(("VerifyImportTab32: procedure no.%d has an invalid address or object number.!\n"1296 " %s addr=0x%08x iObj=%d offObj=%d\n",1297 i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,1298 aImportTab[i].iObject, aImportTab[i].offObject));1299 return (USHORT)(ERROR_D32_INVALID_OBJ_OR_ADDR | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);1300 }1301 1302 1303 #ifndef R3TST1304 if (aImportTab[i].ulAddress < 0xff400000UL)1305 {1306 kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",1307 i, aImportTab[i].ulAddress));1308 return (USHORT)(ERROR_D32_INVALID_ADDRESS | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);1309 }1310 #endif1311 1312 switch (aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ | EPT_WRAPPED | EPT_PROCIMPORTH))1313 {1314 case EPT_PROC:1315 case EPT_PROCIMPORT:1316 /*1317 * Verify known function prolog.1318 */1319 if (EPT32BitEntry(aImportTab[i]))1320 {1321 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, EPT32Proc(aImportTab[i]));1322 cbmax = OVERLOAD32_ENTRY - 5; /* 5 = Size of the jump instruction */1323 }1324 else1325 {1326 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, EPT16Proc(aImportTab[i]));1327 cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */1328 }1329 1330 /*1331 * Check result of the function prolog interpretations.1332 */1333 if (cb <= 0 || cb > cbmax)1334 { /* failed, too small or too large. */1335 kprintf(("VerifyImportTab32/16: verify failed for procedure no.%d (cb=%d), %s\n", i, cb, aImportTab[i].achName));1336 return (USHORT)(ERROR_D32_TOO_INVALID_PROLOG | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);1337 }1338 break;1339 1340 case EPT_VARIMPORT:1341 /* do nothing! */1342 break;1343 1344 default:1345 kprintf(("VerifyImportTab32: invalid type/type not implemented. Proc no.%d, %s\n",i, aImportTab[i].achName));1346 Int3(); /* temporary fix! */1347 return (USHORT)(ERROR_D32_NOT_IMPLEMENTED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);1348 }1349 }1350 1351 return NO_ERROR;1352 }1353 1354 1355 /**1356 * Initiates the overrided functions.1357 * @returns 16-bit errorcode where the high byte is the procedure number which1358 * the error occured on and the low byte the error code.1359 */1360 int importTabInit(void)1361 {1362 int i;1363 int cb;1364 int cbmax;1365 char * pchCTEntry; /* Pointer to current 32-bit calltab entry. */1366 char * pchCTEntry16; /* Pointer to current 16-bit calltab entry. */1367 ULONG flWP; /* CR0 WP flag restore value. */1368 1369 /*1370 * Apply build specific changes to the auFuncs table1371 */1372 if (options.ulBuild < 14053)1373 {1374 #ifdef DEBUG1375 if (auFuncs[0] != (unsigned)myldrOpenPath)1376 {1377 kprintf(("importTabInit: ASSERTION FAILED auFuncs don't point at myldrOpenPath\n"));1378 Int3();1379 }1380 #endif1381 auFuncs[0] = (unsigned)myldrOpenPath_old;1382 }1383 1384 #ifdef R3TST1385 R3TstFixImportTab();1386 #endif1387 1388 /*1389 * verify proctable1390 */1391 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)1392 {1393 /* EPT_VARIMPORTs are skipped */1394 if ((aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ)) == EPT_VARIMPORT)1395 continue;1396 /* EPT_NOT_REQ which is not found are set pointing to the nop function provided. */1397 if (!aImportTab[i].fFound && EPTNotReq(aImportTab[i]))1398 continue;1399 1400 if (EPT32BitEntry(aImportTab[i]))1401 {1402 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, EPT32Proc(aImportTab[i]));1403 1404 cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */1405 }1406 else1407 {1408 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, EPT16Proc(aImportTab[i]));1409 cbmax = OVERLOAD16_ENTRY - 5; /* 5 = Size of the jump instruction */1410 }1411 if (cb <= 0 || cb > cbmax)1412 {1413 kprintf(("ImportTabInit: Verify failed for procedure no.%d, cb=%d\n", i, cb));1414 return ERROR_D32_VERIFY_FAILED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1415 }1416 }1417 1418 /*1419 * rehook / import1420 */1421 pchCTEntry = &callTab[0];1422 pchCTEntry16 = &callTab16[0];1423 flWP = x86DisableWriteProtect();1424 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)1425 {1426 switch (aImportTab[i].fType & ~EPT_WRAPPED)1427 {1428 /*1429 * 32-bit procedure overload.1430 * The overloading procedure is found in the auFuncs table (at the same index1431 * as the overloaded procedure has in aImportTab).1432 * The overloaded procedure is called by issuing a call to the callTab entry.1433 */1434 case EPT_PROC32:1435 {1436 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, TRUE);1437 aImportTab[i].cbProlog = (char)cb;1438 if (cb >= 5 && cb + 5 < OVERLOAD32_ENTRY) /* 5(1st): size of jump instruction in the function prolog which jumps to my overloading function */1439 { /* 5(2nd): size of jump instruction which jumps back to the original function after executing the prolog copied to the callTab entry for this function. */1440 /*1441 * Copy function prolog which will be overwritten by the jmp to calltabl.1442 */1443 memcpy(pchCTEntry, (void*)aImportTab[i].ulAddress, (size_t)cb);1444 1445 /*1446 * Make jump instruction which jumps from calltab to original function.1447 * 0xE9 <four bytes displacement>1448 * Note: the displacement is relative to the next instruction1449 */1450 pchCTEntry[cb] = 0xE9; /* jmp */1451 *(unsigned long*)(void*)&pchCTEntry[cb+1] = aImportTab[i].ulAddress + cb - (unsigned long)&pchCTEntry[cb+5];1452 1453 /*1454 * Jump from original function to my function - an cli(?) could be needed here1455 */1456 *(char*)aImportTab[i].ulAddress = 0xE9; /* jmp */1457 *(unsigned long*)(aImportTab[i].ulAddress + 1) = auFuncs[i] - (aImportTab[i].ulAddress + 5);1458 }1459 else1460 { /* !fatal! - this could never happen really... */1461 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));1462 Int3(); /* ipe - later! */1463 x86RestoreWriteProtect(flWP);1464 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1465 }1466 pchCTEntry += OVERLOAD32_ENTRY;1467 break;1468 }1469 1470 1471 /*1472 * 16-bit procedure overload.1473 * Currently disabled due to expected problems when calltab is a 32-bit segment.1474 */1475 case EPT_PROC16:1476 {1477 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, TRUE);1478 aImportTab[i].cbProlog = (char)cb;1479 if (cb >= 5 && cb + 5 < OVERLOAD16_ENTRY) /* 5: size of a 16:16 jump which jumps to my overloading function */1480 { /* cb+5: size of a 16:16 jump which is added to the call tab */1481 /*1482 * Copy function prolog which is to be overwritten.1483 */1484 memcpy(pchCTEntry16, (void*)aImportTab[i].ulAddress, (size_t)cb);1485 1486 /*1487 * Create far jump from calltab to original function.1488 * 0xEA <two byte target address> <two byte target selector>1489 */1490 pchCTEntry16[cb] = 0xEA; /* jmp far ptr */1491 *(unsigned short*)(void*)&pchCTEntry16[cb+1] = (unsigned short)aImportTab[i].offObject + cb;1492 *(unsigned short*)(void*)&pchCTEntry16[cb+3] = aImportTab[i].usSel;1493 1494 /*1495 * We store the far 16:16 pointer to the function in the last four1496 * bytes of the entry. Set them!1497 */1498 *(unsigned short*)(void*)&pchCTEntry16[OVERLOAD16_ENTRY-4] = (unsigned short)aImportTab[i].offObject;1499 *(unsigned short*)(void*)&pchCTEntry16[OVERLOAD16_ENTRY-2] = aImportTab[i].usSel;1500 1501 /*1502 * jump from original function to my function - an cli(?) could be needed here1503 * 0xEA <two byte target address> <two byte target selector>1504 */1505 *(char*)(aImportTab[i].ulAddress) = 0xEA; /* jmp far ptr */1506 *(unsigned long*)(aImportTab[i].ulAddress + 1) = auFuncs[i]; /* The auFuncs entry is a far pointer. */1507 }1508 else1509 { /* !fatal! - this could never happen really... */1510 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));1511 Int3(); /* ipe - later! */1512 x86RestoreWriteProtect(flWP);1513 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1514 }1515 pchCTEntry16 += OVERLOAD16_ENTRY;1516 break;1517 }1518 1519 1520 /*1521 * 32-bit imported procedure.1522 * This is called by issuing a near call to the callTab entry.1523 */1524 case EPT_PROCIMPORTNR32: /* Not required */1525 if (!(pchCTEntry[6] = aImportTab[i].fFound))1526 aImportTab[i].ulAddress = auFuncs[i];1527 case EPT_PROCIMPORT32:1528 {1529 cb = interpretFunctionProlog32((char*)aImportTab[i].ulAddress, FALSE);1530 aImportTab[i].cbProlog = (char)cb;1531 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */1532 {1533 /*1534 * Make jump instruction which jumps from calltab to original function.1535 * 0xE9 <four bytes displacement>1536 * Note: the displacement is relative to the next instruction1537 */1538 pchCTEntry[0] = 0xE9; /* jmp */1539 *(unsigned*)(void*)&pchCTEntry[1] = aImportTab[i].ulAddress - (unsigned)&pchCTEntry[5];1540 }1541 else1542 { /* !fatal! - this should never really happen... */1543 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));1544 Int3(); /* ipe - later! */1545 x86RestoreWriteProtect(flWP);1546 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1547 }1548 pchCTEntry += IMPORT32_ENTRY;1549 break;1550 }1551 1552 1553 /*1554 * 16-bit imported procedure.1555 * This is called by issuing a far call to the calltab entry.1556 */1557 case EPT_PROCIMPORTNR16: /* Not required */1558 if (!(pchCTEntry[7] = aImportTab[i].fFound))1559 {1560 aImportTab[i].ulAddress = auFuncs[i];1561 Int3();1562 break;1563 }1564 case EPT_PROCIMPORT16:1565 {1566 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE);1567 aImportTab[i].cbProlog = (char)cb;1568 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */1569 {1570 /*1571 * Create far jump from calltab to original function.1572 * 0xEA <four byte target address> <two byte target selector>1573 */1574 pchCTEntry[0] = 0xEA; /* jmp far ptr */1575 *(unsigned long*)(void*)&pchCTEntry[1] = aImportTab[i].offObject;1576 *(unsigned short*)(void*)&pchCTEntry[5] = aImportTab[i].usSel;1577 }1578 else1579 { /* !fatal! - this should never really happen... */1580 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));1581 Int3(); /* ipe - later! */1582 x86RestoreWriteProtect(flWP);1583 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1584 }1585 pchCTEntry += IMPORT16_ENTRY;1586 break;1587 }1588 1589 1590 /*1591 * 16-bit imported hybrid procedure.1592 * This is called by issuing a far call to the 16-bit calltab entry.1593 */1594 case EPT_PROCIMPORTH16:1595 {1596 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE);1597 aImportTab[i].cbProlog = (char)cb;1598 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */1599 {1600 /*1601 * Create far jump from calltab to original function.1602 * 0xEA <four byte target address> <two byte target selector>1603 */1604 pchCTEntry16[0] = 0xEA; /* jmp far ptr */1605 *(unsigned short*)(void*)&pchCTEntry16[1] = aImportTab[i].offObject;1606 *(unsigned short*)(void*)&pchCTEntry16[3] = aImportTab[i].usSel;1607 }1608 else1609 { /* !fatal! - this should never really happen... */1610 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));1611 Int3(); /* ipe - later! */1612 x86RestoreWriteProtect(flWP);1613 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1614 }1615 pchCTEntry16 += IMPORTH16_ENTRY;1616 break;1617 }1618 1619 1620 /*1621 * 16/32-bit importe variable.1622 * This is used by accessing the 32-bit flat address in the callTab.1623 * callTab-entry + 4 holds the offset of the variable into the object.1624 * callTab-entry + 8 holds the selector for the object. (These two fields is the 16:32-bit pointer to the variable.)1625 * callTab-entry + a holds the 16-bit offset for the variable.1626 * callTab-entry + c holds the selector for the object. (These two fields is the 16:16-bit pointer to the variable.)1627 */1628 case EPT_VARIMPORTNR32:1629 case EPT_VARIMPORTNR16:1630 if (!aImportTab[i].fFound)1631 {1632 memset(pchCTEntry, 0, VARIMPORT_ENTRY);1633 pchCTEntry += VARIMPORT_ENTRY;1634 break;1635 }1636 case EPT_VARIMPORT32:1637 case EPT_VARIMPORT16:1638 aImportTab[i].cbProlog = (char)0;1639 *(unsigned long*)(void*)&pchCTEntry[0] = aImportTab[i].ulAddress;1640 *(unsigned long*)(void*)&pchCTEntry[4] = aImportTab[i].offObject;1641 *(unsigned short*)(void*)&pchCTEntry[8] = aImportTab[i].usSel;1642 *(unsigned short*)(void*)&pchCTEntry[0xa] = (unsigned short)aImportTab[i].offObject;1643 *(unsigned short*)(void*)&pchCTEntry[0xc] = aImportTab[i].usSel;1644 pchCTEntry += VARIMPORT_ENTRY;1645 break;1646 1647 default:1648 kprintf(("ImportTabInit: unsupported type. (procedure no.%d, cb=%d)\n", i, cb));1649 Int3(); /* ipe - later! */1650 x86RestoreWriteProtect(flWP);1651 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;1652 } /* switch - type */1653 } /* for */1654 1655 x86RestoreWriteProtect(flWP);1656 1657 return NO_ERROR;1658 }1659 1660 1661 #ifdef R3TST1662 /**1663 * Creates a fake kernel MTE, SMTE and OTE for use while testing in Ring3.1664 * @returns Pointer to the fake kernel MTE.1665 * @status completely implemented.1666 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)1667 */1668 PMTE GetOS2KrnlMTETst(void)1669 {1670 static MTE KrnlMTE;1671 static SMTE KrnlSMTE;1672 1673 KrnlMTE.mte_swapmte = &KrnlSMTE;1674 KrnlSMTE.smte_objtab = &aKrnlOTE[0];1675 KrnlSMTE.smte_objcnt = cObjectsFake;1676 1677 return &KrnlMTE;1678 }1679 1680 /**1681 * -Ring-3 testing-1682 * Changes the entries in aImportTab to point to their fake equivalents.1683 * @returns void1684 * @param void1685 * @status completely implemented.1686 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)1687 * @remark Called before the aImportTab array is used/verified.1688 */1689 VOID R3TstFixImportTab(VOID)1690 {1691 int i;1692 1693 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++)1694 {1695 switch (aImportTab[i].fType & ~EPT_NOT_REQ)1696 {1697 case EPT_PROC32:1698 if (aTstFakers[i].fObj != 1)1699 kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROC32)\n", i));1700 break;1701 case EPT_PROCIMPORT32:1702 if (aTstFakers[i].fObj != 1)1703 kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT32)\n", i));1704 break;1705 case EPT_PROCIMPORT16:1706 if (aTstFakers[i].fObj != 2)1707 kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (PROCIMPORT16)\n", i));1708 break;1709 case EPT_VARIMPORT32:1710 case EPT_VARIMPORT16:1711 if (aTstFakers[i].fObj != 3 && aTstFakers[i].fObj != 4)1712 kprintf(("R3TstFixImportTab: invalid segment config for entry %i. (VARIMPORT32/16)\n", i));1713 break;1714 } /* switch - type */1715 1716 aImportTab[i].ulAddress = aTstFakers[i].uAddress;1717 switch (aTstFakers[i].fObj)1718 {1719 case 1:1720 aImportTab[i].usSel = GetSelectorCODE32();1721 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE32START;1722 break;1723 case 2:1724 aImportTab[i].usSel = GetSelectorCODE16();1725 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&CODE16START;1726 break;1727 case 3:1728 aImportTab[i].usSel = GetSelectorDATA32();1729 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA32START;1730 break;1731 case 4:1732 aImportTab[i].usSel = GetSelectorDATA16();1733 aImportTab[i].offObject = aTstFakers[i].uAddress - (unsigned)&DATA16START;1734 break;1735 default:1736 kprintf(("R3TstFixImportTab: invalid segment config for entry %i.\n", i));1737 }1738 } /* for */1739 }1740 #endif1741 1742 /**1743 * Dummy nop function if SecPathFromSFN isn't found.1744 */1745 PSZ SECCALL nopSecPathFromSFN(SFN hFile)1746 {1747 NOREF(hFile);1748 return NULL;1749 } -
branches/splittup/src/win32k/dev32/devfirst.asm
r6280 r6841 1 ; $Id: devfirst.asm,v 1.9 2001-07-10 05:19:34 bird Exp $1 ; $Id: devfirst.asm,v 1.9.2.1 2001-09-27 03:08:14 bird Exp $ 2 2 ; 3 3 ; DevFirst - entrypoint and segment definitions … … 33 33 public EH_DATASTART 34 34 35 36 public _strategyAsm0 37 public _strategyAsm1 38 public _CallGetKernelInfo32 39 public _CallElfIOCtl 35 public _strategyAsm 40 36 public _CallWin32kIOCtl 41 37 public _CallWin32kOpen 42 38 public _CallWin32kClose 43 39 public _SSToDS_16a 44 public GetOS2KrnlMTE45 public x86DisableWriteProtect46 public x86RestoreWriteProtect47 40 48 41 … … 50 43 ; Externs 51 44 ; 52 extrn _TKSSBase16:dword 53 extrn GETKERNELINFO32:FAR 54 extrn ELFIOCTL:FAR 45 extrn _TKSSBase:dword 55 46 extrn WIN32KIOCTL:FAR 56 47 extrn WIN32KOPEN:FAR … … 64 55 ASSUME CS:CODE16, DS:DATA16, ES:NOTHING, SS:NOTHING 65 56 66 CODE16START label byte 57 CODE16START db 'CODE16START',0 58 67 59 68 60 .286p 69 ;$win32ki entry point70 _strategyAsm0:71 ; int 372 push 073 jmp _strategyAsm74 75 ;$win32k entry point76 _strategyAsm1:77 ; int 378 push 179 jmp _strategyAsm80 81 61 ;; 82 62 ; Stub which pushes parameters onto the stack and call the 16-bit C strategy routine. … … 99 79 .386p 100 80 ;; 101 ; Thunk procedure for R0Init32.102 ; @cproto USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);103 ; @returns Same as GetKernelInfo32.104 ; @param addressKrnlInfoBuf 32-bit pointer to request data on stack.105 ; @status completely implemented.106 ; @author knut st. osmundsen107 _CallGetKernelInfo32 PROC NEAR108 ASSUME CS:CODE16109 push ds110 push word ptr [esp+6] ; push high word.111 push word ptr [esp+6] ; push low word.112 call far ptr FLAT:GETKERNELINFO32113 pop ds114 ret115 _CallGetKernelInfo32 ENDP116 117 118 119 120 ;;121 ; Thunk procedure for .122 ; @cproto USHORT NEAR CallElfIOCtl(void);123 ; @returns Same as ElfIOCtl124 ; @param address of IOCtl request packet (32-bit pointer).125 ; @status completely implemented.126 ; @author knut st. osmundsen127 _CallElfIOCtl PROC NEAR128 ASSUME CS:CODE16129 push ds130 push word ptr [esp+6] ; push high word.131 push word ptr [esp+6] ; push low word.132 call far ptr FLAT:ELFIOCTL133 pop ds134 retn135 _CallElfIOCtl ENDP136 137 ;;138 81 ; Thunk procedure for . 139 82 ; @cproto USHORT NEAR CallWin32kIOCtl(void); … … 189 132 190 133 191 192 134 ;; 193 135 ; SSToDS - stack pointer to Flat pointer. … … 204 146 _SSToDS_16a proc NEAR 205 147 assume CS:CODE16, DS:DATA16, ES:NOTHING 206 mov edx, ds:_TKSSBase16 ; get pointer held by _TKSSBase16 (pointer to stack base)207 148 call far ptr FLAT:far_getCS ; get flat selector. 208 149 push es 209 150 mov es, ax 210 151 assume es:FLAT 211 mov eax, es: [edx]; get pointer to stack base152 mov eax, es:_TKSSBase ; get pointer to stack base 212 153 pop es 213 154 movzx edx, word ptr ss:[esp + 2] ; 16-bit stack pointer (parameter) … … 262 203 ret 263 204 GetOS2KrnlMTE ENDP 264 265 266 ;;267 ; Disables the ring-0 write protection.268 ; It's used to help us write to readonly code segments and objects.269 ; @cproto extern ULONG _Optlink x86DisableWriteProtect(void);270 ; @return Previous write protection flag setting.271 ; @uses eax, edx272 ; @status completely implemented.273 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)274 ; @remark Used by importTabInit.275 x86DisableWriteProtect proc near276 cli277 mov edx, cr0 ; Get current cr0278 test edx, 000010000h ; Test for the WriteProtect flag (bit 16)279 setnz al280 movzx eax, al ; Old flag setting in eax (return value)281 and edx, 0fffeffffh ; Clear the 16th (WP) bit.282 mov cr0, edx ;283 sti284 ret ; return eax holds previous WP value.285 x86DisableWriteProtect endp286 287 288 ;;289 ; Restore the WP flag of CR0 to it's previous state.290 ; The call is intent only to be called with the result from x86DisableWriteProtect,291 ; and will hence only enable the WP flag.292 ; @cproto extern ULONG _Optlink x86RestoreWriteProtect(ULONG flWP);293 ; @return Previous write protection flag setting.294 ; @param eax - flWP Boolean value. (1 = WP was set, 0 WP was clear)295 ; @uses eax296 ; @status completely implemented.297 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)298 ; @remark Used by importTabInit.299 x86RestoreWriteProtect proc near300 test eax, eax ; Check if the flag was previously clear301 jnz x86RWP_set ; If set Then Set it back.302 jmp x86RWP_end ; If clear Then nothing to do.303 x86RWP_set:304 cli305 mov eax, cr0 ; Get current cr0.306 or eax, 000010000h ; The the 16-bit (WP) bit.307 mov cr0, eax ; Update cr0.308 sti309 310 x86RWP_end:311 ret312 x86RestoreWriteProtect endp313 205 314 206 … … 367 259 368 260 CODE16_INIT segment 369 CODE16_INITSTART label byte261 CODE16_INITSTART db 'CODE16_INITSTART',0 370 262 CODE16_INIT ends 371 263 372 264 DATA16 segment 373 DATA16START label byte 265 DATA16START label byte ; no string here!! 374 266 DATA16 ends 375 267 376 268 DATA16_BSS segment 377 DATA16_BSSSTART label byte269 DATA16_BSSSTART db 'DATA16_BSSSTART',0 378 270 DATA16_BSS ends 379 271 380 272 DATA16_CONST segment 381 DATA16_CONSTSTART label byte273 DATA16_CONSTSTART db 'DATA16_CONSTSTART', 0 382 274 DATA16_CONST ends 383 275 384 276 DATA16_INIT segment 385 DATA16_INITSTART label byte277 DATA16_INITSTART db 'DATA16_INITSTART',0 386 278 DATA16_INIT ends 387 279 388 280 DATA32 segment 389 DATA32START label byte281 DATA32START db 'DATA32START',0 390 282 DATA32 ends 391 283 392 284 BSS32 segment 393 BSS32START label byte285 BSS32START db 'BSS32START',0 394 286 BSS32 ends 395 287 396 288 CONST32_RO segment 397 CONST32_ROSTART label byte289 CONST32_ROSTART db 'CONST32_ROSTART',0 398 290 CONST32_RO ends 399 291 400 292 _VFT segment 401 _VFTSTART LABEL BYTE293 _VFTSTART db '_VFTSTART',0 402 294 _VFT ends 403 295 404 296 EH_DATA segment 405 EH_DATASTART LABEL BYTE297 EH_DATASTART db 'EH_DATASTART',0 406 298 EH_DATA ends 407 299 -
branches/splittup/src/win32k/dev32/devlast.asm
r4164 r6841 1 ; $Id: devlast.asm,v 1.6 2000-09-02 21:07:58bird Exp $1 ; $Id: devlast.asm,v 1.6.2.1 2001-09-27 03:08:15 bird Exp $ 2 2 ; 3 3 ; DevLast - the object file termintating the resident part of the objects. … … 5 5 ; after this file is discarded after init. 6 6 ; 7 ; Copyright (c) 1999 knut st. osmundsen7 ; Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 8 8 ; 9 9 ; Project Odin Software License can be found in LICENSE.TXT … … 36 36 public EH_DATAEND 37 37 38 public _CallR0Init32 39 public _CallVerifyImportTab32 38 public _GetR0InitPtr 40 39 41 40 ; 41 ; External Functions 42 ; 43 extrn R0Init:PROC 42 44 43 45 ; … … 45 47 ; 46 48 DATA16 segment 47 DATA16END db ? 49 db 'DATA16END' 50 DATA16END db 0 48 51 DATA16 ends 49 52 50 53 DATA16_BSS segment 51 DATA16_BSSEND db ? 54 db 'DATA16_BSSEND' 55 DATA16_BSSEND db 0 52 56 DATA16_BSS ends 53 57 54 58 DATA16_CONST segment 55 DATA16_CONSTEND db ? 59 db 'DATA16_CONSTEND' 60 DATA16_CONSTEND db 0 56 61 DATA16_CONST ends 57 62 58 63 DATA16_INIT segment 59 DATA16_INITEND db ? 64 db 'DATA16_INITEND' 65 DATA16_INITEND db 0 60 66 DATA16_INIT ends 61 67 62 68 DATA16_INIT_BSS segment 63 DATA16_INIT_BSSEND db ? 69 db 'DATA16_INIT_BSSEND' 70 DATA16_INIT_BSSEND db 0 64 71 DATA16_INIT_BSS ends 65 72 66 73 DATA16_INIT_CONST segment 67 DATA16_INIT_CONSTEND db ? 74 db 'DATA16_INIT_CONSTEND' 75 DATA16_INIT_CONSTEND db 0 68 76 DATA16_INIT_CONST ends 69 77 70 78 CODE16 segment 71 CODE16END db ? 79 db 'CODE16END' 80 CODE16END db 0 72 81 CODE16 ends 73 82 74 extrn R0INIT32:FAR75 extrn VERIFYIMPORTTAB32:FAR76 83 77 84 CODE16_INIT segment 78 85 ;; 79 ; Thunk procedure for R0Init32. 80 ; @cproto USHORT NEAR CallR0Init32(LIN pRpInit); 81 ; @returns Same as R0Init32. 82 ; @param pRpInit 32-bit pointer to request packet. 83 ; @status completely implemented. 84 ; @author knut st. osmundsen 85 _CallR0Init32 PROC NEAR 86 ASSUME CS:CODE16_INIT 87 push ds 88 push word ptr [esp+6] ; push high word. 89 push word ptr [esp+6] ; push low word. 90 call far ptr FLAT:R0INIT32 91 pop ds 86 ; Gets the 32-bit flat pointer of R0Init. (32-bit init function) 87 ; @cproto ULONG GetR0InitPtr(void); 88 ; @returns Flat pointer to R0Init. (ax:dx) 89 ; @uses uses eax, edx. 90 ; @author knut st. osmundsen (kosmunds@csc.com) 91 _GetR0InitPtr PROC NEAR 92 assume ds:nothing, ss:nothing, es:nothing 93 mov eax, offset FLAT:CODE32:R0Init 94 mov edx, eax 95 shr edx, 16 92 96 ret 93 _ CallR0Init32ENDP97 _GetR0InitPtr ENDP 94 98 95 96 ;; 97 ; Thunk procedure for VerifyImportTab32. 98 ; @cproto USHORT NEAR CallVerifyImportTab32(void); 99 ; @returns Same as VerifyImportTab32. 100 ; @status completely implemented. 101 ; @author knut st. osmundsen 102 _CallVerifyImportTab32 PROC NEAR 103 ASSUME CS:CODE16_INIT 104 push ds 105 call far ptr FLAT:VERIFYIMPORTTAB32 106 pop ds 107 ret 108 _CallVerifyImportTab32 ENDP 109 110 CODE16_INITEND LABEL BYTE 99 db 'CODE16_INITEND' 100 CODE16_INITEND db 0 111 101 CODE16_INIT ends 112 102 113 103 114 104 CODE32 segment 115 CODE32END LABEL BYTE 105 db 'CODE32END' 106 CODE32END db 0 116 107 CODE32 ends 117 108 118 109 DATA32 segment 119 DATA32END LABEL BYTE 110 db 'DATA32END' 111 DATA32END db 0 120 112 DATA32 ends 121 113 122 114 BSS32 segment 123 BSS32END LABEL BYTE 115 db 'BSS32END' 116 BSS32END db 0 124 117 BSS32 ends 125 118 126 119 CONST32_RO segment 127 CONST32_ROEND LABEL BYTE 120 db 'CONST32_ROEND' 121 CONST32_ROEND db 0 128 122 CONST32_RO ends 129 123 130 124 _VFT segment 131 _VFTEND LABEL BYTE 125 db '_VFTEND' 126 _VFTEND db 0 132 127 _VFT ends 133 128 134 129 EH_DATA segment 135 EH_DATAEND LABEL BYTE 130 db 'EH_DATAEND' 131 EH_DATAEND db 0 136 132 EH_DATA ends 137 133 -
branches/splittup/src/win32k/include/PerTaskW32kData.h
r6296 r6841 1 /* $Id: PerTaskW32kData.h,v 1.2 2001-07-10 16:41:10bird Exp $1 /* $Id: PerTaskW32kData.h,v 1.2.2.1 2001-09-27 03:08:17 bird Exp $ 2 2 * 3 3 * Per Task (Win32k) Data. … … 18 18 typedef struct _PerTaskData 19 19 { 20 AVL NODECOREcore;20 AVLPVNODECORE core; 21 21 ULONG cUsage; /* Usage counter. */ 22 22 PPTDA pPTDA; /* Also in core.Key */ -
branches/splittup/src/win32k/include/dev16.h
r6227 r6841 1 /* $Id: dev16.h,v 1.11 2001-07-08 03:05:28bird Exp $1 /* $Id: dev16.h,v 1.11.2.1 2001-09-27 03:08:17 bird Exp $ 2 2 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++. 3 3 * 4 * Copyright (c) 1999 knut st. osmundsen4 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 5 5 * 6 6 * Project Odin Software License can be found in LICENSE.TXT … … 21 21 #endif 22 22 23 /*24 * Ring 0 init IOCtl (dev1 -> dev0)25 */26 #define D16_IOCTL_CAT 0xC027 #define D16_IOCTL_RING0INIT 0x4028 typedef struct _D16R0INITDATA29 {30 USHORT usRcInit32;31 } D16R0INITDATA;32 typedef D16R0INITDATA FAR *PD16R0INITDATA;33 34 typedef struct _D16R0INITPARAM35 {36 PRPINITIN pRpInitIn;37 } D16R0INITPARAM;38 typedef D16R0INITPARAM FAR *PD16R0INITPARAM;39 40 41 /*42 * Get Kernel OTEs. No params. Data is KRNLOBJTABLE (dev1632.h).43 */44 #define D16_IOCTL_GETKRNLINFO 0x4145 46 47 /*48 * Verify aImportTab. No params. No data (aImportTab is used).49 */50 #define D16_IOCTL_VERIFYIMPORTTAB 0x4251 typedef struct _D16VERIFYIMPORTTABDATA52 {53 USHORT usRc;54 } D16VERIFYIMPORTTABDATA;55 typedef D16VERIFYIMPORTTABDATA FAR *PD16VERIFYIMPORTTABDATA;56 57 58 /**59 * Regards goes to Matthieu Willm for (parts of) this!60 */61 #ifdef INCL_1662 typedef void FAR * FPVOID;63 #else64 typedef ULONG FPVOID;65 #endif66 typedef struct _DosTable /* dt */67 {68 UCHAR cul; /* count of entries (dwords) in this table.*/69 FPVOID fph_HardError;70 FPVOID fph_UCase;71 ULONG UnknownOrReserved1;72 ULONG UnknownOrReserved2;73 ULONG UnknownOrReserved3;74 FPVOID fph_MemMapAlias;75 FPVOID fph_MemUnmapAlias;76 FPVOID fph_GoProtAll;77 FPVOID fph_GoRealAll;78 FPVOID fph_doshlp_RedirDev;79 ULONG UnknownOrReserved4;80 ULONG UnknownOrReserved5;81 FPVOID fph_SFFromSFN;82 FPVOID fph_SegGetInfo;83 FPVOID fph_AsgCheckDrive;84 ULONG UnknownOrReserved6;85 ULONG UnknownOrReserved7;86 } DOSTABLE, FAR *PDOSTABLE , NEAR *NPDOSTABLE;87 88 typedef struct _DosTable2 /* dt2 */89 {90 UCHAR cul; /* count of entries (dwords) in this table.*/91 FPVOID fpErrMap24;92 FPVOID fpErrMap24End;93 FPVOID fpErr_Table_24;94 FPVOID fpCDSAddr;95 FPVOID fpGDT_RDR1;96 FPVOID fpInterrupLevel;97 FPVOID fp_cInDos;98 ULONG UnknownOrReserved1;99 ULONG UnknownOrReserved2;100 ULONG R0FlatCS;101 ULONG R0FlatDS;102 LIN pTKSSBase;103 LIN pintSwitchStack;104 LIN pprivatStack;105 FPVOID fpPhysDiskTablePtr;106 LIN pforceEMHandler;107 LIN pReserveVM;108 LIN p_pgpPageDir;109 ULONG UnknownOrReserved3;110 } DOSTABLE2, FAR *PDOSTABLE2 , NEAR *NPDOSTABLE2;111 112 23 113 24 /* 114 25 * init functions 115 26 */ 116 USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut); 117 USHORT NEAR dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut); 118 USHORT NEAR R0Init16(PRP_GENIOCTL pRp); 119 USHORT NEAR initGetDosTableData(void); 120 #if 0 /*ndef CODE16_INIT*/ 121 #pragma alloc_text(CODE16_INIT, dev0Init, dev1Init, R0Init16, initGetDosTableData) 122 #endif 27 USHORT NEAR devInit(PRPINITIN pRpIn, PRPINITOUT pRpOut); 28 123 29 124 30 /* … … 126 32 */ 127 33 USHORT NEAR CallR0Init32(LIN pRpInit); 128 USHORT NEAR CallGetKernelInfo32(ULONG addressKrnlInfoBuf);129 USHORT NEAR CallVerifyImportTab32(void);130 USHORT NEAR CallElfIOCtl(LIN pRpIOCtl);131 34 USHORT NEAR CallWin32kIOCtl(LIN pRpIOCtl); 132 35 USHORT NEAR CallWin32kOpen(LIN pRpOpen); 133 36 USHORT NEAR CallWin32kClose(LIN pRpClose); 134 #if 0 /*ndef CODE16_INIT*/ 135 #pragma alloc_text(CODE16_INIT, CallR0Init32, CallVerifyImportTab32, CallGetKernelInfo32) 136 #endif 37 ULONG NEAR GetR0InitPtr(void); 137 38 138 39 … … 140 41 * These are only for use in the 'aDevHdrs'. 141 42 */ 142 extern void NEAR strategyAsm0(void); 143 extern void NEAR strategyAsm1(void); 43 extern void NEAR strategyAsm(void); 144 44 145 45 /* 146 46 * Global data. 147 47 */ 148 extern DDHDR aDevHdrs[ 2];48 extern DDHDR aDevHdrs[1]; 149 49 extern PFN Device_Help; 150 extern ULONG TKSSBase16;151 extern USHORT R0FlatCS16;152 extern USHORT R0FlatDS16;153 50 extern BOOL fInitTime; 154 51 … … 157 54 * Stack to Flat DS - 16-bit version. 158 55 */ 159 /*#define SSToDS_16(pStackVar) ((LIN)(getTKSSBaseValue() + (ULONG)(USHORT)(pStackVar)))*/160 56 #define SSToDS_16(pStackVar) (SSToDS_16a((void NEAR *)pStackVar)) 161 57 -
branches/splittup/src/win32k/include/dev1632.h
r6226 r6841 1 /* $Id: dev1632.h,v 1.8 2001-07-08 03:03:51bird Exp $1 /* $Id: dev1632.h,v 1.8.2.1 2001-09-27 03:08:17 bird Exp $ 2 2 * dev1632.h - Common header file for 16-bit and 32-bit C 3 3 * … … 49 49 } RP32OPENCLOSE, *PRP32OPENCLOSE; 50 50 51 #ifdef _OS2KLDR_H_52 53 54 #define MAXKRNLOBJECTS 2455 typedef struct _KRNLINFO56 {57 unsigned long ulBuild;58 unsigned short fKernel;59 unsigned char cObjects;60 unsigned char chPadding;61 OTE aObjects[MAXKRNLOBJECTS];62 } KRNLINFO, FAR * PKRNLINFO;63 64 #else65 66 #define PKRNLINFO void *67 68 #endif69 70 51 #pragma pack() 71 52 -
branches/splittup/src/win32k/include/dev32.h
r6225 r6841 1 /* $Id: dev32.h,v 1.12 2001-07-08 03:03:14bird Exp $1 /* $Id: dev32.h,v 1.12.2.1 2001-09-27 03:08:18 bird Exp $ 2 2 * 3 3 * dev32 - header file for 32-bit part of the driver. … … 60 60 #if !defined(__cplusplus) && defined(RING0) 61 61 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit); 62 USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo);63 USHORT _loadds _Far32 _Pascal VerifyImportTab32(void);64 USHORT _loadds _Far32 _Pascal ElfIOCtl(PRP32GENIOCTL pRpIOCtl);65 62 USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl); 66 63 USHORT _loadds _Far32 _Pascal Win32kOpen(PRP32OPENCLOSE pRpOpen); 67 64 USHORT _loadds _Far32 _Pascal Win32kClose(PRP32OPENCLOSE pRpClose); 68 65 #endif 69 #ifdef _OS2KLDR_H_70 PMTE _System GetOS2KrnlMTE(void); /* (devfirst.asm) */71 #endif72 66 ULONG _Optlink InitCallGate(void); 73 ULONG _Optlink x86DisableWriteProtect(void);74 ULONG _Optlink x86RestoreWriteProtect(ULONG flWP);75 67 76 68 … … 79 71 * Global variables 80 72 */ 81 extern PULONG pulTKSSBase32;82 73 extern USHORT CallGateGDT; 83 74 … … 97 88 * @returns 32-bit FLAT pointer. 98 89 */ 99 #ifdef RING0 100 #define SSToDS(a) ((PVOID)((ULONG)(a) + *pulTKSSBase32)) 101 #else 102 #define SSToDS(a) ((PVOID)(a)) 90 #ifndef SSToDS 91 #ifdef RING0 92 #define SSToDS(a) ((PVOID)((ULONG)(a) + TKSSBase)) 93 #else 94 #define SSToDS(a) ((PVOID)(a)) 95 #endif 103 96 #endif 104 97 -
branches/splittup/src/win32k/include/ldr.h
r4785 r6841 1 /* $Id: ldr.h,v 1.7 2000-12-11 06:44:35bird Exp $1 /* $Id: ldr.h,v 1.7.2.1 2001-09-27 03:08:18 bird Exp $ 2 2 * 3 3 * ldr - Our loader "subsystem" public header file. … … 23 23 * Fail if dependent header files is missing 24 24 */ 25 #ifndef _ AVL_H_26 #error "You'll have to include avl.hbefore ldr.h!"25 #ifndef _kAVL_h_ 26 #error "You'll have to include kKrnlLib.h with INCL_KKL_AVL before ldr.h!" 27 27 #endif 28 28 … … 170 170 typedef struct _Module 171 171 { 172 AVL NODECOREcoreKey; /* Key is hFile. */173 AVL NODECOREcoreMTE; /* Key is pMTE. */172 AVLULNODECORE coreKey; /* Key is hFile. */ 173 AVLULNODECORE coreMTE; /* Key is pMTE. */ 174 174 175 175 SFN hFile; /* System file number or file handle if you prefer that. */ … … 239 239 ULONG ldrInit(void); 240 240 241 242 243 /* 244 * Overriding functions. 245 */ 246 extern ULONG LDRCALL myldrOpen(PSFN phFile, PSZ pszFilename, PULONG pfl); 247 241 248 #ifdef __cplusplus 242 249 } -
branches/splittup/src/win32k/include/options.h
r6003 r6841 1 /* $Id: options.h,v 1.22 2001-06-14 01:06:47bird Exp $1 /* $Id: options.h,v 1.22.2.1 2001-09-27 03:08:19 bird Exp $ 2 2 * 3 3 * Options. … … 17 17 * Defined Constants And Macros * 18 18 *******************************************************************************/ 19 /* fKernel */20 #define KF_UNI 0x000021 #define KF_SMP 0x000122 #define KF_W4 0x000223 #define KF_REV_MASK 0x0FF024 #define KF_REV_SHIFT 425 #define KF_REV_0 0x000026 #define KF_REV_A 0x001027 #define KF_REV_B 0x002028 #define KF_REV_C 0x003029 #define KF_REV_D 0x004030 #define KF_REV_E 0x005031 #define KF_REV_F 0x006032 #define KF_REV_G 0x007033 #define KF_REV_H 0x008034 #define KF_REV_I 0x009035 #define KF_REV_J 0x00a036 #define KF_REV_K 0x00b037 #define KF_REV_L 0x00c038 #define KF_REV_M 0x00d039 #define KF_REV_N 0x00e040 #define KF_REV_O 0x00f041 #define KF_REV_P 0x010042 #define KF_REV_Q 0x011043 #define KF_REV_R 0x012044 #define KF_REV_S 0x013045 #define KF_REV_T 0x014046 #define KF_REV_U 0x015047 #define KF_REV_V 0x016048 #define KF_REV_W 0x017049 #define KF_REV_X 0x018050 #define KF_REV_Y 0x019051 #define KF_REV_Z 0x01a052 #define KF_REV_ECS 0x090053 #define KF_DEBUG 0x100054 #define KF_HAS_DEBUGTYPE 0x200055 #define KF_ALLSTRICT 0x300056 #define KF_HALFSTRICT 0x700057 58 19 /* fPE */ 59 20 #define FLAGS_PE_NOT 0x00000000UL … … 74 35 #define INFOLEVEL_INFOALL 0x00000004UL 75 36 76 /* default heapsizes */77 #define CB_SWP_INIT ((unsigned long)1024*512) /* 512KB */78 #define CB_SWP_MAX ((unsigned long)1024*1024*16) /* 16MB */79 #define CB_RES_INIT ((unsigned long)1024*256) /* 256KB */80 #define CB_RES_MAX ((unsigned long)1024*1024*10) /* 10MB */81 82 37 /* NOINC */ 83 38 /* default assignments */ 84 39 #define DEFAULT_OPTION_ASSIGMENTS \ 85 40 {FALSE, /* fQuiet */ \ 86 OUTPUT_COM2, /* usCom */ \87 41 FALSE, /* fLogging */ \ 88 KF_UNI, /* fKernel */ \89 ~0UL, /* ulBuild */ \90 (unsigned short)~0, /* usVerMajor */ \91 (unsigned short)~0, /* usVerMinor */ \92 42 FLAGS_PE_PE, /* fPE */ \ 93 43 FLAGS_PEOO_FORCED, /* fPEOneObject */ \ … … 101 51 TRUE, /* fExeFixes */ \ 102 52 FALSE, /* fForcePreload */ \ 103 FALSE, /* fApiEnh */ \ 104 CB_SWP_INIT, /* cbSwpHeapInit */ \ 105 CB_SWP_MAX, /* cbSwpHeapMax */ \ 106 CB_RES_INIT, /* cbResHeapInit */ \ 107 CB_RES_MAX} /* cbResHeapMax */ 53 FALSE /* fApiEnh */ \ 54 } 108 55 109 56 #define isAnyLoaderEnabled() (!options.fNoLoader && \ … … 126 73 #define isJAVAEnabled() (options.fJava) 127 74 128 #define isSMPKernel() (options.fKernel & KF_SMP)129 #define isUNIKernel() (!(options.fKernel & KF_SMP))130 131 #define isHighMemorySupported() (options.ulBuild >= 14000 || isSMPKernel())132 133 75 #define isDllFixesEnabled() (options.fDllFixes) 134 76 #define isDllFixesDisabled() (!options.fDllFixes) … … 150 92 /** Option struct */ 151 93 #pragma pack(4) 152 struct options94 struct Win32kOptions 153 95 { 154 96 /** @cat misc */ … … 156 98 157 99 /** @cat logging options */ 158 USHORT usCom; /* Output port no. */159 100 USHORT fLogging; /* Logging. */ 160 161 /** @cat kernel selection */162 ULONG fKernel; /* Smp or uni kernel. */163 ULONG ulBuild; /* Kernel build. */164 USHORT usVerMajor; /* OS/2 major ver - 20 */165 USHORT usVerMinor; /* OS/2 minor ver - 30,40 */166 101 167 102 /** @cat Options affecting the generated LX executables */ … … 190 125 ULONG fForcePreload; /* Forces the loader to preload executable images. Handy for ICAT Ring-3 debugging. */ 191 126 ULONG fApiEnh; /* Enables the API enhancements */ 192 193 /** @cat Options affecting the heap. */194 ULONG cbSwpHeapInit; /* Initial heapsize. */195 ULONG cbSwpHeapMax; /* Maximum heapsize. */196 ULONG cbResHeapInit; /* Initial residentheapsize. */197 ULONG cbResHeapMax; /* Maxiumem residentheapsize. */198 127 }; 199 128 #pragma pack() … … 203 132 *******************************************************************************/ 204 133 /* NOINC */ 205 extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */134 extern struct Win32kOptions DATA16_GLOBAL options; /* defined in d16globals.c */ 206 135 extern char szWin32kIni[160]; /* defined in d16globals.c */ 207 136 #ifdef RING0 -
branches/splittup/src/win32k/include/test.h
r6285 r6841 1 /* $Id: test.h,v 1.10 2001-07-10 05:24:18bird Exp $1 /* $Id: test.h,v 1.10.2.1 2001-09-27 03:08:20 bird Exp $ 2 2 * 3 3 * Definitions and declarations for test moduls. … … 158 158 ULONG KRNLCALL fakeTKSuFuBuff(PVOID pvUsr, PVOID pv, ULONG cb, ULONG fl); 159 159 ULONG KRNLCALL fakeTKPidToPTDA(PID pid, PPPTDA ppPTDA); 160 ULONG KRNLCALL fakeTKScanTasks(ULONG flFlags, ULONG id, PTKSCANTASKWORKER pfnWorker, ULONG ulArg); 160 161 void KRNLCALL fakeTKForceThread(ULONG flFlag, PTCB pTCB); 161 162 void KRNLCALL fakeTKForceTask(ULONG flFlag, PPTDA pPTDA, BOOL fForce); -
branches/splittup/src/win32k/k32/k32AllocMemEx.cpp
r5179 r6841 1 /* $Id: k32AllocMemEx.cpp,v 1.5 2001-02-19 05:49:05bird Exp $1 /* $Id: k32AllocMemEx.cpp,v 1.5.2.1 2001-09-27 03:08:21 bird Exp $ 2 2 * 3 3 * k32AllocMemEx - Equivalent to DosAllocMem, but this one … … 18 18 #define INCL_OS2KRNL_VM 19 19 #define INCL_OS2KRNL_TK 20 21 20 #define NO_WIN32K_LIB_FUNCTIONS 22 21 #define INCL_KKL_LOG 23 22 24 23 … … 27 26 *******************************************************************************/ 28 27 #include <os2.h> 28 #include <OS2Krnl.h> 29 #include <kKrnlLib.h> 30 29 31 #include "devSegDf.h" /* Win32k segment definitions. */ 30 #include "OS2Krnl.h"31 32 #include "win32k.h" 32 33 #include "k32.h" 33 34 #include "options.h" 34 35 #include "dev32.h" 35 #include "log.h"36 #include "macros.h"37 36 38 37 … … 159 158 if ( vmac.ac_va < 0x10000 160 159 || vmac.ac_va + cb < vmac.ac_va 161 || vmac.ac_va + cb > ((vmac.ac_va >= 0x20000000 && pahvmhShr) ? pahvmhShr : pahvmShr)->ah_laddrMax160 || vmac.ac_va + cb > ((vmac.ac_va >= 0x20000000 && &ahvmhShr) ? ahvmhShr.ah_laddrMax : ahvmShr.ah_laddrMax) 162 161 ) 163 162 { … … 186 185 187 186 flVMFlags = VMA_USER | VMA_ZEROFILL | VMA_LOWMEM2 | VMA_ARENAPRIVATE /* 0x02010084*/ 188 | ((flFlags & OBJ_ANY) && pahvmhShr ? VMA_ARENAHIGHA : VMA_SELALLOC | VMA_ALIGNSEL)187 | ((flFlags & OBJ_ANY) && &ahvmhShr ? VMA_ARENAHIGHA : VMA_SELALLOC | VMA_ALIGNSEL) 189 188 | vmApiF0[flFlags & (PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_GUARD)] 190 189 | vmApiF1[(flFlags & (PAG_COMMIT | PAG_DECOMMIT | OBJ_TILE | OBJ_PROTECTED)) >> 4]; -
branches/splittup/src/win32k/k32/k32HandleSystemEvent.cpp
r5169 r6841 1 /* $Id: k32HandleSystemEvent.cpp,v 1.1 2001-02-18 15:26:38bird Exp $1 /* $Id: k32HandleSystemEvent.cpp,v 1.1.2.1 2001-09-27 03:08:22 bird Exp $ 2 2 * 3 3 * k32HandleSystemEvent - Override system events like Ctrl-Alt-Delete … … 19 19 #define INCL_OS2KRNL_TK 20 20 #define INCL_OS2KRNL_SEM 21 22 21 #define NO_WIN32K_LIB_FUNCTIONS 22 #define INCL_KKL_LOG 23 23 24 24 /******************************************************************************* … … 26 26 *******************************************************************************/ 27 27 #include <os2.h> 28 #include <OS2Krnl.h> 29 #include <kKrnlLib.h> 30 28 31 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "OS2Krnl.h"30 32 #include "win32k.h" 31 33 #include "k32.h" 32 34 #include "options.h" 33 35 #include "dev32.h" 34 #include "log.h"35 36 36 37 -
branches/splittup/src/win32k/k32/k32KillProcessEx.cpp
r6286 r6841 1 /* $Id: k32KillProcessEx.cpp,v 1.1 2001-07-10 05:20:59bird Exp $1 /* $Id: k32KillProcessEx.cpp,v 1.1.2.1 2001-09-27 03:08:22 bird Exp $ 2 2 * 3 3 * k32KillProcessEx - DosKillProcessEx extention. … … 20 20 #define NO_WIN32K_LIB_FUNCTIONS 21 21 22 #define INCL_KKL_LOG 23 22 24 23 25 … … 26 28 *******************************************************************************/ 27 29 #include <os2.h> 30 #include <OS2Krnl.h> 31 #include <kKrnlLib.h> 32 28 33 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "OS2Krnl.h"30 34 #include "win32k.h" 31 35 #include "k32.h" 32 36 #include "options.h" 33 37 #include "dev32.h" 34 #include "log.h"35 #include "macros.h"36 38 37 39 -
branches/splittup/src/win32k/k32/k32ProcessReadWrite.cpp
r5086 r6841 1 /* $Id: k32ProcessReadWrite.cpp,v 1.2 2001-02-10 11:11:44bird Exp $1 /* $Id: k32ProcessReadWrite.cpp,v 1.2.2.1 2001-09-27 03:08:22 bird Exp $ 2 2 * 3 3 * k32ProcessReadWrite - Read or write to another process. … … 22 22 #define INCL_OS2KRNL_LDR 23 23 #define NO_WIN32K_LIB_FUNCTIONS 24 #define INCL_KKL_LOG 24 25 25 26 /******************************************************************************* … … 27 28 *******************************************************************************/ 28 29 #include <os2.h> 30 #include <OS2Krnl.h> 31 #include <kKrnlLib.h> 29 32 30 33 #include "devSegDf.h" /* Win32k segment definitions. */ 31 #include "OS2Krnl.h"32 34 #include "win32k.h" 33 35 #include "k32.h" 34 36 #include "options.h" 35 37 #include "dev32.h" 36 #include "log.h"37 38 38 39 -
branches/splittup/src/win32k/k32/k32QueryCallGate.cpp
r5250 r6841 1 /* $Id: k32QueryCallGate.cpp,v 1.3 2001-02-23 04:01:48bird Exp $1 /* $Id: k32QueryCallGate.cpp,v 1.3.2.1 2001-09-27 03:08:22 bird Exp $ 2 2 * 3 3 * k32QueryCallGate - Query the callgate selector for the callgate to the k32 APIs. … … 25 25 *******************************************************************************/ 26 26 #include <os2.h> 27 #include <OS2Krnl.h> 28 #include <kKrnlLib.h> 29 27 30 #include "devSegDf.h" /* Win32k segment definitions. */ 28 #include "OS2Krnl.h"29 31 #include "win32k.h" 30 32 #include "k32.h" 31 33 #include "options.h" 32 34 #include "dev32.h" 33 #include "log.h"34 #include "macros.h"35 35 36 36 -
branches/splittup/src/win32k/k32/k32QueryOTEs.cpp
r5086 r6841 1 /* $Id: k32QueryOTEs.cpp,v 1.3 2001-02-10 11:11:44bird Exp $1 /* $Id: k32QueryOTEs.cpp,v 1.3.2.1 2001-09-27 03:08:22 bird Exp $ 2 2 * 3 3 * k32QueryOTEs - Get's the object table entries (OTEs) for a given … … 20 20 #define INCL_OS2KRNL_SEM 21 21 #define INCL_OS2KRNL_LDR 22 23 22 #define NO_WIN32K_LIB_FUNCTIONS 23 #define INCL_KKL_LOG 24 24 25 25 /******************************************************************************* … … 27 27 *******************************************************************************/ 28 28 #include <os2.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 31 29 32 #include "devSegDf.h" /* Win32k segment definitions. */ 30 #include "OS2Krnl.h"31 33 #include "win32k.h" 32 34 #include "k32.h" 33 35 #include "options.h" 34 36 #include "dev32.h" 35 #include "log.h"36 37 37 38 -
branches/splittup/src/win32k/k32/k32QueryOptionsStatus.cpp
r5118 r6841 1 /* $Id: k32QueryOptionsStatus.cpp,v 1.7 2001-02-11 23:43:00bird Exp $1 /* $Id: k32QueryOptionsStatus.cpp,v 1.7.2.1 2001-09-27 03:08:23 bird Exp $ 2 2 * 3 3 * k32QueryOptionsStatus - Queries the options and/or the status of … … 21 21 #define INCL_OS2KRNL_SEM 22 22 #define INCL_OS2KRNL_LDR 23 24 23 #define NO_WIN32K_LIB_FUNCTIONS 24 #define INCL_KKL_LOG 25 #define INCL_KKL_HEAP 26 #define INCL_KKL_AVL 25 27 26 28 /******************************************************************************* … … 32 34 #include <newexe.h> /* OS/2 NE structs and definitions. */ 33 35 #include <exe386.h> /* OS/2 LX structs and definitions. */ 36 #include <OS2Krnl.h> 37 #include <kKrnlLib.h> 34 38 35 39 #include "devSegDf.h" /* Win32k segment definitions. */ 36 37 #include "malloc.h" /* win32k malloc (resident). Not C library! */38 #include "smalloc.h" /* win32k swappable heap. */39 #include "rmalloc.h" /* win32k resident heap. */40 40 41 41 #include <string.h> /* C library string.h. */ … … 44 44 #include <stdarg.h> /* C library stdarg.h. */ 45 45 46 #include "vprintf.h" /* win32k printf and vprintf. Not C library! */47 46 #include "dev1632.h" /* Common 16- and 32-bit parts */ 48 47 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 49 #include "OS2Krnl.h" /* kernel structs. (SFN) */50 #include "log.h" /* Logging. */51 #include "avl.h" /* AVL tree. (ldr.h need it) */52 48 #include "ldr.h" /* ldr helpers. (ldrGetExePath) */ 53 #include "env.h" /* Environment helpers. */49 #include "env.h" //todo /* Environment helpers. */ 54 50 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 55 51 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ … … 57 53 #include "options.h" /* Win32k options. */ 58 54 59 #include "ProbKrnl.h" /* ProbKrnl variables and definitions. */60 55 #include "win32k.h" /* Win32k API structures. */ 61 56 #include "k32.h" /* Internal Win32k API structures. */ … … 126 121 127 122 TmpOptions.cb = sizeof(K32OPTIONS); 123 #if 0 128 124 TmpOptions.usCom = options.usCom; 125 #endif 129 126 TmpOptions.fLogging = options.fLogging; 130 127 TmpOptions.fPE = options.fPE; … … 140 137 TmpOptions.fForcePreload= options.fForcePreload; 141 138 TmpOptions.fApiEnh = options.fApiEnh; 139 #if 0 142 140 TmpOptions.cbSwpHeapMax = options.cbSwpHeapMax; 143 141 TmpOptions.cbResHeapMax = options.cbResHeapMax; 142 #endif 144 143 145 144 rc = TKSuBuff(pOptions, SSToDS(&TmpOptions), sizeof(K32OPTIONS), TK_FUSU_NONFATAL); … … 162 161 /* options */ 163 162 TmpStatus.fQuiet = options.fQuiet; 163 #if 0 //todo 164 164 TmpStatus.fKernel = options.fKernel; /* Smp or uni kernel. */ 165 165 TmpStatus.ulBuild = options.ulBuild; /* Kernel build. */ 166 166 TmpStatus.usVerMajor = options.usVerMajor; /* OS/2 major ver - 20 */ 167 167 TmpStatus.usVerMinor = options.usVerMinor; /* OS/2 minor ver - 30,40 */ 168 #endif 168 169 169 170 /* swappable heap */ 170 171 if (_swp_state((PHEAPSTATE)SSToDS(&HeapState)) == 0) 171 172 { 173 #if 0 172 174 TmpStatus.cbSwpHeapInit = options.cbSwpHeapInit; /* Initial heapsize. */ 175 #endif 173 176 TmpStatus.cbSwpHeapFree = HeapState.cbHeapFree; /* Amount of used space. */ 174 177 TmpStatus.cbSwpHeapUsed = HeapState.cbHeapUsed; /* Amount of free space reserved. */ … … 181 184 if (_res_state((PHEAPSTATE)SSToDS(&HeapState)) == 0) 182 185 { 186 #if 0 183 187 TmpStatus.cbResHeapInit = options.cbResHeapInit; /* Initial heapsize. */ 188 #endif 184 189 TmpStatus.cbResHeapFree = HeapState.cbHeapFree; /* Amount of used space. */ 185 190 TmpStatus.cbResHeapUsed = HeapState.cbHeapUsed; /* Amount of free space reserved. */ … … 193 198 strcpy((char*)SSToDS(TmpStatus.szBuildTime), szBuildTime); /* Time of the win32k build. */ 194 199 TmpStatus.ulVersion = PE2LX_VERSION; /* Win32k version */ 200 #if 0 195 201 strcpy((char*)SSToDS(TmpStatus.szSymFile), szSymbolFile); /* The name of the symbol file or sym database. */ 202 #endif 196 203 197 204 /* Module counts */ -
branches/splittup/src/win32k/k32/k32QuerySystemMemInfo.cpp
r5289 r6841 1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.2 2001-03-07 21:55:30bird Exp $1 /* $Id: k32QuerySystemMemInfo.cpp,v 1.2.2.1 2001-09-27 03:08:23 bird Exp $ 2 2 * 3 3 * k32QuerySystemMemInfo - Collects more or less useful information on the … … 24 24 #define INCL_OS2KRNL_SEM 25 25 #define INCL_OS2KRNL_LDR 26 27 26 #define NO_WIN32K_LIB_FUNCTIONS 27 #define INCL_KKL_LOG 28 28 29 29 /******************************************************************************* … … 35 35 #include <newexe.h> /* OS/2 NE structs and definitions. */ 36 36 #include <exe386.h> /* OS/2 LX structs and definitions. */ 37 #include <OS2Krnl.h> 38 #include <kKrnlLib.h> 37 39 38 40 #include "devSegDf.h" /* Win32k segment definitions. */ 39 40 #include "malloc.h" /* win32k malloc (resident). Not C library! */41 #include "smalloc.h" /* win32k swappable heap. */42 #include "rmalloc.h" /* win32k resident heap. */43 41 44 42 #include <string.h> /* C library string.h. */ 45 43 #include <stdlib.h> /* C library stdlib.h. */ 46 44 #include <stddef.h> /* C library stddef.h. */ 47 #include <stdarg.h> /* C library stdarg.h. */48 45 49 #include "vprintf.h" /* win32k printf and vprintf. Not C library! */50 46 #include "dev1632.h" /* Common 16- and 32-bit parts */ 51 47 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 52 #include "OS2Krnl.h" /* kernel structs. (SFN) */53 #include "log.h" /* Logging. */54 48 #include "options.h" /* Win32k options. */ 55 49 56 #include "ProbKrnl.h" /* ProbKrnl variables and definitions. */57 50 #include "win32k.h" /* Win32k API structures. */ 58 51 #include "k32.h" /* Internal Win32k API structures. */ … … 147 140 MemInfo.ulAddressLimit = VirtualAddressLimit; 148 141 vmRecalcShrBound(VMRSBF_ARENASHR, (PULONG)SSToDS(&MemInfo.ulVMArenaPrivMax)); 149 MemInfo.ulVMArenaSharedMin = pahvmShr->ah_laddrMin;150 MemInfo.ulVMArenaSharedMax = pahvmShr->ah_laddrMax;151 MemInfo.ulVMArenaSystemMin = pahvmSys->ah_laddrMin;152 MemInfo.ulVMArenaSystemMax = pahvmSys->ah_laddrMax;153 if ( pahvmhShr && VirtualAddressLimit > 0x20000000) /* Not valid if less or equal to 512MB user memory */142 MemInfo.ulVMArenaSharedMin = ahvmShr.ah_laddrMin; 143 MemInfo.ulVMArenaSharedMax = ahvmShr.ah_laddrMax; 144 MemInfo.ulVMArenaSystemMin = ahvmSys.ah_laddrMin; 145 MemInfo.ulVMArenaSystemMax = ahvmSys.ah_laddrMax; 146 if (&ahvmhShr && VirtualAddressLimit > 0x20000000) /* Not valid if less or equal to 512MB user memory */ 154 147 { 155 MemInfo.ulVMArenaHighSharedMin = pahvmhShr->ah_laddrMin;156 MemInfo.ulVMArenaHighSharedMax = pahvmhShr->ah_laddrMax;148 MemInfo.ulVMArenaHighSharedMin = ahvmhShr.ah_laddrMin; 149 MemInfo.ulVMArenaHighSharedMax = ahvmhShr.ah_laddrMax; 157 150 vmRecalcShrBound(VMRSBF_ARENAHIGH, (PULONG)SSToDS(&MemInfo.ulVMArenaHighPrivMax)); 158 151 } -
branches/splittup/src/win32k/k32/k32SetEnvironment.cpp
r6296 r6841 1 /* $Id: k32SetEnvironment.cpp,v 1.2 2001-07-10 16:39:17bird Exp $1 /* $Id: k32SetEnvironment.cpp,v 1.2.2.1 2001-09-27 03:08:23 bird Exp $ 2 2 * 3 3 * k32SetEnvironment - Sets the Odin32 environment for a process. … … 19 19 #define INCL_OS2KRNL_LDR 20 20 #define NO_WIN32K_LIB_FUNCTIONS 21 #define INCL_KKL_LOG 22 #define INCL_KKL_AVL 21 23 22 24 … … 25 27 *******************************************************************************/ 26 28 #include <os2.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 31 27 32 #include <memory.h> 28 33 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "OS2Krnl.h"30 34 #include "win32k.h" 31 35 #include "k32.h" … … 33 37 #include "dev32.h" 34 38 #include "dev32hlp.h" 35 #include "log.h"36 #include "macros.h"37 #include "avl.h"38 39 #include "PerTaskW32kData.h" 39 40 -
branches/splittup/src/win32k/k32/k32SetOptions.cpp
r5118 r6841 1 /* $Id: k32SetOptions.cpp,v 1.7 2001-02-11 23:43:00bird Exp $1 /* $Id: k32SetOptions.cpp,v 1.7.2.1 2001-09-27 03:08:23 bird Exp $ 2 2 * 3 3 * k32SetOptions - Sets the changable options of win32k.sys the options. … … 20 20 #define INCL_OS2KRNL_SEM 21 21 #define INCL_OS2KRNL_LDR 22 23 22 #define NO_WIN32K_LIB_FUNCTIONS 23 #define INCL_KKL_LOG 24 #define INCL_KKL_AVL 24 25 25 26 /******************************************************************************* … … 31 32 #include <newexe.h> /* OS/2 NE structs and definitions. */ 32 33 #include <exe386.h> /* OS/2 LX structs and definitions. */ 34 #include <OS2Krnl.h> 35 #include <kKrnlLib.h> 33 36 34 37 #include "devSegDf.h" /* Win32k segment definitions. */ 35 36 #include "malloc.h" /* win32k malloc (resident). Not C library! */37 #include "smalloc.h" /* win32k swappable heap. */38 #include "rmalloc.h" /* win32k resident heap. */39 38 40 39 #include <string.h> /* C library string.h. */ … … 43 42 #include <stdarg.h> /* C library stdarg.h. */ 44 43 45 #include "vprintf.h" /* win32k printf and vprintf. Not C library! */46 44 #include "dev1632.h" /* Common 16- and 32-bit parts */ 47 45 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 48 #include "OS2Krnl.h" /* kernel structs. (SFN) */49 #include "log.h" /* Logging. */50 #include "avl.h" /* AVL tree. (ldr.h need it) */51 46 #include "ldr.h" /* ldr helpers. (ldrGetExePath) */ 52 #include "env.h" /* Environment helpers. */47 #include "env.h" //todo /* Environment helpers. */ 53 48 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 54 49 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ … … 56 51 #include "options.h" /* Win32k options. */ 57 52 58 #include "ProbKrnl.h" /* ProbKrnl variables and definitions. */59 53 #include "win32k.h" /* Win32k API structures. */ 60 54 #include "k32.h" /* Internal Win32k API structures. */ … … 103 97 * Validate contents. 104 98 */ 99 #if 0 105 100 if ( TmpOptions.usCom != OUTPUT_COM1 106 101 && TmpOptions.usCom != OUTPUT_COM2 … … 108 103 && TmpOptions.usCom != OUTPUT_COM4) 109 104 return ERROR_INVALID_PARAMETER; 105 #endif 110 106 if (TmpOptions.fLogging > 1) 111 107 return ERROR_INVALID_PARAMETER; … … 136 132 if (TmpOptions.fApiEnh > 1) 137 133 return ERROR_INVALID_PARAMETER; 134 #if 0 138 135 if (TmpOptions.cbSwpHeapMax > (32768*1024) || TmpOptions.cbSwpHeapMax < options.cbSwpHeapInit) 139 136 return ERROR_INVALID_PARAMETER; 140 137 if (TmpOptions.cbResHeapMax > (32768*1024) || TmpOptions.cbResHeapMax < options.cbResHeapInit) 141 138 return ERROR_INVALID_PARAMETER; 139 #endif 142 140 143 141 /* … … 155 153 * Apply changes 156 154 */ 155 #if 0 157 156 options.usCom = TmpOptions.usCom; /* Output port no. */ 157 #endif 158 158 options.fLogging = (USHORT)TmpOptions.fLogging;/* Logging. */ 159 159 options.fPE = TmpOptions.fPE; /* Flags set the type of conversion. */ … … 170 170 options.fApiEnh = TmpOptions.fApiEnh; /* Enables the API enhancements */ 171 171 172 #if 0 172 173 options.cbSwpHeapMax = TmpOptions.cbSwpHeapMax; /* Maximum heapsize. */ 173 174 cbSwpHeapMax = (unsigned)options.cbSwpHeapMax; 174 175 options.cbResHeapMax = TmpOptions.cbResHeapMax; /* Maxiumem residentheapsize. */ 175 176 cbResHeapMax = (unsigned)options.cbResHeapMax; 177 #endif 176 178 177 179 /* -
branches/splittup/src/win32k/ldr/ModuleBase.cpp
r5086 r6841 1 /* $Id: ModuleBase.cpp,v 1.7 2001-02-10 11:11:44 bird Exp $1 /* $Id: ModuleBase.cpp,v 1.7.2.1 2001-09-27 03:08:24 bird Exp $ 2 2 * 3 3 * ModuleBase - Implementetation. … … 19 19 #endif 20 20 #define INCL_OS2KRNL_LDR 21 #define INCL_KKL_LOG 22 #define INCL_KKL_AVL 23 #define INCL_KKL_HEAP 24 #define INCL_KKL_PRINTF 21 25 22 26 … … 25 29 *******************************************************************************/ 26 30 #include <os2.h> /* OS/2 header file. */ 31 #include <OS2Krnl.h> 32 #include <kKrnlLib.h> 27 33 28 34 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "malloc.h" /* Win32k malloc. Not C library! */30 35 31 36 #include <string.h> /* C library string.h. */ 32 #include <stdarg.h> /* C library stdarg.h. */ 33 34 #include "vprintf.h" /* win32k printf and vprintf. Not C library! */ 37 35 38 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 36 #include "OS2Krnl.h" /* kernel structs. (SFN) */37 39 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 38 40 -
branches/splittup/src/win32k/ldr/ldr.cpp
r5086 r6841 1 /* $Id: ldr.cpp,v 1.10 2001-02-10 11:11:45bird Exp $1 /* $Id: ldr.cpp,v 1.10.2.1 2001-09-27 03:08:24 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 17 17 #define INCL_OS2KRNL_PTDA 18 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 20 #define INCL_KKL_AVL 21 #define INCL_KKL_HEAP 19 22 20 23 /******************************************************************************* … … 22 25 *******************************************************************************/ 23 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 24 31 25 32 #include "devSegDf.h" 26 #include "malloc.h"27 #include "new.h"28 33 #include <memory.h> 29 34 #include <stdlib.h> … … 31 36 #include <string.h> 32 37 33 #include "log.h"34 #include "avl.h"35 #include <peexe.h>36 #include <exe386.h>37 #include "OS2Krnl.h"38 38 #include "ldr.h" 39 39 #include "ModuleBase.h" … … 45 45 * Global Variables * 46 46 *******************************************************************************/ 47 static PAVL NODECOREpSFNRoot = NULL;48 static PAVL NODECOREpMTERoot = NULL;47 static PAVLULNODECORE pSFNRoot = NULL; 48 static PAVLULNODECORE pMTERoot = NULL; 49 49 50 50 … … 81 81 * @returns Pointer to module node. If not found NULL. 82 82 * @param hFile File handle of the module to be found. 83 * @sketch return a AVL Get on the pSFNRoot-tree.83 * @sketch return a AVLULGet on the pSFNRoot-tree. 84 84 * @status completely implemented. 85 85 * @author knut st. osmundsen … … 87 87 PMODULE getModuleBySFN(SFN hFile) 88 88 { 89 return (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)hFile);89 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)hFile); 90 90 } 91 91 … … 115 115 #if 0 116 116 /* Not 100% sure that this will work correctly! */ 117 PMODULE pMod = (PMODULE)AVL Get(&pMTERoot, (AVLKEY)pMTE);117 PMODULE pMod = (PMODULE)AVLULGet(&pMTERoot, (AVLULKEY)pMTE); 118 118 if (pMod == NULL) 119 119 { … … 125 125 } 126 126 #endif 127 pMod = (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);127 pMod = (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 128 128 if (pMod != NULL) 129 129 { 130 pMod->coreMTE.Key = (AVL KEY)pMTE;130 pMod->coreMTE.Key = (AVLULKEY)pMTE; 131 131 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 132 AVLInsert(&pMTERoot, (PAVL NODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));132 AVLInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 133 133 } 134 134 } … … 146 146 #endif 147 147 if (GetState(pMTE->mte_sfn) == HSTATE_OUR) 148 return (PMODULE)AVL Get(&pSFNRoot, (AVLKEY)pMTE->mte_sfn);148 return (PMODULE)AVLULGet(&pSFNRoot, (AVLULKEY)pMTE->mte_sfn); 149 149 150 150 return NULL; … … 209 209 PMODULE pMod; 210 210 #ifdef DEBUG 211 if (AVL Get(&pSFNRoot, (AVLKEY)hFile) != NULL)211 if (AVLULGet(&pSFNRoot, (AVLULKEY)hFile) != NULL) 212 212 kprintf(("addModule: Module allready present in the SFN-tree!\n")); 213 213 if (hFile == 0) … … 232 232 233 233 /* fill in the module node. */ 234 pMod->coreKey.Key = (AVL KEY)hFile;234 pMod->coreKey.Key = (AVLULKEY)hFile; 235 235 pMod->hFile = hFile; 236 236 pMod->pMTE = pMTE; … … 239 239 240 240 /* insert the module node into the tree(s) */ 241 AVL Insert(&pSFNRoot, (PAVLNODECORE)pMod);241 AVLULInsert(&pSFNRoot, (PAVLULNODECORE)pMod); 242 242 if (pMTE != NULL) 243 243 { 244 pMod->coreMTE.Key = (AVL KEY)pMTE;244 pMod->coreMTE.Key = (AVLULKEY)pMTE; 245 245 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 246 AVL Insert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE)));246 AVLULInsert(&pMTERoot, (PAVLULNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 247 247 } 248 248 … … 265 265 ULONG removeModule(SFN hFile) 266 266 { 267 PMODULE pMod = (PMODULE)AVL Remove(&pSFNRoot, (AVLKEY)hFile);267 PMODULE pMod = (PMODULE)AVLULRemove(&pSFNRoot, (AVLULKEY)hFile); 268 268 if (pMod == NULL) 269 269 { … … 275 275 if (pMod->fFlags & MOD_FLAGS_IN_MTETREE) 276 276 { 277 if (AVL Remove(&pMTERoot, (AVLKEY)pMod->pMTE) == NULL)278 { 279 kprintf(("removeModule: MOD_FLAGS_IN_MTETREE set but AVL Remove returns NULL\n"));277 if (AVLULRemove(&pMTERoot, (AVLULKEY)pMod->pMTE) == NULL) 278 { 279 kprintf(("removeModule: MOD_FLAGS_IN_MTETREE set but AVLULRemove returns NULL\n")); 280 280 } 281 281 } … … 333 333 * Then get the pMTE, and access the smte_path to get a pointer to the executable path. 334 334 */ 335 PPTDA pPTDA Cur;/* Pointer to the current (system context) PTDA */335 PPTDA pPTDA1; /* Pointer to the current (system context) PTDA */ 336 336 PPTDA pPTDA; /* PTDA in question. */ 337 337 HMTE hMTE = NULLHANDLE; /* Modulehandle of the executable module. */ … … 343 343 * IF no pPTDAExecChild THEN get hMte for the current PTDA. 344 344 */ 345 pPTDA Cur= ptdaGetCur();346 if (pPTDA Cur!= NULL)347 { 348 pPTDA = ptdaGet_pPTDAExecChild(pPTDA Cur);345 pPTDA1 = ptdaGetCur(); 346 if (pPTDA1 != NULL) 347 { 348 pPTDA = ptdaGet_pPTDAExecChild(pPTDA1); 349 349 if (pPTDA != NULL && fExecChild) 350 350 hMTE = ptdaGet_ptda_module(pPTDA); 351 351 if (hMTE == NULLHANDLE) 352 hMTE = ptdaGet_ptda_module(pPTDA Cur);352 hMTE = ptdaGet_ptda_module(pPTDA1); 353 353 } 354 354 else -
branches/splittup/src/win32k/ldr/myLDRGetProcAddr.cpp
r5086 r6841 1 /* $Id: myLDRGetProcAddr.cpp,v 1.2 2001-02-10 11:11:45 bird Exp $1 /* $Id: myLDRGetProcAddr.cpp,v 1.2.2.1 2001-09-27 03:08:25 bird Exp $ 2 2 * 3 3 * LDRGetProcAddr - Get an entry point to a module. … … 17 17 #define INCL_OS2KRNL_PTDA 18 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 20 #define INCL_KKL_AVL 19 21 20 22 /******************************************************************************* … … 22 24 *******************************************************************************/ 23 25 #include <os2.h> 26 #include <peexe.h> 27 #include <exe386.h> 28 #include <OS2Krnl.h> 29 #include <kKrnlLib.h> 24 30 25 31 #include <memory.h> … … 28 34 29 35 #include "devSegDf.h" /* Win32k segment definitions. */ 30 #include "log.h"31 #include "avl.h"32 #include <peexe.h>33 #include <exe386.h>34 #include "OS2Krnl.h"35 36 #include "dev32.h" 36 37 #include "ldr.h" -
branches/splittup/src/win32k/ldr/myLDRQAppType.cpp
r5086 r6841 1 /* $Id: myLDRQAppType.cpp,v 1.5 2001-02-10 11:11:45 bird Exp $1 /* $Id: myLDRQAppType.cpp,v 1.5.2.1 2001-09-27 03:08:25 bird Exp $ 2 2 * 3 3 * _myLDRQAppType - _LDRQAppType overload. … … 18 18 #define INCL_OS2KRNL_SEM 19 19 #define INCL_OS2KRNL_LDR 20 #define INCL_KKL_LOG 21 #define INCL_KKL_AVL 20 22 21 23 /******************************************************************************* … … 23 25 *******************************************************************************/ 24 26 #include <os2.h> 27 #include <OS2Krnl.h> 28 #include <kKrnlLib.h> 25 29 26 30 #include "devSegDf.h" /* Win32k segment definitions. */ 27 #include "OS2Krnl.h"28 #include "avl.h"29 31 #include "ldr.h" 30 #include "log.h"31 32 32 33 -
branches/splittup/src/win32k/ldr/myVMAllocMem.cpp
r5086 r6841 1 /* $Id: myVMAllocMem.cpp,v 1.3 2001-02-10 11:11:45 bird Exp $1 /* $Id: myVMAllocMem.cpp,v 1.3.2.1 2001-09-27 03:08:25 bird Exp $ 2 2 * 3 3 * Debug module - overloads VMAllocMem to analyse input parameters.... … … 15 15 #define INCL_NOPMAPI 16 16 #define INCL_OS2KRNL_LDR 17 #define INCL_OS2KRNL_VM 18 #define INCL_KKL_AVL 19 #define INCL_KKL_LOG 17 20 18 21 /******************************************************************************* … … 20 23 *******************************************************************************/ 21 24 #include <os2.h> 25 #include <OS2Krnl.h> 26 #include <kKrnlLib.h> 22 27 23 #include "log.h"24 #include "OS2Krnl.h"25 #include "avl.h"26 28 #include "ldr.h" 27 29 … … 51 53 APIRET rc; 52 54 53 rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8, p9);55 rc = VMAllocMem(p1,p2,p3,p4,p5,p6,p7,p8,(PVMAC)p9); 54 56 55 57 return rc; -
branches/splittup/src/win32k/ldr/myldrCheckInternalName.cpp
r6193 r6841 1 /* $Id: myldrCheckInternalName.cpp,v 1.5 2001-07-07 04:39:57bird Exp $1 /* $Id: myldrCheckInternalName.cpp,v 1.5.2.1 2001-09-27 03:08:25 bird Exp $ 2 2 * 3 3 * ldrCheckInternalName - ldrCheckInternalName replacement with support for 4 4 * long DLL names and no .DLL-extention dependency. 5 5 * 6 * Copyright (c) 1999-200 0 knut st. osmundsen (knut.stange.osmundsen@mynd.no)6 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 7 7 * 8 8 * Project Odin Software License can be found in LICENSE.TXT … … 17 17 #define INCL_NOPMAPI 18 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 20 #define INCL_KKL_AVL 19 21 20 22 … … 23 25 *******************************************************************************/ 24 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 25 31 26 32 #include <memory.h> … … 29 35 30 36 #include "devSegDf.h" /* Win32k segment definitions. */ 31 #include "log.h"32 #include "avl.h"33 #include <peexe.h>34 #include <exe386.h>35 #include "OS2Krnl.h"36 37 #include "dev32.h" 37 38 #include "ldr.h" -
branches/splittup/src/win32k/ldr/myldrClose.cpp
r5086 r6841 1 /* $Id: myldrClose.cpp,v 1.7 2001-02-10 11:11:46 bird Exp $1 /* $Id: myldrClose.cpp,v 1.7.2.1 2001-09-27 03:08:26 bird Exp $ 2 2 * 3 3 * myldrClose - ldrClose 4 4 * 5 * Copyright (c) 1998- 1999 knut st. osmundsen5 * Copyright (c) 1998-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 15 15 #define INCL_NOPMAPI 16 16 #define INCL_OS2KRNL_LDR 17 #define INCL_KKL_LOG 18 #define INCL_KKL_AVL 17 19 18 20 /******************************************************************************* … … 20 22 *******************************************************************************/ 21 23 #include <os2.h> 24 #include <peexe.h> 25 #include <exe386.h> 26 #include <OS2Krnl.h> 27 #include <kKrnlLib.h> 22 28 23 29 #include <memory.h> … … 25 31 26 32 #include "devSegDf.h" /* Win32k segment definitions. */ 27 #include "log.h"28 #include "avl.h"29 #include <peexe.h>30 #include <exe386.h>31 #include "OS2Krnl.h"32 33 #include "ldr.h" 33 34 #include "ModuleBase.h" -
branches/splittup/src/win32k/ldr/myldrEnum32bitRelRecs.cpp
r5086 r6841 1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.5 2001-02-10 11:11:46 bird Exp $1 /* $Id: myldrEnum32bitRelRecs.cpp,v 1.5.2.1 2001-09-27 03:08:26 bird Exp $ 2 2 * 3 3 * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs 4 4 * 5 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)5 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 15 15 #define INCL_NOPMAPI 16 16 #define INCL_OS2KRNL_LDR 17 #define INCL_KKL_LOG 18 #define INCL_KKL_AVL 17 19 18 20 … … 21 23 *******************************************************************************/ 22 24 #include <os2.h> 25 #include <peexe.h> 26 #include <exe386.h> 27 #include <OS2Krnl.h> 28 #include <kKrnlLib.h> 23 29 24 30 #include <memory.h> … … 26 32 27 33 #include "devSegDf.h" /* Win32k segment definitions. */ 28 #include "avl.h"29 #include "log.h"30 #include <peexe.h>31 #include <exe386.h>32 #include "OS2Krnl.h"33 34 #include "ldr.h" 34 35 #include "ModuleBase.h" -
branches/splittup/src/win32k/ldr/myldrFindModule.cpp
r6192 r6841 1 /* $Id: myldrFindModule.cpp,v 1.3 2001-07-07 04:39:11bird Exp $1 /* $Id: myldrFindModule.cpp,v 1.3.2.1 2001-09-27 03:08:26 bird Exp $ 2 2 * 3 3 * ldrFindModule - ldrFindModule replacement with support for long DLL names 4 4 * and .DLL-extention dependency. 5 5 * 6 * Copyright (c) 1999-200 0 knut st. osmundsen (knut.stange.osmundsen@mynd.no)6 * Copyright (c) 1999-2001 knut st. osmundsen (kosmunds@csc.com) 7 7 * 8 8 * Project Odin Software License can be found in LICENSE.TXT … … 16 16 #define INCL_NOPMAPI 17 17 #define INCL_OS2KRNL_LDR 18 #define INCL_KKL_LOG 19 #define INCL_KKL_AVL 18 20 19 21 /******************************************************************************* … … 21 23 *******************************************************************************/ 22 24 #include <os2.h> 25 #include <peexe.h> 26 #include <exe386.h> 27 #include <OS2Krnl.h> 28 #include <kKrnlLib.h> 23 29 24 30 #include <memory.h> … … 27 33 28 34 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "log.h"30 #include "avl.h"31 #include <peexe.h>32 #include <exe386.h>33 #include "OS2Krnl.h"34 35 #include "dev32.h" 35 36 #include "ldr.h" 36 37 #include "ModuleBase.h" 37 38 #include "options.h" 38 39 /*******************************************************************************40 * Global Variables *41 *******************************************************************************/42 extern PPMTE pmte_h;43 extern PPMTE pprogram_h;44 extern PPMTE pprogram_l;45 extern PPMTE pglobal_h;46 extern PPMTE pglobal_l;47 extern PPMTE pspecific_h;48 extern PPMTE pspecific_l;49 39 50 40 /******************************************************************************* … … 106 96 static PMTE pmteNULL = NULL; 107 97 static PPMTE ppmteNULL = &pmteNULL; 108 static P PMTE * apppmteHeadTail[] =98 static PMTE apmteHeadTail[] = 109 99 {/* head tail */ 110 &pmte_h, &ppmteNULL,/* CLASS_ALL 0x00000000 */111 &pprogram_h, &pprogram_l,/* CLASS_PROGRAM 0x00000040 */112 &pglobal_h, &pglobal_l,/* CLASS_GLOBAL 0x00000080 */113 &pspecific_h, &pspecific_l,/* CLASS_SPECIFIC 0x000000c0 */100 mte_h, pmteNULL, /* CLASS_ALL 0x00000000 */ 101 program_h, program_l, /* CLASS_PROGRAM 0x00000040 */ 102 global_h, global_l, /* CLASS_GLOBAL 0x00000080 */ 103 specific_h, specific_l, /* CLASS_SPECIFIC 0x000000c0 */ 114 104 }; 115 105 … … 157 147 * Find start and end mte node 158 148 */ 159 pmte = **apppmteHeadTail[usClass >> 5];160 pmteEnd = **apppmteHeadTail[(usClass >> 5) + 1];149 pmte = apmteHeadTail[usClass >> 5]; 150 pmteEnd = apmteHeadTail[(usClass >> 5) + 1]; 161 151 if (pmteEnd != NULL) /* Advance one node - see loop condition. */ 162 152 pmteEnd = pmteEnd->mte_link; -
branches/splittup/src/win32k/ldr/myldrGetFileName.asm
r5247 r6841 1 ; $Id: myldrGetFileName.asm,v 1.2 2001-02-23 02:57:54bird Exp $1 ; $Id: myldrGetFileName.asm,v 1.2.2.1 2001-09-27 03:08:26 bird Exp $ 2 2 ; 3 3 ; myldrGetFileName2 - assembly helper for ldrGetFileName. … … 5 5 ; doesn't have a path, and return correct *ppachExt. 6 6 ; 7 ; Copyright (c) 2000 knut st. osmundsen7 ; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com) 8 8 ; 9 9 ; Project Odin Software License can be found in LICENSE.TXT -
branches/splittup/src/win32k/ldr/myldrOpen.cpp
r6009 r6841 1 /* $Id: myldrOpen.cpp,v 1.16 2001-06-14 12:19:41bird Exp $1 /* $Id: myldrOpen.cpp,v 1.16.2.1 2001-09-27 03:08:27 bird Exp $ 2 2 * 3 3 * myldrOpen - ldrOpen. … … 21 21 #define INCL_OS2KRNL_SEC 22 22 #define INCL_OS2KRNL_LDR 23 #define INCL_KKL_LOG 24 #define INCL_KKL_AVL 25 #define INCL_KKL_HEAP 23 26 24 27 /******************************************************************************* … … 26 29 *******************************************************************************/ 27 30 #include <os2.h> 31 #include <peexe.h> 32 #include <exe386.h> 33 #include <OS2Krnl.h> 34 #include <kKrnlLib.h> 28 35 29 36 #include "devSegDf.h" /* Win32k segment definitions. */ 30 #include "rmalloc.h"31 #include "malloc.h"32 37 #include <memory.h> 33 38 #include <stdlib.h> … … 35 40 #include <stdarg.h> 36 41 37 #include "log.h"38 #include "avl.h"39 42 #include "options.h" 40 #include <peexe.h>41 #include <exe386.h>42 43 #include "elf.h" 43 44 #include "OS2Krnl.h" … … 47 48 #include "pe2lx.h" 48 49 #include "myExecPgm.h" 49 #include "env.h" 50 #include "vprintf.h" /* Make 100% sure we have va_start. */ 50 #include "env.h" /* TODO */ 51 51 52 52 -
branches/splittup/src/win32k/ldr/myldrOpenPath.cpp
r5086 r6841 1 /* $Id: myldrOpenPath.cpp,v 1.5 2001-02-10 11:11:46bird Exp $1 /* $Id: myldrOpenPath.cpp,v 1.5.2.1 2001-09-27 03:08:27 bird Exp $ 2 2 * 3 3 * myldrOpenPath - ldrOpenPath used to open executables we'll override 4 4 * this to altern the search path for DLLs. 5 5 * 6 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)6 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com) 7 7 * 8 8 * Project Odin Software License can be found in LICENSE.TXT … … 18 18 #define INCL_OS2KRNL_PTDA 19 19 #define INCL_OS2KRNL_LDR 20 #define INCL_KKL_LOG 21 #define INCL_KKL_AVL 20 22 21 23 /******************************************************************************* … … 23 25 *******************************************************************************/ 24 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 25 31 26 32 #include <memory.h> … … 28 34 29 35 #include "devSegDf.h" /* Win32k segment definitions. */ 30 #include "log.h"31 36 #include "dev32.h" 32 37 #include "dev32hlp.h" 33 #include <peexe.h>34 #include <exe386.h>35 #include "OS2Krnl.h"36 #include "avl.h"37 38 #include "ldr.h" 38 39 #include "ModuleBase.h" -
branches/splittup/src/win32k/ldr/myldrOpenPatha.asm
r5247 r6841 1 ; $Id: myldrOpenPatha.asm,v 1.5 2001-02-23 02:57:54bird Exp $1 ; $Id: myldrOpenPatha.asm,v 1.5.2.1 2001-09-27 03:08:27 bird Exp $ 2 2 ; 3 3 ; myldrOpenPatha - assembly helpers for myldrOpenPath. 4 4 ; 5 ; Copyright (c) 2000 knut st. osmundsen5 ; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 ; 7 7 ; Project Odin Software License can be found in LICENSE.TXT … … 13 13 ; 14 14 include devsegdf.inc 15 include options.inc16 15 17 16 ; … … 24 23 ; 25 24 extrn _ldrOpenPath_wrapped:PROC ; calltab entry 26 extrn _options:options25 extrn ulKernelBuild:ABS 27 26 28 27 … … 37 36 _ldrOpenPath@20 PROC NEAR 38 37 ASSUME ds:FLAT 39 cmp FLAT:DATA16:_options.ulBuild, 14053 40 jge new 38 mov eax, ulKernelBuild 39 cmp eax, 14053 40 jge new 41 41 42 42 if 0 … … 73 73 ; 74 74 if 0 75 extrn pulTKSSBase32:DWORD75 extrn _TKSSBase:DWORD 76 76 push ecx 77 77 push edi … … 80 80 pop es 81 81 82 mov edi, pulTKSSBase32 83 mov edi, [edi] 82 mov edi, _TKSSBase 84 83 add edi, esp 85 84 mov ecx, esp -
branches/splittup/src/win32k/ldr/myldrRead.cpp
r5086 r6841 1 /* $Id: myldrRead.cpp,v 1.9 2001-02-10 11:11:47bird Exp $1 /* $Id: myldrRead.cpp,v 1.9.2.1 2001-09-27 03:08:28 bird Exp $ 2 2 * 3 3 * myldrRead - ldrRead. … … 15 15 #define INCL_NOPMAPI 16 16 #define INCL_OS2KRNL_LDR 17 #define INCL_KKL_LOG 18 #define INCL_KKL_AVL 17 19 18 20 /******************************************************************************* … … 20 22 *******************************************************************************/ 21 23 #include <os2.h> 24 #include <peexe.h> 25 #include <exe386.h> 26 #include <OS2Krnl.h> 27 #include <kKrnlLib.h> 22 28 23 29 #include <memory.h> … … 25 31 26 32 #include "devSegDf.h" /* Win32k segment definitions. */ 27 #include "log.h"28 #include "avl.h"29 33 #include "dev32.h" 30 #include <peexe.h>31 #include <exe386.h>32 #include "OS2Krnl.h"33 34 #include "ldr.h" 34 35 #include "ModuleBase.h" -
branches/splittup/src/win32k/ldr/myldrSetVMflags.cpp
r5086 r6841 1 /* $Id: myldrSetVMflags.cpp,v 1.2 2001-02-10 11:11:47bird Exp $1 /* $Id: myldrSetVMflags.cpp,v 1.2.2.1 2001-09-27 03:08:28 bird Exp $ 2 2 * 3 3 * myldrSetVMflags - ldrSetVMflags 4 4 * 5 * Copyright (c) 2000 knut st. osmundsen5 * Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.com) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 17 17 #define INCL_OS2KRNL_VM 18 18 #define INCL_OS2KRNL_LDR 19 #define INCL_KKL_LOG 20 #define INCL_KKL_AVL 21 19 22 20 23 /******************************************************************************* … … 22 25 *******************************************************************************/ 23 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 24 31 25 32 #include <memory.h> … … 27 34 28 35 #include "devSegDf.h" /* Win32k segment definitions. */ 29 #include "log.h"30 #include "avl.h"31 #include <peexe.h>32 #include <exe386.h>33 #include "OS2Krnl.h"34 36 #include "ldr.h" 35 37 -
branches/splittup/src/win32k/ldr/myldrWasLoadModuled.cpp
r5086 r6841 1 /* $Id: myldrWasLoadModuled.cpp,v 1.2 2001-02-10 11:11:47bird Exp $1 /* $Id: myldrWasLoadModuled.cpp,v 1.2.2.1 2001-09-27 03:08:28 bird Exp $ 2 2 * 3 3 * ldrWasLoadModuled - Tells OS/2 that the executable module was LoadModuled … … 18 18 #define INCL_OS2KRNL_PTDA 19 19 #define INCL_OS2KRNL_LDR 20 #define INCL_KKL_LOG 21 #define INCL_KKL_AVL 20 22 21 23 /******************************************************************************* … … 23 25 *******************************************************************************/ 24 26 #include <os2.h> 27 #include <peexe.h> 28 #include <exe386.h> 29 #include <OS2Krnl.h> 30 #include <kKrnlLib.h> 25 31 26 32 #include <memory.h> … … 29 35 30 36 #include "devSegDf.h" /* Win32k segment definitions. */ 31 #include "log.h"32 #include "avl.h"33 #include <peexe.h>34 #include <exe386.h>35 #include "OS2Krnl.h"36 37 #include "dev32.h" 37 38 #include "ldr.h" -
branches/splittup/src/win32k/ldr/mytkExecPgm.asm
r5247 r6841 1 ; $Id: mytkExecPgm.asm,v 1.13 2001-02-23 02:57:55bird Exp $1 ; $Id: mytkExecPgm.asm,v 1.13.2.1 2001-09-27 03:08:28 bird Exp $ 2 2 ; 3 3 ; mytkExecPgm - tkExecPgm overload 4 4 ; 5 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)5 ; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.no) 6 6 ; 7 7 ; Project Odin Software License can be found in LICENSE.TXT … … 57 57 ; LDR semaphore 58 58 ; 59 extrn pLdrSem:DWORD59 extrn _LdrSem:DWORD 60 60 extrn _LDRClearSem@0:PROC 61 61 extrn _KSEMRequestMutex@8:PROC … … 80 80 ; TKSSBase (32-bit) 81 81 ; 82 extrn pulTKSSBase32:DWORD82 extrn _TKSSBase:DWORD 83 83 84 84 ; … … 222 222 ASSUME DS:FLAT, ES:FLAT 223 223 224 mov eax, pLdrSem; Get pointer to the loader semaphore.224 mov eax, offset _LdrSem ; Get pointer to the loader semaphore. 225 225 or eax, eax ; Check if null. (paranoia) 226 226 jz tkepgm_backout ; Fail if null. … … 332 332 ; 333 333 push 0 ; Usage count variable. 334 mov eax, pulTKSSBase32 ; Get TKSSBase 335 mov eax, [eax] 334 mov eax, _TKSSBase ; Get TKSSBase 336 335 add eax, esp ; Added TKSSBase to the usage count pointer 337 336 push eax ; Push address of usage count pointer. 338 push pLdrSem; Push pointer to loader semaphore ( = handle).337 push offset _LdrSem ; Push pointer to loader semaphore ( = handle). 339 338 call _KSEMQueryMutex@8 340 339 or eax, eax ; Check return code. (1 = our / free; 0 = not our but take) -
branches/splittup/src/win32k/ldr/mytkStartProcess.asm
r5247 r6841 1 ; $Id: mytkStartProcess.asm,v 1.4 2001-02-23 02:57:55bird Exp $1 ; $Id: mytkStartProcess.asm,v 1.4.2.1 2001-09-27 03:08:29 bird Exp $ 2 2 ; 3 3 ; tkStartProcess overloader. Needed to clear the loader semaphore 4 4 ; when a process is being started syncronously. 5 5 ; 6 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)6 ; Copyright (c) 2000-2001 knut st. osmundsen (kosmunds@csc.no) 7 7 ; 8 8 ; Project Odin Software License can be found in LICENSE.TXT … … 24 24 ; LDR semaphore 25 25 ; 26 extrn pLdrSem:DWORD26 extrn _LdrSem:DWORD 27 27 extrn _LDRClearSem@0:PROC 28 28 extrn _KSEMQueryMutex@8:PROC … … 46 46 ; TKSSBase (32-bit) 47 47 ; 48 extrn pulTKSSBase32:DWORD48 extrn _TKSSBase:DWORD 49 49 50 50 ; … … 83 83 84 84 push 0 ; Usage count variable. 85 mov eax, pulTKSSBase32 ; Get TKSSBase 86 mov eax, [eax] 85 mov eax, _TKSSBase ; Get TKSSBase 87 86 add eax, esp ; Added TKSSBase to the usage count pointer 88 87 push eax ; Push address of usage count pointer. 89 push pLdrSem; Push pointer to loader semaphore ( = handle).88 push offset _LdrSem ; Push pointer to loader semaphore ( = handle). 90 89 call _KSEMQueryMutex@8 91 90 or eax, eax ; Check return code. (1 = our / free; 0 = not our but take) -
branches/splittup/src/win32k/ldr/xx2lxmain.cpp
r5293 r6841 1 /* $Id: xx2lxmain.cpp,v 1.1 2001-03-11 16:37:17bird Exp $1 /* $Id: xx2lxmain.cpp,v 1.1.2.1 2001-09-27 03:08:29 bird Exp $ 2 2 * 3 3 * Xx2Lx main program. (Ring 3 only!) … … 46 46 *******************************************************************************/ 47 47 char szBackupXxFilename[CCHMAXPATH]; /* too save stack/heap */ 48 struct options options = DEFAULT_OPTION_ASSIGMENTS;48 struct Win32kOptions options = DEFAULT_OPTION_ASSIGMENTS; 49 49 50 50 /******************************************************************************* -
branches/splittup/src/win32k/misc/PerTaskW32kData.c
r6296 r6841 1 /* $Id: PerTaskW32kData.c,v 1.2 2001-07-10 16:39:19bird Exp $1 /* $Id: PerTaskW32kData.c,v 1.2.2.1 2001-09-27 03:08:30 bird Exp $ 2 2 * 3 3 * Per Task (Win32k) Data. … … 18 18 #define INCL_OS2KRNL_TK /* OS2KRNL: Task Stuff */ 19 19 #define INCL_OS2KRNL_PTDA 20 #define INCL_KKL_AVL 21 #define INCL_KKL_LOG 22 #define INCL_KKL_HEAP 20 23 21 24 /******************************************************************************* … … 23 26 *******************************************************************************/ 24 27 #include <os2.h> 28 #include <OS2Krnl.h> 29 #include <kKrnlLib.h> 25 30 26 31 #include "devSegDf.h" /* Win32k segment definitions. */ 27 32 #include "dev32.h" 28 33 #include "dev32hlp.h" 29 #include "log.h"30 #include "OS2Krnl.h"31 34 #include <string.h> 32 #include "macros.h"33 #include "avl.h"34 35 #include "PerTaskW32kData.h" 35 #include "rmalloc.h"36 36 37 37 … … 39 39 * Global Variables * 40 40 *******************************************************************************/ 41 /*static*/ PAVL NODECORE pPTDTree;/* Pointer to PTD tree */41 /*static*/ PAVLPVNODECORE pPTDTree; /* Pointer to PTD tree */ 42 42 /* Currently assumed protected by ldrSem. */ 43 43 … … 65 65 if (pPTDA == 0) 66 66 pPTDA = ptdaGetCur(); 67 pptd = (PPTD)(void*)AVL Get(&pPTDTree, (AVLKEY)pPTDA);67 pptd = (PPTD)(void*)AVLPVGet(&pPTDTree, pPTDA); 68 68 if (!pptd && fCreate) 69 69 { … … 75 75 } 76 76 memset(pptd, 0, sizeof(*pptd)); 77 pptd->core.Key = (AVLKEY)pPTDA;78 AVL Insert(&pPTDTree, &pptd->core);77 pptd->core.Key = pPTDA; 78 AVLPVInsert(&pPTDTree, &pptd->core); 79 79 } 80 80 return pptd; … … 93 93 if (pPTDA == 0) 94 94 pPTDA = ptdaGetCur(); 95 pptd = (PPTD)(void*)AVL Remove(&pPTDTree, (AVLKEY)pPTDA);95 pptd = (PPTD)(void*)AVLPVRemove(&pPTDTree, pPTDA); 96 96 if (pptd) 97 97 { -
branches/splittup/src/win32k/pe2lx/pe2lx.cpp
r6493 r6841 1 /* $Id: pe2lx.cpp,v 1.32 2001-08-08 17:24:45bird Exp $1 /* $Id: pe2lx.cpp,v 1.32.2.1 2001-09-27 03:08:34 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 19 19 #define INCL_OS2KRNL_LDR /* Loader definitions. */ 20 20 #define INCL_OS2KRNL_PTDA /* PTDA definitions. */ 21 #define INCL_KKL_LOG 22 #define INCL_KKL_AVL 23 #define INCL_KKL_HEAP 21 24 #ifdef RING0 22 25 #define INCL_NOAPI /* RING0: No apis. */ 26 #define Yield() D32Hlp_Yield() 23 27 #else /*RING3*/ 24 28 #define INCL_DOSPROCESS /* RING3: DosSleep. */ 25 29 #define INCL_OS2KRNL_LDR_NOAPIS /* No apis */ 30 #define Yield() DosSleep(0) 26 31 #endif 27 32 … … 83 88 #include <newexe.h> /* OS/2 NE structs and definitions. */ 84 89 #include <exe386.h> /* OS/2 LX structs and definitions. */ 90 #include <OS2Krnl.h> /* kernel structs. (SFN) */ 91 #include <kKrnlLib.h> 85 92 86 93 #include "devSegDf.h" /* Win32k segment definitions. */ 87 88 #include "malloc.h" /* win32k malloc (resident). Not C library! */89 #include "smalloc.h" /* win32k swappable heap. */90 #include "rmalloc.h" /* win32k resident heap. */91 94 92 95 #include <string.h> /* C library string.h. */ … … 95 98 #include <stdarg.h> /* C library stdarg.h. */ 96 99 97 #include "vprintf.h" /* win32k printf and vprintf. Not C library! */98 100 #include "dev32.h" /* 32-Bit part of the device driver. (SSToDS) */ 99 #include "OS2Krnl.h" /* kernel structs. (SFN) */100 101 #ifdef RING0 101 #include "avl.h" /* AVL tree. (ldr.h need it) */102 102 #include "ldr.h" /* ldr helpers. (ldrGetExePath) */ 103 103 #include "env.h" /* Environment helpers. */ … … 108 108 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ 109 109 #include <versionos2.h> /* Pe2Lx version. */ 110 #include "yield.h" /* Yield CPU. */111 110 #include "options.h" /* Win32k options. */ 112 111 … … 1791 1790 1792 1791 case FINDDLL_LIBPATH: 1793 pszPath = *pLdrLibPath;1792 pszPath = LdrLibPath; 1794 1793 break; 1795 1794 -
branches/splittup/src/win32k/test/fake.c
r6288 r6841 1 /* $Id: fake.c,v 1.9 2001-07-10 05:26:51bird Exp $1 /* $Id: fake.c,v 1.9.4.1 2001-09-27 03:08:35 bird Exp $ 2 2 * 3 3 * Fake stubs for the ldr and kernel functions we imports or overloads. … … 2101 2101 2102 2102 /** 2103 * 2104 * @returns OS/2 return code. 2105 * @param pid Process Identifier. 2106 * @param ppPTDA Pointer to the PTDA-pointer variabel which is to receive 2107 * the PTDA pointer on successful return. 2108 */ 2109 ULONG KRNLCALL fakeTKScanTasks(ULONG flFlags, ULONG id, PTKSCANTASKWORKER pfnWorker, ULONG ulArg); 2110 { 2111 DUMMY(); 2112 printf("fakeTKScanTasks: - not implemented\n"); 2113 return ERROR_NOT_SUPPORTED; 2114 } 2115 2116 /** 2103 2117 * Force a thread to be made ready. 2104 2118 * @param flFlag Which flag(s?) to set. -
branches/splittup/src/win32k/win32k.def
r5247 r6841 1 1 ;****************************************************************************** 2 ; Copyright 1998-200 0knut st. osmundsen2 ; Copyright 1998-2001 knut st. osmundsen 3 3 ; Definition file for Win32k 4 4 ; Project Odin Software License can be found in LICENSE.TXT 5 5 ;****************************************************************************** 6 PHYSICAL DEVICE Grace7 DESCRIPTION "Odin32 Ring-0 support driver - copyright (c) 1998-200 0knut st. osmundsen"6 PHYSICAL DEVICE Win32k 7 DESCRIPTION "Odin32 Ring-0 support driver - copyright (c) 1998-2001 knut st. osmundsen" 8 8 9 9 CODE PRELOAD EXECUTEREAD -
branches/splittup/src/win32k/win32k.mak
r6429 r6841 1 # $Id: win32k.mak,v 1.13 2001-07-31 21:34:08 bird Exp $1 # $Id: win32k.mak,v 1.13.2.1 2001-09-27 03:08:08 bird Exp $ 2 2 3 3 # 4 4 # Win32k.sys makefile. 5 5 # 6 # Copyright 1998-2001 knut st. osmundsen (k nut.stange.osmundsen@mynd.no)6 # Copyright 1998-2001 knut st. osmundsen (kosmunds@csc.com) 7 7 # 8 8 # Project Odin Software License can be found in LICENSE.TXT … … 39 39 $(WIN32KOBJ)\d16strat.obj \ 40 40 $(WIN32KOBJ)\d32CallGate.obj \ 41 $(WIN32KOBJ)\d32hlp.obj \42 41 $(WIN32KOBJ)\d32globals.obj \ 43 42 $(WIN32KOBJ)\d16globl.obj \ 44 $(WIN32KOBJ)\abort.obj \45 $(WIN32KOBJ)\asmutils.obj \46 $(WIN32KOBJ)\calltaba.obj \47 $(WIN32KOBJ)\locks.obj \48 $(WIN32KOBJ)\malloc.obj \49 $(WIN32KOBJ)\smalloc_avl.obj \50 $(WIN32KOBJ)\avl.obj \51 $(WIN32KOBJ)\rmalloc_avl.obj \52 $(WIN32KOBJ)\new.obj \53 $(WIN32KOBJ)\env.obj \54 43 $(WIN32KOBJ)\PerTaskW32kData.obj \ 55 $(WIN32KOBJ)\stricmp.obj \56 $(WIN32KOBJ)\yield.obj \57 $(WIN32KOBJ)\vsprintf.obj \58 $(WIN32KOBJ)\vprintf.obj \59 44 $(WIN32KOBJ)\ldr.obj \ 60 45 $(WIN32KOBJ)\myldrClose.obj \ … … 69 54 $(WIN32KOBJ)\myldrGetFileName.obj \ 70 55 $(WIN32KOBJ)\d32Events.obj \ 71 $(WIN32KOBJ)\OS2KTCB.obj \72 $(WIN32KOBJ)\OS2KPTDA.obj \73 56 $(WIN32KOBJ)\pe2lx.obj \ 74 57 $(WIN32KOBJ)\ModuleBase.obj \ 75 $(WIN32KOBJ)\d32ElfIOCtl.obj \76 58 $(WIN32KOBJ)\d32Win32kIOCtl.obj \ 77 59 $(WIN32KOBJ)\d32Win32kOpenClose.obj \ … … 90 72 $(WIN32KOBJ)\vprntf16.obj \ 91 73 $(WIN32KOBJ)\d32init.obj \ 92 $(WIN32KOBJ)\d16init.obj_init \ 93 $(WIN32KOBJ)\ProbKrnl.obj_init \ 94 $(WIN32KOBJ)\SymDB.obj 74 $(WIN32KOBJ)\d16init.obj_init 95 75 96 76 LASTOBJ =\ … … 101 81 $(DDKPATH)\lib\os2386.lib \ 102 82 $(WIN32KOBJ)\devhelp.lib \ 103 $(WIN32KOBJ)\clib.lib 83 $(WIN32KOBJ)\clib.lib \ 84 $(ODIN32_LIB)\kKrnlLib.lib 104 85 105 86 … … 109 90 $(NAME).sys: $(WIN32KBIN)\$(NAME).sys 110 91 111 $(WIN32KBIN)\$(NAME).sys: clfix.exe \92 $(WIN32KBIN)\$(NAME).sys: $(WIN32KBIN)\clfix.exe \ 112 93 $(WIN32KINCLUDE)\options.inc \ 113 94 $(WIN32KINCLUDE)\api.inc \ … … 152 133 153 134 # Add bldlevel signature to win32k.def - creates temporary win32kbldlevel.def. 154 $(WIN32KOBJ)\$(NAME)bldlevel.def: $(NAME).def win32k.mak MakeDesc.cmd135 $(WIN32KOBJ)\$(NAME)bldlevel.def: $(NAME).def win32k.mak 155 136 -$(ECHO) Creates $@ with bldlevel signature string. 156 137 $(BLDLEVELINF) $(NAME).def $@ -R"$(NAME).def" \ … … 166 147 TSTOBJS =\ 167 148 $(WIN32KOBJ)\devfirst.obj \ 168 $(WIN32KOBJ)\$(NAME)tst.obj \169 $(WIN32KOBJ)\dh.obj \170 $(WIN32KOBJ)\dos.obj \171 $(WIN32KOBJ)\dosa.obj \172 $(WIN32KOBJ)\init.obj \173 $(WIN32KOBJ)\fake.obj \174 $(WIN32KOBJ)\fakea.obj \175 $(WIN32KOBJ)\TstFakers.obj \176 149 $(WIN32KOBJ)\d16strat.obj \ 177 150 $(WIN32KOBJ)\d32CallGate.obj \ … … 179 152 $(WIN32KOBJ)\d32globals.obj \ 180 153 $(WIN32KOBJ)\d16globl.obj \ 181 $(WIN32KOBJ)\abort.obj \182 154 $(WIN32KOBJ)\asmutils.obj \ 183 $(WIN32KOBJ)\calltaba.obj \184 155 $(WIN32KOBJ)\locks.obj \ 185 $(WIN32KOBJ)\malloc.obj_tst. \186 $(WIN32KOBJ)\smalloc_avl.obj \187 $(WIN32KOBJ)\avl.obj \188 $(WIN32KOBJ)\rmalloc_avl.obj \189 $(WIN32KOBJ)\new.obj \190 $(WIN32KOBJ)\env.obj \191 156 $(WIN32KOBJ)\PerTaskW32kData.obj \ 192 $(WIN32KOBJ)\stricmp.obj \193 $(WIN32KOBJ)\yield.obj \194 $(WIN32KOBJ)\vsprintf.obj \195 $(WIN32KOBJ)\vprintf.obj_tst. \196 157 $(WIN32KOBJ)\ldr.obj \ 197 158 $(WIN32KOBJ)\myldrClose.obj \ … … 210 171 $(WIN32KOBJ)\pe2lx.obj \ 211 172 $(WIN32KOBJ)\ModuleBase.obj \ 212 $(WIN32KOBJ)\d32ElfIOCtl.obj \213 173 $(WIN32KOBJ)\d32Win32kIOCtl.obj \ 214 174 $(WIN32KOBJ)\d32Win32kOpenClose.obj \ … … 228 188 $(WIN32KOBJ)\d32init.obj_tst. \ 229 189 $(WIN32KOBJ)\d16init.obj_tst_init. \ 230 $(WIN32KOBJ)\ProbKrnl.obj_tst_init. \ 231 $(WIN32KOBJ)\SymDB.obj 190 $(WIN32KOBJ)\$(NAME)tst.obj \ 191 $(WIN32KOBJ)\dh.obj \ 192 $(WIN32KOBJ)\dos.obj \ 193 $(WIN32KOBJ)\dosa.obj \ 194 $(WIN32KOBJ)\init.obj \ 195 $(WIN32KOBJ)\fake.obj \ 196 $(WIN32KOBJ)\fakea.obj \ 232 197 233 198 TSTLASTOBJ = $(LASTOBJ) … … 348 313 349 314 # 350 # Generate calltaba.asm351 #352 ldr\calltaba.asm \353 $(WIN32KBASE)\ldr\calltaba.asm : dev16\probkrnl.c $(WIN32KBIN)\mkcalltab.exe354 $(WIN32KBIN)\mkcalltab.exe calltab > $@355 356 357 #358 # Generate TstFakers.c359 #360 test\TstFakers.c \361 $(WIN32KBASE)\test\TstFakers.c: dev16\probkrnl.c include\probkrnl.h $(WIN32KBIN)\mkcalltab.exe362 $(WIN32KBIN)\mkcalltab.exe tstfakers > $@363 364 365 #366 315 # Make assembly version of options.h; options.inc 367 316 # … … 395 344 # Make the convert tool. 396 345 # 397 $(WIN32KBIN)\libconv.exe: libconv.c 398 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj libconv.c 399 400 401 # 402 # Make the MkCallTab.exe utillity. 403 # 404 405 # MkCallTab objects. 406 MKCALLTABOBJS = \ 407 $(WIN32KOBJ)\mkcalltab.obj_c \ 408 $(WIN32KOBJ)\probkrnl.obj_c \ 409 $(WIN32KOBJ)\d16globl.obj_c \ 410 $(WIN32KOBJ)\vprntf16.obj_c 411 412 # Rule to build MkCallTab.exe 413 mkcalltab.exe mkcalltab: $(WIN32KBIN)\mkcalltab.exe 414 $(WIN32KBIN)\mkcalltab.exe: clfix.exe $(MKCALLTABOBJS) 415 $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk 416 /OUT:$@ 417 /MAP:$(WIN32KBIN)\$(@B).map 418 $(MKCALLTABOBJS) 419 $(TOOLKIT)\lib\os2286.lib 420 $(MSCPATH)\lib\clibcep.lib 421 <<keep 422 423 # Interference rule to make the MkCallTab objects. 424 {dev16}.c.obj_c: 425 @$(ECHO) compiling 16bit (mkcalltab): $< 426 @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \ 427 -Fa$(WIN32KLIST)\$(*B)_c.s -Fo$(WIN32KOBJ)\$(@B).obj_c $(CINCLUDES16) $< 346 $(WIN32KBIN)\libconv.exe: kKrnlLib\tools\libconv.c 347 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $** 428 348 429 349 … … 433 353 # MSC v6.0a compiler (cl.exe) (16-bit). 434 354 # 435 clfix.exe: clfix.c 436 $(CC) $(@B).c 437 438 439 # 440 # Make the symbol extract utillity - Extract.exe 441 # 442 443 # Extract object files. 444 EXTRACTOBJS = \ 445 $(WIN32KOBJ)\extract.obj_e \ 446 $(WIN32KOBJ)\probkrnl.obj_e \ 447 $(WIN32KOBJ)\d16globl.obj_e \ 448 $(WIN32KOBJ)\vprntf16.obj_e 449 450 # Rules to build Extract.exe. 451 $(WIN32KBIN)\extract.exe: clfix.exe $(EXTRACTOBJS) 452 $(LD) $(LFLAGS) /pmtype:vio @<<$(WIN32KOBJ)\$(@B).lnk 453 /OUT:$@ 454 /MAP:$(WIN32KBIN)\$(@B).map 455 $(EXTRACTOBJS) 456 $(TOOLKIT)\lib\os2286.lib 457 $(MSCPATH)\lib\clibcep.lib 458 <<keep 459 460 # Copy rule. 461 extract.exe: $(WIN32KBIN)\extract.exe 462 $(CP) $** $@ 463 464 # Interference rule to make the Extract objects. 465 {dev16}.c.obj_e: 466 @$(ECHO) compiling 16bit (extract): $< 467 @$(CC16) -c -W3 -Asfw -G2s -Zp -Zl -nologo -Fa -Zi -Od -Lp -DDEBUG -DEXTRACT \ 468 -Fa$(WIN32KLIST)\$(*B)_e.s -Fo$(WIN32KOBJ)\$(@B).obj_e $(CINCLUDES16) $< 469 470 355 $(WIN32KBIN)\clfix.exe: kKrnlLib\tools\clfix.c 356 icc -Q+ -Ti+ -Fe$@ -Fo$(WIN32KOBJ)\$(*B).obj $** 471 357 472 358 -
branches/splittup/src/win32k/win32k.tools.mk
r5944 r6841 1 # $Id: win32k.tools.mk,v 1.10 2001-06-10 01:38:09bird Exp $1 # $Id: win32k.tools.mk,v 1.10.2.1 2001-09-27 03:08:08 bird Exp $ 2 2 3 3 # … … 30 30 # IBM VisualAge for C++ v3.08 or IBM C/C++ Tools v3.6.5 31 31 # 32 CC16 = clfix.exe $(MSCPATH)\binp\cl.exe32 CC16 = $(WIN32KBIN)\clfix.exe $(MSCPATH)\binp\cl.exe 33 33 CC = icc 34 34 CCPP = icc … … 89 89 # 90 90 !ifdef DEBUG 91 CDEFINES = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DDEBUG 92 CDEFINES16 = -DRING0 -DDEBUG 93 ADEFINES = -D:WIN32K -D:DEBUG 94 !else 95 CDEFINES = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DRELEASE 96 CDEFINES16 = -DRING0 -DRELEASE 97 ADEFINES = -D:WIN32K -D:RELEASE 91 CDEFINES = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DDEBUG $(CDEFINESEXTRA) 92 CDEFINES16 = -DRING0 -DDEBUG $(CDEFINESEXTRA16) 93 ADEFINES = -D:WIN32K -D:DEBUG $(ADEFINESEXTRA) 94 !else 95 CDEFINES = -DWIN32K -DRING0 -D__WIN32OS2__ -D__WINE__ -DRELEASE $(CDEFINESEXTRA) 96 CDEFINES16 = -DRING0 -DRELEASE $(CDEFINESEXTRA16) 97 ADEFINES = -D:WIN32K -D:RELEASE $(ADEFINESEXTRA) 98 98 !endif 99 99 … … 106 106 # 107 107 CINCLUDES = -I$(WIN32KINCLUDE) \ 108 -I$(KKRNLLIBINCLUDE) \ 108 109 -I$(TOOLKIT)\h \ 109 110 -I$(VACPATH)\include \ … … 115 116 116 117 CINCLUDES16= -I$(WIN32KINCLUDE) \ 118 -I$(KKRNLLIBINCLUDE) \ 117 119 -I. \ 118 120 -I$(DDKPATH)\h \ … … 122 124 123 125 AINCLUDES = -Fdi:$(WIN32KINCLUDE) \ 126 -Fdi:$(KKRNLLIBINCLUDE) \ 124 127 -Fdi:$(DDKPATH)\inc 125 128 … … 321 324 322 325 326 {Krnl}.asm{$(WIN32KOBJ)}.obj: 327 @$(ECHO) assembling Krnl: $(SOURCEFILE) 328 @$(ASMCOMPILE) 329 {Krnl}.asm.obj: 330 @$(ECHO) assembling Krnl: $(SOURCEFILE) 331 @$(ASMCOMPILE) 332 333 {Krnl}.c{$(WIN32KOBJ)}.obj: 334 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 335 @$(CCOMPILE) 336 {Krnl}.c.obj: 337 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 338 @$(CCOMPILE) 339 340 {Krnl}.c{$(WIN32KOBJ)}.obj_tst: 341 @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE) 342 @$(CCOMPILE_TST) 343 @$(CP) $@ $@.obj 344 {Krnl}.c.obj_tst: 345 @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE) 346 @$(CCOMPILE_TST) 347 @$(CP) $@ $@.obj 348 349 {Krnl}.cpp{$(WIN32KOBJ)}.obj: 350 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 351 @$(CCOMPILE) 352 {Krnl}.cpp.obj: 353 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 354 @$(CCOMPILE) 355 356 357 {clib}.asm{$(WIN32KOBJ)}.obj: 358 @$(ECHO) assembling Krnl: $(SOURCEFILE) 359 @$(ASMCOMPILE) 360 {clib}.asm.obj: 361 @$(ECHO) assembling Krnl: $(SOURCEFILE) 362 @$(ASMCOMPILE) 363 364 {clib}.c{$(WIN32KOBJ)}.obj: 365 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 366 @$(CCOMPILE) 367 {clib}.c.obj: 368 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 369 @$(CCOMPILE) 370 371 {clib}.c{$(WIN32KOBJ)}.obj_tst: 372 @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE) 373 @$(CCOMPILE_TST) 374 @$(CP) $@ $@.obj 375 {clib}.c.obj_tst: 376 @$(ECHO) compiling 32bit Krnl tst: $(SOURCEFILE) 377 @$(CCOMPILE_TST) 378 @$(CP) $@ $@.obj 379 380 {clib}.cpp{$(WIN32KOBJ)}.obj: 381 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 382 @$(CCOMPILE) 383 {clib}.cpp.obj: 384 @$(ECHO) compiling 32bit Krnl: $(SOURCEFILE) 385 @$(CCOMPILE) 386 387 388 389 323 390 {pe2lx}.c{$(WIN32KOBJ)}.obj: 324 391 @$(ECHO) compiling 32bit pe2lx: $(SOURCEFILE) … … 358 425 359 426 427 428 {testcase}.asm{$(WIN32KOBJ)}.obj: 429 @$(ECHO) assembling testcase: $(SOURCEFILE) 430 @$(ASMCOMPILE_TST) 431 {testcase}.asm.obj: 432 @$(ECHO) assembling testcase: $(SOURCEFILE) 433 @$(ASMCOMPILE_TST) 434 435 {testcase}.c{$(WIN32KOBJ)}.obj: 436 @$(ECHO) compiling 32bit testcase: $(SOURCEFILE) 437 @$(CCOMPILE_TST_TEST) 438 {testcase}.c.obj: 439 @$(ECHO) compiling 32bit testcase: $(SOURCEFILE) 440 @$(CCOMPILE_TST_TEST) 441 442 {testcase}.cpp{$(WIN32KOBJ)}.obj: 443 @$(ECHO) compiling 32bit testcase: $(SOURCEFILE) 444 @$(CPPCOMPILE_TST_TEST) 445 {testcase}.cpp.obj: 446 @$(ECHO) compiling 32bit testcase: $(SOURCEFILE) 447 @$(CPPCOMPILE_TST_TEST) 448 -
branches/splittup/src/win32k/win32k.vpj
r5247 r6841 1 1 [COMPILER] 2 2 MACRO=odin32_setcurrentdir();\nodin32_maketagfile();\n 3 FILTEREXPANSION= 0 1 0 0 0 0 0 0 0 0 0 1 1 04 compile=concur|capture|clear|:Compile:&Compile,nmake -f win32k.mak.\bin\debug\%n.obj3 FILTEREXPANSION=1 1 0 0 1 4 compile=concur|capture|clear|:Compile:&Compile,nmake .\bin\debug\%n.obj 5 5 make=concur|capture|clear|:Build:&Build,nmake 6 6 rebuild=concur|capture|clear|:Rebuild:&Rebuild,nmake -a … … 10 10 user2=hide|:User 2:User 2, 11 11 usertool_resource_editor=hide|:Resource Editor:Resource Editor,dlgedit 12 workingdir= ..\..\src\win32k13 includedirs= include;..\..\include;..\..\include\win;%(INCLUDE)12 workingdir=G:\ODIN32\TREE\src\win32k 13 includedirs=G:\ODIN32\TREE\src\win32k\include;G:\ODIN32\TREE\src\win32k\kKrnlLib\include;F:\toolkit\h;f:\ibmcpp\include;F:\ddk\base\h;F:\ddk\base\src\dev\dasd\diskh;.;G:\ODIN32\TREE\include;G:\ODIN32\TREE\include\win;%(INCLUDE) 14 14 tagfiles= 15 15 reffile= 16 FILTERNAME=Dev16\nDev32\nLoader\nPe2Lx\nElf2Lx\nRexx\nMisc\nKernelStuff\nTest\nDef Files\nMakefiles\nLibrary\nk32\nOther Files\n17 FILTERPATTERN=d16*;prob*;symdb*;vprintf16*;dev16*;omf*;sym*\nd32*;dev*;calltab*\nldr*;my*;ModuleBase*\npe*;ModuleBas*\nElf*;ModuleBase*\nkRx*;ModuleBase*\nmalloc*;smallo*;rmall*;heap*;new*;vpr*;spr*;vspr*;yield*;str*;macros*;cout*;buffer*;avl*;asmutil*;log*;env*;option*;type*\nOS2K*;calltab*;probe*;d32ini*\ndh.asm;dos*;fake*;init.asm;win32ktst*;test*\n*.def\nmakefile*;*.mak;Check*;configure*\nlib*;win32k.h\nk32*\n*.*\n18 FILTERAPPCOMMAND=\n\n\n\n\n\n\n\n\n\n\n\n\n\n19 FILTERASSOCIATEFILETYPES=0 0 0 0 0 0 0 0 0 0 0 0 0 020 16 [FILES] 21 17 calltrees.txt 22 18 Check.cmd 23 19 Check.mk 24 clfix.c25 20 configure.cmd 26 dump27 fastdep.c28 21 history.txt 29 libconv.c30 22 makedesc.cmd 31 Makefile23 makefile 32 24 Makefile.inc 33 25 win32k.def … … 35 27 win32k.tools.mk 36 28 win32k.txt 37 Win32knew.def38 29 win32ktst.def 39 ..\..\include\win32k.h 30 Xx2Lx.def 31 Xx2Lx.mak 40 32 api\api.cpp 41 33 api\myVR32AllocMem.asm … … 43 35 dev16\d16init.c 44 36 dev16\d16strat.c 45 dev16\extract.c46 dev16\mkcalltab.c47 dev16\probkrnl.c48 dev16\SymDB.c49 37 dev16\vprntf16.c 38 dev32\d32CallGate.asm 50 39 dev32\d32ElfIOCtl.c 40 dev32\d32Events.asm 51 41 dev32\d32globals.c 52 42 dev32\d32hlp.asm 53 43 dev32\d32init.c 54 44 dev32\d32Win32kIOCtl.c 45 dev32\d32Win32kOpenClose.c 55 46 dev32\devfirst.asm 56 47 dev32\devlast.asm 57 48 elf2lx\elf2lx.cpp 49 elf2lx\elf2lx.def 58 50 elf2lx\elf2lxmain.cpp 59 51 elf2lx\elfdumper.cpp 60 52 elf2lx\makefile 61 k32\k32QuerySystemMemInfo.cpp62 test\AllocMem.c63 test\AllocMem.def64 test\AllocMem.mak65 test\invokelongexename.c66 test\longexecutablename..c67 test\longexecutablename..def68 test\longexecutablename.c69 test\longexecutablename.def70 test\longexecutablename.drv.c71 test\longexecutablename.drv.def72 test\makefile73 test\MemInfoTest.c74 test\MemInfoTest.def75 test\MemInfoTest.mak76 53 include\api.h 54 include\api.inc 77 55 include\asmutils.h 78 include\avl.h79 include\cout.h80 56 include\dev16.h 81 57 include\dev1632.h … … 83 59 include\dev32hlp.h 84 60 include\devSegDf.h 85 include\dev segdf.inc61 include\devSegDf.inc 86 62 include\elf.h 87 63 include\elf2lx.h 88 include\env.h89 include\errors.h90 64 include\k32.h 91 65 include\ldr.h 92 66 include\locks.h 93 include\log.h94 include\macros.h95 include\malloc.h96 67 include\ModuleBase.h 97 68 include\myExecPgm.h 98 include\new.h99 69 include\omf.h 100 70 include\options.h 101 71 include\options.inc 102 include\OS2KIO.h103 include\OS2KLDR.h104 include\OS2KPG.h105 include\OS2KPTDA.h106 include\OS2Krnl.h107 include\OS2Krnl.inc108 include\OS2KSEC.h109 include\OS2KSEM.h110 include\OS2KSM.h111 include\OS2KTCB.h112 include\OS2KTK.h113 include\OS2KVM.h114 72 include\pe2lx.h 115 include\probkrnl.h 116 include\ptda.h 117 include\rmalloc.h 118 include\smalloc.h 119 include\sprintf.h 120 include\sym.h 73 include\PerTaskW32kData.h 121 74 include\test.h 122 include\types.h123 include\vprintf.h124 75 include\vprntf16.h 125 include\ yield.h76 include\win32k.inc 126 77 k32\k32AllocMemEx.cpp 78 k32\k32HandleSystemEvent.cpp 79 k32\k32KillProcessEx.cpp 127 80 k32\k32ProcessReadWrite.cpp 81 k32\k32QueryCallGate.cpp 128 82 k32\k32QueryOptionsStatus.cpp 129 83 k32\k32QueryOTEs.cpp 84 k32\k32QuerySystemMemInfo.cpp 85 k32\k32SendSystemEvent.cpp 86 k32\k32SetEnvironment.cpp 130 87 k32\k32SetOptions.cpp 88 kKrnlLib\clib\abort.c 89 kKrnlLib\clib\asmutils.asm 90 kKrnlLib\clib\kAssert.c 91 kKrnlLib\clib\kAVLBase.c.h 92 kKrnlLib\clib\kAVLDoWithAll.c.h 93 kKrnlLib\clib\kAVLEnum.c.h 94 kKrnlLib\clib\kAVLGet.c.h 95 kKrnlLib\clib\kAVLGet2.c.h 96 kKrnlLib\clib\kAVLGetBestFit.c.h 97 kKrnlLib\clib\kAVLGetWithAdjacentNodes.c.h 98 kKrnlLib\clib\kAVLGetWithParent.c.h 99 kKrnlLib\clib\kAVLPV.c 100 kKrnlLib\clib\kAVLRemove2.c.h 101 kKrnlLib\clib\kAVLRemoveBestFit.c.h 102 kKrnlLib\clib\kAVLStr.c 103 kKrnlLib\clib\kAVLStrI.c 104 kKrnlLib\clib\kAVLULM.c 105 kKrnlLib\clib\malloc.c 106 kKrnlLib\clib\new.cpp 107 kKrnlLib\clib\rmalloc.c 108 kKrnlLib\clib\smalloc.c 109 kKrnlLib\clib\stricmp.c 110 kKrnlLib\clib\vprintf.c 111 kKrnlLib\clib\vsprintf.c 112 kKrnlLib\dev32\Extract32.c 113 kKrnlLib\include\dev16.h 114 kKrnlLib\include\dev1632.h 115 kKrnlLib\include\dev32.h 116 kKrnlLib\include\dev32hlp.h 117 kKrnlLib\include\devSegDf.h 118 kKrnlLib\include\devSegDf.inc 119 kKrnlLib\include\env.h 120 kKrnlLib\include\kAssert.h 121 kKrnlLib\include\kAVL.h 122 kKrnlLib\include\kKLasmutils.h 123 kKrnlLib\include\kKLavl.h 124 kKrnlLib\include\kKLFunc.h 125 kKrnlLib\include\kKLInitHlp.h 126 kKrnlLib\include\kKLlog.h 127 kKrnlLib\include\kKLmalloc.h 128 kKrnlLib\include\kKLnew.h 129 kKrnlLib\include\kKLprintf.h 130 kKrnlLib\include\kKLrmalloc.h 131 kKrnlLib\include\kKLsmalloc.h 132 kKrnlLib\include\kKLsprintf.h 133 kKrnlLib\include\kKrnlLib.h 134 kKrnlLib\include\krnlPrivate.h 135 kKrnlLib\include\kTypes.h 136 kKrnlLib\include\omf.h 137 kKrnlLib\include\options.h 138 kKrnlLib\include\options.inc 139 kKrnlLib\include\OS2KIO.h 140 kKrnlLib\include\OS2KLDR.h 141 kKrnlLib\include\OS2KOwn.h 142 kKrnlLib\include\OS2KPG.h 143 kKrnlLib\include\OS2KPTDA.h 144 kKrnlLib\include\OS2Krnl.h 145 kKrnlLib\include\OS2KSEC.h 146 kKrnlLib\include\OS2KSEL.h 147 kKrnlLib\include\OS2KSEM.h 148 kKrnlLib\include\OS2KSM.h 149 kKrnlLib\include\OS2KTCB.h 150 kKrnlLib\include\OS2KTK.h 151 kKrnlLib\include\OS2KVM.h 152 kKrnlLib\include\ProbKrnl.h 153 kKrnlLib\include\ProbKrnlErrors.h 154 kKrnlLib\include\sym.h 155 kKrnlLib\include\testcase.h 156 kKrnlLib\include\vprntf16.h 157 kKrnlLib\krnl\env.c 158 kKrnlLib\krnl\krnlInit.c 159 kKrnlLib\krnl\krnlLockedWrite.asm 160 kKrnlLib\krnl\krnlOverloading.c 161 kKrnlLib\krnl\krnlPrologs.c 162 kKrnlLib\krnl\krnlStubs.c 163 kKrnlLib\krnl\OS2KPTDA.c 164 kKrnlLib\krnl\OS2KTCB.c 165 kKrnlLib\testcase\DH.asm 166 kKrnlLib\testcase\Dos.c 167 kKrnlLib\testcase\DosA.asm 168 kKrnlLib\testcase\Fake.c 169 kKrnlLib\testcase\FakeA.asm 170 kKrnlLib\testcase\Init.asm 171 kKrnlLib\testcase\kKrnlLibTst.c 172 kKrnlLib\testcase\TstFakers.c 173 kKrnlLib\tools\clfix.c 174 kKrnlLib\tools\libconv.c 175 ldr\calltaba.asm 131 176 ldr\ldr.cpp 132 177 ldr\ModuleBase.cpp … … 136 181 ldr\myldrFindModule.cpp 137 182 ldr\myldrGetFileName.asm 183 ldr\myLDRGetProcAddr.cpp 138 184 ldr\myldrOpen.cpp 139 185 ldr\myldrOpenPath.cpp … … 142 188 ldr\myldrRead.cpp 143 189 ldr\myldrSetVMflags.cpp 190 ldr\myldrWasLoadModuled.cpp 144 191 ldr\mytkExecPgm.asm 145 192 ldr\mytkStartProcess.asm 146 193 ldr\myVMAllocMem.cpp 194 ldr\xx2lxmain.cpp 195 lib\libCallThruCallGate.asm 147 196 lib\libDosAllocMemEx.c 197 lib\libDosKillProcessEx.c 148 198 lib\libGetCS.asm 149 199 lib\libInit.c 200 lib\libPrivate.h 150 201 lib\libTerm.c 151 202 lib\libTest.c 203 lib\libW32kHandleSystemEvent.c 152 204 lib\libW32kProcessReadWrite.c 153 205 lib\libW32kQueryOTEs.c 206 lib\libW32kQuerySystemMemInfo.c 154 207 lib\libWin32kInstalled.c 155 208 lib\libWin32kQueryOptionsStatus.c 209 lib\libWin32kSetEnvironment.c 156 210 lib\libWin32kSetOptions.c 157 211 lib\makefile … … 171 225 misc\OS2KPTDA.c 172 226 misc\OS2KTCB.c 227 misc\PerTaskW32kData.c 173 228 misc\ptda.c 174 229 misc\rmalloc.c … … 180 235 misc\yield.c 181 236 mmf\mmf.cpp 237 mmf\stderr 238 mmf\stdout 182 239 pe2lx\makefile 183 240 pe2lx\pe2lx.cpp 241 pe2lx\pe2lx.def 184 242 pe2lx\pe2lxmain.cpp 185 243 rexx\kRx.c … … 187 245 rexx\kRxa.asm 188 246 rexx\makefile 247 rexx\tst.asm 189 248 rexx\tst.cmd 249 test\AllocMem.c 250 test\AllocMem.def 251 test\AllocMem.mak 190 252 test\dh.asm 191 253 test\dos.c 192 254 test\dosa.asm 255 test\DosAllocMemEx.c 256 test\DosAllocMemEx.def 257 test\DosAllocMemEx.mak 193 258 test\fake.c 194 259 test\fakea.asm 195 260 test\init.asm 261 test\invokelongexename.c 262 test\longexecutablename 263 test\longexecutablename..c 264 test\longexecutablename..def 265 test\longexecutablename.c 266 test\longexecutablename.def 267 test\longexecutablename.drv.c 268 test\longexecutablename.drv.def 269 test\makefile 270 test\MemInfoTest.c 271 test\MemInfoTest.def 272 test\MemInfoTest.mak 273 test\ole 274 test\PrfTstProcess.c 275 test\PrfTstProcess.def 276 test\PrfTstProcess.mak 196 277 test\TestKernels.cmd 278 test\tst3 197 279 test\TstProcessReadWrite.c 198 280 test\win32ktst.c 281 test\Zombie.c 282 test\Zombie.def 283 test\Zombie.mak 284 test\test\64alloc.c 285 utils\Dialog.h 199 286 utils\makefile 200 287 utils\Win32kCC.c 288 utils\Win32kCC.def 201 289 utils\Win32kCC.dlg 202 290 utils\Win32kCC.h 203 291 utils\Win32kCC.rc 292 utils\test\Dialog.h 293 utils\test\Win32kCC.c 294 utils\test\WIN32KCC.dlg 204 295 [ASSOCIATION] 205 296 [STATE] 206 SCREEN: 1 600 1200 -250 255 1244 800 0 0 M 0 0 0 0 1247 855207 CWD: G:\odin32\tree\src\win32k 297 SCREEN: 1792 1344 5 2 1194 1330 0 0 N 0 0 0 0 927 950 298 CWD: G:\odin32\tree\src\win32k\kKrnlLib 208 299 BUFFER: BN="F:\VSLICK40\OS2\vrestore.slk" 209 300 BI: 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 301 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=21 HT=0 HN=0 HF=0 HC=4 302 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32ElfIOCtl.c" 303 BI: MA=1 74 1 TABS=1 9 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 304 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=26 HT=0 HN=0 HF=0 HC=4 305 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm" 306 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly HM=0 MF=0 307 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=25 HT=0 HN=0 HF=0 HC=4 308 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32globals.c" 309 BI: MA=1 74 1 TABS=1 9 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 210 310 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=24 HT=0 HN=0 HF=0 HC=4 211 BUFFER: BN="G:\odin32\tree\src\win32k\dev32\d32Events.asm" 212 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly HM=0 MF=864 213 VIEW: LN=.4055 CL=36 LE=0 CX=35 CY=21 WI=5 BI=17 HT=0 HN=0 HF=0 HC=4 214 BUFFER: BN="G:\odin32\tree\src\win32k\win32k.mak" 215 BI: 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= HM=0 MF=512 216 VIEW: LN=.3660 CL=5 LE=0 CX=4 CY=21 WI=5 BI=23 HT=0 HN=0 HF=0 HC=4 217 WINDOW: 52 54 841 577 -1 -1 M WF=0 WT=2 "System Monospaced,10,0,1" 218 BUFFER: BN="G:\odin32\tree\src\win32k\dev32\d32Events.asm" 219 VIEW: LN=.4055 CL=36 LE=0 CX=35 CY=21 WI=83 BI=17 HT=0 HN=0 HF=0 HC=4 220 WINDOW: 0 0 841 577 -1 -1 M WF=0 WT=1 "System Monospaced,10,0,1" 221 BUFFER: BN="G:\odin32\tree\src\win32k\win32k.mak" 222 VIEW: LN=.3659 CL=4 LE=0 CX=3 CY=21 WI=85 BI=23 HT=0 HN=0 HF=0 HC=4 311 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm" 312 BI: MA=1 74 1 TABS=1 5 WWS=1 IWT=0 ST=0 IN=1 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN=Assembly HM=0 MF=0 313 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=5 BI=4 HT=0 HN=0 HF=0 HC=4 314 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32init.c" 315 BI: MA=1 74 1 TABS=1 9 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=608 316 VIEW: LN=.934 CL=21 LE=0 CX=20 CY=27 WI=5 BI=27 HT=0 HN=0 HF=0 HC=4 317 WINDOW: 260 270 625 641 -1 -1 M WF=0 WT=1 "System Monospaced,10,0,1" 318 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32ElfIOCtl.c" 319 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=84 BI=26 HT=0 HN=0 HF=0 HC=4 320 WINDOW: 286 297 625 641 -1 -1 M WF=0 WT=3 "System Monospaced,10,0,1" 321 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm" 322 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=83 BI=25 HT=0 HN=0 HF=0 HC=4 323 WINDOW: 0 0 625 641 -1 -1 M WF=0 WT=4 "System Monospaced,10,0,1" 324 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32globals.c" 325 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=134 BI=24 HT=0 HN=0 HF=0 HC=4 326 WINDOW: 26 27 625 641 -1 -1 M WF=0 WT=5 "System Monospaced,10,0,1" 327 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm" 328 VIEW: LN=.0 CL=1 LE=0 CX=0 CY=1 WI=102 BI=4 HT=0 HN=0 HF=0 HC=4 329 WINDOW: 52 54 625 641 -1 -1 M WF=0 WT=6 "System Monospaced,10,0,1" 330 BUFFER: BN="G:\ODIN32\TREE\src\win32k\dev32\d32init.c" 331 VIEW: LN=.934 CL=21 LE=0 CX=20 CY=27 WI=96 BI=27 HT=0 HN=0 HF=0 HC=4 223 332 FILEHIST: 9 224 G:\ odin32\tree\src\win32k\dev32\d32CallGate.asm225 G:\ odin32\tree\src\win32k\include\k32.h226 G:\ odin32\tree\src\win32k\k32\k32HandleSystemEvent.cpp227 G:\ odin32\tree\src\win32k\ldr\myldrGetFileName.asm228 G:\ odin32\tree\src\win32k\ldr\myldrOpenPatha.asm229 G:\ odin32\tree\src\win32k\ldr\mytkExecPgm.asm230 G:\ odin32\tree\src\win32k\ldr\mytkStartProcess.asm231 G:\ odin32\tree\src\win32k\ldr\calltaba.asm232 G:\odin32\tree\src\win32k\ win32k.mak333 G:\ODIN32\TREE\src\win32k\dev32\d32Events.asm 334 G:\ODIN32\TREE\src\win32k\dev32\d32globals.c 335 G:\ODIN32\TREE\src\win32k\dev32\d32hlp.asm 336 G:\ODIN32\TREE\src\win32k\dev32\d32init.c 337 G:\ODIN32\TREE\src\win32k\dev32\d32Win32kIOCtl.c 338 G:\ODIN32\TREE\src\win32k\dev32\d32Win32kOpenClose.c 339 G:\ODIN32\TREE\src\win32k\dev32\devfirst.asm 340 G:\ODIN32\TREE\src\win32k\dev32\devlast.asm 341 G:\odin32\tree\src\win32k\kKrnlLib\dev32\d32init.c 233 342 PRINTER: 2 234 PRINTER: 2 235 Printer1,343 344 ,
Note:
See TracChangeset
for help on using the changeset viewer.
