This function reads a file containing MIME-encoded content to be FDRM-protected and creates the device-locked version of that content as well as any associated rights or pending rights.


HRESULT FileDrmStoreContent (
  LPCTSTR pszInputFileName,
  LPCTSTR pszOutputFileName,
  PVOID pvReserved,
  LPTSTR pszMimeType,
  DWORD* pcchMimeTypeLen


  • pszInputFileName
    [in] Fully qualified path to the file that contains the MIME message to be decoded. This file starts with the Content-Type, "Content-type: ...", optionally proceeded by linear white space.
  • pszOutputFileName
    [in] Fully qualified path to the file to hold the object contained within the MIME message.
  • pvReserved
    Unused. This parameter may be NULL.
  • pszMimeType
    [out] A pointer to the buffer to be filled with the type of the embedded object, "image/jpeg". If this pointer is NULL, this call is treated as a request to obtain the size of the buffer needed to hold the MIME type string.
  • pcchMimeTypeLen
    [in/out] A pointer to a DWORD that holds the length, in characters, of the pszMimeType buffer. On entry, this value is the size of the passed buffer. On exit, this is set to the length of the MIME type string that includes the NULL terminator.

Return Values:

The function can return any HRESULT and the application should use the SUCCEEDED and FAILED macros to check the results. The following table shows additional HRESULT values that may be returned.

Value Description


No provider found.


The output file was not created. *pcchMimeTypeLen was updated with the required buffer size.


A new file is created holding the FDRM-protected content. The original file is deleted.

The input file must contain a complete and valid MIME message and requires the appropriate content-type header for the DRM specification supported by the device.


Header fdrm.h
Library aygshell.lib
Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also


FDRM API Reference
FDRM Functions