Changeset 2827 for trunk/src/win32k/ldr/mytkExecPgm.asm
- Timestamp:
- Feb 19, 2000, 9:40:31 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/ldr/mytkExecPgm.asm
r2825 r2827 1 ; $Id: mytkExecPgm.asm,v 1. 2 2000-02-18 19:54:19bird Exp $1 ; $Id: mytkExecPgm.asm,v 1.3 2000-02-19 08:40:31 bird Exp $ 2 2 ; 3 3 ; mytkExecPgm - tkExecPgm overload … … 17 17 ; Imported Functions 18 18 ; 19 DATA32 SEGMENT 19 20 extrn g_tkExecPgm:PROC 21 DATA32 ENDS 20 22 extrn AcquireBuffer:PROC 21 23 extrn ReleaseBuffer:PROC … … 54 56 ; struct Buffer 55 57 ; { 56 ; char szFilename[261]; /* offset 0 */57 ; char szArg[4096-261]; /* offset 261 */58 ; char szFilename[261]; /* offset 0 */ 59 ; char achArg[1536-261]; /* offset 261 */ 58 60 ; }; 59 61 ; … … 77 79 push edi 78 80 79 ; init local variables 80 mov [ebp+pBuffer], 0 81 IF 0 82 ; ; Check if this overloading has anything too say, after all it is using some stack space! 83 ; jmp mytkExecPgm_CalltkExecPgm_X1 84 ENDIF 85 86 ; parameter validations 87 mov ax, ds ; pointer to filename 88 cmp ax, 4 89 jb mytkExecPgm_CalltkExecPgm_X1 90 91 ; This test is currently disabled. We'll pass on an empty string if the argument pointer is NULL. 92 ; Hopefully an empty string is treated equally to an NULL pointer. 93 ; cmp di, 4 94 ; jl mytkExecPgm_CalltkExecPgm_X1 81 95 82 96 ; filename length … … 86 100 movzx edi, dx ; es:di is now filename address (ds:dx). 87 101 mov ecx, 0ffffffffh 102 cld 88 103 repne scasb 89 104 not ecx … … 98 113 ; 99 114 ; args length 100 ; 101 pop edi 102 push edi 115 ; Note: the arguments are a series of ASCIIZs ended by an empty string (ie. '\0'). 116 ; 117 pop edi 118 push edi 119 xor ecx, ecx 120 cmp di, 4 ; The argument might me a invalid pointer... 121 jb mytkExecPgm_CalltkExecPgm_1 103 122 mov es, di 104 movzx edi, si ; es:di is now args address (di:si), eax is still 0 105 mov ecx, 0ffffffffh 106 repne scasb 123 movzx edi, si ; es:edi is now args address (di:si), eax is still 0 124 dec ecx 125 cld 126 mytkExecPgm_CalltkExecPgm_loop: ; loop true all ASCIIZ strings 127 repne scasb ; scans forwards until '\0' is read. es:edi is pointing at the char after the '\0'. 128 cmp byte ptr es:[edi], 0 ; is this char '\0' ? stop looping : loop once more; 129 jnz mytkExecPgm_CalltkExecPgm_loop 130 dec ecx ; update count - count terminating zero too 107 131 not ecx 108 132 133 mytkExecPgm_CalltkExecPgm_1: 109 134 mov [ebp+cchArgs], ecx 110 135 add ecx, [ebp+cchFilename] ; filename 111 136 add ecx, 3 + 260 ; 260 = new argument from a scrip file or something. 112 137 ; 3 = two '\0's and a space after added argument. 113 cmp ecx, 4096 ; 4096 = Buffersize. FIXME! Define this!!!138 cmp ecx, 1536 ; 1536 = Buffersize. FIXME! Define this!!! 114 139 jae mytkExecPgm_CalltkExecPgm_X1; jmp if argument + file + new file > buffer size 115 140 … … 139 164 movzx esi, dx ; ds:si Filename pointer (input ds:dx) 140 165 mov ecx, [ebp+cchFilename] 141 repnz movsb 166 cld 167 rep movsb 142 168 143 169 ; … … 149 175 push edi 150 176 push esi 177 add eax, 261 ; we'll use eax in the branch 178 cmp di, 4 179 jb mytkExecPgm_CalltkExecPgm_2 180 and esi, 00000ffffh ; remove high part of the register 151 181 mov ds, di ; ds:si -> arguments 152 mov edi, eax 153 add edi, 261 ; es:di -> pBuffer + 261 182 mov edi, eax ; es:di -> pBuffer + 261 154 183 mov ecx, [ebp+cchArgs] 155 repnz movsb 184 cld 185 rep movsb 186 jmp mytkExecPgm_CalltkExecPgm_3 187 188 mytkExecPgm_CalltkExecPgm_2: 189 mov byte ptr es:[eax], 0 ; Terminate the empty string! 156 190 157 191 ; 158 192 ; Set Pointers, pszFilename and pszArguments 159 193 ; 194 mytkExecPgm_CalltkExecPgm_3: 160 195 mov ax, seg FLAT:DATA32 161 196 mov ds, ax … … 197 232 ; Call g_tkExecPgm 198 233 ; 199 call far ptr FLAT:g_tkExecPgm;WARNING far call!!! 234 push cs 235 call near ptr FLAT:g_tkExecPgm 200 236 pushfd 201 237 … … 235 271 236 272 mytkExecPgm_CalltkExecPgm: 237 call far ptr FLAT:g_tkExecPgm 273 call far ptr FLAT:g_tkExecPgmStub 238 274 leave 239 275 retf 240 276 mytkExecPgm ENDP 241 277 278 279 ;; 280 ; Stub which jumps to g_tkExecPgmStub. 281 ; (This way I will hopefully get the right selector.) 282 g_tkExecPgmStub PROC FAR 283 jmp near ptr FLAT:g_tkExecPgm 284 g_tkExecPgmStub ENDP 285 286 242 287 CODE32 ENDS 243 288 END
Note:
See TracChangeset
for help on using the changeset viewer.