MrmDumpPriFileInMemory function

Dumps a PRI file to its XML equivalent, storing the result in memory. PRI files are stored in an undocumented binary format, so in order to view the contents of a file for debugging etc. it must be saved ("dumped") as XML.

This function performs the equivalent of the makepri dump command, with the results being stored in memory.

COM must be initialized (e.g. by calling CoInitializeEx) before using this function.

Syntax

HRESULT HRESULT MrmDumpPriFileInMemory(
  _In_     PCWSTR      indexFileName,
  _In_opt_ PCWSTR      schemaPriFile,
  _In_     MrmDumpType dumpType,
  _Out_    BYTE        **outputXmlData,
  _Out_    ULONG       *outputXmlSize
);

Parameters

indexFileName [in]

Type: PCWSTR

The path to the PRI file to dump. If this file does not have an embedded schema, then schemaPriFile is required.

schemaPriFile [in, optional]

Type: PCWSTR

The path to the PRI file that provides the schema for the indexFileName if needed, otherwise NULL. See the Remarks section of MrmDumpPriFile for more info.

dumpType [in]

Type: MrmDumpType

Specified the kind of dump to create. For most use-cases, MrmDumpTypeBasic is sufficient. See the MrmDumpType reference for more info.

outputXmlData [out]

Type: BYTE**

The address of a BYTE pointer. On successful return, contains a pointer to the buffer allocated by the function that contains the generated XML content. You must free the memory by calling MrmFreeMemory when you are done with it.

outputXmlSize [out]

Type: ULONG*

The address of a ULONG. On successful return, contains the size of the allocated memory buffer pointed to by outputXmlData.

Return value

Type: HRESULT

S_OK if the function succeeded, otherwise some other value. Use the SUCCEEDED or FAILED macros (defined in winerror.h) to determine success or failure.

Remarks

See the Remarks section of MrmDumpPriFile for more info, as this function is essentially the same (except it dumps the XML to memory instead of to a disk file).

Requirements

Requirement Value
Minimum supported client
Windows 10, version 1803 [desktop apps only]
Minimum supported server
Windows Server [desktop apps only]
Header
MrmResourceIndexer.h
Library
Mrmsupport.lib
DLL
Mrmsupport.dll

See also

MrmDumpPriDataInMemory

MrmDumpPriFile

Package resource indexing (PRI) APIs and custom build systems