本文整理了Java中com.sun.jna.Native.setProtected()
方法的一些代码示例,展示了Native.setProtected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.setProtected()
方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:setProtected
[英]Set whether native memory accesses are protected from invalid accesses. This should only be set true when testing or debugging, and should not be considered reliable or robust for multithreaded applications. Protected mode will be automatically set if the system property jna.protected
has a value of "true" when the JNA library is first loaded.
If not supported by the underlying platform, this setting will have no effect.
[中]设置是否保护本机内存访问不受无效访问的影响。这只应在测试或调试时设置为true,对于多线程应用程序不应被视为可靠或健壮。如果首次加载JNA库时系统属性jna.protected
的值为“true”,则会自动设置保护模式。
如果基础平台不支持,此设置将无效。
代码示例来源:origin: net.java.dev.jna/jna
setProtected(true);
代码示例来源:origin: martin-lizner/trezor-ssh-agent
/**
* @param eventSource - component
*/
public JNIMouseHook(Component eventSource) {
if (!Platform.isWindows()) {
throw new UnsupportedOperationException("Not supported on this platform.");
}
SOURCE = eventSource;
USER32INST = JNIMouseHook.User32.INSTANCE;
KERNEL32INST = Kernel32.INSTANCE;
mouseHook = hookTheMouse();
Native.setProtected(true);
}
代码示例来源:origin: com.sun.jna/jna
setProtected(true);
代码示例来源:origin: org.elasticsearch/jna
setProtected(true);
代码示例来源:origin: net.java.dev.jna/platform
throws COMException {
Native.setProtected(true);
内容来源于网络,如有侵权,请联系作者删除!