Klasse Kernel32Util
- Alle implementierten Schnittstellen:
WinDef
- Autor:
- dblock[at]dblock.org, markus[at]headcrashing[dot]eu, Andreas "PAX" Lück, onkelpax-git[at]yahoo.de
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.sun.jna.platform.win32.WinDef
WinDef.ATOM, WinDef.BOOL, WinDef.BOOLByReference, WinDef.BYTE, WinDef.CHAR, WinDef.CHARByReference, WinDef.DWORD, WinDef.DWORDByReference, WinDef.DWORDLONG, WinDef.HBITMAP, WinDef.HBRUSH, WinDef.HCURSOR, WinDef.HDC, WinDef.HFONT, WinDef.HGLRC, WinDef.HGLRCByReference, WinDef.HICON, WinDef.HINSTANCE, WinDef.HKL, WinDef.HMENU, WinDef.HMODULE, WinDef.HPALETTE, WinDef.HPEN, WinDef.HRGN, WinDef.HRSRC, WinDef.HWND, WinDef.INT_PTR, WinDef.LCID, WinDef.LONG, WinDef.LONGByReference, WinDef.LONGLONG, WinDef.LONGLONGByReference, WinDef.LPARAM, WinDef.LPVOID, WinDef.LRESULT, WinDef.POINT, WinDef.PVOID, WinDef.RECT, WinDef.SCODE, WinDef.SCODEByReference, WinDef.SHORT, WinDef.UCHAR, WinDef.UINT, WinDef.UINT_PTR, WinDef.UINTByReference, WinDef.ULONG, WinDef.ULONGByReference, WinDef.ULONGLONG, WinDef.ULONGLONGByReference, WinDef.USHORT, WinDef.USHORTByReference, WinDef.WORD, WinDef.WORDByReference, WinDef.WPARAM
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic void
InvokesKernel32.CloseHandle(WinNT.HANDLE)
and checks the success code.static void
Closes the handle in the referencestatic void
closeHandleRefs
(WinNT.HANDLEByReference... refs) Closes all referenced handles.static void
closeHandles
(WinNT.HANDLE... handles) InvokescloseHandle(WinNT.HANDLE)
on each handle.static void
deleteFile
(String filename) static String
expandEnvironmentStrings
(String input) Expands environment-variable strings and replaces them with the values defined for the current user.static final String
extractVolumeGUID
(String volumeGUIDPath) Parses and returns the pure GUID value of a volume name obtained fromKernel32.FindFirstVolume(char[], int)
orKernel32.FindNextVolume(com.sun.jna.platform.win32.WinNT.HANDLE, char[], int)
callsstatic long
findEnvironmentStringBlockEntryEnd
(Pointer lpszEnvironmentBlock, long offset, boolean asWideChars) static String
formatMessage
(int code) Format a message from a code.static String
formatMessage
(int code, int primaryLangId, int sublangId) Format a message from the value obtained fromKernel32.GetLastError()
orNative.getLastError()
.static String
formatMessage
(WinNT.HRESULT code) Format a message from an HRESULT.static String
formatMessage
(WinNT.HRESULT code, int primaryLangId, int sublangId) Format a message from an HRESULT.static String
formatMessageFromLastErrorCode
(int code) Format a system message from an error code.static String
formatMessageFromLastErrorCode
(int code, int primaryLangId, int sublangId) Format a system message from an error code.static void
freeGlobalMemory
(Pointer ptr) InvokesKernel32.GlobalFree(Pointer)
and checks if it succeeded.static void
freeLocalMemory
(Pointer ptr) InvokesKernel32.LocalFree(Pointer)
and checks if it succeeded.static String
Get current computer NetBIOS name.static WinDef.DWORD
Gets the priority class of the current process.static int
Gets the priority value of the current thread.static int
getDriveType
(String rootName) static String
getEnvironmentVariable
(String name) Get the value of an environment variable.Uses theKernel32.GetEnvironmentStrings()
to retrieve and parse the current process environmentgetEnvironmentVariables
(Pointer lpszEnvironmentBlock, long offset) static int
getFileAttributes
(String fileName) Retrieves file system attributes for a specified file or directory.static int
getFileType
(String fileName) Retrieves the result of GetFileType, provided the file exists.static String
static String
getLastErrorMessage
(int primaryLangId, int sublangId) Returns valid drives in the system.static final WinNT.SYSTEM_LOGICAL_PROCESSOR_INFORMATION[]
Convenience method to get the processor information.static final WinNT.SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX[]
getLogicalProcessorInformationEx
(int relationshipType) Convenience method to get the processor information.static List
<Tlhelp32.MODULEENTRY32W> getModules
(int processID) Returns all the executable modules for a given process ID.static final int
getPrivateProfileInt
(String appName, String keyName, int defaultValue, String fileName) Retrieves an integer associated with a key in the specified section of an initialization file.static final String[]
getPrivateProfileSection
(String appName, String fileName) Retrieves all the keys and values for the specified section of an initialization file.static final String[]
getPrivateProfileSectionNames
(String fileName) Retrieves the names of all sections in an initialization file.static final String
getPrivateProfileString
(String lpAppName, String lpKeyName, String lpDefault, String lpFileName) Retrieves a string from the specified section in an initialization file.static WinDef.DWORD
getProcessPriority
(int pid) Gets the priority class of the specified process.static byte[]
getResource
(String path, String type, String name) Gets the specified resource out of the specified executable filegetResourceNames
(String path) Gets a list of all resources from the specified executable filestatic String
Return the path designated for temporary files.static int
getThreadPriority
(int tid) Gets the priority value of the specified thread.getVolumePathNamesForVolumeName
(String lpszVolumeName) Invokes and parses the result ofKernel32.GetVolumePathNamesForVolumeName(String, char[], int, IntByReference)
static boolean
isValidPriorityClass
(WinDef.DWORD dwPriorityClass) Test whether the given priority class is valid.static boolean
isValidThreadPriority
(int nPriority) Test whether the given thread priority is valid.static boolean
isWideCharEnvironmentStringBlock
(Pointer lpszEnvironmentBlock, long offset) Attempts to determine whether the data block useswchar_t
instead of "plain old"char
s.queryDosDevice
(String lpszDeviceName, int maxTargetSize) Invokes theKernel32.QueryDosDevice(String, char[], int)
method and parses the resultstatic final String
QueryFullProcessImageName
(int pid, int dwFlags) This function retrieves the full path of the executable file of a given process identifier.static final String
QueryFullProcessImageName
(WinNT.HANDLE hProcess, int dwFlags) This function retrieves the full path of the executable file of a given process.static String
readEnvironmentStringBlockEntry
(Pointer lpszEnvironmentBlock, long offset, boolean asWideChars) static void
setCurrentProcessBackgroundMode
(boolean enable) Enables or disables "background" processing mode for the current processstatic void
setCurrentProcessPriority
(WinDef.DWORD dwPriorityClass) Sets the priority class for the current process.static void
setCurrentThreadBackgroundMode
(boolean enable) Enables or disables "background" processing mode for the current threadstatic void
setCurrentThreadPriority
(int nPriority) Sets the priority value for the current thread.static void
setProcessPriority
(int pid, WinDef.DWORD dwPriorityClass) Sets the priority class for the specified process.static void
setThreadPriority
(int tid, int nPriority) Sets the priority value for the specified thread.static final void
writePrivateProfileSection
(String appName, String[] strings, String fileName) static final void
writePrivateProfileString
(String appName, String keyName, String string, String fileName)
-
Felddetails
-
VOLUME_GUID_PATH_PREFIX
- Siehe auch:
-
VOLUME_GUID_PATH_SUFFIX
- Siehe auch:
-
-
Konstruktordetails
-
Kernel32Util
public Kernel32Util()
-
-
Methodendetails
-
getComputerName
Get current computer NetBIOS name.- Gibt zurück:
- Netbios name.
-
freeLocalMemory
InvokesKernel32.LocalFree(Pointer)
and checks if it succeeded.- Parameter:
ptr
- ThePointer
to the memory to be released - ignored if NULL- Löst aus:
Win32Exception
- if non-ERROR_SUCCESS
code reported
-
freeGlobalMemory
InvokesKernel32.GlobalFree(Pointer)
and checks if it succeeded.- Parameter:
ptr
- ThePointer
to the memory to be released - ignored if NULL- Löst aus:
Win32Exception
- if non-ERROR_SUCCESS
code reported
-
closeHandleRefs
Closes all referenced handles. If an exception is thrown for a specific handle, then it is accumulated until all handles have been closed. If more than one exception occurs, then it is added as a suppressed exception to the first one. Once closed all handles, the accumulated exception (if any) is thrown- Parameter:
refs
- The references to close- Siehe auch:
-
closeHandleRef
Closes the handle in the reference- Parameter:
ref
- The handle reference - ignored ifnull
- Siehe auch:
-
closeHandles
InvokescloseHandle(WinNT.HANDLE)
on each handle. If an exception is thrown for a specific handle, then it is accumulated until all handles have been closed. If more than one exception occurs, then it is added as a suppressed exception to the first one. Once closed all handles, the accumulated exception (if any) is thrown- Parameter:
handles
- The handles to be closed- Siehe auch:
-
closeHandle
InvokesKernel32.CloseHandle(WinNT.HANDLE)
and checks the success code. If not successful, then throws aWin32Exception
with theGetLastError
value- Parameter:
h
- The handle to be closed - ignored ifnull
-
formatMessage
Format a message from a code.- Parameter:
code
- The error code- Gibt zurück:
- Formatted message in the default locale.
-
formatMessage
Format a message from the value obtained fromKernel32.GetLastError()
orNative.getLastError()
.If you pass in zero, FormatMessage looks for a message for LANGIDs in the following order:
- Language neutral
- Thread LANGID, based on the thread's locale value
- User default LANGID, based on the user's default locale value
- System default LANGID, based on the system default locale value
- US English
- Parameter:
code
- The error codeprimaryLangId
- The primary language identifiersublangId
- The sublanguage identifier- Gibt zurück:
- Formatted message in the specified locale.
-
formatMessage
Format a message from an HRESULT.- Parameter:
code
- HRESULT- Gibt zurück:
- Formatted message in the default locale.
-
formatMessage
Format a message from an HRESULT.- Parameter:
code
- HRESULTprimaryLangId
- The primary language identifiersublangId
- The primary language identifier- Gibt zurück:
- Formatted message in the specified locale.
-
formatMessageFromLastErrorCode
Format a system message from an error code.- Parameter:
code
- Error code, typically a result of GetLastError.- Gibt zurück:
- Formatted message in the default locale.
-
formatMessageFromLastErrorCode
Format a system message from an error code.- Parameter:
code
- Error code, typically a result of GetLastError.primaryLangId
- The primary language identifiersublangId
- The primary language identifier- Gibt zurück:
- Formatted message in the specified locale.
-
getLastErrorMessage
- Gibt zurück:
- Obtains the human-readable error message text from the last error
that occurred by invocating
Kernel32.GetLastError()
in the default locale.
-
getLastErrorMessage
- Gibt zurück:
- Obtains the human-readable error message text from the last error
that occurred by invocating
Kernel32.GetLastError()
in the specified locale.
-
getTempPath
Return the path designated for temporary files.- Gibt zurück:
- Path.
-
deleteFile
-
getLogicalDriveStrings
Returns valid drives in the system.- Gibt zurück:
- A
List
of valid drives.
-
getFileAttributes
Retrieves file system attributes for a specified file or directory.- Parameter:
fileName
- The name of the file or directory.- Gibt zurück:
- The attributes of the specified file or directory.
-
getFileType
Retrieves the result of GetFileType, provided the file exists.- Parameter:
fileName
- file name- Gibt zurück:
- file type
- Löst aus:
FileNotFoundException
- if file not found
-
getDriveType
- Parameter:
rootName
- name of root drive- Gibt zurück:
- One of the WinBase.DRIVE_* constants.
-
getEnvironmentVariable
Get the value of an environment variable.- Parameter:
name
- Name of the environment variable.- Gibt zurück:
- Value of an environment variable.
-
getEnvironmentVariables
Uses theKernel32.GetEnvironmentStrings()
to retrieve and parse the current process environment- Gibt zurück:
- The current process environment as a
Map
. - Löst aus:
LastErrorException
- if failed to get or free the environment data block- Siehe auch:
-
getEnvironmentVariables
- Parameter:
lpszEnvironmentBlock
- The environment block as received from the GetEnvironmentStrings functionoffset
- Offset within the block to parse the data- Gibt zurück:
- A
Map
of the parsedname=value
pairs. Note: if the environment block isnull
thennull
is returned instead of an empty map since we want to distinguish between the case that the data block isnull
and when there are no environment variables (as unlikely as it may be)
-
readEnvironmentStringBlockEntry
public static String readEnvironmentStringBlockEntry(Pointer lpszEnvironmentBlock, long offset, boolean asWideChars) - Parameter:
lpszEnvironmentBlock
- The environment block as received from the GetEnvironmentStrings functionoffset
- Offset within the block to look for the entryasWideChars
- Iftrue
then the block containswchar_t
instead of "plain old"char
s- Gibt zurück:
- A
String
containing thename=value
pair or empty if reached end of block - Siehe auch:
-
findEnvironmentStringBlockEntryEnd
public static long findEnvironmentStringBlockEntryEnd(Pointer lpszEnvironmentBlock, long offset, boolean asWideChars) - Parameter:
lpszEnvironmentBlock
- The environment block as received from the GetEnvironmentStrings functionoffset
- Offset within the block to look for the entryasWideChars
- Iftrue
then the block containswchar_t
instead of "plain old"char
s- Gibt zurück:
- The offset of the first
'\0'
in the data block starting at the specified offset - can be the start offset itself if empty string. - Siehe auch:
-
isWideCharEnvironmentStringBlock
Attempts to determine whether the data block uses
wchar_t
instead of "plain old"char
s. It does that by reading 2 bytes from the specified offset - the character value and its charset indicator - and examining them as follows:-
If the charset indicator is non-zero then it is assumed to be
a "plain old"
char
s data block. Note: the assumption is that the environment variable name (at least) is ASCII. -
Otherwise (i.e., zero charset indicator), it is assumed to be
a
wchar_t
ByteOrder
even though onlyByteOrder.LITTLE_ENDIAN
is the likely one- Parameter:
lpszEnvironmentBlock
- The environment block as received from the GetEnvironmentStrings functionoffset
- offset- Gibt zurück:
true
if the block containswchar_t
instead of "plain old"char
s
-
If the charset indicator is non-zero then it is assumed to be
a "plain old"
-
getPrivateProfileInt
public static final int getPrivateProfileInt(String appName, String keyName, int defaultValue, String fileName) Retrieves an integer associated with a key in the specified section of an initialization file.- Parameter:
appName
- The name of the section in the initialization file.keyName
- The name of the key whose value is to be retrieved. This value is in the form of a string; theKernel32.GetPrivateProfileInt(java.lang.String, java.lang.String, int, java.lang.String)
function converts the string into an integer and returns the integer.defaultValue
- The default value to return if the key name cannot be found in the initialization file.fileName
- The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.- Gibt zurück:
- The retrieved integer, or the default if not found.
-
getPrivateProfileString
public static final String getPrivateProfileString(String lpAppName, String lpKeyName, String lpDefault, String lpFileName) Retrieves a string from the specified section in an initialization file.- Parameter:
lpAppName
- The name of the section containing the key name. If this parameter isnull
, theKernel32.GetPrivateProfileString(java.lang.String, java.lang.String, java.lang.String, char[], com.sun.jna.platform.win32.WinDef.DWORD, java.lang.String)
function copies all section names in the file to the supplied buffer.lpKeyName
- The name of the key whose associated string is to be retrieved. If this parameter isnull
, all key names in the section specified by thelpAppName
parameter are returned.lpDefault
- A default string. If thelpKeyName
key cannot be found in the initialization file,Kernel32.GetPrivateProfileString(java.lang.String, java.lang.String, java.lang.String, char[], com.sun.jna.platform.win32.WinDef.DWORD, java.lang.String)
returns the default. If this parameter isnull
, the default is an empty string,""
.Avoid specifying a default string with trailing blank characters. The function inserts a
null
character in thelpReturnedString
buffer to strip any trailing blanks.lpFileName
- The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.- Gibt zurück:
If neither
lpAppName
norlpKeyName
isnull
and the destination buffer is too small to hold the requested string, the string is truncated.If either
lpAppName
orlpKeyName
isnull
and the destination buffer is too small to hold all the strings, the last string is truncated and followed by twonull
characters.In the event the initialization file specified by
lpFileName
is not found, or contains invalid values, this function will set errorno with a value of '0x2' (File Not Found). To retrieve extended error information, callKernel32.GetLastError()
.
-
writePrivateProfileString
-
getLogicalProcessorInformation
Convenience method to get the processor information. Takes care of auto-growing the array.- Gibt zurück:
- the array of processor information.
-
getLogicalProcessorInformationEx
public static final WinNT.SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX[] getLogicalProcessorInformationEx(int relationshipType) Convenience method to get the processor information. Takes care of auto-growing the array and populating variable-length arrays in structures.- Parameter:
relationshipType
- The type of relationship to retrieve. This parameter can be one of the following values:WinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationCache
,WinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationGroup
,WinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationNumaNode
,WinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationProcessorCore
,WinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationProcessorPackage
, orWinNT.LOGICAL_PROCESSOR_RELATIONSHIP.RelationAll
- Gibt zurück:
- the array of processor information.
-
getPrivateProfileSection
Retrieves all the keys and values for the specified section of an initialization file.Each string has the following format:
key=string
.This operation is atomic; no updates to the specified initialization file are allowed while this method is executed.
- Parameter:
appName
- The name of the section in the initialization file.fileName
- The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.- Gibt zurück:
- The key name and value pairs associated with the named section.
-
getPrivateProfileSectionNames
Retrieves the names of all sections in an initialization file.This operation is atomic; no updates to the initialization file are allowed while this method is executed.
- Parameter:
fileName
- The name of the initialization file. If this parameter isNULL
, the function searches the Win.ini file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.- Gibt zurück:
- the section names associated with the named file.
-
writePrivateProfileSection
public static final void writePrivateProfileSection(String appName, String[] strings, String fileName) - Parameter:
appName
- The name of the section in which data is written. This section name is typically the name of the calling application.strings
- The new key names and associated values that are to be written to the named section. Each entry must be of the formkey=value
.fileName
- The name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory.
-
queryDosDevice
Invokes theKernel32.QueryDosDevice(String, char[], int)
method and parses the result- Parameter:
lpszDeviceName
- The device namemaxTargetSize
- The work buffer size to use for the query- Gibt zurück:
- The parsed result
-
getVolumePathNamesForVolumeName
Invokes and parses the result ofKernel32.GetVolumePathNamesForVolumeName(String, char[], int, IntByReference)
- Parameter:
lpszVolumeName
- The volume name- Gibt zurück:
- The parsed result
- Löst aus:
Win32Exception
- If failed to retrieve the required information
-
extractVolumeGUID
Parses and returns the pure GUID value of a volume name obtained fromKernel32.FindFirstVolume(char[], int)
orKernel32.FindNextVolume(com.sun.jna.platform.win32.WinNT.HANDLE, char[], int)
calls- Parameter:
volumeGUIDPath
- The volume GUID path as returned by one of the above mentioned calls- Gibt zurück:
- The pure GUID value after stripping the "\\?\" prefix and removing the trailing backslash.
- Löst aus:
IllegalArgumentException
- if bad format encountered- Siehe auch:
-
QueryFullProcessImageName
This function retrieves the full path of the executable file of a given process identifier.- Parameter:
pid
- Identifier for the running processdwFlags
- 0 - The name should use the Win32 path format. 1(WinNT.PROCESS_NAME_NATIVE) - The name should use the native system path format.- Gibt zurück:
- the full path of the process's executable file of null if failed. To get extended error information, call GetLastError.
-
QueryFullProcessImageName
This function retrieves the full path of the executable file of a given process.- Parameter:
hProcess
- Handle for the running processdwFlags
- 0 - The name should use the Win32 path format. 1(WinNT.PROCESS_NAME_NATIVE) - The name should use the native system path format.- Gibt zurück:
- the full path of the process's executable file of null if failed. To get extended error information, call GetLastError.
-
getResource
Gets the specified resource out of the specified executable file- Parameter:
path
- The path to the executable filetype
- The type of the resource (either a type name or type ID is allowed)name
- The name or ID of the resource- Gibt zurück:
- The resource bytes, or null if no such resource exists.
- Löst aus:
IllegalStateException
- if the call to LockResource fails
-
getResourceNames
Gets a list of all resources from the specified executable file- Parameter:
path
- The path to the executable file- Gibt zurück:
- A map of resource type name/ID => resources.
A map key + a single list item + the path to the executable can be handed off to getResource() to actually get the resource.
-
getModules
Returns all the executable modules for a given process ID.- Parameter:
processID
- The process ID to get executable modules for- Gibt zurück:
- All the modules in the process.
-
expandEnvironmentStrings
Expands environment-variable strings and replaces them with the values defined for the current user.- Parameter:
input
- A string that contains one or more environment-variable strings in the form: %variableName%. For each such reference, the %variableName% portion is replaced with the current value of that environment variable.Case is ignored when looking up the environment-variable name. If the name is not found, the %variableName% portion is left unexpanded.
Note that this function does not support all the features that Cmd.exe supports. For example, it does not support %variableName:str1=str2% or %variableName:~offset,length%.
- Gibt zurück:
- the replaced string
- Löst aus:
Win32Exception
- if an error occurs
-
getCurrentProcessPriority
Gets the priority class of the current process.- Gibt zurück:
- The priority class of the current process.
- Löst aus:
Win32Exception
- if an error occurs.
-
setCurrentProcessPriority
Sets the priority class for the current process.- Parameter:
dwPriorityClass
- The priority class for the process.- Löst aus:
Win32Exception
- if an error occurs.
-
setCurrentProcessBackgroundMode
public static void setCurrentProcessBackgroundMode(boolean enable) Enables or disables "background" processing mode for the current process- Parameter:
enable
- If true, enables "background" processing mode, otherwise disables it.- Löst aus:
Win32Exception
- if an error occurs.
-
getCurrentThreadPriority
public static int getCurrentThreadPriority()Gets the priority value of the current thread.- Gibt zurück:
- The priority value of the current thread.
- Löst aus:
Win32Exception
- if an error occurs.
-
setCurrentThreadPriority
public static void setCurrentThreadPriority(int nPriority) Sets the priority value for the current thread.- Parameter:
nPriority
- The priority value for the thread.- Löst aus:
Win32Exception
- if an error occurs.
-
setCurrentThreadBackgroundMode
public static void setCurrentThreadBackgroundMode(boolean enable) Enables or disables "background" processing mode for the current thread- Parameter:
enable
- If true, enables "background" processing mode, otherwise disables it.- Löst aus:
Win32Exception
- if an error occurs.
-
getProcessPriority
Gets the priority class of the specified process.- Parameter:
pid
- Identifier for the running process.- Löst aus:
Win32Exception
- if an error occurs.
-
setProcessPriority
Sets the priority class for the specified process.- Parameter:
pid
- Identifier for the running process.dwPriorityClass
- The priority class for the process.- Löst aus:
Win32Exception
- if an error occurs.
-
getThreadPriority
public static int getThreadPriority(int tid) Gets the priority value of the specified thread.- Parameter:
tid
- Identifier for the running thread.- Löst aus:
Win32Exception
- if an error occurs.
-
setThreadPriority
public static void setThreadPriority(int tid, int nPriority) Sets the priority value for the specified thread.- Parameter:
tid
- Identifier for the running thread.nPriority
- The priority value for the thread.- Löst aus:
Win32Exception
- if an error occurs.
-
isValidPriorityClass
Test whether the given priority class is valid.Intentionally does not accept "background" processing mode flags!
- Parameter:
dwPriorityClass
- The priority value to test.- Gibt zurück:
- Returns true, if and only if the given priority value was valid
-
isValidThreadPriority
public static boolean isValidThreadPriority(int nPriority) Test whether the given thread priority is valid.Intentionally does not accept "background" processing mode flags!
- Parameter:
nPriority
- The priority value to test.- Gibt zurück:
- Returns true, if and only if the given priority value was valid
-