forked from KolibriOS/kolibrios
fix load driver
TODO: add function for unload driver git-svn-id: svn://kolibrios.org@9406 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f3dca4689e
commit
36933473bc
@ -1261,18 +1261,21 @@ proc load_pe_driver stdcall, file:dword, cmdline:dword
|
|||||||
jz .fail
|
jz .fail
|
||||||
|
|
||||||
mov esi, eax
|
mov esi, eax
|
||||||
|
push ebx ; base addres driver
|
||||||
push [cmdline]
|
push [cmdline]
|
||||||
push DRV_ENTRY
|
push DRV_ENTRY
|
||||||
call eax
|
call eax
|
||||||
pop ecx
|
pop ecx
|
||||||
pop ecx
|
pop ecx
|
||||||
|
pop ebx
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz .fail
|
jz .fail_init
|
||||||
|
|
||||||
mov [eax+SRV.entry], esi
|
mov [eax+SRV.entry], esi
|
||||||
pop esi
|
pop esi
|
||||||
ret
|
ret
|
||||||
|
.fail_init:
|
||||||
|
stdcall kernel_free, ebx ;clear memory driver
|
||||||
.fail:
|
.fail:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
pop esi
|
pop esi
|
||||||
|
@ -11,6 +11,9 @@ include 'export.inc'
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
|
; This function load file driver and output
|
||||||
|
; eax = address function START in driver
|
||||||
|
; ebx = address for kernel_free
|
||||||
proc load_PE stdcall, file_name:dword
|
proc load_PE stdcall, file_name:dword
|
||||||
locals
|
locals
|
||||||
image dd ?
|
image dd ?
|
||||||
@ -58,6 +61,7 @@ proc load_PE stdcall, file_name:dword
|
|||||||
.cleanup:
|
.cleanup:
|
||||||
stdcall kernel_free, [image]
|
stdcall kernel_free, [image]
|
||||||
mov eax, [entry]
|
mov eax, [entry]
|
||||||
|
mov ebx, [base]
|
||||||
ret
|
ret
|
||||||
.fail:
|
.fail:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
|
Loading…
Reference in New Issue
Block a user