public static ushort?CursorGetUnsignedSmallInt(HDFqlCursor cursor) { IntPtr pointer = HDFqlPINVOKE.CursorGetUnsignedSmallInt(HDFqlCursor.getCPtr(cursor)); if (pointer == IntPtr.Zero) { return(null); } else { short [] value = new short[1]; Marshal.Copy(pointer, value, 0, 1); return((ushort)value[0]); } }