Rev 506 | Rev 520 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 506 | Rev 519 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | $Revision: 506 $ |
1 | $Revision: 519 $ |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;; ;; |
3 | ;; ;; |
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; ;; |
6 | ;; ;; |
Line 74... | Line 74... | ||
74 | hdr_i_end dd ? ;0x14 |
74 | hdr_i_end dd ? ;0x14 |
75 | endl |
75 | endl |
Line 76... | Line 76... | ||
76 | 76 | ||
Line 77... | Line -... | ||
77 | pushad |
- | |
78 | 77 | pushad |
|
Line 79... | Line 78... | ||
79 | mov [cmdline], ebx |
78 | |
Line 80... | Line 79... | ||
80 | mov [flags], edx |
79 | mov [flags], edx |
81 | 80 | ||
82 | ; [ebp] pointer to filename |
81 | ; [ebp] pointer to filename |
83 | 82 | ||
- | 83 | lea eax, [filename] |
|
- | 84 | mov dword [eax+1020],0 ;force terminate |
|
- | 85 | ;string |
|
- | 86 | stdcall strncpy, eax, [ebp], 1023 |
|
Line 84... | Line 87... | ||
84 | lea eax, [filename] |
87 | |
85 | mov dword [eax+1020],0 ;force terminate |
88 | mov [cmdline], ebx |
86 | ;string |
89 | test ebx, ebx |
87 | stdcall k_strncpy, eax, [ebp], 1023 |
90 | jz @F |
88 | 91 | ||
89 | lea eax, [cmdline] |
92 | lea eax, [cmdline] |
90 | mov dword [eax+252], 0 |
93 | mov dword [eax+252], 0 |
91 | stdcall k_strncpy, eax, [cmdline], 255 |
94 | stdcall strncpy, eax, ebx, 255 |
92 | 95 | @@: |
|
Line 134... | Line 137... | ||
134 | mov [slot_base], eax |
137 | mov [slot_base], eax |
135 | mov edi, eax |
138 | mov edi, eax |
136 | _clear_ 256 ;clean extended information about process |
139 | _clear_ 256 ;clean extended information about process |
Line 137... | Line 140... | ||
137 | 140 | ||
138 | ; write application name |
141 | ; write application name |
139 | lea edi, [filename] |
- | |
140 | mov al, '/' |
142 | lea eax, [filename] |
Line 141... | Line 143... | ||
141 | call k_strrchr ; now eax points to name without path |
143 | stdcall strrchr, eax, '/' ; now eax points to name without path |
142 | 144 | ||
143 | lea esi, [eax+1] |
145 | lea esi, [eax+1] |
144 | test eax, eax |
146 | test eax, eax |
Line 961... | Line 963... | ||
961 | mov dword [CURRENT_TASK+ebx+0x10],eax |
963 | mov dword [CURRENT_TASK+ebx+0x10],eax |
Line 962... | Line 964... | ||
962 | 964 | ||
963 | .add_command_line: |
965 | .add_command_line: |
964 | mov edx,[params] |
966 | mov edx,[params] |
965 | mov edx,[edx] ;app_cmdline |
967 | mov edx,[edx] ;app_cmdline |
966 | test edx,edx |
968 | test edx, [cmd_line] ;check both src & dst |
Line 967... | Line 969... | ||
967 | jz @F ;application don't need parameters |
969 | jz @F ;application don't need parameters |
968 | 970 | ||
969 | mov eax, edx |
971 | mov eax, edx |
Line 970... | Line 972... | ||
970 | add eax, 256 |
972 | add eax, 256 |
971 | jc @f |
973 | jc @f |
Line 972... | Line 974... | ||
972 | 974 | ||
973 | cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
975 | cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
974 | ja @f |
976 | ja @f |
975 | 977 | ||
976 | stdcall k_strncpy, edx, [cmd_line], 256 |
978 | stdcall strncpy, edx, [cmd_line], 256 |
977 | @@: |
979 | @@: |
978 | mov edx,[params] |
980 | mov edx,[params] |
979 | mov edx, [edx+4] ;app_path |
981 | mov edx, [edx+4] ;app_path |
980 | test edx,edx |
982 | test edx,edx |
981 | jz @F ;application don't need path of file |
983 | jz @F ;application don't need path of file |
982 | mov eax, edx |
984 | mov eax, edx |
983 | add eax, 1024 |
985 | add eax, 1024 |
984 | jc @f |
986 | jc @f |
985 | cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
987 | cmp eax, [SLOT_BASE+APPDATA.mem_size+ebx*8] |
986 | ja @f |
988 | ja @f |
987 | stdcall k_strncpy, edx, [app_path], 1024 |
989 | stdcall strncpy, edx, [app_path], 1024 |
988 | @@: |
990 | @@: |