MrmDumpPriDataInMemory function

Dumps an in-memory 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") XML.

This function performs the equivalent of the makepri dump command, but entirely in memory.

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

Syntax

HRESULT HRESULT MrmDumpPriDataInMemory(
  _In_     BYTE        *inputPriData,
  _In_     ULONG       inputPriSize,
  _In_opt_ BYTE        *schemaPriData,
  _In_     ULONG       schemaPriSize,
  _In_     MrmDumpType dumpType,
  _Out_    BYTE        **outputXmlData,
  _Out_    ULONG       *outputXmlSize
);

Parameters

inputPriData [in]

Type: BYTE*

A pointer to an in-memory PRI file. If this in-memory file does not have an embedded schema, then schemaPriData is required.

inputPriSize [in]

Type: ULONG

The size of the data pointed to by inputPriData.

schemaPriData [in, optional]

Type: BYTE*

A pointer to an in-memory PRI file that provides the schema for inputPriData if needed, otherwise NULL. See the Remarks section of MrmDumpPriFile for more info.

schemaPriSize [in]

Type: ULONG

The size of the data pointed to by schemaPriData.

dumpType [in]

Type: MrmDumpType

Specified the kind of dump to create. For most debugging 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 works with in-memory data instead of files).

You can obtain an in-memory PRI file either by manually loading an existing PRI file from disk, or by creating it in-memory with MrmCreateResourceFileInMemory.

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

MrmDumpPriFile

MrmDumpPriFileInMemory

Package resource indexing (PRI) APIs and custom build systems