GetFileMUIInfo function (winnls.h)
Retrieves resource-related information about a file.
Syntax
BOOL GetFileMUIInfo(
[in] DWORD dwFlags,
[in] PCWSTR pcwszFilePath,
[in, out, optional] PFILEMUIINFO pFileMUIInfo,
[in, out] DWORD *pcbFileMUIInfo
);
Parameters
[in] dwFlags
Flags specifying the information to retrieve. Any combination of the following flags is allowed. The default value of the flags is MUI_QUERY_TYPE | MUI_QUERY_CHECKSUM.
Value | Meaning |
---|---|
|
Retrieve one of the following values in the dwFileType member of FILEMUIINFO:
|
|
Retrieve the resource checksum of the input file in the pChecksum member of FILEMUIINFO. If the input file does not have resource configuration data, this member of the structure contains 0. |
|
Retrieve the language associated with the input file. For a language-specific resource file, this flag requests the associated language. For an LN file, this flag requests the language of the ultimate fallback resources for the module, which can be either in the LN file or in a separate language-specific resource file referenced by the resource configuration data of the LN file. For more information, see the Remarks section. |
|
Retrieve lists of resource types in the language-specific resource files and LN files as they are specified in the resource configuration data. See the Remarks section for a way to access this information. |
[in] pcwszFilePath
Pointer to a null-terminated string indicating the path to the file. Typically the file is either an LN file or a language-specific resource file. If it is not one of these types, the only significant value that the function retrieves is MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL. The function only retrieves this value if the MUI_QUERY_RESOURCE_TYPES flag is set.
[in, out, optional] pFileMUIInfo
Pointer to a buffer containing file information in a FILEMUIINFO structure and possibly in data following that structure. The information buffer might have to be much larger than the size of the structure itself. Depending on flag settings, the function can store considerable information following the structure, at offsets retrieved in the structure. For more information, see the Remarks section.
Alternatively, the application can set this parameter to NULL if pcbFileMUIInfo is set to 0. In this case, the function retrieves the required size for the information buffer in pcbFileMUIInfo.
[in, out] pcbFileMUIInfo
Pointer to the buffer size, in bytes, for the file information indicated by pFileMUIInfo. On successful return from the function, this parameter contains the size of the retrieved file information buffer and the FILEMUIINFO structure that contains it.
Alternatively, the application can set this parameter to 0 if it sets NULL in pFileMUIInfo. In this case, the function retrieves the required file information buffer size in pcbFileMUIInfo. To allocate the correct amount of memory, this value should be added to the size of the FILEMUIINFO structure itself.
Return value
Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError.
Remarks
For the MUI_QUERY_LANGUAGE_NAME flag, this function retrieves an offset, in bytes, from the beginning of FILEMUIINFO in the dwLanguageNameOffset member.
The following is sample code that accesses the language name associated with the input file:
LPWSTR lpszLang = reinterpret_cast<LPWSTR>(
reinterpret_cast<BYTE*>(pFileMUIInfo) +
pFileMUIInfo->dwLanguageNameOffset);
For the MUI_QUERY_RESOURCE_TYPES flag, this function retrieves language-specific resource file information in the following FILEMUIINFO members:
- The dwTypeIDMUIOffset member contains the offset to an array of identifiers of resources contained in the language-specific resource file.
- The dwTypeIDMUISize member contains the size of the array of resource identifiers for the language-specific resource file.
- The dwTypeNameMUIOffset member contains the offset to an array of names of resources contained in the language-specific resource file.
- The dwTypeIDMainOffset member contains the offset to an array of identifiers of resources contained in the LN file.
- The dwTypeIDMainSize member contains the size of the array of resource identifiers for the LN file.
- The dwTypeNameMainOffset member contains the offset to an array of names of resources contained in the file.
DWORD *pdwTypeID = reinterpret_cast<DWORD *>(
reinterpret_cast<BYTE*>(pFileMUIInfo) +
pFileMUIInfo->dwTypeIDMainOffset);
LPWSTR lpszNames = reinterpret_cast<LPWSTR>(
reinterpret_cast<BYTE*>(pFileMUIInfo) +
pFileMUIInfo->dwTypeNameMainOffset);
Another approach is to write the following instead of the code shown in the samples. The effect is the same and the choice is strictly one of style.
DWORD ix = pFileMUIInfo->dwLanguageNameOffset -
offsetof(struct _FILEMUIINFO, abBuffer);
LPWSTR lpszLang = reinterpret_cast<LPWSTR>(&(pFileMUIInfo->abBuffer[ix]));
C# Signature
[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
static extern System.Boolean GetFileMUIInfo(
System.UInt32 dwFlags,
System.String pcwszFilePath,
ref FILEMUIINFO pFileMUIInfo,
ref System.UInt32 pcbFileMUIInfo
);
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | winnls.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |