|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Kernel32
Definition (incomplete) of kernel32.dll
.
Nested Class Summary | |
---|---|
static interface |
Kernel32.OVERLAPPED_COMPLETION_ROUTINE
|
Nested classes/interfaces inherited from interface com.sun.jna.platform.win32.W32API |
---|
W32API.DWORD, W32API.HANDLE, W32API.HANDLEByReference, W32API.HBITMAP, W32API.HDC, W32API.HICON, W32API.HINSTANCE, W32API.HMODULE, W32API.HRESULT, W32API.HRGN, W32API.HWND, W32API.LONG, W32API.LONG_PTR, W32API.LPARAM, W32API.LRESULT, W32API.SIZE_T, W32API.SSIZE_T, W32API.UINT_PTR, W32API.ULONG_PTR, W32API.WORD, W32API.WPARAM |
Nested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibrary |
---|
com.sun.jna.win32.StdCallLibrary.StdCallCallback |
Nested classes/interfaces inherited from interface com.sun.jna.Library |
---|
com.sun.jna.Library.Handler |
Field Summary | |
---|---|
static Kernel32 |
INSTANCE
|
Fields inherited from interface com.sun.jna.platform.win32.W32API |
---|
HWND_BROADCAST, INVALID_HANDLE_VALUE |
Fields inherited from interface com.sun.jna.win32.StdCallLibrary |
---|
FUNCTION_MAPPER, STDCALL_CONVENTION |
Fields inherited from interface com.sun.jna.Library |
---|
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER |
Method Summary | |
---|---|
boolean |
CloseHandle(W32API.HANDLE hObject)
The CloseHandle function closes an open object handle. |
boolean |
CreateDirectory(java.lang.String lpPathName,
WinNT.SECURITY_ATTRIBUTES lpSecurityAttributes)
The CreateDirectory function creates a new directory. |
W32API.HANDLE |
CreateEvent(WinNT.SECURITY_ATTRIBUTES lpEventAttributes,
boolean bManualReset,
boolean bInitialState,
java.lang.String lpName)
|
W32API.HANDLE |
CreateFile(java.lang.String lpFileName,
int dwDesiredAccess,
int dwShareMode,
WinNT.SECURITY_ATTRIBUTES lpSecurityAttributes,
int dwCreationDisposition,
int dwFlagsAndAttributes,
W32API.HANDLE hTemplateFile)
The CreateFile function creates or opens a file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, or named pipe. |
W32API.HANDLE |
CreateFileMapping(W32API.HANDLE hFile,
WinNT.SECURITY_ATTRIBUTES lpAttributes,
int flProtect,
int dwMaximumSizeHigh,
int dwMaximumSizeLow,
java.lang.String lpName)
|
W32API.HANDLE |
CreateIoCompletionPort(W32API.HANDLE FileHandle,
W32API.HANDLE ExistingCompletionPort,
com.sun.jna.Pointer CompletionKey,
int NumberOfConcurrentThreads)
|
boolean |
DuplicateHandle(W32API.HANDLE hSourceProcessHandle,
W32API.HANDLE hSourceHandle,
W32API.HANDLE hTargetProcessHandle,
W32API.HANDLEByReference lpTargetHandle,
int dwDesiredAccess,
boolean bInheritHandle,
int dwOptions)
The DuplicateHandle function duplicates an object handle. |
int |
FormatMessage(int dwFlags,
com.sun.jna.Pointer lpSource,
int dwMessageId,
int dwLanguageId,
java.nio.Buffer lpBuffer,
int nSize,
com.sun.jna.Pointer va_list)
The FormatMessage function formats a message string. |
int |
FormatMessage(int dwFlags,
com.sun.jna.Pointer lpSource,
int dwMessageId,
int dwLanguageId,
com.sun.jna.ptr.PointerByReference lpBuffer,
int nSize,
com.sun.jna.Pointer va_list)
The FormatMessage function formats a message string. |
boolean |
GetComputerName(char[] buffer,
com.sun.jna.ptr.IntByReference lpnSize)
Retrieves only the NetBIOS name of the local computer. |
W32API.HANDLE |
GetCurrentProcess()
This function returns a pseudohandle for the current process. |
int |
GetCurrentProcessId()
This function returns the process identifier of the calling process. |
W32API.HANDLE |
GetCurrentThread()
The GetCurrentThread function retrieves a pseudo handle for the current thread. |
int |
GetCurrentThreadId()
The GetCurrentThreadId function retrieves the thread identifier of the calling thread. |
int |
GetDriveType(java.lang.String rootPathName)
The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. |
int |
GetLastError()
The GetLastError function retrieves the calling thread's last-error code value. |
W32API.HMODULE |
GetModuleHandle(java.lang.String name)
The GetModuleHandle function retrieves a module handle for the specified module if the file has been mapped into the address space of the calling process. |
int |
GetProcessId(W32API.HANDLE process)
The GetProcessId function retrieves the process identifier of the specified process. |
int |
GetProcessVersion(int processId)
The GetProcessVersion function retrieves the major and minor version numbers of the system on which the specified process expects to run. |
boolean |
GetQueuedCompletionStatus(W32API.HANDLE CompletionPort,
com.sun.jna.ptr.IntByReference lpNumberOfBytes,
com.sun.jna.ptr.ByReference lpCompletionKey,
com.sun.jna.ptr.PointerByReference lpOverlapped,
int dwMilliseconds)
|
int |
GetShortPathName(java.lang.String lpszLongPath,
byte[] lpdzShortPath,
int cchBuffer)
ASCII version. |
int |
GetShortPathName(java.lang.String lpszLongPath,
char[] lpdzShortPath,
int cchBuffer)
Unicode version (the default). |
void |
GetSystemTime(WinBase.SYSTEMTIME lpSystemTime)
The GetSystemTime function retrieves the current system date and time. |
W32API.DWORD |
GetTempPath(W32API.DWORD nBufferLength,
char[] buffer)
The GetTempPath function retrieves the path of the directory designated for temporary files. |
com.sun.jna.Pointer |
GlobalFree(com.sun.jna.Pointer hGlobal)
Frees the specified global memory object and invalidates its handle. |
com.sun.jna.Pointer |
LocalAlloc(int type,
int cbInput)
The LocalAlloc function allocates the specified number of bytes from the heap. |
com.sun.jna.Pointer |
LocalFree(com.sun.jna.Pointer hLocal)
Frees the specified local memory object and invalidates its handle. |
com.sun.jna.Pointer |
MapViewOfFile(W32API.HANDLE hFileMappingObject,
int dwDesiredAccess,
int dwFileOffsetHigh,
int dwFileOffsetLow,
int dwNumberOfBytesToMap)
|
W32API.HANDLE |
OpenProcess(int fdwAccess,
boolean fInherit,
int IDProcess)
This function returns a handle to an existing process object. |
W32API.HANDLE |
OpenThread(int dwDesiredAccess,
boolean bInheritHandle,
int dwThreadId)
The OpenThread function opens an existing thread object. |
boolean |
PostQueuedCompletionStatus(W32API.HANDLE CompletionPort,
int dwNumberOfBytesTransferred,
com.sun.jna.Pointer dwCompletionKey,
WinBase.OVERLAPPED lpOverlapped)
|
boolean |
PulseEvent(W32API.HANDLE hEvent)
|
boolean |
ReadDirectoryChangesW(W32API.HANDLE directory,
WinNT.FILE_NOTIFY_INFORMATION info,
int length,
boolean watchSubtree,
int notifyFilter,
com.sun.jna.ptr.IntByReference bytesReturned,
WinBase.OVERLAPPED overlapped,
Kernel32.OVERLAPPED_COMPLETION_ROUTINE completionRoutine)
NOTE: only exists in unicode form (W suffix). |
boolean |
SetEvent(W32API.HANDLE hEvent)
|
void |
SetLastError(int dwErrCode)
The SetLastError function sets the last-error code for the calling thread. |
boolean |
UnmapViewOfFile(com.sun.jna.Pointer lpBaseAddress)
|
int |
WaitForMultipleObjects(int nCount,
W32API.HANDLE[] hHandle,
boolean bWaitAll,
int dwMilliseconds)
Waits until one or all of the specified objects are in the signaled state or the time-out interval elapses. |
int |
WaitForSingleObject(W32API.HANDLE hHandle,
int dwMilliseconds)
Waits until the specified object is in the signaled state or the time-out interval elapses. |
boolean |
WriteFile(W32API.HANDLE hFile,
byte[] lpBuffer,
int nNumberOfBytesToWrite,
com.sun.jna.ptr.IntByReference lpNumberOfBytesWritten,
WinBase.OVERLAPPED lpOverlapped)
|
Field Detail |
---|
static final Kernel32 INSTANCE
Method Detail |
---|
com.sun.jna.Pointer LocalFree(com.sun.jna.Pointer hLocal)
hLocal
- A handle to the local memory object.
com.sun.jna.Pointer GlobalFree(com.sun.jna.Pointer hGlobal)
hGlobal
- A handle to the global memory object.
W32API.HMODULE GetModuleHandle(java.lang.String name)
name
- Pointer to a null-terminated string that contains the name of the module
(either a .dll or .exe file).
void GetSystemTime(WinBase.SYSTEMTIME lpSystemTime)
lpSystemTime
- Pointer to a SYSTEMTIME structure to receive the current system date and time.int GetCurrentThreadId()
W32API.HANDLE GetCurrentThread()
int GetCurrentProcessId()
W32API.HANDLE GetCurrentProcess()
int GetProcessId(W32API.HANDLE process)
process
- Handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right.
int GetProcessVersion(int processId)
processId
- Process identifier of the process of interest. A value of zero specifies the
calling process.
int GetLastError()
void SetLastError(int dwErrCode)
dwErrCode
- Last-error code for the thread.int GetDriveType(java.lang.String rootPathName)
rootPathName
- Pointer to a null-terminated string that specifies the root directory of
the disk to return information about. A trailing backslash is required.
If this parameter is NULL, the function uses the root of the current directory.
int FormatMessage(int dwFlags, com.sun.jna.Pointer lpSource, int dwMessageId, int dwLanguageId, com.sun.jna.ptr.PointerByReference lpBuffer, int nSize, com.sun.jna.Pointer va_list)
dwFlags
- Formatting options, and how to interpret the lpSource parameter. The low-order
byte of dwFlags specifies how the function handles line breaks in the output
buffer. The low-order byte can also specify the maximum width of a formatted
output line.lpSource
- Location of the message definition.dwMessageId
- Message identifier for the requested message.dwLanguageId
- Language identifier for the requested message.lpBuffer
- Pointer to a buffer that receives the null-terminated string that specifies the
formatted message.nSize
- If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies
the size of the output buffer, in TCHARs. If FORMAT_MESSAGE_ALLOCATE_BUFFER is
set, this parameter specifies the minimum number of TCHARs to allocate for an
output buffer.va_list
- Pointer to an array of values that are used as insert values in the formatted message.
int FormatMessage(int dwFlags, com.sun.jna.Pointer lpSource, int dwMessageId, int dwLanguageId, java.nio.Buffer lpBuffer, int nSize, com.sun.jna.Pointer va_list)
dwFlags
- Formatting options, and how to interpret the lpSource parameter. The low-order
byte of dwFlags specifies how the function handles line breaks in the output
buffer. The low-order byte can also specify the maximum width of a formatted
output line.lpSource
- Location of the message definition.dwMessageId
- Message identifier for the requested message.dwLanguageId
- Language identifier for the requested message.lpBuffer
- Pointer to a buffer that receives the null-terminated string that specifies the
formatted message.nSize
- If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies
the size of the output buffer, in TCHARs. If FORMAT_MESSAGE_ALLOCATE_BUFFER is
set, this parameter specifies the minimum number of TCHARs to allocate for an
output buffer.va_list
- Pointer to an array of values that are used as insert values in the formatted message.
W32API.HANDLE CreateFile(java.lang.String lpFileName, int dwDesiredAccess, int dwShareMode, WinNT.SECURITY_ATTRIBUTES lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, W32API.HANDLE hTemplateFile)
lpFileName
- A pointer to a null-terminated string that specifies the name of an object to create or open.dwDesiredAccess
- The access to the object, which can be read, write, or both.dwShareMode
- The sharing mode of an object, which can be read, write, both, or none.lpSecurityAttributes
- A pointer to a SECURITY_ATTRIBUTES structure that determines whether or not
the returned handle can be inherited by child processes. If lpSecurityAttributes
is NULL, the handle cannot be inherited.dwCreationDisposition
- An action to take on files that exist and do not exist.dwFlagsAndAttributes
- The file attributes and flags.hTemplateFile
- Handle to a template file with the GENERIC_READ access right. The template file
supplies file attributes and extended attributes for the file that is being
created. This parameter can be NULL.
boolean CreateDirectory(java.lang.String lpPathName, WinNT.SECURITY_ATTRIBUTES lpSecurityAttributes)
lpPathName
- Pointer to a null-terminated string that specifies the path of the directory
to be created.lpSecurityAttributes
- Pointer to a SECURITY_ATTRIBUTES structure. The lpSecurityDescriptor member
of the structure specifies a security descriptor for the new directory. If
lpSecurityAttributes is NULL, the directory gets a default security descriptor.
W32API.HANDLE CreateIoCompletionPort(W32API.HANDLE FileHandle, W32API.HANDLE ExistingCompletionPort, com.sun.jna.Pointer CompletionKey, int NumberOfConcurrentThreads)
boolean GetQueuedCompletionStatus(W32API.HANDLE CompletionPort, com.sun.jna.ptr.IntByReference lpNumberOfBytes, com.sun.jna.ptr.ByReference lpCompletionKey, com.sun.jna.ptr.PointerByReference lpOverlapped, int dwMilliseconds)
boolean PostQueuedCompletionStatus(W32API.HANDLE CompletionPort, int dwNumberOfBytesTransferred, com.sun.jna.Pointer dwCompletionKey, WinBase.OVERLAPPED lpOverlapped)
int WaitForSingleObject(W32API.HANDLE hHandle, int dwMilliseconds)
hHandle
- A handle to the object. For a list of the object types whose handles can be specified, see the following Remarks section.
If this handle is closed while the wait is still pending, the function's behavior is undefined.
The handle must have the SYNCHRONIZE access right. For more information, see Standard Access Rights.dwMilliseconds
- The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses.
If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately.
If dwMilliseconds is INFINITE, the function will return only when the object is signaled.
int WaitForMultipleObjects(int nCount, W32API.HANDLE[] hHandle, boolean bWaitAll, int dwMilliseconds)
nCount
- The number of object handles in the array pointed to by lpHandles. The maximum number of object handles is MAXIMUM_WAIT_OBJECTS.hHandle
- An array of object handles. For a list of the object types whose handles can be specified, see the following Remarks section. The array can contain handles to objects of different types.
It may not contain multiple copies of the same handle.
If one of these handles is closed while the wait is still pending, the function's behavior is undefined.
The handles must have the SYNCHRONIZE access right. For more information, see Standard Access Rights.bWaitAll
- If this parameter is TRUE, the function returns when the state of all objects in the lpHandles array is signaled.
If FALSE, the function returns when the state of any one of the objects is set to signaled.
In the latter case, the return value indicates the object whose state caused the function to return.dwMilliseconds
- The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the specified objects are signaled or the interval elapses.
If dwMilliseconds is zero, the function does not enter a wait state if the specified objects are not signaled; it always returns immediately.
If dwMilliseconds is INFINITE, the function will return only when the specified objects are signaled.
boolean DuplicateHandle(W32API.HANDLE hSourceProcessHandle, W32API.HANDLE hSourceHandle, W32API.HANDLE hTargetProcessHandle, W32API.HANDLEByReference lpTargetHandle, int dwDesiredAccess, boolean bInheritHandle, int dwOptions)
hSourceProcessHandle
- Handle to the process with the handle to duplicate.
The handle must have the PROCESS_DUP_HANDLE access right.hSourceHandle
- Handle to duplicate. This is an open object handle that is valid in the
context of the source process.hTargetProcessHandle
- Handle to the process that is to receive the duplicated handle.
The handle must have the PROCESS_DUP_HANDLE access right.lpTargetHandle
- Pointer to a variable that receives the duplicate handle. This handle value is valid in
the context of the target process. If hSourceHandle is a pseudo handle returned by
GetCurrentProcess or GetCurrentThread, DuplicateHandle converts it to a real handle to
a process or thread, respectively.dwDesiredAccess
- Access requested for the new handle.bInheritHandle
- Indicates whether the handle is inheritable.dwOptions
- Optional actions.
boolean CloseHandle(W32API.HANDLE hObject)
hObject
- Handle to an open object. This parameter can be a pseudo handle or INVALID_HANDLE_VALUE.
boolean ReadDirectoryChangesW(W32API.HANDLE directory, WinNT.FILE_NOTIFY_INFORMATION info, int length, boolean watchSubtree, int notifyFilter, com.sun.jna.ptr.IntByReference bytesReturned, WinBase.OVERLAPPED overlapped, Kernel32.OVERLAPPED_COMPLETION_ROUTINE completionRoutine)
int GetShortPathName(java.lang.String lpszLongPath, byte[] lpdzShortPath, int cchBuffer)
Native.toString(byte[])
to obtain the short
path from the byte
array.
Use only if w32.ascii==true
.
int GetShortPathName(java.lang.String lpszLongPath, char[] lpdzShortPath, int cchBuffer)
Native.toString(char[])
to
obtain the short path from the char
array.
com.sun.jna.Pointer LocalAlloc(int type, int cbInput)
type
- Memory allocation attributes. The default is the LMEM_FIXED value.cbInput
- Number of bytes to allocate. If this parameter is zero and the uFlags parameter
specifies LMEM_MOVEABLE, the function returns a handle to a memory object that
is marked as discarded.
boolean WriteFile(W32API.HANDLE hFile, byte[] lpBuffer, int nNumberOfBytesToWrite, com.sun.jna.ptr.IntByReference lpNumberOfBytesWritten, WinBase.OVERLAPPED lpOverlapped)
W32API.HANDLE CreateEvent(WinNT.SECURITY_ATTRIBUTES lpEventAttributes, boolean bManualReset, boolean bInitialState, java.lang.String lpName)
boolean SetEvent(W32API.HANDLE hEvent)
boolean PulseEvent(W32API.HANDLE hEvent)
W32API.HANDLE CreateFileMapping(W32API.HANDLE hFile, WinNT.SECURITY_ATTRIBUTES lpAttributes, int flProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, java.lang.String lpName)
com.sun.jna.Pointer MapViewOfFile(W32API.HANDLE hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap)
boolean UnmapViewOfFile(com.sun.jna.Pointer lpBaseAddress)
boolean GetComputerName(char[] buffer, com.sun.jna.ptr.IntByReference lpnSize)
buffer
- A pointer to a buffer that receives the computer name or the cluster virtual server
name. The buffer size should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1
characters.lpnSize
- On input, specifies the size of the buffer, in TCHARs. On output, the number of TCHARs
copied to the destination buffer, not including the terminating null character. If
the buffer is too small, the function fails and GetLastError returns
ERROR_BUFFER_OVERFLOW. The lpnSize parameter specifies the size of the buffer required,
including the terminating null character.
W32API.HANDLE OpenThread(int dwDesiredAccess, boolean bInheritHandle, int dwThreadId)
dwDesiredAccess
- Access to the thread object. This access right is checked against any security
descriptor for the thread.bInheritHandle
- If this parameter is TRUE, the new process inherits the handle. If the parameter
is FALSE, the handle is not inherited.dwThreadId
- Identifier of the thread to be opened.
W32API.HANDLE OpenProcess(int fdwAccess, boolean fInherit, int IDProcess)
fdwAccess
- Not supported; set to zero.fInherit
- Not supported; set to FALSE.IDProcess
- Specifies the process identifier of the process to open.
W32API.DWORD GetTempPath(W32API.DWORD nBufferLength, char[] buffer)
nBufferLength
- Size of the string buffer identified by lpBuffer, in TCHARs.buffer
- Pointer to a string buffer that receives the null-terminated string specifying the
temporary file path. The returned string ends with a backslash, for example,
C:\TEMP\.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |