cbInfo.isStdcall() ? CallingConvention.STDCALL : CallingConvention.DEFAULT, runtime.getNil())
: runtime.getNil();
} else if (type instanceof StructByValue) {
StructByValue sbv = (StructByValue) type;
final long address = buffer.getStruct(index);
DirectMemoryIO memory = address != 0
? new BoundedNativeMemoryIO(runtime, address, type.getNativeSize())
: new NullMemoryIO(runtime);
return sbv.getStructClass().newInstance(runtime.getCurrentContext(),
new IRubyObject[] { new Pointer(runtime, memory) },
Block.NULL_BLOCK);
} else if (type instanceof MappedType) {
MappedType mappedType = (MappedType) type;