Update dependency net.java.dev.jna:jna-platform to v5#166
Open
dev-mend-for-github-com[bot] wants to merge 1 commit into
Open
Update dependency net.java.dev.jna:jna-platform to v5#166dev-mend-for-github-com[bot] wants to merge 1 commit into
dev-mend-for-github-com[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.2.2→5.0.0By merging this PR, the below vulnerabilities will be automatically resolved:
Release Notes
java-native-access/jna (net.java.dev.jna:jna-platform)
v5.0.0Compare Source
=============
Features
HRESULTinc.s.j.p.win32.COM.COMException, introducec.s.j.p.win32.COM.COMInvokeExceptionas subclass ofCOMExceptionfor exception as the result of aIDispatch#Invoke. TheEXECPINFOis unwrapped into fields in theCOMInvokeExceptionand correctly freed. - @matthiasblaesing.Native#loadLibraryrequires that the interface class passed in is an instance of Library. The runtime check can be enhanced by using a constraint generic. This breaks binary compatibility (see notes below) - @d-noll.In a followup, the original
loadLibrarymethods were deprecated andNative#loadmethods were introduced, that hold the new generic definitions. So this change is now binary compatible.Structure#newInstancereceive the target type as a parameter. This adds a limited generic type, so that the return type ist the target type and not a generic structure, removing the necessity to do an explizit cast - @matthiasblaesing.@ComInterfaceannotation tocom.sun.jna.platform.win32.COM.util.IConnectionPointto make it possible to retrieve it viaIUnknown#queryInterface- @matthiasblaesing.Advapi32#EnumDependendServices,Advapi32#EnumServicesStatusExandAdvapi32#QueryServiceStatus.W32Service#stopServicewas modified to be more resilent when stopping service - @matthiasblaesing.com.sun.jna.platform.win32.Kernel32.ExpandEnvironmentStringsand add helper method for it asKernel32Util#expandEnvironmentStrings- @matthiasblaesing.ACEsfromcom.sun.jna.platform.win32.WinNT.ACLeven if the containedACEis not currently supported - @jrobhoward.c.s.j.Structure.FieldOrderannotation to define the field order of a structures without implementingStructure#getFieldOrder()- @idosu.GetProcessTimesandGetProcessIoCounterstocom.sun.jna.platform.win32.Kernel32- @dbwiddis.CreateMutex,OpenMutexandReleaseMutextocom.sun.jna.platform.win32.Kernel32- @matthiasblaesing.PdhLookupPerfNameByIndex,PdhLookupPerfIndexByName, andPdhEnumObjectItemstoc.s.j.platform.win32.Pdhand ac.s.j.platform.win32.PdhUtilclass to access them - @dbwiddis.PERF_OBJECT_TYPE,PERF_COUNTER_BLOCK, andPERF_COUNTER_DEFINITIONtoc.s.j.platform.win32.WinPerfand addedPointerconstructors to ``PERF_INSTANCE_DEFINITIONandPERF_DATA_BLOCK` - @dbwiddis.WTS_PROCESS_INFO_EX,WTSEnumerateProcessesEx, andWTSFreeMemoryExtoc.s.j.platform.win32.Wtsapi32- @dbwiddis.GetIfEntry,GetIfEntry2, andGetNetworkParamsand supporting structuresMIB_IFROW,MIB_IF_ROW2, andFIXED_INFOtoc.s.j.platform.win32.IPHlpAPI.java- @dbwiddis.CM_Locate_DevNode,CM_Get_Parent,CM_Get_Child,CM_Get_Sibling,CM_Get_Device_ID, andCM_Get_Device_ID_Sizetoc.s.j.platform.win32.Cfgmgr32.javaand ac.s.j.platform.win32.Cfgmgr32Utilclass forCM_Get_Device_ID- @dbwiddis.PdhLookupPerfIndexByEnglishNametoc.s.j.platform.win32.PdhUtil- @dbwiddis.c.s.j.platform.mac.SystemBfor Process, Network interface, Swapfile, Time, and Filesystem info - @dbwiddis.Sysinfostructure and function toc.s.j.platform.linux.LibC- @dbwiddis.c.s.j.platform.win32.Advapi32Utilmethods which allow the caller to specifysamDesiredExtrato request additional registry key security and access rights - @camw.NativeMappedto be used with enums - @koraktor.CoInitializeSecurityandCoSetProxyBlankettoc.s.j.platform.win32.Ole32, added newc.s.j.platform.win32.Wbemcliclasses needed to query WMI, and added aWbemcliUtilclass implementing WMI queries. - @dbwiddis.~/Library/Application Support/JNA/tempand on other Unix like systems$XDG_CACHE_DIR/JNA/temp(Default value is:~/.cache/JNA/temp) is used - @matthiasblaesing.com.sun.jna.platform.win32.Kernel32#ExitProcess- @Groostav.Bug Fixes
com.sun.jna.platform.win32.SecBufferDescand add convenience binding ascom.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDesc. Bind SSPI functionsInitializeSecurityContext,AcceptSecurityContext,QueryCredentialsAttributes,QuerySecurityPackageInfo,EncryptMessage,DecryptMessage,MakeSignature,VerifySignatureincom.sun.jna.platform.win32.Secur32- @matthiasblaesing.COMLateBindingObject#getStringProperty- @matthiasblaesing.gethostname,sethostname,getdomainnameandsetdomainnameand bindcom.sun.jna.platform.win32.Winsock2.gethostname(byte[], int)- @matthiasblaesing.ELFAnalyser#runDetection, fix suggested by @Sylvyrfysh in #880 - @matthiasblaesing.com.sun.jna.platform.win32.COM.util.ProxyObject#disposemultiple times - @matthiasblaesing.Structure#validateand preventArrayIndexOutOfBoundsExceptioninSAFEARRAY#readfor zero dimensions - @matthiasblaesing.javahwas removed from the JDK and
javacis now used to create the necessary headers.JNA now has JDK 8 as the minimum build version, at runtime Java 6 is the minimum version.
Native code for platforms with a JDK version lower than 8 can still be build by (demonstrated for Solaris x86):
- Run `ant -Dbuild.os.name=SunOS -Dbuild.os.arch=x86 native-build-package`
- Transfer the `build/build-package-sunos-x86-5.2.1.zip` file to the target system. The file holds the native sources, the necessary headers and and a shell script for the build.
- Expand the zip on the target system.
- Setup `JAVA_HOME` to point to the JDK sources.
- Change into the expanded directory and run `bash build.sh`.
- The resulting `sunos-x86.jar` is copied back to the original build system to `lib/native/sunos-x86.jar`
- [@matthiasblaesing](https://redirect.github.com/matthiasblaesing).JNIEnvpointer was used to access the JVM - @matthiasblaesing.lpAccessNameparameter ofcom.sun.jna.platform.win32.Mpr#WNetUseConnection- @matthiasblaesing.jna.nosystotrue. By default then the embedded native library is used - @matthiasblaesing.Breaking Changes
com.sun.jna.Pointer#SIZEis removed. Its use is replaced bycom.sun.jna.Native#POINTER_SIZEto prevent a class loading deadlock, when JNA is initialized from multiple threads
com.sun.jna.Pointer#getString(long offset, boolean wide)is removed. It was replaced bycom.sun.jna.Pointer#getString(long offset)orcom.sun.jna.Pointer#getWideString(long offset)com.sun.jna.Pointer#getStringArray(long offset, boolean wide)is removed. It was replaced bycom.sun.jna.Pointer#getStringArray(long offset)orcom.sun.jna.Pointer#getWideStringArray(long offset)com.sun.jna.Pointer#setString(long offset, String value, boolean wide)is removed. It was replaced bycom.sun.jna.Pointer#setString(long offset, String value)orcom.sun.jna.Pointer#setWideString(long offset, String value)com.sun.jna.Structure#setFieldOrderis removed. It was replaced bycom.sun.jna.Structure#getFieldOrderand threw anjava.lang.Erroron call.com.sun.jna.Native#parseVersionwas removed without replacementcom.sun.jna.Native#setPreserveLastErrorandcom.sun.jna.Native#getPreserveLastErrorwere removed without replacement. They were turned into NOOPs in the past.
com.sun.jna.Native#getDirectByteBufferwas replaced bycom.sun.jna.Pointer#getByteBuffergethostname,sethostname,getdomainnameand
setdomainnamein the interfacecom.sun.jna.platform.unix.LibCAPIwere changed from
(char[] name, int len)to(byte[] name, int len)com.sun.jna.Platform#isAixwas replaced bycom.sun.jna.Platform#isAIXcom.sun.jna.platform.win32.Sspi.SecBufferDescwas incompatibly changed tomatch the correct native semantics. SecBufferDesc describing more than one
buffer were broken. For most usecases
com.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDescis the bestalternative.
com.sun.jna.platform.win32.WinBase.FILETIME#toLong()was replaced bycom.sun.jna.platform.win32.WinBase.FILETIME#toTime()com.sun.jna.platform.win32.Variant#COM_DAYS_ADJUSTMENTwas removedcom.sun.jna.platform.win32.Variant#MICRO_SECONDS_PER_DAYwas removedcom.sun.jna.platform.win32.Variant.VARIANT#toJavaDatewas removedcom.sun.jna.platform.win32.Variant.VARIANT#fromJavaDatewas removedcom.sun.jna.platform.win32.User32#MonitorFromPoint(Point pt, int dwFlags)was replaced by
com.sun.jna.platform.win32.User32#MonitorFromPoint(Point.ByValue pt, int dwFlags)com.sun.jna.platform.win32.OleAuto.LoadTypeLib(WString, PointerByReference)was replaced by
com.sun.jna.platform.win32.OleAuto.LoadTypeLib(String, PointerByReference)com.sun.jna.platform.win32.Kernel32Util.formatMessageFromHR(HRESULT)was replaced by
com.sun.jna.platform.win32.Kernel32Util.formatMessage(HRESULT)com.sun.jna.platform.win32.COM.COMExceptionwas structurally modified. ThepExcepInfoandpuArgErrmembers were removed andhresultmember was added.The now missing information in
COMExceptionwas moved toCOMInvokeException.com.sun.jna.platform.win32.COM.IShellFolder#GetDisplayNameOfwas changed from
PointerByReferencetoSTRRETand matching this,the first parameter of
com.sun.jna.platform.win32.Shlwapi.StrRetToStrwaschanged identically.
ACE_HEADERreplacesACEStructureas the base class forACEs.com.sun.jna.platform.win32.WinNT.ACLwas modified to support ACLS, that containACEsother thanACCESS_ALLOWED_ACE_TYPEandACCESS_DENIED_ACE_TYPEbywidening the return type of
getACEStructurestoACE_HEADER[]and renamingthe method to
getACEs. Inconsequence
com.sun.jna.platform.win32.Advapi32Util#getFileSecuritywaschanged similarly. The SID accessors
getSidStringandgetSIDwere movedfrom
ACEStructuretoACCESS_ACEStructure.com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID.ByReference pguid)was replaced bycom.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID pguid)andcom.sun.jna.platform.win32.Ole32#CLSIDFromString(WString lpsz, CLSID.ByReference pclsid)was replaced bycom.sun.jna.platform.win32.Ole32#CLSIDFromString(String lpsz, CLSID.ByReference pclsid)v4.5.2Compare Source
v4.5.1Compare Source
v4.5.0Compare Source
=============
Features
OleBuildVersion,OleInitialize,OleUninitialize,OleFlushClipboard,OleRun, add VARIANT conversion functions to OleAuto, add default locale, LCID and LANG to WinNT - @matthiasblaesing.boolean[]in direct mapping - @ncruces.com.sun.jna.platform.win32.Advapi32:StartServiceCtrlDispatcher,RegisterServiceCtrlHandler,RegisterServiceCtrlHandlerEx,SetServiceStatus,CreateService,DeleteServiceandcom.sun.jna.platform.win32.Winsvc:Handler,HandlerEx,SERVICE_MAIN_FUNCTION,SERVICE_TABLE_ENTRY,SERVICE_DESCRIPTION,SERVICE_STATUS_HANDLE- @matthiasblaesing.Bug Fixes
com.sun.jna.platform.win32.User32#MonitorFromPoint- @matthiasblaesing.v4.4.0Compare Source
=============
Features
Bug Fixes
v4.3.0Compare Source
=============
Features
com.sun.jna.platform.win32.Mpr,com.sun.jna.platform.win32.LmShare, andcom.sun.jna.platform.win32.Winnetwk- @amarcionek.ACCESS_*definitions tocom.sun.jna.platform.win32.LmAccess- @amarcionek.NetShareAddandNetShareDeltocom.sun.jna.platform.win32.Netapi32- @amarcionek.CreateProcessWithLogonWtocom.sun.jna.platform.win32.Advapi32- @mlfreeman2.CertAddEncodedCertificateToSystemStoretocom.sun.jna.platform.win32.Crypt32- @mlfreeman2.BitBlttocom.sun.jna.platform.win32.GDI32, Addedcom.sun.jna.platform.win32.GDI32Utiland addedgetScreenshot()to it - @mlfreeman2.SHEmptyRecycleBin,ShellExecuteExtocom.sun.jna.platform.win32.Shell32- @mlfreeman2.GetDesktopWindowtocom.sun.jna.platform.win32.User32- @mlfreeman2.ProcessIdToSessionId,LoadLibraryEx,FreeLibraryandFind/Load/Lock/SizeofResourcetocom.sun.jna.platform.win32.Kernel32- @mlfreeman2.EnumResourceTypesandEnumResourceNamestocom.sun.jna.platform.win32.Kernel32- @mlfreeman2.GetSystemTimestocom.sun.jna.platform.win32.Kernel32- @dbwiddis.com.sun.jna.platform.win32.WinBase.FILETIME- @dbwiddis.bool- @twall.XFetchNametoX11interface - @pinaf.Module32FirstWandModule32NextWtocom.sun.jna.platform.win32.Kernel32(and helper tocom.sun.jna.platform.win32.Kernel32Util) andMODULEENTRY32Wstructure tocom.sun.jna.platform.win32.Tlhelp32- @mlfreeman2.com.sun.jna.platform.win32.VersionUtilwithgetFileVersionInfoutility method to get file major, minor, revision, and build version parts - @mlfreeman2.com.sun.jna.platform.win32.Wininetwith the following 4 methods:FindFirstUrlCacheEntry,DeleteUrlCacheEntry,FindCloseUrlCache,FindNextUrlCacheEntry, and theINTERNET_CACHE_ENTRY_INFOstructure, and a helper incom.sun.jna.platform.win32.WininetUtilfor parsing WinInet's cache - @mlfreeman2.PrintWindow,IsWindowEnabled,IsWindow,FindWindowEx,GetAncestor,GetCursorPos,SetCursorPos,SetWinEventHook,UnhookWinEvent,CopyIcon, andGetClassLongtocom.sun.jna.platform.win32.User32and supporting constants tocom.sun.jna.platform.win32.WinUser- @mlfreeman2.EnumProcessModules,GetModuleInformation, andGetProcessImageFileNametocom.sun.jna.platform.win32.Psapiand addedExtractIconExtocom.sun.jna.platform.win32.Shell32- @mlfreeman2.com.sun.jna.platform.win32.Winspool.PRINTER_INFO_2support. Added GetPrinter and ClosePrinter functions incom.sun.jna.platform.win32.Winspool- @IvanRF.com.sun.jna.MethodResultContextin direct mapping (as done in interface mapping) - @marco2357.Kernel32Util.freeLocalMemory()/Kernel32Util.freeGlobalMemory()always throwcom.sun.jna.platform.win32.Win32Exceptionif failed - @lgoldstein.com.sun.jna.platform.win32.Win32Exceptionextendcom.sun.jna.LastErrorException- @lgoldstein.com.sun.jna.platform.win32.Kernel32Util.closeHandle()method that throws acom.sun.jna.platform.win32.Win32Exceptionif failed to close the handle - @lgoldstein.wTypeFlagsincom.sun.jna.platform.win32.OaIdl.TYPEATTR- @SevenOf9Sleeper.com.sun.jna.platform.win32.COM.util.Convertmore flexible and dependable - @matthiasblaesing.com.sun.jna.platform.win32.Psapi.GetPerformanceInfo(),com.sun.jna.platform.win32.Kernel32.GetTickCount64(), andcom.sun.jna.platform.win32.Kernel32.SetErrorMode()- @dbwiddis.com.sun.jna.platform.win32.COM.util.CallbackProxybased callbacks - @matthiasblaesing.com.sun.jna.platform.win32.COM.util.ProxyObject-based COM calls - @matthiasblaesing.XSetWMProtocolsandXGetWMProtocolstocom.sun.jna.platform.unix.X11- @zainab-ali.com.sun.jna.platform.win32.Advapi32- @amarcionek.com.sun.jna.platform.win32.NtDll- @amarcionek.SetCurrentProcessExplicitAppUserModelIDandGetCurrentProcessExplicitAppUserModelIDtocom.sun.jna.platform.win32.Shell32for setting the System.AppUserModel.ID of the host process - @rednoah.GetClientRecttocom/sun/jna/platform/win32/User32- @Jonatino.GetProcAddress(HMODULE, int)tocom.sun.jna.platform.win32.Kernel32- @matthiasblaesing.com.sun.jna.platform.win32.Wevtapiandcom.sun.jna.platform.win32.Winevt- @sakamotodesu.SetThreadExecutionStatetocom.sun.jna.platform.win32.Kernel32- @matthiasblaesing.GetSecurityDescriptorOwner,SetSecurityDescriptorOwner,GetSecurityDescriptorGroup,SetSecurityDescriptorGroup,GetSecurityDescriptorControl,SetSecurityDescriptorControl,GetSecurityDescriptorDacl,SetSecurityDescriptorDacl,MakeSelfRelativeSD,MakeAbsoluteSD,EqualSid,InitializeSecurityDescriptor,InitializeAcl,AddAce,AddAccessAllowedAce,AddAccessAllowedAceEx, andGetAceto `com.sun.jna.platform.win32.Advapi32 - @amarcionek.RtlNtStatusToDosErrorto `com.sun.jna.platform.win32.NtDll - @amarcionek.com.sun.jna.platform.win32.WinioctlUtilfor help in determining FSCTL_* codes - @amarcionek.com.sun.jna.platform.win32.Ntifswith Reparse Point structures and defines - @amarcionek.GetFileInformationByHandleExandSetFileInformationByHandletocom.sun.jna.platform.win32.Kernel32- @amarcionek.com.sun.jna.platform.win32.WinioctlUtilfor simplicity dealing with FSCTL_* codes - @amarcionek.Bug Fixes
SysStringByteLenandSysStringLentocom.sun.jna.platform.win32.OleAuto- @matthiasblaesing.platform.win32.COM.COMBindingBaseObjectswallows reason if instantiation fails - @matthiasblaesing.com.sun.jna.platform.win32.DsGetDC,com.sun.jna.platform.win32.LMAccess,com.sun.jna.platform.win32.LMShare,com.sun.jna.platform.win32.Sspi,com.sun.jna.platform.win32.WinBase,com.sun.jna.platform.win32.WinCrypt,com.sun.jna.platform.win32.WinUserandcom.sun.jna.platform.win32.Winnetwk- @matthiasblaesing.Native.toString()in#getFileName()and#getAlternateFileName()inc.s.j.p.win32.WinBaseinstead of custom NUL terminator logic - @jhult.