JNA API 3.4.0
com.sun.jna.platform.win32

Interface Kernel32

    • Field Detail

      • INSTANCE

        static final Kernel32 INSTANCE
    • Method Detail

      • FormatMessage

        int FormatMessage(int dwFlags,
                        Pointer lpSource,
                        int dwMessageId,
                        int dwLanguageId,
                        java.nio.Buffer lpBuffer,
                        int nSize,
                        Pointer va_list)
        The FormatMessage function formats a message string. The function requires a message definition as input. The message definition can come from a buffer passed into the function. It can come from a message table resource in an already-loaded module. Or the caller can ask the function to search the system's message table resource(s) for the message definition. The function finds the message definition in a message table resource based on a message identifier and a language identifier. The function copies the formatted message text to an output buffer, processing any embedded insert sequences if requested.
        Parameters:
        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.

        This version of the function assumes FORMAT_MESSAGE_ALLOCATE_BUFFER is not set.

        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 - This this parameter specifies the size of the output buffer, in TCHARs. If FORMAT_MESSAGE_ALLOCATE_BUFFER is
        va_list - Pointer to an array of values that are used as insert values in the formatted message.
        Returns:
        If the function succeeds, the return value is the number of TCHARs stored in the output buffer, excluding the terminating null character. If the function fails, the return value is zero. To get extended error information, call GetLastError.
      • ReadFile

        boolean ReadFile(WinNT.HANDLE hFile,
                       java.nio.Buffer lpBuffer,
                       int nNumberOfBytesToRead,
                       IntByReference lpNumberOfBytesRead,
                       WinBase.OVERLAPPED lpOverlapped)
        Reads data from the specified file or input/output (I/O) device. Reads occur at the position specified by the file pointer if supported by the device. This function is designed for both synchronous and asynchronous operations. For a similar function designed solely for asynchronous operation, see ReadFileEx
        Parameters:
        hFile - A handle to the device (for example, a file, file stream, physical disk, volume, console buffer, tape drive, socket, communications resource, mailslot, or pipe).
        lpBuffer - A pointer to the buffer that receives the data read from a file or device.
        nNumberOfBytesToRead - The maximum number of bytes to be read.
        lpNumberOfBytesRead - A pointer to the variable that receives the number of bytes read when using a synchronous hFile parameter
        lpOverlapped - A pointer to an OVERLAPPED structure is required if the hFile parameter was opened with FILE_FLAG_OVERLAPPED, otherwise it can be NULL.
        Returns:
        If the function succeeds, the return value is nonzero (TRUE). If the function fails, or is completing asynchronously, the return value is zero (FALSE). To get extended error information, call the GetLastError function. Note The GetLastError code ERROR_IO_PENDING is not a failure; it designates the read operation is pending completion asynchronously. For more information, see Remarks.
JNA API 3.4.0

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