From a6507bc8e9e872f5df02e63d7210c463a021560e Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 11 Feb 2015 00:29:44 +0300 Subject: [PATCH] platform: JNA updated to 4.1.0 (code) --- .../masterKey/windows/WindowsCryptUtils.java | 9 ++++++++ .../ui/mac/foundation/Foundation.java | 23 +++++++++++++++++++ .../intellij/updater/Win32RestartManager.java | 18 +++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtils.java b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtils.java index 348a8f28cade..159f8a523e50 100644 --- a/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtils.java +++ b/platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/windows/WindowsCryptUtils.java @@ -24,7 +24,9 @@ import com.sun.jna.win32.StdCallLibrary; import com.sun.jna.win32.W32APIFunctionMapper; import com.sun.jna.win32.W32APITypeMapper; +import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import static com.sun.jna.Library.OPTION_FUNCTION_MAPPER; @@ -123,8 +125,15 @@ public class WindowsCryptUtils { DATA_BLOB pDataOut); class DATA_BLOB extends Structure implements Structure.ByReference { + private static final List __FIELDS = Arrays.asList("cbData", "pbData"); + public W32API.DWORD cbData; public Pointer pbData; + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } } diff --git a/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java b/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java index 171a00ea699d..35eec6209e2e 100644 --- a/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java +++ b/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java @@ -23,6 +23,8 @@ import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.UnsupportedEncodingException; +import java.util.Arrays; +import java.util.List; import java.util.Map; /** @@ -350,6 +352,8 @@ public class Foundation { } public static class NSRect extends Structure implements Structure.ByValue { + private static final List __FIELDS = Arrays.asList("origin", "size"); + public NSPoint origin; public NSSize size; @@ -357,9 +361,16 @@ public class Foundation { origin = new NSPoint(x, y); size = new NSSize(w, h); } + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } public static class NSPoint extends Structure implements Structure.ByValue { + private static final List __FIELDS = Arrays.asList("x", "y"); + public CGFloat x; public CGFloat y; @@ -372,9 +383,16 @@ public class Foundation { this.x = new CGFloat(x); this.y = new CGFloat(y); } + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } public static class NSSize extends Structure implements Structure.ByValue { + private static final List __FIELDS = Arrays.asList("width", "height"); + public CGFloat width; public CGFloat height; @@ -387,6 +405,11 @@ public class Foundation { this.width = new CGFloat(width); this.height = new CGFloat(height); } + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } public static class CGFloat implements NativeMapped { diff --git a/updater/src/com/intellij/updater/Win32RestartManager.java b/updater/src/com/intellij/updater/Win32RestartManager.java index a502a57c0931..08f6b1ac021a 100644 --- a/updater/src/com/intellij/updater/Win32RestartManager.java +++ b/updater/src/com/intellij/updater/Win32RestartManager.java @@ -21,6 +21,9 @@ import com.sun.jna.platform.win32.WinDef; import com.sun.jna.ptr.IntByReference; import com.sun.jna.ptr.LongByReference; +import java.util.Arrays; +import java.util.List; + public interface Win32RestartManager extends Library { Win32RestartManager INSTANCE = (Win32RestartManager) Native.loadLibrary("Rstrtmgr", Win32RestartManager.class); @@ -30,11 +33,21 @@ public interface Win32RestartManager extends Library { int CCH_RM_MAX_SVC_NAME = 63; class RmUniqueProcess extends Structure { + private static final List __FIELDS = Arrays.asList("dwProcessId", "ProcessStartTime"); + public int dwProcessId; public WinBase.FILETIME ProcessStartTime; + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } class RmProcessInfo extends Structure { + private static final List __FIELDS = Arrays.asList( + "Process", "strAppName", "strServiceShortName", "ApplicationType", "AppStatus", "TSSessionId", "bRestartable"); + public RmUniqueProcess Process; public char[] strAppName = new char[CCH_RM_MAX_APP_NAME + 1]; public char[] strServiceShortName = new char[CCH_RM_MAX_SVC_NAME + 1]; @@ -42,6 +55,11 @@ public interface Win32RestartManager extends Library { public WinDef.LONG AppStatus; public int TSSessionId; public boolean bRestartable; + + @Override + protected List getFieldOrder() { + return __FIELDS; + } } int RmGetList(int dwSessionHandle,