public interface WindowsNativeUtil extends NativeUtil
| Modifier and Type | Interface and Description |
|---|---|
static class |
WindowsNativeUtil._locking_Mode
see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/locking?
|
static class |
WindowsNativeUtil.CreateFileA_createMode |
static class |
WindowsNativeUtil.Path_VolumeName |
| Modifier and Type | Method and Description |
|---|---|
String |
__get_cpuid_count_model()
Returns the CPU Model string.
|
int[] |
__get_cpuid_count(int code,
int subcode)
queries the cpu for info.
|
boolean |
_locking(int fd,
WindowsNativeUtil._locking_Mode mode,
long len)
returns true if successful false if not.
|
Stat |
_stat64(String path) |
void |
CancelIo(long handle) |
void |
CancelIoEx(long handle,
long overlapped) |
void |
CancelSynchronousIo(long threadHandle) |
void |
ClearCommBreak(long handle) |
int |
ClearCommError(long handle) |
int |
ClearCommError(long handle,
ComStat stat) |
void |
CloseHandle(long handle)
Closes a windows handle.
|
void |
ConnectNamedPipe(long pipeHandle) |
long |
ConnectNamedPipe(long pipeHandle,
long eventHandle) |
long |
ConvertInterfaceIndexToLuid(int idx) |
String |
ConvertInterfaceLuidToAlias(long luid) |
int |
ConvertInterfaceLuidToIndex(long luid) |
String |
ConvertInterfaceLuidToNameA(long luid) |
long |
ConvertInterfaceNameToLuidA(String name) |
long |
CreateEventA(long lpEventAttributes,
boolean manualReset,
boolean initialState,
String name)
Returns a newly created event handle from the OS.
|
long |
CreateFileA(String lpFileName,
int access,
boolean allowDelete,
boolean allowRead,
boolean allowWrite,
WindowsNativeUtil.CreateFileA_createMode openMode,
int attributes)
opens a windows handle for a given path.
|
long |
CreateFileMappingA(long hFile,
long lpFileMappingAttributes,
int flProtect,
int dwMaximumSizeHigh,
int dwMaximumSizeLow,
String lpName)
Creates a file mapping.
|
long |
CreateFileW(String lpFileName,
int access,
boolean allowDelete,
boolean allowRead,
boolean allowWrite,
WindowsNativeUtil.CreateFileA_createMode openMode,
int attributes)
opens a windows handle for a given path.
|
void |
CreateHardLinkA(String lpFileName,
String lpExistingFileName)
Makes a hard link.
|
boolean |
CreateIpForwardEntry2(MibIpForwardRow2 entry) |
long |
CreateNamedPipeA(String name,
int dwOpenMode,
int dwPipeMode,
int nMaxInstances,
int nOutBufferSize,
int nInBufferSize,
int nDefaultTimeOut,
long lpSecurityAttributes) |
long |
CreateSemaphoreExA(long lpSemaphoreAttributes,
long initialCount,
long maximumCount,
String name,
int dwDesiredAccess)
Create or open semaphore handle.
|
void |
CreateSymbolicLinkA(String lpSymlinkFileName,
String lpTargetFileName,
boolean targetIsDir,
boolean isDevMode)
Makes a symbolic link.
|
int |
CTL_CODE(int DeviceType,
int Function,
int Method,
int Access)
Helper function for CTL_CODE macro that can be used to generate the dwIoControlCode for the DeviceIoControl function.
|
boolean |
DeleteIpForwardEntry2(MibIpForwardRow2 entry) |
int |
DeviceIoControl(long hDevice,
int dwIoControlCode,
byte[] inBuffer,
int inOff,
int inLen,
byte[] outBuffer,
int outOff,
int outLen)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
|
int |
DeviceIoControl(long hDevice,
int dwIoControlCode,
NativeMemory inBuffer,
long inOff,
int inLen,
NativeMemory outBuffer,
long outOff,
int outLen)
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
|
void |
DisconnectNamedPipe(long pipeHandle) |
long |
DuplicateHandle(long srcProcess,
long handle,
long targetProcess,
int access,
boolean inheritHandle,
boolean closeSource,
boolean sameAccess) |
void |
EscapeCommFunction(long handle,
int func) |
String |
ExpandEnvironmentStringsA(String str) |
void |
FlushFileBuffers(long handle) |
String |
FormatMessageA(int lastError)
Returns a english string repesentation of the native error code
This only works for all calls to methods that start with a capital case letter.
|
void |
free(long ptr)
Calls free on a pointer.
|
long |
GetAdapterIndex(String adapterName)
returns a unfriendly adapter index based on adapter name (GUID).
|
Collection<IpAdapterAddresses> |
GetAdaptersAddresses(long family,
long flags)
Returns adapter addresses.
|
CommConfig |
GetCommConfig(long handle) |
int |
GetCommMask(long handle) |
int |
GetCommModemStatus(long handle) |
CommProp |
GetCommProperties(long handle) |
DCB |
GetCommState(long handle) |
CommTimeouts |
GetCommTimeouts(long handle) |
long |
GetCurrentProcess()
Returns a pseudo handle to the current process.
|
long |
GetCurrentThread()
Returns a pseudo Thread handle that always means current thread.
|
CommConfig |
GetDefaultCommConfigA(String name) |
String |
GetEnvironmentVariableA(String name) |
int |
getFD(FileDescriptor fd)
Returns the int based file descriptor of the given java FileDescriptor or -1 if it is invalid.
|
int |
GetFileAttributesA(String str) |
Win32FileAttributeData |
GetFileAttributesEx(String path)
Returns file attributes.
|
String |
GetFinalPathNameByHandleA(long handle,
boolean normalize,
WindowsNativeUtil.Path_VolumeName volumeName) |
String |
GetFinalPathNameByHandleW(long handle,
boolean normalize,
WindowsNativeUtil.Path_VolumeName volumeName) |
int |
GetFriendlyIfIndex(long index)
Returns a friendly adapter index.
|
long |
getHandle(FileDescriptor fd)
Returns the HANDLE (void *) based file descriptor of the given java FileDescriptor or -1 (INVALID_HANDLE_VALUE) if it is invalid.
|
List<MibIpForwardRow2> |
GetIpForwardTable2(int Family) |
String |
GetModuleFileNameA(long hModule) |
int |
GetOverlappedResult(long handle,
long overlapped,
boolean wait)
Gets the result from an async io operation on a handle.
|
int |
getPointerSize()
Returns size of void* or windows HANDLE datatype in bytes.
|
byte[] |
GetTokenInformation(long TokenHandle,
int TokenInformationClass)
Gets information about a token
|
String |
GetVolumePathNameW(String path) |
long |
INVALID_HANDLE_VALUE() |
Iterable<String> |
iterateDeviceInterfaces(GUID deviceClass,
String enumerator,
int flags,
GUID interfaceClass)
Convenience method that uses the SetupDiGetClassDevsA+SetupDiEnumDeviceInterfaces+SetupDiGetDeviceInterfaceDetail
Syscalls to provide the return value of SetupDiGetDeviceInterfaceDetail into a iterable for easier use.
|
Iterable<RegEnumKeyExResult> |
iterateRegistrySubKeys(long hkey)
Convenience method that returns an iterable over all subkeys of a hkey.
|
boolean |
LockFileEx(long handle,
boolean exclusive,
boolean failImmediately,
long start,
long len)
returns true if successful false if not.
|
NativeMemory |
malloc(long size)
Allocates a new pointer of the given size
|
long |
MapViewOfFileEx(long hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
int dwNumberOfBytesToMap,
long lpBaseAddress) |
long |
OpenEventA(int desiredAccess,
boolean inheritHandle,
String name) |
long |
OpenFileMappingA(int dwDesiredAccess,
boolean bInheritHandle,
String lpName)
Opens an existing file mapping.
|
long |
OpenProcessToken(long ProcessHandle,
int DesiredAccess)
Opens a process token handle.
|
NativeMemory |
pointer(long ptr,
long size,
PointerHandler handler)
Any calls to the resulting NativeMemory may cause the JVM to die due to a SEGFAULT is size is not specified correctly.
|
void |
PurgeComm(long handle,
int flags) |
int |
ReadFile(long handle,
byte[] buffer,
int off,
int len)
Reads bytes from a handle into a buffer.
|
int |
ReadFile(long handle,
ByteBuffer buffer,
int len)
Reads bytes from a handle into a buffer.
|
int |
ReadFile(long handle,
NativeMemory buffer,
long off,
int len)
Reads bytes from a handle into a buffer.
|
long |
ReadFile(long handle,
NativeMemory buffer,
long off,
int len,
long overlapped,
long event)
reads using overlapped mechanism. returns an overlapped pointer that must be feed by calling
free(long) after it has been confirmed that the async READ is done by calling GetOverlappedResult. |
void |
RegCloseKey(long hkey) |
RegEnumKeyExResult |
RegEnumKeyExA(long hkey,
int index,
int maxSubKeyLen,
int maxClassLen)
Enumerate subkeys of a registry key.
|
RegEnumValueResult |
RegEnumValueA(long hkey,
int index) |
long |
RegOpenKeyExA(long hkey,
String subKey,
int options,
int sam) |
RegQueryInfoKeyResult |
RegQueryInfoKeyA(long hkey)
Get information about a registry key.
|
RegData |
RegQueryValueExA(long hkey,
String valueName)
Read a registry value.
|
long |
ReleaseSemaphore(long hSemaphore,
long lReleaseCount)
releases a "locked" semaphore
|
void |
ResetEvent(long handle)
Resets the given event handle.
|
void |
SetCommBreak(long handle) |
void |
SetCommConfig(long handle,
CommConfig config) |
void |
SetCommMask(long handle,
int mask) |
void |
SetCommState(long handle,
DCB dcb) |
void |
SetCommTimeouts(long handle,
CommTimeouts timeouts) |
void |
SetDefaultCommConfigA(String name,
CommConfig config) |
void |
SetEnvironmentVariableA(String name,
String value) |
void |
SetEvent(long handle)
Sets a event identified by the handle
|
void |
SetFileAttributesA(String str,
int attr) |
void |
SetupComm(long handle,
int dwInQueue,
int dwOutQueue) |
void |
SetupDiDestroyDeviceInfoList(long handle)
Destroys a handle created by SetupDiGetClassDevsA
|
SpDeviceInterfaceData |
SetupDiEnumDeviceInterfaces(long DeviceInfoSet,
SpDeviceInfoData DeviceInfoData,
GUID InterfaceClassGuid,
int index)
Get a device element from the device set.
|
long |
SetupDiGetClassDevsA(GUID ClassGuid,
String Enumerator,
long hwndParent,
int flags)
Create a device enumeration for connected hardware devices.
|
String |
SetupDiGetDeviceInterfaceDetail(long DeviceInfoSet,
SpDeviceInterfaceData DeviceInterfaceData,
SpDeviceInfoData outputData)
Get detailed info from a device.
|
long |
ShellExecuteA(long hwnd,
String lpOperation,
String lpFile,
String lpParameters,
String lpDirectory,
int nShowCmd)
Performs an operation on a specified file.
|
String |
strerror_s(int errno)
Returns a english string repesentation of the native error code.
|
void |
TransmitCommChar(long handle,
byte data) |
boolean |
UnlockFileEx(long handle,
long start,
long len)
returns true if successful false if not.
|
void |
UnmapViewOfFile(long address) |
int |
WaitCommEvent(long handle) |
int |
WaitForMultipleObjects(long[] handles,
int millis,
boolean waitAll)
Wait for any or all event handles in a handle array.
|
boolean |
WaitForSingleObject(long handle,
int millis)
Waits for a single event handle.
|
boolean |
WaitNamedPipeA(String name,
long timeout)
returns true if ConnectNamedPipe will succeed.
|
int |
WriteFile(long handle,
byte[] buffer,
int off,
int len)
Writes bytes from a Buffer into a handle.
|
int |
WriteFile(long handle,
ByteBuffer buffer,
int len)
Writes bytes from a Buffer into a handle.
|
int |
WriteFile(long handle,
NativeMemory buffer,
long off,
int len)
Writes bytes from a Buffer into a handle.
|
long |
WriteFile(long handle,
NativeMemory buffer,
long off,
int len,
long overlapped,
long event)
writes using overlapped mechanism. returns an overlapped pointer that must be feed by calling
free(long) after it has been confirmed that the async WRITE is done by calling GetOverlappedResult. |
int getFD(FileDescriptor fd)
long getHandle(FileDescriptor fd)
int getPointerSize()
int[] __get_cpuid_count(int code,
int subcode)
String __get_cpuid_count_model()
boolean _locking(int fd,
WindowsNativeUtil._locking_Mode mode,
long len)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
In detail: true if _locking() returns true. false if _locking() returns false and errno is set to EACCES. any other errno leads to UnknownNativeErrorException.
The start position the lock has will always be the current position in the file. Meaning if you want to unlock a lock you will HAVE TO move it back to position it was in when you made the lock. You have to use methods like RandomAccessFiles.seek() to accomplish this.
boolean LockFileEx(long handle,
boolean exclusive,
boolean failImmediately,
long start,
long len)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
boolean UnlockFileEx(long handle,
long start,
long len)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
NativeMemory malloc(long size) throws OutOfMemoryError, IllegalArgumentException
OutOfMemoryError - if malloc returns NULLIllegalArgumentException - if size is <= 0void free(long ptr)
ptr - the pointer.NativeMemory pointer(long ptr, long size, PointerHandler handler) throws NullPointerException
ptr - pointer to the datasize - -1 if unknown.NullPointerExceptionStat _stat64(String path) throws UnknownNativeErrorException, FileNotFoundException, IllegalArgumentException
Win32FileAttributeData GetFileAttributesEx(String path) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid CreateSymbolicLinkA(String lpSymlinkFileName, String lpTargetFileName, boolean targetIsDir, boolean isDevMode) throws UnknownNativeErrorException
lpSymlinkFileName - The name of the symbolic link. This is where the acutal link is createdlpTargetFileName - This is the name of the target where the link points to.targetIsDir - if true flag =| 0x1 is performed -> SYMBOLIC_LINK_FLAG_DIRECTORYisDevMode - if true flag =| 0x2 is poformed -> SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
according to microsoft this only works when "Developer Mode" is enabled.UnknownNativeErrorExceptionvoid CreateHardLinkA(String lpFileName, String lpExistingFileName) throws UnknownNativeErrorException
lpFileName - The name of the hard link. This is where the acutal link is createdlpExistingFileName - This is the name of the target where the link points to.UnknownNativeErrorExceptionlong CreateFileA(String lpFileName, int access, boolean allowDelete, boolean allowRead, boolean allowWrite, WindowsNativeUtil.CreateFileA_createMode openMode, int attributes) throws FileAlreadyExistsException, SharingViolationException, UnknownNativeErrorException
lpFileName - the path to the fileaccess - flag integer for meaning of bits see https://docs.microsoft.com/en-us/windows/win32/secauthz/access-maskallowDelete - allow another process to delete the file while it is opened by this processallowRead - allow another process to read the file while it is opened by this processallowWrite - allow another process to write the file while it is opened by this processopenMode - defines how the file is openedattributes - flag integer for meaning of bits see https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constantsFileAlreadyExistsException - CREATE_ALWAYS when the file already existsSharingViolationExceptionUnknownNativeErrorExceptionlong CreateFileW(String lpFileName, int access, boolean allowDelete, boolean allowRead, boolean allowWrite, WindowsNativeUtil.CreateFileA_createMode openMode, int attributes) throws FileAlreadyExistsException, SharingViolationException, UnknownNativeErrorException
lpFileName - the path to the fileaccess - flag integer for meaning of bits see https://docs.microsoft.com/en-us/windows/win32/secauthz/access-maskallowDelete - allow another process to delete the file while it is opened by this processallowRead - allow another process to read the file while it is opened by this processallowWrite - allow another process to write the file while it is opened by this processopenMode - defines how the file is openedattributes - flag integer for meaning of bits see https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constantsFileAlreadyExistsException - CREATE_ALWAYS when the file already existsSharingViolationExceptionUnknownNativeErrorExceptionlong CreateFileMappingA(long hFile,
long lpFileMappingAttributes,
int flProtect,
int dwMaximumSizeHigh,
int dwMaximumSizeLow,
String lpName)
throws UnknownNativeErrorException
hFile - handle from CreateFileA/WlpFileMappingAttributes - 0 or pointer of LPSECURITY_ATTRIBUTESflProtect - 0x4 for readwrite, 0x2 for read only, 0x40 for read write execute. For other values see microsoft documentation.dwMaximumSizeHigh - high order 32 bit of the size of the mapping.dwMaximumSizeLow - low order 32 bit of the size mapping.lpName - optional global name of this mapping. If the mapping already exists then it will open that mapping instead of creating a new one.UnknownNativeErrorExceptionlong OpenFileMappingA(int dwDesiredAccess,
boolean bInheritHandle,
String lpName)
throws UnknownNativeErrorException
dwDesiredAccess - desired access see WinConst.FILE_MAP_ALL_ACCESS or WinConst.FILE_MAP_WRITE among others.bInheritHandle - can a child process that is created by this process inherit this handle?lpName - name of the named file mapping.UnknownNativeErrorExceptionlong MapViewOfFileEx(long hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
int dwNumberOfBytesToMap,
long lpBaseAddress)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid UnmapViewOfFile(long address)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid CloseHandle(long handle)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
Iterable<String> iterateDeviceInterfaces(GUID deviceClass, String enumerator, int flags, GUID interfaceClass) throws UnknownNativeErrorException
deviceClass - for SetupDiGetClassDevsA, can be nullenumerator - for SetupDiGetClassDevsA, can be nullflags - for SetupDiGetClassDevsAinterfaceClass - for SetupDiEnumDeviceInterfaces, can NOT be nullUnknownNativeErrorExceptionlong SetupDiGetClassDevsA(GUID ClassGuid, String Enumerator, long hwndParent, int flags) throws UnknownNativeErrorException
hwndParent - set to '0' for absence of a parent device classEnumerator - can be nullClassGuid - can be nullUnknownNativeErrorExceptionSpDeviceInterfaceData SetupDiEnumDeviceInterfaces(long DeviceInfoSet, SpDeviceInfoData DeviceInfoData, GUID InterfaceClassGuid, int index) throws UnknownNativeErrorException
DeviceInfoSet - obtained from SetupDiGetClassDevsADeviceInfoData - can be null (the syscall that returns this is not yet implemented)InterfaceClassGuid - can NOT be nullindex - index from the set. Starts at 0, increment to iterate over the devices.UnknownNativeErrorExceptionString SetupDiGetDeviceInterfaceDetail(long DeviceInfoSet, SpDeviceInterfaceData DeviceInterfaceData, SpDeviceInfoData outputData)
DeviceInfoSet - obtained from SetupDiGetClassDevsADeviceInterfaceData - obtained from SetupDiEnumDeviceInterfacesoutputData - may be null if not needed. Output parametervoid SetupDiDestroyDeviceInfoList(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint DeviceIoControl(long hDevice,
int dwIoControlCode,
byte[] inBuffer,
int inOff,
int inLen,
byte[] outBuffer,
int outOff,
int outLen)
throws UnknownNativeErrorException
hDevice - device handle, probably obtained from CreateFileA withdwIoControlCode - device specific code of the operationinBuffer - input buffer, can be nulloutBuffer - output buffer, can be nullUnknownNativeErrorExceptionint DeviceIoControl(long hDevice,
int dwIoControlCode,
NativeMemory inBuffer,
long inOff,
int inLen,
NativeMemory outBuffer,
long outOff,
int outLen)
throws UnknownNativeErrorException
hDevice - device handle, probably obtained from CreateFileA withdwIoControlCode - device specific code of the operationinBuffer - input buffer memory, can be nulloutBuffer - output buffer memory, can be nullUnknownNativeErrorExceptionint CTL_CODE(int DeviceType,
int Function,
int Method,
int Access)
long CreateEventA(long lpEventAttributes,
boolean manualReset,
boolean initialState,
String name)
throws UnknownNativeErrorException
lpEventAttributes - pointer treated as LPSECURITY_ATTRIBUTESmanualReset - if true then the event must be manually reset by calling ResetEventinitialState - if true then the event is initally set and must be first manually reset using ResetEventname - name of the event, may be null.UnknownNativeErrorExceptionlong OpenEventA(int desiredAccess,
boolean inheritHandle,
String name)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetEvent(long handle)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
handle - UnknownNativeErrorExceptionInvalidFileDescriptorExceptionvoid ResetEvent(long handle)
throws UnknownNativeErrorException,
InvalidFileDescriptorException
boolean WaitForSingleObject(long handle,
int millis)
throws UnknownNativeErrorException,
InvalidFileDescriptorException,
MutexAbandonedException
handle - the handlemillis - timeout in millisUnknownNativeErrorExceptionInvalidFileDescriptorExceptionMutexAbandonedExceptionint WaitForMultipleObjects(long[] handles,
int millis,
boolean waitAll)
throws UnknownNativeErrorException,
InvalidFileDescriptorException,
MutexAbandonedException
handles - handles array. May not be null. May not be larger than 64.millis - the timeout in milliseconds.waitAll - wait for every handle in the array.UnknownNativeErrorExceptionInvalidFileDescriptorExceptionMutexAbandonedExceptionString strerror_s(int errno)
String FormatMessageA(int lastError)
String GetVolumePathNameW(String path) throws UnknownNativeErrorException
UnknownNativeErrorExceptionString GetModuleFileNameA(long hModule) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetEnvironmentVariableA(String name, String value) throws UnknownNativeErrorException
UnknownNativeErrorExceptionString ExpandEnvironmentStringsA(String str) throws UnknownNativeErrorException
UnknownNativeErrorExceptionString GetEnvironmentVariableA(String name) throws UnknownNativeErrorException
UnknownNativeErrorExceptionString GetFinalPathNameByHandleA(long handle, boolean normalize, WindowsNativeUtil.Path_VolumeName volumeName) throws UnknownNativeErrorException, InvalidFileDescriptorException
String GetFinalPathNameByHandleW(long handle, boolean normalize, WindowsNativeUtil.Path_VolumeName volumeName) throws UnknownNativeErrorException, InvalidFileDescriptorException
int GetFileAttributesA(String str) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetFileAttributesA(String str, int attr) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong RegOpenKeyExA(long hkey,
String subKey,
int options,
int sam)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid RegCloseKey(long hkey)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionRegData RegQueryValueExA(long hkey, String valueName) throws UnknownNativeErrorException
hkey - the hkey obtained from RegOpenKeyExAvalueName - the name of the value to readUnknownNativeErrorExceptionRegQueryInfoKeyResult RegQueryInfoKeyA(long hkey) throws UnknownNativeErrorException
UnknownNativeErrorExceptionRegEnumKeyExResult RegEnumKeyExA(long hkey, int index, int maxSubKeyLen, int maxClassLen) throws UnknownNativeErrorException
index - the index of the key in the enumeration
microsofts documentation states that this starts at 0
and should ALWAYS be enumerated until the end
(i.e. always increment this until this function returns null)maxSubKeyLen - obtained from RegQueryInfoKeyA field maxSubKeyLen
If set to <= 0 then a call to RegQueryInfoKeyResult
will be made internally to determine the size.maxClassLen - obtained from RegQueryInfoKeyA field maxClassLen
If set to <= 0 then a call to RegQueryInfoKeyResult
will be made internally to determine the size.UnknownNativeErrorExceptionRegEnumValueResult RegEnumValueA(long hkey, int index) throws UnknownNativeErrorException
UnknownNativeErrorExceptionIterable<RegEnumKeyExResult> iterateRegistrySubKeys(long hkey) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong GetCurrentThread()
long GetCurrentProcess()
long DuplicateHandle(long srcProcess,
long handle,
long targetProcess,
int access,
boolean inheritHandle,
boolean closeSource,
boolean sameAccess)
srcProcess - source process, most likely return value of GetCurrentProcess()handle - the source handle to duplicatetargetProcess - target process, most likely return value of GetCurrentProcess()access - desired access flags, completely ignored if sameAccess is trueinheritHandle - should child process inherit the duplicated handle?closeSource - close the source handle when "duplicating" the handle?sameAccess - use the same access flags as the source handle? true means access parameter is completely ignored.void CancelIo(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid CancelIoEx(long handle,
long overlapped)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid CancelSynchronousIo(long threadHandle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint ReadFile(long handle,
byte[] buffer,
int off,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data goes hereoff - offset in the bufferlen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint ReadFile(long handle,
ByteBuffer buffer,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data goes herelen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint ReadFile(long handle,
NativeMemory buffer,
long off,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data goes hereoff - offset in the bufferlen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionlong ReadFile(long handle,
NativeMemory buffer,
long off,
int len,
long overlapped,
long event)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
free(long) after it has been confirmed that the async READ is done by calling GetOverlappedResult.event - created by CreateEventAInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint WriteFile(long handle,
byte[] buffer,
int off,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data from hereoff - offset of datalen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint WriteFile(long handle,
ByteBuffer buffer,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data from herelen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint WriteFile(long handle,
NativeMemory buffer,
long off,
int len)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - file handlebuffer - data from hereoff - offset of datalen - maximum bytes to readInvalidFileDescriptorExceptionUnknownNativeErrorExceptionlong WriteFile(long handle,
NativeMemory buffer,
long off,
int len,
long overlapped,
long event)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
free(long) after it has been confirmed that the async WRITE is done by calling GetOverlappedResult.overlapped - pointer from a previous already completed call to this function. May be 0.event - created by CreateEventAInvalidFileDescriptorExceptionUnknownNativeErrorExceptionint GetOverlappedResult(long handle,
long overlapped,
boolean wait)
throws InvalidFileDescriptorException,
UnknownNativeErrorException
handle - handle on which the async operation is performed.overlapped - overlapped pointer returned by the call that started the async operation.wait - wait until the async operation is completed before return. false means return immediately.InvalidFileDescriptorExceptionUnknownNativeErrorExceptionint GetFriendlyIfIndex(long index)
NetworkInterface class uses the friendly index for its byIndex method.index - the "unfriendly" adapter indexlong GetAdapterIndex(String adapterName) throws UnknownNativeErrorException
adapterName - this is a GUID. YOU DO NOT SEE THIS NAME ANYWHERE OUTSIDE THE WINDOWS REGISTRY!
for example: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0000->NetCfgInstanceId
would hold this GUID. Ex value would be "{4E27A816-B07C-48E3-9453-6145B1BFFB51}"UnknownNativeErrorExceptionCollection<IpAdapterAddresses> GetAdaptersAddresses(long family, long flags) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong OpenProcessToken(long ProcessHandle,
int DesiredAccess)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionbyte[] GetTokenInformation(long TokenHandle,
int TokenInformationClass)
throws UnknownNativeErrorException
TokenHandle - obtained from OpenProcessToken(long, int)TokenInformationClass - int constants from WinConst, all valid values start with "Token"UnknownNativeErrorExceptionlong ShellExecuteA(long hwnd,
String lpOperation,
String lpFile,
String lpParameters,
String lpDirectory,
int nShowCmd)
throws ShellExecuteException
hwnd - handle to parent window. 0 is a possible value.lpOperation - operation to perform. This is a string enum. noteable values are "runas" "open" "print" and "explore"lpFile - the file to perform the operation onlpParameters - dependant on verb. on "runas" for example this would be parameters to the program pointed to by lpFilelpDirectory - defines the working directory for the actionnShowCmd - defines how to action is displayed to the user value from 0 to 11 are validShellExecuteExceptionlong INVALID_HANDLE_VALUE()
long CreateNamedPipeA(String name, int dwOpenMode, int dwPipeMode, int nMaxInstances, int nOutBufferSize, int nInBufferSize, int nDefaultTimeOut, long lpSecurityAttributes) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid ConnectNamedPipe(long pipeHandle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong ConnectNamedPipe(long pipeHandle,
long eventHandle)
throws UnknownNativeErrorException
eventHandle - created by CreateEventAUnknownNativeErrorExceptionboolean WaitNamedPipeA(String name, long timeout) throws UnknownNativeErrorException
name - pipe nametimeout - in millis. 0 to use default timeout of the pipe.UnknownNativeErrorExceptionvoid DisconnectNamedPipe(long pipeHandle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid FlushFileBuffers(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionList<MibIpForwardRow2> GetIpForwardTable2(int Family) throws UnknownNativeErrorException
UnknownNativeErrorExceptionboolean CreateIpForwardEntry2(MibIpForwardRow2 entry) throws UnknownNativeErrorException
UnknownNativeErrorExceptionboolean DeleteIpForwardEntry2(MibIpForwardRow2 entry) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong ConvertInterfaceIndexToLuid(int idx)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint ConvertInterfaceLuidToIndex(long luid)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionString ConvertInterfaceLuidToNameA(long luid) throws UnknownNativeErrorException
UnknownNativeErrorExceptionString ConvertInterfaceLuidToAlias(long luid) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong ConvertInterfaceNameToLuidA(String name) throws UnknownNativeErrorException
UnknownNativeErrorExceptionlong CreateSemaphoreExA(long lpSemaphoreAttributes,
long initialCount,
long maximumCount,
String name,
int dwDesiredAccess)
throws UnknownNativeErrorException
lpSemaphoreAttributes - treated as pointer to LPSECURITY_ATTRIBUTES. Most likely 0 should be passed!UnknownNativeErrorExceptionlong ReleaseSemaphore(long hSemaphore,
long lReleaseCount)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetupComm(long handle,
int dwInQueue,
int dwOutQueue)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetCommTimeouts(long handle,
CommTimeouts timeouts)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint WaitCommEvent(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid TransmitCommChar(long handle,
byte data)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetDefaultCommConfigA(String name, CommConfig config) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetCommState(long handle,
DCB dcb)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetCommMask(long handle,
int mask)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetCommConfig(long handle,
CommConfig config)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid SetCommBreak(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid PurgeComm(long handle,
int flags)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionCommConfig GetDefaultCommConfigA(String name) throws UnknownNativeErrorException
UnknownNativeErrorExceptionCommTimeouts GetCommTimeouts(long handle) throws UnknownNativeErrorException
UnknownNativeErrorExceptionDCB GetCommState(long handle) throws UnknownNativeErrorException
UnknownNativeErrorExceptionCommProp GetCommProperties(long handle) throws UnknownNativeErrorException
UnknownNativeErrorExceptionint GetCommModemStatus(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint GetCommMask(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionCommConfig GetCommConfig(long handle) throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid EscapeCommFunction(long handle,
int func)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint ClearCommError(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionint ClearCommError(long handle,
ComStat stat)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionvoid ClearCommBreak(long handle)
throws UnknownNativeErrorException
UnknownNativeErrorExceptionCopyright © 2024. All rights reserved.