There is an exampleof the use. This case is for get a cnvironment variable.
// declaration
external "kernel32.dll" long GetEnvironmentVariable(string lpName , string lpBuffer , long nSize) ;
// use
var variable_name = "MY_VAR";
var variable_value = new String(255); // This var is passed by reference, the value of the environment variable is stored here
var value_lenght = 255;
GetEnvironmentVariable (variable_name, variable_value, value_length);