JNative project : see http://jnative.sf.net


org.xvolks.jnative.util
Class Kernel32

java.lang.Object
  extended by org.xvolks.jnative.util.Kernel32

public class Kernel32
extends java.lang.Object

Kernel32 this is the class wrapper to Kernel32.dll.
When a developper needs a function of this DLL (s)he should add it here. $Id: Kernel32.java,v 1.5 2006/01/14 21:06:12 mdenty Exp $;


Constructor Summary
Kernel32()
           
 
Method Summary
static int createFile(java.lang.String fileName, int desiredAccess, int shareMode, SecurityAttributes securityAttributes, int creationDisposition, int flagsAndAttributes, int templateFile)
          HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile );
static java.lang.String getComputerName()
           
static FreeDiskSpace getDiskFreeSpaceEx(java.lang.String drive)
           
static int getLastError()
           
static SystemInfo getNativeSystemInfo()
          typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; }; }; DWORD dwPageSize; LPVOID lpMinimumApplicationAddress; LPVOID lpMaximumApplicationAddress; DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; WORD wProcessorLevel; WORD wProcessorRevision; } SYSTEM_INFO;
static MemoryStatusEx globalMemoryStatusEx()
          Method globalMemoryStatusEx BOOL GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpBuffer ); Parameters lpBuffer [in, out] Pointer to a MEMORYSTATUSEX structure that receives information about current memory availability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kernel32

public Kernel32()
Method Detail

globalMemoryStatusEx

public static final MemoryStatusEx globalMemoryStatusEx()
                                                 throws NativeException,
                                                        java.lang.IllegalAccessException
Method globalMemoryStatusEx
 BOOL GlobalMemoryStatusEx(
        LPMEMORYSTATUSEX lpBuffer
 );

         Parameters

         lpBuffer
         [in, out] Pointer to a MEMORYSTATUSEX structure that receives information about current memory availability.

         Return Values

         If the function succeeds, the return value is nonzero.

         If the function fails, the return value is zero. To get extended error information, call GetLastError.
         Remarks

         You can use the GlobalMemoryStatusEx function to determine how much memory your application can allocate without severely impacting other applications.

         The information returned by the GlobalMemoryStatusEx function is volatile. There is no guarantee that two sequential calls to this function will return the same information.
 

Returns:
a MemoryStatusEx
Throws:
NativeException
java.lang.IllegalAccessException

createFile

public static final int createFile(java.lang.String fileName,
                                   int desiredAccess,
                                   int shareMode,
                                   SecurityAttributes securityAttributes,
                                   int creationDisposition,
                                   int flagsAndAttributes,
                                   int templateFile)
                            throws NativeException,
                                   java.lang.IllegalAccessException
HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile );

Throws:
NativeException
java.lang.IllegalAccessException

getLastError

public static final int getLastError()
                              throws NativeException,
                                     java.lang.IllegalAccessException
Throws:
NativeException
java.lang.IllegalAccessException

getNativeSystemInfo

public static final SystemInfo getNativeSystemInfo()
                                            throws NativeException,
                                                   java.lang.IllegalAccessException
typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; }; }; DWORD dwPageSize; LPVOID lpMinimumApplicationAddress; LPVOID lpMaximumApplicationAddress; DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; WORD wProcessorLevel; WORD wProcessorRevision; } SYSTEM_INFO;

Throws:
NativeException
java.lang.IllegalAccessException

getComputerName

public static final java.lang.String getComputerName()
                                              throws NativeException,
                                                     java.lang.IllegalAccessException
Throws:
NativeException
java.lang.IllegalAccessException

getDiskFreeSpaceEx

public static final FreeDiskSpace getDiskFreeSpaceEx(java.lang.String drive)
                                              throws NativeException,
                                                     java.lang.IllegalAccessException
Throws:
NativeException
java.lang.IllegalAccessException

JNative project : see http://jnative.sf.net