Ignore:
Timestamp:
Aug 19, 2000, 4:37:21 PM (25 years ago)
Author:
bird
Message:

More bugs corrected.
It's working now!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Grace/src/win32k/ldr/mytkExecPgm.asm

    r4025 r4046  
    1 ; $Id: mytkExecPgm.asm,v 1.10.4.2 2000-08-17 08:23:34 bird Exp $
     1; $Id: mytkExecPgm.asm,v 1.10.4.3 2000-08-19 14:37:16 bird Exp $
    22;
    33; mytkExecPgm - tkExecPgm overload
     
    8484    public tkExecPgmCopyEnv
    8585
     86    public fLdrSemTaken
    8687    public fTkExecPgm
    8788    public achTkExecPgmFilename
     
    100101; (and you'll have to be behind the loader semaphore of course!)
    101102DATA16 SEGMENT
     103fLdrSemTaken            db 0            ; 0 - Loader Semaphore not taken
     104                                        ; 1 - Loader semaphore is taken and will be freed at exit.
    102105fTkExecPgm              db 0            ; 0 - achTkExecPgmFilename and achTkExecPgmArguments is INVALID
    103106                                        ; 1 - achTkExecPgmFilename and achTkExecPgmArguments is VALID.
     
    223226
    224227    push    0ffffffffh                  ; Wait indefinitely.
    225     push    dword ptr eax               ; LDRSem handle.
     228    push    eax                         ; LDRSem handle.
    226229    call    near ptr FLAT:_KSEMRequestMutex@8
    227230    or      eax, eax                    ; Check if failed.
    228231    jnz     tkepgm_backout              ; Backout on failure.
     232    mov     fLdrSemTaken, 1             ; Marks that the loader semaphore is taken
    229233
    230234
     
    313317    push    cs                          ; Problem calling far into the calltab segement.
    314318    call    near ptr FLAT:_g_tkExecPgm
    315     pushfd
    316 
    317     ;
    318     ; Clear loader semaphore.
    319     ;
     319    pushfd                              ; preserve flags
    320320    push    eax                         ; preserve result.
    321321    push    ecx                         ; preserve ecx just in case
     
    324324    mov     ds, ax
    325325    mov     es, ax
    326     ASSUME  ds:FLAT, es:FLAT
    327     call    near ptr FLAT:_LDRClearSem@0
    328     pop     edx                         ; restore edx
    329     pop     ecx                         ; restore ecx
    330     pop     eax                         ; restore result.
     326    ASSUME  ds:FLAT, es:FLAT            ; both ds and es are now FLAT
    331327
    332328    ;
     
    338334
    339335    ;
     336    ; Clear loader semaphore.
     337    ;
     338    cmp     fLdrSemTaken, 0             ; is the semaphore still taken?
     339    je      tkepgm_callbehindret        ; jmp if not taken.
     340    mov     fLdrSemTaken, 0             ; Loader semaphore is not taken any longer!
     341    call    near ptr FLAT:_LDRClearSem@0
     342
     343    ;
    340344    ; Restore ds and es (probably unecessary but...) and Return
    341345    ;
     346tkepgm_callbehindret:
    342347    push    dword ptr [ebp + SegFilename]
    343348    pop     ds
    344349    push    dword ptr [ebp + SegEnv]
    345350    pop     es
    346     popfd
     351    pop     edx                         ; restore edx
     352    pop     ecx                         ; restore ecx
     353    pop     eax                         ; restore result.
     354    popfd                               ; restore flags
    347355    leave
    348356    retf
Note: See TracChangeset for help on using the changeset viewer.