Version (JNA API)

com.sun.jna.platform.win32

## Interface Version

- All Superinterfaces:
    AltCallingConvention, Library, StdCall, StdCallLibrary

      public interface Version
      extends StdCallLibrary

  Provides access to the w32 version library.

- - ### Nested Class Summary

    - ### 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
    Modifier and Type | Field and Description
    --- | ---
    `static Version` | `INSTANCE`

    - ### 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_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `GetFileVersionInfo(java.lang.String lptstrFilename, int dwHandle, int dwLen, Pointer lpData)` Retrieves version information for the specified file.
    `int` | `GetFileVersionInfoSize(java.lang.String lptstrFilename, IntByReference lpdwHandle)` Determines whether the operating system can retrieve version information for a specified file.
    `boolean` | `VerQueryValue(Pointer pBlock, java.lang.String lpSubBlock, PointerByReference lplpBuffer, IntByReference puLen)` Retrieves specified version information from the specified version-information resource.

- - ### Field Detail

    - #### INSTANCE

          static final Version INSTANCE

  - ### Method Detail

    - #### GetFileVersionInfoSize

          int GetFileVersionInfoSize(java.lang.String lptstrFilename,
                                   IntByReference lpdwHandle)

      Determines whether the operating system can retrieve version information for a specified file. If version information is available, GetFileVersionInfoSize returns the size, in bytes, of that information.
      Parameters:
        `lptstrFilename` - The name of the file of interest. The function uses the search sequence specified by the LoadLibrary function.
        `lpdwHandle` - A pointer to a variable that the function sets to zero.
      Returns:
        If the function succeeds, the return value is the size, in bytes, of the file's version information. If the function fails, the return value is zero. To get extended error information, call GetLastError.

    - #### GetFileVersionInfo

          boolean GetFileVersionInfo(java.lang.String lptstrFilename,
                                   int dwHandle,
                                   int dwLen,
                                   Pointer lpData)

      Retrieves version information for the specified file.
      Parameters:
        `lptstrFilename` - The name of the file. If a full path is not specified, the function uses the search sequence specified by the LoadLibrary function.
        `dwHandle` - This parameter is ignored.
        `dwLen` - The size, in bytes, of the buffer pointed to by the lpData parameter. Call the GetFileVersionInfoSize function first to determine the size, in bytes, of a file's version information. The dwLen member should be equal to or greater than that value. If the buffer pointed to by lpData is not large enough, the function truncates the file's version information to the size of the buffer.
        `lpData` - Pointer to a buffer that receives the file-version information. You can use this value in a subsequent call to the VerQueryValue function to retrieve data from the buffer.
      Returns:
        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.

    - #### VerQueryValue

          boolean VerQueryValue(Pointer pBlock,
                              java.lang.String lpSubBlock,
                              PointerByReference lplpBuffer,
                              IntByReference puLen)

      Retrieves specified version information from the specified version-information resource. To retrieve the appropriate resource, before you call VerQueryValue, you must first call the GetFileVersionInfoSize function, and then the GetFileVersionInfo function.
      Parameters:
        `pBlock` - The version-information resource returned by the GetFileVersionInfo function.
        `lpSubBlock` - The version-information value to be retrieved.
        `lplpBuffer` - When this method returns, contains the address of a pointer to the requested version information in the buffer pointed to by pBlock. The memory pointed to by lplpBuffer is freed when the associated pBlock memory is freed.
        `puLen` - When this method returns, contains a pointer to the size of the requested data pointed to by lplpBuffer: for version information values, the length in characters of the string stored at lplpBuffer; for translation array values, the size in bytes of the array stored at lplpBuffer; and for root block, the size in bytes of the structure.
      Returns:
        If the specified version-information structure exists, and version information is available, the return value is nonzero. If the address of the length buffer is zero, no value is available for the specified version-information name. If the specified name does not exist or the specified resource is not valid, the return value is zero.

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