c# - Is it possible to create a 6400 byte integer? -
i have function can't alter because of protection , abstraction, , declared this:
getdevicelonginfo(int, int, ref int);
in "ref int" argument passed said give 6400 bytes of information.
my question is, how can information in variable if choice have give function int32
? can allocate more memory int32
? possible achieve in way?
edit: can tell function uses ref int dump values in it, int size (size of information) not fixed, depends on option chosed in second parameter. can't @ function see how uses ref.
you can allocate int[]
, pass function. hack don't see why should not safe.
var array = new int[6400 / sizeof(int)]; getdevice(..., ref array[0]);
the array pinned clr duration of call.
note, ref
called managed pointer clr. marshaled passing pointer , pinning object points to. int[]
passed in same way (a pointer first element passed).
Comments
Post a Comment