воскресенье, 5 декабря 2010 г.

YAR Update: Importing external function

Yar supports now for

import external functions

sample

program Helloworld;

function importedfunc(var a:integer):integer;external library=mydll name=importfunc;

GField:integer;

begin
GField:=1;
write importedfunc(GField);
end

=>

.assembly extern mscorlib { auto }
.assembly project {}
.field public static int32 GField

.method static public void main() cil managed
{
.entrypoint
ldc.i4 1
stsfld int32 GField
ldsflda int32 GField
call int32 importedfunc(int32& a)
call void [mscorlib]System.Console::Write(int32)
ret
}

.method public static pinvokeimpl("mydll.dll" as "importfunc" winapi)
int32 importedfunc(int32& a) cil managed preservesig
{}

Комментариев нет: