MrmCreateResourceFileInMemory function

Creates PRI file in memory, not as a file on disk. This is the last stage of creating a PRI file, after creating the indexer and adding resources.

This function can only create a single PRI file; if you want to create split PRI files you must use the MrmCreateResourceFile function.

Syntax

HRESULT HRESULT MrmCreateResourceFileInMemory(
  _In_  MrmResourceIndexerHandle indexer,
  _In_  MrmPackagingMode         packagingMode,
  _In_  MrmPackagingOptions      packagingOptions,
  _Out_ BYTE                     **outputPriData,
  _Out_ ULONG                    *outputPriSize
);

Parameters

indexer [in]

Type: MrmResourceIndexerHandle

A handle identifying the resource indexer from which to create the PRI file. This handle is returned via a call to MrmCreateResourceIndexer or one of the related MrmCreateResourceIndexer...* functions.

packagingMode [in]

Type: MrmPackagingMode

Specifies what kind of PRI file the function should create. You cannot use MrmPackagingModeAutoSplit with this function. See the documentation for MrmPackagingMode and the Remarks section of MrmCreateResourceFile for more info.

packagingOptions [in]

Type: MrmPackagingOptions

Specifies additional options about the PRI file. Most callers should specify MrmPackagingOptionsNone. See the documentation for MrmPackagingOptions for more info.

outputPriData [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 PRI file. You must free the memory by calling MrmFreeMemory when you are done with it.

outputPriSize [out]

Type: ULONG*

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

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

If you intend to pass outputPriData to MrmCreateResourceIndexerFromPreviousPriData, don't free the memory until after you've finished using the resource indexer.

For more information about the packagingMode parameter, see the Remarks section of MrmCreateResourceFile. In particular, if you intend to save the data to a file yourself, be sure to follow the correct naming conventions.

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

MrmCreateResourceFile

Package resource indexing (PRI) APIs and custom build systems