Package net.bytebuddy.agent
Interface VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsLibrary
-
- All Superinterfaces:
com.sun.jna.AltCallingConvention,com.sun.jna.Library,com.sun.jna.win32.StdCall,com.sun.jna.win32.StdCallLibrary
- Enclosing class:
- VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe
protected static interface VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsLibrary extends com.sun.jna.win32.StdCallLibraryA library for interacting with Windows.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.sun.jna.platform.win32.WinNT.HANDLECreateRemoteThread(com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES securityAttributes, int stackSize, com.sun.jna.Pointer code, com.sun.jna.Pointer argument, com.sun.jna.platform.win32.WinDef.DWORD creationFlags, com.sun.jna.Pointer threadId)An alternative implementation ofKernel32.CreateRemoteThread(WinNT.HANDLE, WinBase.SECURITY_ATTRIBUTES, int, WinBase.FOREIGN_THREAD_START_ROUTINE, Pointer, WinDef.DWORD, Pointer)that uses a pointer as thecodeargument rather then a structure to avoid accessing foreign memory.booleanGetExitCodeThread(com.sun.jna.platform.win32.WinNT.HANDLE thread, com.sun.jna.ptr.IntByReference exitCode)Receives the exit code of a given thread.com.sun.jna.PointerVirtualAllocEx(com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.Pointer address, int size, int allocationType, int protect)Changes the state of memory in a given process.booleanVirtualFreeEx(com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.Pointer address, int size, int freeType)Frees memory in the given process.
-
-
-
Method Detail
-
VirtualAllocEx
com.sun.jna.Pointer VirtualAllocEx(com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.Pointer address, int size, int allocationType, int protect)Changes the state of memory in a given process.- Parameters:
process- The process in which to change the memory.address- The address of the memory to allocate.size- The size of the allocated region.allocationType- The allocation type.protect- The memory protection.- Returns:
- A pointer to the allocated memory.
-
VirtualFreeEx
boolean VirtualFreeEx(com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.Pointer address, int size, int freeType)Frees memory in the given process.- Parameters:
process- The process in which to change the memory.address- The address of the memory to free.size- The size of the freed region.freeType- The freeing type.- Returns:
trueif the operation succeeded.
-
CreateRemoteThread
@MaybeNull com.sun.jna.platform.win32.WinNT.HANDLE CreateRemoteThread(com.sun.jna.platform.win32.WinNT.HANDLE process, @MaybeNull com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES securityAttributes, int stackSize, com.sun.jna.Pointer code, com.sun.jna.Pointer argument, @MaybeNull com.sun.jna.platform.win32.WinDef.DWORD creationFlags, @MaybeNull com.sun.jna.Pointer threadId)
An alternative implementation ofKernel32.CreateRemoteThread(WinNT.HANDLE, WinBase.SECURITY_ATTRIBUTES, int, WinBase.FOREIGN_THREAD_START_ROUTINE, Pointer, WinDef.DWORD, Pointer)that uses a pointer as thecodeargument rather then a structure to avoid accessing foreign memory.- Parameters:
process- A handle of the target process.securityAttributes- The security attributes to use ornullif no attributes are provided.stackSize- The stack size or0for using the system default.code- A pointer to the code to execute.argument- A pointer to the argument to provide to the code being executed.creationFlags- The creation flags ornullif no flags are set.threadId- A pointer to the thread id ornullif no thread reference is set.- Returns:
- A handle to the created remote thread or
nullif the creation failed.
-
GetExitCodeThread
boolean GetExitCodeThread(com.sun.jna.platform.win32.WinNT.HANDLE thread, com.sun.jna.ptr.IntByReference exitCode)Receives the exit code of a given thread.- Parameters:
thread- A handle to the targeted thread.exitCode- A reference to the exit code value.- Returns:
trueif the exit code retrieval succeeded.
-
-