Changeset 2848 for trunk/src


Ignore:
Timestamp:
Feb 21, 2000, 3:53:39 PM (26 years ago)
Author:
bird
Message:

Unix styled scripts is working!

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.14 2000-02-21 09:24:00 bird Exp $
     1/* $Id: probkrnl.c,v 1.15 2000-02-21 14:53:38 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    104104    {FALSE, -1, 11, "_VMAllocMem",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 11 */
    105105    {FALSE, -1, 11, "_VMGetOwner",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},  /* 12 */
    106     {FALSE, -1, 11, "g_tkExecPgm",          -1,  -1,  -1,  -1, EPT_PROCIMPORT32},        /* 13 */ /* currently disabled! */
     106    {FALSE, -1, 11, "g_tkExecPgm",          -1,  -1,  -1,  -1, EPT_PROC32},        /* 13 */ /* currently disabled! */
    107107    {FALSE, -1, 11, "f_FuStrLenZ",          -1,  -1,  -1,  -1, EPT_PROCIMPORT16},  /* 14 */
    108108    {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:47 bird Exp $
     1/* $Id: options.h,v 1.8 2000-02-21 14:53:39 bird Exp $
    22 *
    33 * Options.
     
    4444            o.usCom         = OUTPUT_COM2;          \
    4545            o.fLogging      = FALSE;                \
    46 //            o.fLogging      = TRUE;                 \
    4746            o.fKernel       = KF_UNI;               \
    4847            o.ulBuild       = ~0UL;                 \
     
    5251            o.ulInfoLevel   = INFOLEVEL_QUIET;      \
    5352            o.fElf          = FALSE;                \
    54             o.fScript       = FALSE;                \
     53            o.fScript       = TRUE;                 \
    5554            o.fNoLoader     = FALSE;                \
    5655            o.cbSwpHeapInit = CB_SWP_INIT;          \
  • trunk/src/win32k/ldr/calltab.asm

    r2838 r2848  
    1 ; $Id: calltab.asm,v 1.10 2000-02-21 09:24:01 bird Exp $
     1; $Id: calltab.asm,v 1.11 2000-02-21 14:53:39 bird Exp $
    22;
    33; callTab - Call back again table - table with entry for each function which is overrided.
     
    3434    public _VMAllocMem@36
    3535    public _VMGetOwner@8
    36     public g_tkExecPgm
    37     public f_FuStrLenZ
    38     public f_FuBuff
     36    public _g_tkExecPgm
     37    public _f_FuStrLenZ
     38    public _f_FuBuff
    3939
    4040
     
    110110_VMGetOwner@8 ENDP
    111111
    112 g_tkExecPgm PROC NEAR
     112_g_tkExecPgm PROC NEAR
    113113    db MAXSIZE_PROLOG dup(0cch)
    114 g_tkExecPgm ENDP
     114_g_tkExecPgm ENDP
    115115
    116116
    117 f_FuStrLenZ PROC FAR
     117_f_FuStrLenZ PROC FAR
    118118    db MAXSIZE_PROLOG dup(0cch)
    119 f_FuStrLenZ ENDP
     119_f_FuStrLenZ ENDP
    120120
    121 f_FuStrLen PROC FAR
     121_f_FuStrLen PROC FAR
    122122    db MAXSIZE_PROLOG dup(0cch)
    123 f_FuStrLen ENDP
     123_f_FuStrLen ENDP
    124124
    125 f_FuBuff PROC FAR
     125_f_FuBuff PROC FAR
    126126    db MAXSIZE_PROLOG dup(0cch)
    127 f_FuBuff ENDP
     127_f_FuBuff ENDP
    128128
    129129CALLTAB ENDS
  • trunk/src/win32k/ldr/mytkExecPgm.asm

    r2839 r2848  
    1 ; $Id: mytkExecPgm.asm,v 1.6 2000-02-21 09:35:45 bird Exp $
     1; $Id: mytkExecPgm.asm,v 1.7 2000-02-21 14:53:39 bird Exp $
    22;
    33; mytkExecPgm - tkExecPgm overload
     
    1717;   Imported Functions
    1818;
    19 DATA32 SEGMENT
    20     extrn  g_tkExecPgm:PROC
    21 DATA32 ENDS
     19    extrn  _g_tkExecPgm:PROC
    2220    extrn  AcquireBuffer:PROC
    2321    extrn  ReleaseBuffer:PROC
     
    2927    ; return: cx size - CF clear
    3028    ;         ax error- CF set
    31     extrn  f_FuStrLenZ:PROC
     29    extrn  _f_FuStrLenZ:PROC
    3230
    3331    ; Stringlength
     
    3634    ; return: cx size - CF clear
    3735    ;         ax error- CF set
    38     extrn  f_FuStrLen:PROC
     36    extrn  _f_FuStrLen:PROC
    3937
    4038    ;memcpy
     
    4240    ;        es:di pointer to target
    4341    ;        cx    count of bytes to copy
    44     ;uses:   nearly all (save bp)
     42    ;uses:   nearly all (save bp), es, ds
    4543    ;return: success CF clear
    4644    ;        failure CF set
    47     extrn  f_FuBuff:PROC
     45    extrn  _f_FuBuff:PROC
    4846
    4947;
     
    5149;
    5250    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
    6152
    6253
     
    8576mytkExecPgm PROC FAR
    8677pBuffer     = dword ptr -04h
    87 ;SegBuffer   =  word ptr (dword ptr -08h)
    8878SegBuffer   = -08h
    89 ;OffBuffer   =  word ptr (dword ptr -0Ch)
    9079OffBuffer   = -0Ch
    9180cchFilename = dword ptr -10h
    9281cchArgs     = 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
    9390    ASSUME CS:CODE32, DS:NOTHING, SS:NOTHING
     91    int 3
    9492    push    ebp
    9593    mov     ebp, esp
     
    113111    mov     es, ax
    114112    pushad
     113    push    es
     114    push    ds
    115115    mov     bx, ds
    116116    mov     di, dx                      ; es:di is now filename address (ds:dx).
    117117    push    cs                          ; Problem calling far into the calltab segement.
    118     call    near ptr FLAT:f_FuStrLen
     118    call    near ptr FLAT:_f_FuStrLen
    119119    movzx   ecx, cx
    120120    mov     [ebp+cchFilename], ecx
     121    pop     ds
     122    pop     es
    121123    popad
    122124    jc      mytkExecPgm_CalltkExecPgm_X1; If the FuStrLen call failed we bail out!
     
    125127    ; if filename length is more that CCHMAXPATH then we don't do anything!.
    126128    ;
    127     mov     ecx, [ebp+cchFilename]
    128     cmp     ecx, 260
     129    cmp     [ebp+cchFilename], 260
    129130    jae     mytkExecPgm_CalltkExecPgm_X1; length >= 260
    130131
     
    140141
    141142    pushad
     143    push    es
     144    push    ds
    142145    mov     bx, di                      ;
    143146    mov     di, si                      ; bx:di -> arguments
    144147    push    cs                          ; Problem calling far into the calltab segement.
    145     call    near ptr FLAT:f_FuStrLenZ
     148    call    near ptr FLAT:_f_FuStrLenZ
    146149    movzx   ecx, cx
    147150    mov     [ebp+cchArgs], ecx
     151    pop     ds
     152    pop     es
    148153    popad
    149154    jc      mytkExecPgm_CalltkExecPgm_X1
     
    179184    ;
    180185    pushad
     186    push    es
     187    push    ds
    181188    mov     di, ax                      ; es:di  pBuffer
    182189    mov     si, dx
     
    184191    mov     ecx, [ebp+cchFilename]
    185192    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
    187196    popad
    188197    jc      mytkExecPgm_CalltkExecPgm_X2
     
    198207    jb      mytkExecPgm_CalltkExecPgm_2
    199208    pushad
     209    push    es
     210    push    ds
    200211    mov     ecx, [ebp+cchArgs]
    201     mov     bx,[ebp+SegBuffer]
    202     mov     ex, bx
    203212    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
    206218    popad
    207219    jc      mytkExecPgm_CalltkExecPgm_X2
     
    212224
    213225    ;
    214     ; Set Pointers, pszFilename and pszArguments
    215     ;
     226    ; Restore variables pushed on the stack
     227    ;
     228    ; stack: edi, es, ds, ecx, eax
    216229mytkExecPgm_CalltkExecPgm_3:
    217     mov     ax, seg FLAT:DATA32
    218     mov     ds, ax
    219     ASSUME  ds:FLAT
    220     mov     eax, ss:[ebp+pBuffer]
    221     mov     pszFilename, eax
    222     add     eax, 261
    223     mov     pszArguments, eax
    224 
    225     ;
    226     ; Restore variables pushed on the stack
    227     ;
    228     ; stack: edi, es, ds, ecx, eax
    229230    pop     edi
    230231    pop     es
     
    234235
    235236    ;
    236     ; Set new input parameters (call g_tkExecPgm)
     237    ; Set new input parameters (call _g_tkExecPgm)
    237238    ;
    238239    ; ds:dx is to become SegBuffer:OffBuffer
     
    251252
    252253    ;
    253     ; Call g_tkExecPgm
    254     ;
    255     push    cs                          ; Problem calling far into the calltab segement.
    256     call    near ptr FLAT:g_tkExecPgm
     254    ; Call _g_tkExecPgm
     255    ;
     256    push    cs                          ; Problem calling far into the calltab segement.
     257    call    near ptr FLAT:_g_tkExecPgm
    257258    pushfd
    258259
     
    292293
    293294mytkExecPgm_CalltkExecPgm:
    294     call    far ptr FLAT:g_tkExecPgmStub
     295    push    cs
     296    call    near ptr FLAT:_g_tkExecPgm
    295297    leave
    296298    retf
     
    298300
    299301
    300 ;;
    301 ; Stub which jumps to g_tkExecPgmStub.
    302 ; (This way I will hopefully get the right selector.)
    303 g_tkExecPgmStub PROC FAR
    304     jmp     near ptr FLAT:g_tkExecPgm
    305 g_tkExecPgmStub ENDP
    306 
    307302
    308303CODE32 ENDS
     304
     305if 0 ; alternate implementation.
     306mytkExecPgm PROC FAR
     307pBuffer     = dword ptr -04h
     308SegBuffer   = -08h
     309OffBuffer   = -0Ch
     310cchFilename = -10h
     311cchArgs     = -14h
     312usExecFlag  = -18h
     313SegFilename = -1ch
     314OffFilename = -1eh
     315SegEnv      = -20h
     316OffEnv      = -22h
     317SegArg      = -24h
     318OffArg      = -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
     372mytkExecPgm_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
     426mytkExecPgm_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    ;
     435mytkExecPgm_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
     472mytkExecPgm_CalltkExecPgm_X2:
     473    ;
     474    ; Release buffer
     475    ;
     476    mov     eax, [ebp + pBuffer]
     477    call    ReleaseBuffer
     478    mov     [ebp + pBuffer], 0
     479
     480mytkExecPgm_CalltkExecPgm_X1:
     481    pop     ds
     482
     483mytkExecPgm_CalltkExecPgm:
     484    push    cs
     485    call    near ptr FLAT:_g_tkExecPgm
     486    leave
     487    retf
     488mytkExecPgm ENDP
     489
     490CODE32 ENDS
     491endif
     492
     493
    309494END
    310495
Note: See TracChangeset for help on using the changeset viewer.