/kernel/trunk/core/dll.inc |
---|
899,7 → 899,7 |
ret |
align 4 |
proc load_library stdcall, file_name:dword |
proc load_library stdcall, file_name:dword, encoding:dword |
locals |
fullname dd ? |
fileinfo rb 40 |
910,8 → 910,12 |
; resolve file name |
stdcall kernel_alloc, maxPathLength |
mov [fullname], eax |
mov ebx, [file_name] |
stdcall get_full_file_name, eax, maxPathLength |
mov edi, eax |
mov esi, [file_name] |
mov eax, [encoding] |
push ebp |
call getFullPath |
pop ebp |
test eax, eax |
jz .fail |
; scan for required DLL in list of already loaded for this process, |
/kernel/trunk/core/memory.inc |
---|
1101,13 → 1101,11 |
f68: |
cmp ebx, 4 |
jbe sys_sheduler |
cmp ebx, 11 |
jb undefined_syscall |
cmp ebx, 27 |
ja undefined_syscall |
xor eax, eax |
jmp dword [f68call+ebx*4-11*4] |
.11: |
call init_heap |
1143,7 → 1141,7 |
.19: |
cmp ecx, OS_BASE |
jae .fail |
stdcall load_library, ecx |
stdcall load_library, ecx, eax |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
.20: |
1155,10 → 1153,8 |
.21: |
cmp ecx, OS_BASE |
jae .fail |
cmp edx, OS_BASE |
jae .fail |
stdcall load_pe_driver, ecx, edx |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
1165,16 → 1161,13 |
.22: |
cmp ecx, OS_BASE |
jae .fail |
stdcall shmem_open, ecx, edx, esi |
mov [esp+SYSCALL_STACK._edx], edx |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
.23: |
cmp ecx, OS_BASE |
jae .fail |
stdcall shmem_close, ecx |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
1195,16 → 1188,13 |
bts [eax+APPDATA.except_mask], ecx |
@@: |
ret |
.26: |
stdcall user_unmap, ecx, edx, esi |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
.27: |
cmp ecx, OS_BASE |
jae .fail |
stdcall load_file_umode, ecx |
mov [esp+SYSCALL_STACK._edx], edx |
mov [esp+SYSCALL_STACK._eax], eax |
1211,11 → 1201,9 |
ret |
.fail: |
xor eax, eax |
mov [esp+SYSCALL_STACK._eax], eax |
ret |
align 4 |
f68call: ; keep this table closer to main code |
/kernel/trunk/core/taskman.inc |
---|
66,11 → 66,19 |
fs_execute_from_sysdir: |
xor ebx, ebx |
fs_execute_from_sysdir_param: |
stdcall kernel_alloc, maxPathLength |
push eax ebx |
mov esi, ebp |
mov edi, eax |
xor eax, eax |
call getFullPath |
pop ecx ebx |
xor edx, edx |
proc fs_execute |
; ebx - cmdline |
; edx - flags |
; ebp - full filename |
; edx = flags |
; ecx -> cmdline |
; ebx -> absolute file path |
; eax = string length |
locals |
cmdline rd 1 |
flags rd 1 |
91,16 → 99,13 |
endl |
mov [flags], edx |
mov [cmdline], ebx |
stdcall kernel_alloc, maxPathLength |
mov [path_string], eax |
mov ebx, [ebp] |
stdcall get_full_file_name, eax, maxPathLength |
mov [cmdline], ecx |
mov [path_string], ebx |
mov [filename_size], eax |
mov esi, -ERROR_FILE_NOT_FOUND |
test eax, eax |
jz .err_file |
stdcall load_file, [path_string] |
mov esi, -ERROR_FILE_NOT_FOUND |
stdcall load_file, ebx |
test eax, eax |
jz .err_file |
141,7 → 146,6 |
jz @f |
stosb |
loop @b |
@@: |
mov edi, [cmdline] |
xor eax, eax |
169,10 → 173,6 |
lea edx, [ebx+APPDATA.list] |
lea ecx, [eax+PROC.thr_list] |
list_add_tail edx, ecx |
mov edi, [path_string] |
mov ecx, maxPathLength |
call _strnlen |
mov [filename_size], eax |
mov eax, [cmdline_size] |
add eax, sizeof.APP_HDR |
stdcall kernel_alloc, eax |