forked from KolibriOS/kolibrios
Added network.obj loader to C_layer
git-svn-id: svn://kolibrios.org@8345 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
48
contrib/C_Layer/ASM/loadnetwork.asm
Normal file
48
contrib/C_Layer/ASM/loadnetwork.asm
Normal file
@@ -0,0 +1,48 @@
|
||||
format coff
|
||||
use32 ; Tell compiler to use 32 bit instructions
|
||||
|
||||
section '.flat' code
|
||||
|
||||
include '../../../programs/proc32.inc'
|
||||
include '../../../programs/macros.inc'
|
||||
purge section,mov,add,sub
|
||||
|
||||
include '../../../programs/dll.inc'
|
||||
|
||||
purge section,mov,add,sub
|
||||
|
||||
public lib_init as '_networklib_init'
|
||||
|
||||
proc lib_init
|
||||
local retval dd ?
|
||||
mov [retval], eax
|
||||
pusha
|
||||
mcall 68, 11
|
||||
test eax, eax
|
||||
jnz @f
|
||||
mov [retval], -1
|
||||
jmp exit_init_networklib
|
||||
@@:
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jz exit_init_networklib
|
||||
mov [retval], -1
|
||||
exit_init_networklib:
|
||||
popa
|
||||
mov eax, [retval]
|
||||
ret
|
||||
endp
|
||||
|
||||
@IMPORT:
|
||||
library networklib, 'network.obj'
|
||||
|
||||
import networklib, \
|
||||
inet_addr, 'inet_addr', \
|
||||
inet_ntoa, 'inet_ntoa', \
|
||||
getaddrinfo, 'getaddrinfo', \
|
||||
freeaddrinfo, 'freeaddrinfo'
|
||||
|
||||
public inet_addr as '_inet_addr'
|
||||
public inet_ntoa as '_inet_ntoa'
|
||||
public getaddrinfo as '_getaddrinfo'
|
||||
public freeaddrinfo as '_freeaddrinfo'
|
Reference in New Issue
Block a user