8 messages in net.java.dev.jna.users[jna-users] Passing a Null Array Pointer
FromSent OnAttachments
Timothy WallJul 17, 2008 10:18 am 
Wayne MeissnerJul 17, 2008 3:57 pm 
Nikolas LotzJul 18, 2008 1:49 am 
RWAD...@UP.COMJul 18, 2008 5:07 am 
Timothy WallJul 18, 2008 5:41 am 
Timothy WallJul 18, 2008 7:20 am 
Timothy WallJul 18, 2008 7:53 am 
RWAD...@UP.COMJul 18, 2008 8:21 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] Passing a Null Array PointerActions...
From:RWAD...@UP.COM (RWAD@UP.COM)
Date:Jul 18, 2008 5:07:37 am
List:net.java.dev.jna.users

I'm having difficulty passing a null pointer to an array as an argument to a C function. The Java declaration is:

void efm111_det_enty_rop_at_loca(FacilityTypeStructure fac_type, int in_rl_nbr, PropoStructure in_propo[], ShortByReference sop_count, ObjectPointAndOrientationStructure sop[]);

It works fine when I use an actual array as the third argument ( PropoStructure in_propo[]), but I need to be able to test the use case where the array pointer is null. More specifically, where the C code says

if (in_propo == (Propo_Struct *)NULL) {...}

I tried substituting a Java null as the third argument, but that causes a JVM crash. I didn't see anything in the forum that covers this exact scenario, but I'm guessing one of the JNA memory or pointer classes must be what I want. I just can't figure out how to do it.

Any ideas?