Partager via


FileDrmCreateForwardableContentEx

4/8/2010

FileDrmCreateForwardableContentEx is an extended version of FileDrmCreateForwardableContent. FileDrmCreateForwardableContentEx creates a copy of the DRM file for forwarding. It has been created to support version 2 of File Based DRM.

In addition to creating the file, this function can generate and return an appropriate path and an extension based on the DRM version.

Syntax

HRESULT FileDrmCreateForwardableContentEx(
        LPCTSTR pszFileName, 
        DWORD dwFlags,
        LPCTSTR pszOutputFolder,
        LPTSTR pszOutputFile,
        DWORD dwOutputFileLen
);

Parameters

  • pszFileName
    [in] The fully qualified path to the file to be forwarded.
  • dwFlags
    [in] Flags to control the format of the generated document. The following table shows the possible values for dwFlags.

    Flag Value Description

    FDRCF_BARE

    0x00000001

    Bare file. Content with no MIME header.

    FDRCF_MIMEENCODED

    0x00000002

    Add needed MIME headers.

  • pszOutputFolder
    [in] Path indicating where the file to be forwarded is to be created.
  • pszOutputFile
    [out] Pointer to a buffer to be filled with the fully qualified path of the file to be forwarded. This buffer must be at least large enough to hold pszOutputFolder concatenated with the file name part of pszFileName.
  • dwOutputFileLen
    [in] Length of the pszOutputFile buffer. A buffer size of MAX_PATH will always be sufficient.

Return Values:

The function may 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

E_POINTER

If pszFileName, pszOutputFolder, or pszOutputFile are NULL

E_INVALIDARG

If one of the above indicated dwFlags is not passed in

E_FDRM_NOPROVIDER

No provider found.

E_FDRM_NOTDRMOBJECT

The target is not an FDRM object.

E_FDRM_NOFORWARDRIGHTS

You do not possess forwarding rights.

Remarks

To upgrade your program to support version 2 of FDRM, any call to FileDrmCreateForwardableContent is to be replaced as follows:

  • Invoke FileDrmCreateForwardableContentEx. Instead of supplying the fully-qualified path name for the file that is to store the contents of the forwardable file, pass the folder in which the file is to be created, and supply a buffer to receive the fully-qualified path for the file that was created.
  • If the call to FileDrmCreateForwardableContentEx succeeds, the application continues with the existing logic using pszOutputFile. On the other hand, if the call fails with error code E_NOTIMPL, it means the DRM Agent is v1.0 and does not provide the extended API. In this case, invoke FileDrmCreateForwardableContent as it is currently implemented.

See Also

Reference

FDRM API Reference
FDRM Functions