JNA API 3.4.0

com.sun.jna.platform.win32
Class Kernel32Util

java.lang.Object
  extended by com.sun.jna.platform.win32.Kernel32Util
All Implemented Interfaces:
AltCallingConvention, Library, WinDef, StdCall, StdCallLibrary

public abstract class Kernel32Util
extends Object
implements WinDef

Kernel32 utility API.

Author:
dblock[at]dblock.org

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.jna.platform.win32.WinDef
WinDef.DWORD, WinDef.DWORDLONG, WinDef.HBITMAP, WinDef.HCURSOR, WinDef.HDC, WinDef.HFONT, WinDef.HICON, WinDef.HINSTANCE, WinDef.HMENU, WinDef.HMODULE, WinDef.HPALETTE, WinDef.HPEN, WinDef.HRGN, WinDef.HRSRC, WinDef.HWND, WinDef.LONG, WinDef.LPARAM, WinDef.LRESULT, WinDef.RECT, WinDef.UINT_PTR, WinDef.ULONGLONG, WinDef.WORD, WinDef.WPARAM
 
Nested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibrary
StdCallLibrary.StdCallCallback
 
Nested classes/interfaces inherited from interface com.sun.jna.Library
Library.Handler
 
Field Summary
 
Fields inherited from interface com.sun.jna.platform.win32.WinDef
MAX_PATH
 
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
 
Constructor Summary
Kernel32Util()
           
 
Method Summary
static void deleteFile(String filename)
           
static String formatMessageFromHR(WinNT.HRESULT code)
          Format a message from an HRESULT.
static String formatMessageFromLastErrorCode(int code)
          Format a system message from an error code.
static String getComputerName()
          Get current computer NetBIOS name.
static int getFileAttributes(String fileName)
          Retrieves file system attributes for a specified file or directory.
static String[] getLogicalDriveStrings()
          Returns valid drives in the system.
static String getTempPath()
          Return the path designated for temporary files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kernel32Util

public Kernel32Util()
Method Detail

getComputerName

public static String getComputerName()
Get current computer NetBIOS name.

Returns:
Netbios name.

formatMessageFromHR

public static String formatMessageFromHR(WinNT.HRESULT code)
Format a message from an HRESULT.

Parameters:
code - HRESULT
Returns:
Formatted message.

formatMessageFromLastErrorCode

public static String formatMessageFromLastErrorCode(int code)
Format a system message from an error code.

Parameters:
code - Error code, typically a result of GetLastError.
Returns:
Formatted message.

getTempPath

public static String getTempPath()
Return the path designated for temporary files.

Returns:
Path.

deleteFile

public static void deleteFile(String filename)

getLogicalDriveStrings

public static String[] getLogicalDriveStrings()
Returns valid drives in the system.

Returns:
An array of valid drives.

getFileAttributes

public static int getFileAttributes(String fileName)
Retrieves file system attributes for a specified file or directory.

Parameters:
fileName - The name of the file or directory.
Returns:
The attributes of the specified file or directory.

JNA API 3.4.0

Copyright © 2007-2010 Timothy Wall. All Rights Reserved.