Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe
java.lang.Object
net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe
- All Implemented Interfaces:
Closeable
,AutoCloseable
,VirtualMachine.ForHotSpot.Connection
- Enclosing interface:
VirtualMachine.ForHotSpot.Connection
public static class VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe
extends Object
implements VirtualMachine.ForHotSpot.Connection
Implements a connection for a Windows named pipe in JNA.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A factory for establishing a connection to a JVM using a named pipe in JNA.protected static class
A response that is sent via a named pipe.protected static interface
A library for interacting with Windows.protected static interface
A library for interacting with Windows.Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket, VirtualMachine.ForHotSpot.Connection.ForJnaSolarisDoor, VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe, VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>, VirtualMachine.ForHotSpot.Connection.Response
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe library to use for communicating with Windows attachment extension that is included as a DLL.private final com.sun.jna.platform.win32.WinDef.LPVOID
A pointer to the code that was injected into the target process.The library to use for communicating with Windows native functions.private static final int
Indicates a memory release.private final com.sun.jna.platform.win32.WinNT.HANDLE
The handle of the target VM's process.private final SecureRandom
A source of random values being used for generating pipe names. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForJnaWindowsNamedPipe
(VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsLibrary library, VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsAttachLibrary attachLibrary, com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.platform.win32.WinDef.LPVOID code) Creates a new connection via a named pipe. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES
CustomWinBase.SECURITY_ATTRIBUTES
is required here to "get" Medium Integrity Level.Executes a command on the current connection.
-
Field Details
-
MEM_RELEASE
private static final int MEM_RELEASEIndicates a memory release.- See Also:
-
library
The library to use for communicating with Windows native functions. -
attachLibrary
private final VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsAttachLibrary attachLibraryThe library to use for communicating with Windows attachment extension that is included as a DLL. -
process
private final com.sun.jna.platform.win32.WinNT.HANDLE processThe handle of the target VM's process. -
code
private final com.sun.jna.platform.win32.WinDef.LPVOID codeA pointer to the code that was injected into the target process. -
random
A source of random values being used for generating pipe names.
-
-
Constructor Details
-
ForJnaWindowsNamedPipe
protected ForJnaWindowsNamedPipe(VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsLibrary library, VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe.WindowsAttachLibrary attachLibrary, com.sun.jna.platform.win32.WinNT.HANDLE process, com.sun.jna.platform.win32.WinDef.LPVOID code) Creates a new connection via a named pipe.- Parameters:
library
- The library to use for communicating with Windows native functions.attachLibrary
- The library to use for communicating with Windows attachment extension that is included as a DLL.process
- The handle of the target VM's process.code
- A pointer to the code that was injected into the target process.
-
-
Method Details
-
execute
Executes a command on the current connection.- Specified by:
execute
in interfaceVirtualMachine.ForHotSpot.Connection
- Parameters:
protocol
- The target VMs protocol version for the attach API.argument
- The arguments to send to the target VM.- Returns:
- The response of the target JVM.
-
createSecurityAttributesToAllowMediumIntegrity
private com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES createSecurityAttributesToAllowMediumIntegrity()CustomWinBase.SECURITY_ATTRIBUTES
is required here to "get" Medium Integrity Level. In order to allow Medium Integrity Level clients to open and use a NamedPipe created by an High Integrity Level process.- Returns:
- A security attributes object that gives everyone read and write access.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-