提交 c577fffe 编写于 作者: C Craig Rodrigues

Use a jna Union type for the DUMMYUNIONNAME union structure

JNAerator ( https://code.google.com/p/jnaerator/ ) was helpful
for generating the Java code from the C struct.
上级 f3e9d5d6
......@@ -25,6 +25,7 @@ package hudson.util.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import java.util.Arrays;
import java.util.List;
......@@ -69,7 +70,7 @@ public class SHELLEXECUTEINFO extends Structure {
public String lpClass;
public Pointer hkeyClass;
public int dwHotKey;
public Pointer hIcon;
public DUMMYUNIONNAME_union DUMMYUNIONNAME;
public Pointer hProcess;
public static final int SEE_MASK_NOCLOSEPROCESS = 0x40;
......@@ -80,7 +81,29 @@ public class SHELLEXECUTEINFO extends Structure {
protected List getFieldOrder() {
return Arrays.asList("cbSize", "fMask", "hwnd", "lpVerb",
"lpFile", "lpParameters", "lpDirectory", "nShow", "hInstApp",
"lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hIcon",
"lpIDList", "lpClass", "hkeyClass", "dwHotKey", "DUMMYUNIONNAME",
"hProcess");
}
public static class DUMMYUNIONNAME_union extends Union {
public Pointer hIcon;
public Pointer hMonitor;
public DUMMYUNIONNAME_union() {
super();
}
public DUMMYUNIONNAME_union(Pointer hIcon_or_hMonitor) {
super();
this.hMonitor = this.hIcon = hIcon_or_hMonitor;
setType(Pointer.class);
}
public static class ByReference extends DUMMYUNIONNAME_union implements Structure.ByReference {
};
public static class ByValue extends DUMMYUNIONNAME_union implements Structure.ByValue {
};
};
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册