File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838
3939import com .sun .jna .Callback .UncaughtExceptionHandler ;
4040import com .sun .jna .CallbacksTest .TestLibrary .CbCallback ;
41+ import com .sun .jna .platform .win32 .OaIdl ;
4142import com .sun .jna .ptr .IntByReference ;
4243import com .sun .jna .ptr .PointerByReference ;
4344import com .sun .jna .win32 .W32APIOptions ;
@@ -1565,6 +1566,31 @@ public void invoke() { }
15651566 }
15661567 }
15671568
1569+ public void testWriteCallback () {
1570+ vTable vtable =new vTable ();
1571+ vtable .callback =new vTable .functionpointer () {
1572+ @ Override
1573+ public int callback (OaIdl .SAFEARRAY runtimeId ) {
1574+ return 0 ;
1575+ }
1576+ };
1577+ vtable .write ();
1578+ }
1579+
1580+ public static class vTable extends Structure {
1581+ public interface functionpointer extends Callback {
1582+ int callback (OaIdl .SAFEARRAY runtimeId );
1583+ }
1584+
1585+ public functionpointer callback ;
1586+
1587+ @ Override
1588+ protected List <String > getFieldOrder () {
1589+ return Arrays .asList (new String []{"callback" });
1590+
1591+ }
1592+ }
1593+
15681594 public static void main (java .lang .String [] argList ) {
15691595 junit .textui .TestRunner .run (CallbacksTest .class );
15701596 }
You can’t perform that action at this time.
0 commit comments