- Timestamp:
- Feb 21, 2000, 3:53:39 PM (26 years ago)
- Location:
- trunk/src/win32k
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev16/probkrnl.c
r2838 r2848 1 /* $Id: probkrnl.c,v 1.1 4 2000-02-21 09:24:00bird Exp $1 /* $Id: probkrnl.c,v 1.15 2000-02-21 14:53:38 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 104 104 {FALSE, -1, 11, "_VMAllocMem", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 11 */ 105 105 {FALSE, -1, 11, "_VMGetOwner", -1, -1, -1, -1, EPT_PROCIMPORT32}, /* 12 */ 106 {FALSE, -1, 11, "g_tkExecPgm", -1, -1, -1, -1, EPT_PROC IMPORT32}, /* 13 */ /* currently disabled! */106 {FALSE, -1, 11, "g_tkExecPgm", -1, -1, -1, -1, EPT_PROC32}, /* 13 */ /* currently disabled! */ 107 107 {FALSE, -1, 11, "f_FuStrLenZ", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 14 */ 108 108 {FALSE, -1, 10, "f_FuStrLen", -1, -1, -1, -1, EPT_PROCIMPORT16}, /* 14 */ -
trunk/src/win32k/include/options.h
r2836 r2848 1 /* $Id: options.h,v 1. 7 2000-02-21 04:45:47bird Exp $1 /* $Id: options.h,v 1.8 2000-02-21 14:53:39 bird Exp $ 2 2 * 3 3 * Options. … … 44 44 o.usCom = OUTPUT_COM2; \ 45 45 o.fLogging = FALSE; \ 46 // o.fLogging = TRUE; \47 46 o.fKernel = KF_UNI; \ 48 47 o.ulBuild = ~0UL; \ … … 52 51 o.ulInfoLevel = INFOLEVEL_QUIET; \ 53 52 o.fElf = FALSE; \ 54 o.fScript = FALSE;\53 o.fScript = TRUE; \ 55 54 o.fNoLoader = FALSE; \ 56 55 o.cbSwpHeapInit = CB_SWP_INIT; \ -
trunk/src/win32k/ldr/calltab.asm
r2838 r2848 1 ; $Id: calltab.asm,v 1.1 0 2000-02-21 09:24:01bird Exp $1 ; $Id: calltab.asm,v 1.11 2000-02-21 14:53:39 bird Exp $ 2 2 ; 3 3 ; callTab - Call back again table - table with entry for each function which is overrided. … … 34 34 public _VMAllocMem@36 35 35 public _VMGetOwner@8 36 public g_tkExecPgm37 public f_FuStrLenZ38 public f_FuBuff36 public _g_tkExecPgm 37 public _f_FuStrLenZ 38 public _f_FuBuff 39 39 40 40 … … 110 110 _VMGetOwner@8 ENDP 111 111 112 g_tkExecPgm PROC NEAR112 _g_tkExecPgm PROC NEAR 113 113 db MAXSIZE_PROLOG dup(0cch) 114 g_tkExecPgm ENDP114 _g_tkExecPgm ENDP 115 115 116 116 117 f_FuStrLenZ PROC FAR117 _f_FuStrLenZ PROC FAR 118 118 db MAXSIZE_PROLOG dup(0cch) 119 f_FuStrLenZ ENDP119 _f_FuStrLenZ ENDP 120 120 121 f_FuStrLen PROC FAR121 _f_FuStrLen PROC FAR 122 122 db MAXSIZE_PROLOG dup(0cch) 123 f_FuStrLen ENDP123 _f_FuStrLen ENDP 124 124 125 f_FuBuff PROC FAR125 _f_FuBuff PROC FAR 126 126 db MAXSIZE_PROLOG dup(0cch) 127 f_FuBuff ENDP127 _f_FuBuff ENDP 128 128 129 129 CALLTAB ENDS -
trunk/src/win32k/ldr/mytkExecPgm.asm
r2839 r2848 1 ; $Id: mytkExecPgm.asm,v 1. 6 2000-02-21 09:35:45bird Exp $1 ; $Id: mytkExecPgm.asm,v 1.7 2000-02-21 14:53:39 bird Exp $ 2 2 ; 3 3 ; mytkExecPgm - tkExecPgm overload … … 17 17 ; Imported Functions 18 18 ; 19 DATA32 SEGMENT 20 extrn g_tkExecPgm:PROC 21 DATA32 ENDS 19 extrn _g_tkExecPgm:PROC 22 20 extrn AcquireBuffer:PROC 23 21 extrn ReleaseBuffer:PROC … … 29 27 ; return: cx size - CF clear 30 28 ; ax error- CF set 31 extrn f_FuStrLenZ:PROC29 extrn _f_FuStrLenZ:PROC 32 30 33 31 ; Stringlength … … 36 34 ; return: cx size - CF clear 37 35 ; ax error- CF set 38 extrn f_FuStrLen:PROC36 extrn _f_FuStrLen:PROC 39 37 40 38 ;memcpy … … 42 40 ; es:di pointer to target 43 41 ; cx count of bytes to copy 44 ;uses: nearly all (save bp) 42 ;uses: nearly all (save bp), es, ds 45 43 ;return: success CF clear 46 44 ; failure CF set 47 extrn f_FuBuff:PROC45 extrn _f_FuBuff:PROC 48 46 49 47 ; … … 51 49 ; 52 50 public mytkExecPgm 53 public pszFilename 54 public pszArguments 55 56 57 DATA32 SEGMENT 58 pszFilename dd 0 ; Pointer to the filename (in the buffer) 59 pszArguments dd 0 ; Pointer to the arguments (int the buffer) 60 DATA32 ENDS 51 61 52 62 53 … … 85 76 mytkExecPgm PROC FAR 86 77 pBuffer = dword ptr -04h 87 ;SegBuffer = word ptr (dword ptr -08h)88 78 SegBuffer = -08h 89 ;OffBuffer = word ptr (dword ptr -0Ch)90 79 OffBuffer = -0Ch 91 80 cchFilename = dword ptr -10h 92 81 cchArgs = dword ptr -14h 82 ;usExecFlag = -18h 83 ;SegFilename = -1ch 84 ;OffFilename = -1eh 85 ;SegEnv = -20h 86 ;OffEnv = -22h 87 ;SegArg = -24h 88 ;OffArg = -26h 89 93 90 ASSUME CS:CODE32, DS:NOTHING, SS:NOTHING 91 int 3 94 92 push ebp 95 93 mov ebp, esp … … 113 111 mov es, ax 114 112 pushad 113 push es 114 push ds 115 115 mov bx, ds 116 116 mov di, dx ; es:di is now filename address (ds:dx). 117 117 push cs ; Problem calling far into the calltab segement. 118 call near ptr FLAT: f_FuStrLen118 call near ptr FLAT:_f_FuStrLen 119 119 movzx ecx, cx 120 120 mov [ebp+cchFilename], ecx 121 pop ds 122 pop es 121 123 popad 122 124 jc mytkExecPgm_CalltkExecPgm_X1; If the FuStrLen call failed we bail out! … … 125 127 ; if filename length is more that CCHMAXPATH then we don't do anything!. 126 128 ; 127 mov ecx, [ebp+cchFilename] 128 cmp ecx, 260 129 cmp [ebp+cchFilename], 260 129 130 jae mytkExecPgm_CalltkExecPgm_X1; length >= 260 130 131 … … 140 141 141 142 pushad 143 push es 144 push ds 142 145 mov bx, di ; 143 146 mov di, si ; bx:di -> arguments 144 147 push cs ; Problem calling far into the calltab segement. 145 call near ptr FLAT: f_FuStrLenZ148 call near ptr FLAT:_f_FuStrLenZ 146 149 movzx ecx, cx 147 150 mov [ebp+cchArgs], ecx 151 pop ds 152 pop es 148 153 popad 149 154 jc mytkExecPgm_CalltkExecPgm_X1 … … 179 184 ; 180 185 pushad 186 push es 187 push ds 181 188 mov di, ax ; es:di pBuffer 182 189 mov si, dx … … 184 191 mov ecx, [ebp+cchFilename] 185 192 push cs ; Problem calling far into the calltab segement. 186 call near ptr FLAT:f_FuBuff 193 call near ptr FLAT:_f_FuBuff 194 pop ds 195 pop es 187 196 popad 188 197 jc mytkExecPgm_CalltkExecPgm_X2 … … 198 207 jb mytkExecPgm_CalltkExecPgm_2 199 208 pushad 209 push es 210 push ds 200 211 mov ecx, [ebp+cchArgs] 201 mov bx,[ebp+SegBuffer]202 mov ex, bx203 212 mov bx, di ; ds:si -> arguments 204 push cs ; Problem calling far into the calltab segement. 205 call near ptr FLAT:f_FuBuff 213 mov di, ax ; es:di -> buffer + 261 214 push cs ; Problem calling far into the calltab segement. 215 call near ptr FLAT:_f_FuBuff 216 pop ds 217 pop es 206 218 popad 207 219 jc mytkExecPgm_CalltkExecPgm_X2 … … 212 224 213 225 ; 214 ; Set Pointers, pszFilename and pszArguments 215 ; 226 ; Restore variables pushed on the stack 227 ; 228 ; stack: edi, es, ds, ecx, eax 216 229 mytkExecPgm_CalltkExecPgm_3: 217 mov ax, seg FLAT:DATA32218 mov ds, ax219 ASSUME ds:FLAT220 mov eax, ss:[ebp+pBuffer]221 mov pszFilename, eax222 add eax, 261223 mov pszArguments, eax224 225 ;226 ; Restore variables pushed on the stack227 ;228 ; stack: edi, es, ds, ecx, eax229 230 pop edi 230 231 pop es … … 234 235 235 236 ; 236 ; Set new input parameters (call g_tkExecPgm)237 ; Set new input parameters (call _g_tkExecPgm) 237 238 ; 238 239 ; ds:dx is to become SegBuffer:OffBuffer … … 251 252 252 253 ; 253 ; Call g_tkExecPgm254 ; 255 push cs ; Problem calling far into the calltab segement. 256 call near ptr FLAT: g_tkExecPgm254 ; Call _g_tkExecPgm 255 ; 256 push cs ; Problem calling far into the calltab segement. 257 call near ptr FLAT:_g_tkExecPgm 257 258 pushfd 258 259 … … 292 293 293 294 mytkExecPgm_CalltkExecPgm: 294 call far ptr FLAT:g_tkExecPgmStub 295 push cs 296 call near ptr FLAT:_g_tkExecPgm 295 297 leave 296 298 retf … … 298 300 299 301 300 ;;301 ; Stub which jumps to g_tkExecPgmStub.302 ; (This way I will hopefully get the right selector.)303 g_tkExecPgmStub PROC FAR304 jmp near ptr FLAT:g_tkExecPgm305 g_tkExecPgmStub ENDP306 307 302 308 303 CODE32 ENDS 304 305 if 0 ; alternate implementation. 306 mytkExecPgm PROC FAR 307 pBuffer = dword ptr -04h 308 SegBuffer = -08h 309 OffBuffer = -0Ch 310 cchFilename = -10h 311 cchArgs = -14h 312 usExecFlag = -18h 313 SegFilename = -1ch 314 OffFilename = -1eh 315 SegEnv = -20h 316 OffEnv = -22h 317 SegArg = -24h 318 OffArg = -26h 319 320 ASSUME CS:CODE32, DS:NOTHING, SS:NOTHING 321 int 3 322 push ebp 323 mov ebp, esp 324 lea esp, [ebp + OffArg] 325 326 ; save input parameters 327 mov [ebp + usExecFlag], ax 328 mov ax, es 329 mov [ebp + SegEnv], ax 330 mov [ebp + OffEnv], bx 331 mov [ebp + SegArg], di 332 mov [ebp + OffArg], si 333 mov ax, ds 334 mov [ebp + SegFilename], ax 335 mov [ebp + OffFilename], dx 336 337 ; parameter validations 338 cmp ax, 4 ; pointer to filename 339 jb mytkExecPgm_CalltkExecPgm_X1 340 341 ; 342 ; filename length 343 ; 344 mov bx, ax 345 mov di, dx ; bx:di is now filename address 346 push cs ; Problem calling far into the calltab segement. 347 call near ptr FLAT:_f_FuStrLen 348 jc mytkExecPgm_CalltkExecPgm_X1; If the FuStrLen call failed we bail out! 349 350 ; 351 ; if filename length is more that CCHMAXPATH then we don't do anything!. 352 ; 353 cmp cx, 260 354 jae mytkExecPgm_CalltkExecPgm_X1; length >= 260 355 mov [ebp+cchFilename], cx 356 357 ; 358 ; args length 359 ; Note: the arguments are a series of ASCIIZs ended by an empty string (ie. '\0'). 360 ; 361 mov bx, [ebp+SegArg] 362 cmp bx, 4 ; The argument might me an NULL pointer 363 xor cx, cx 364 jb mytkExecPgm_CalltkExecPgm_1 365 366 mov di, [ebp+OffArg] ; bx:di -> arguments 367 push cs ; Problem calling far into the calltab segement. 368 call near ptr FLAT:_f_FuStrLenZ 369 mov [ebp+cchArgs], cx 370 jc mytkExecPgm_CalltkExecPgm_X1 371 372 mytkExecPgm_CalltkExecPgm_1: 373 add cx, [ebp+cchFilename] ; filename length 374 add cx, 3 + 260 ; 260 = new argument from a scrip file or something. 375 ; 3 = two '\0's and a space after added argument. 376 cmp ecx, 1536 ; 1536 = Buffersize. FIXME! Define this!!! 377 jae mytkExecPgm_CalltkExecPgm_X1; jmp if argument + file + new file > buffer size 378 379 ; 380 ; Aquire a buffer 381 ; 382 call AcquireBuffer 383 mov [ebp+pBuffer], eax 384 or eax, eax 385 jz mytkExecPgm_CalltkExecPgm_X1; Failed to get buffer. 386 387 ; 388 ; Get Segment and offset for the buffer 389 ; 390 call QueryBufferSegmentOffset 391 mov cx, es 392 mov [ebp+OffBuffer], ax 393 mov [ebp+SegBuffer], es 394 test eax, 000570000h 395 jnz mytkExecPgm_CalltkExecPgm_X2 396 397 ; 398 ; Copy filename to pBuffer. 399 ; 400 mov di, ax ; es:di pBuffer 401 mov si, dx 402 mov bx, ds ; bx:si Filename pointer (input ds:dx) 403 mov cx, [ebp+cchFilename] ; cx = length of area to copy 404 push cs ; Problem calling far into the calltab segement. 405 call near ptr FLAT:_f_FuBuff 406 jc mytkExecPgm_CalltkExecPgm_X2 407 408 ; 409 ; Copy Args to pBuffer + 261 410 ; 411 mov si, [ebp+SegArg] 412 cmp si, 4 413 jb mytkExecPgm_CalltkExecPgm_2 414 mov ds, si 415 mov si, [ebp+OffArg] ; ds:si -> arguments 416 mov di, [ebp+SegBuffer] 417 mov es, di 418 mov di, [ebp+OffBuffer] 419 add di, 261 ; es:di -> buffer + 261 420 mov cx, [ebp+cchArgs] ; cx = length of area to copy 421 push cs ; Problem calling far into the calltab segement. 422 call near ptr FLAT:_f_FuBuff 423 jc mytkExecPgm_CalltkExecPgm_X2 424 jmp mytkExecPgm_CalltkExecPgm_3 425 426 mytkExecPgm_CalltkExecPgm_2: 427 mov word ptr es:[eax], 0 ; Terminate the empty string! 428 429 ; 430 ; Set new input parameters (call _g_tkExecPgm) 431 ; 432 ; ds:dx is to become SegBuffer:OffBuffer 433 ; di:si is to become SegBuffer:OffBuffer+261 434 ; 435 mytkExecPgm_CalltkExecPgm_3: 436 mov di, [ebp+SegBuffer] 437 mov ds, di 438 mov si, [ebp+OffBuffer] 439 mov dx, si ; ds:dx SegBuffer:OffBuffer 440 add si, 261 ; di:si SegBuffer:OffBuffer+261 441 mov bx, [ebp+SegEnv] 442 mov es, bx 443 mov bx, [ebp+SegEnv] 444 445 ; 446 ; Call _g_tkExecPgm 447 ; 448 push cs ; Problem calling far into the calltab segement. 449 call near ptr FLAT:_g_tkExecPgm 450 pushfd 451 452 ; 453 ; Release buffer 454 ; 455 push eax 456 mov eax, [ebp + pBuffer] 457 call ReleaseBuffer 458 mov [ebp + pBuffer], 0 459 pop eax 460 461 ; 462 ; Return 463 ; 464 push [ebp + SegFilename] 465 pop ds 466 push [ebp + SegEnv] 467 pop es 468 popfd 469 leave 470 retf 471 472 mytkExecPgm_CalltkExecPgm_X2: 473 ; 474 ; Release buffer 475 ; 476 mov eax, [ebp + pBuffer] 477 call ReleaseBuffer 478 mov [ebp + pBuffer], 0 479 480 mytkExecPgm_CalltkExecPgm_X1: 481 pop ds 482 483 mytkExecPgm_CalltkExecPgm: 484 push cs 485 call near ptr FLAT:_g_tkExecPgm 486 leave 487 retf 488 mytkExecPgm ENDP 489 490 CODE32 ENDS 491 endif 492 493 309 494 END 310 495
Note:
See TracChangeset
for help on using the changeset viewer.