Changeset 4068 for branches/Grace/src/win32k/ldr/mytkStartProcess.asm
- Timestamp:
- Aug 22, 2000, 5:00:22 AM (25 years ago)
- 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:40bird Exp $1 ; $Id: mytkStartProcess.asm,v 1.1.2.2 2000-08-22 03:00:22 bird Exp $ 2 2 ; 3 3 ; tkStartProcess overloader. Needed to clear the loader semaphore … … 20 20 ; Imported Functions and variables. 21 21 ; 22 22 23 ; 23 24 ; LDR semaphore 24 25 ; 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 28 30 29 31 ; … … 33 35 34 36 ; 37 ; mytkExecPgm stuff. 35 38 ; 36 ;37 extrn fLdrSemTaken:BYTE38 39 extrn fTkExecPgm:BYTE 39 40 … … 44 45 45 46 ; 46 ; Exported symbols47 ; TKSSBase (32-bit) 47 48 ; 49 extrn pulTKSSBase32:DWORD 50 51 ; 52 ; Calltable entry for tkStartProcess 53 ; 54 extrn _g_tkStartProcess:PROC 55 56 ; 57 ; Exported symbols 58 ; 48 59 public mytkStartProcess 49 60 50 61 51 62 CODE32 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 52 73 mytkStartProcess PROC NEAR 53 74 ASSUME CS:CODE32, DS:FLAT, ES:NOTHING, SS:NOTHING 54 75 55 76 ; 56 ; Check if the loader semphore is take .77 ; Check if the loader semphore is take by us. 57 78 ; Clear it (and other vars) if it is. 58 79 ; 59 cmp fLdrSemTaken, 0 60 jz finished 80 push eax 81 push ecx 82 push edx 61 83 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). 62 96 mov ulLDRState, 0 ; Clears loaderstate. (LDRSTATE_UNKNOWN) 63 97 mov pExeModule, 0 ; Sets the exemodule pointer to NULL. 64 98 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). 65 101 call near ptr FLAT:_LDRClearSem@0 66 mov fLdrSemTaken, 0 ; Loader semaphore is not taken any longer!67 102 68 finished: 69 call ktStartProcess 70 ret 103 mtksp_ret: 104 pop edx 105 pop ecx 106 pop eax 107 jmp _g_tkStartProcess 71 108 mytkStartProcess ENDP 72 109
Note:
See TracChangeset
for help on using the changeset viewer.
