Ignore:
Timestamp:
Aug 22, 2000, 5:00:22 AM (25 years ago)
Author:
bird
Message:

More code is completed.
Test stuff is broken. (Missing fake functions/variables for the new functions.)

File:
1 edited

Legend:

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

    r4065 r4068  
    1 ; $Id: mytkStartProcess.asm,v 1.1.2.1 2000-08-21 22:59:40 bird Exp $
     1; $Id: mytkStartProcess.asm,v 1.1.2.2 2000-08-22 03:00:22 bird Exp $
    22;
    33; tkStartProcess overloader. Needed to clear the loader semaphore
     
    2020;   Imported Functions and variables.
    2121;
     22
    2223    ;
    2324    ; LDR semaphore
    2425    ;
    25     extrn  pLDRSem:DWORD
    26     extrn  _KSEMRequestMutex@8:PROC
    27     extrn  _LDRClearSem@0:PROC
     26    extrn pLdrSem:DWORD
     27    extrn _LDRClearSem@0:PROC
     28    extrn _KSEMRequestMutex@8:PROC
     29    extrn _KSEMQueryMutex@8:PROC
    2830
    2931    ;
     
    3335
    3436    ;
     37    ; mytkExecPgm stuff.
    3538    ;
    36     ;
    37     extrn fLdrSemTaken:BYTE
    3839    extrn fTkExecPgm:BYTE
    3940
     
    4445
    4546    ;
    46     ;   Exported symbols
     47    ; TKSSBase (32-bit)
    4748    ;
     49    extrn pulTKSSBase32:DWORD
     50
     51    ;
     52    ; Calltable entry for tkStartProcess
     53    ;
     54    extrn _g_tkStartProcess:PROC
     55
     56;
     57;   Exported symbols
     58;
    4859    public mytkStartProcess
    4960
    5061
    5162CODE32 SEGMENT
     63
     64;;
     65; Overloads tkStartProcess. If the loader semahore is taken by us we'll release it.
     66; @returns
     67; @param
     68; @uses      eax, ecx, edx
     69; @sketch
     70; @status
     71; @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     72; @remark
    5273mytkStartProcess PROC NEAR
    5374    ASSUME CS:CODE32, DS:FLAT, ES:NOTHING, SS:NOTHING
    5475
    5576    ;
    56     ; Check if the loader semphore is take.
     77    ; Check if the loader semphore is take by us.
    5778    ; Clear it (and other vars) if it is.
    5879    ;
    59     cmp     fLdrSemTaken, 0
    60     jz      finished
     80    push    eax
     81    push    ecx
     82    push    edx
    6183
     84    push    0                           ; Usage count variable.
     85    mov     eax, pulTKSSBase32          ; Get TKSSBase
     86    mov     eax, [eax]
     87    add     eax, esp                    ; Added TKSSBase to the usage count pointer
     88    push    eax                         ; Push address of usage count pointer.
     89    push    pLdrSem                     ; Push pointer to loader semaphore ( = handle).
     90    call    _KSEMQueryMutex@8
     91    or      eax, eax                    ; Check return code. (1 = our / free; 0 = not our but take)
     92    jz      mtksp_ret                   ; jmp if not taken by us (FALSE).
     93    pop     eax                         ; Pops usage count.
     94    or      eax, eax                    ; Check usage count.
     95    jz      mtksp_ret                   ; jmp if 0 (=free).
    6296    mov     ulLDRState, 0               ; Clears loaderstate. (LDRSTATE_UNKNOWN)
    6397    mov     pExeModule, 0               ; Sets the exemodule pointer to NULL.
    6498    mov     fTkExecPgm, 0               ; Marks global data invalid.
     99    cmp     eax, 1                      ; If usage count > 1 then issue a release. (should not happen here)
     100    je      mtksp_ret                   ; jmp if usage count < 2. (tkStartProcess or tkExecPgm will free the last usage).
    65101    call    near ptr FLAT:_LDRClearSem@0
    66     mov     fLdrSemTaken, 0             ; Loader semaphore is not taken any longer!
    67102
    68 finished:
    69     call    ktStartProcess
    70     ret
     103mtksp_ret:
     104    pop     edx
     105    pop     ecx
     106    pop     eax
     107    jmp    _g_tkStartProcess
    71108mytkStartProcess ENDP
    72109
Note: See TracChangeset for help on using the changeset viewer.