MrmIndexEmbeddedData function

Adds an embeded data resource (BLOB) to a Resource Indexer. Note that it is the resource name that is indexed, not the data. In other words, this function does not search the data looking for things to index.

Embedded data resources are more efficient than file resources, but are less useful during app development. See Files resources in MRM for more info.

Syntax

HRESULT HRESULT MrmIndexEmbeddedData(
  _In_           MrmResourceIndexerHandle indexer,
  _In_           PCWSTR                   resourceUri,
  _In_     const BYTE                     *embeddedData,
  _In_           ULONG                    embeddedDataSize,
  _In_opt_       PCWSTR                   qualifiers
);

Parameters

indexer [in]

Type: MrmResourceIndexerHandle

A handle identifying the resource indexer to add the resource to. This handle is returned via a call to MrmCreateResourceIndexer or one of the related MrmCreateResourceIndexer...* functions.

resourceUri [in]

Type: PCWSTR

The URI (name) to assign to the resource. See Resource names in MRM for more info.

embeddedData [in]

Type: const BYTE*

A pointer to the data you want to add to the indexer.

embeddedDataSize [in]

Type: ULONG

The size of the data pointed to by embeddedData.

qualifiers [in, optional]

Type: PCWSTR

An optional list of resource qualifiers for the resource, for example "language-en-US". Passing an empty string or NULL indicates a neutral resource that is applicable in any resource context. See Qualifiers in MRM for more info.

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

This function adds binary data (such as an image or audio file) directly to the indexer, so that it will be embedded in the output PRI file. This is in contrast to file-based resources, which only adds the filename to the PRI file and requires the file to be installed alongside the app.

See Files in MRM for more info on the pros and cons of using embedded data vs. file resources.

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

MrmIndexFile

MrmIndexFileAutoQualifiers

MrmIndexResourceContainerAutoQualifiers

MrmIndexString

File resources in MRM

Package resource indexing (PRI) APIs and custom build systems