I_IrmProtector.HrUnprotectRMS Method

Last modified: October 07, 2009

Applies to: SharePoint Foundation 2010

Generates an unprotected version of the specified rights-managed file.

HRESULT HrUnprotect(
    ILockBytes       *pilbInput,
    ILockBytes       *pilbOutput,
    I_IrmPolicyInfoRMS    *piid,
    DWORD            *pdwStatus


[in] The rights-managed file.


[out] The unprotected stream that the Information Rights Management (IRM) protector generates from the rights-managed file.


[in] A link to functions and data that assist with the encryption/decryption process.


[in] The status of the method call. Possible values are:


The result of the method cannot be determined.


The protector has successfully generated the unprotected file stream.


The specified file is not protected.


A general failure of the protector.


The specified file is not of a file type associated with this IRM protector.


The specified file is corrupt.


The protector is unable to access SharePoint Foundation functions, or those encryption functions have failed.


The protector is not installed properly.

The protector methods return typical HRESULT values. In general, the protector should return a positive OK value for success or a negative FAIL value when unsuccessful.

The I_IrmProtector Interface is implemented by both integrated and autonomous IRM protectors. For more information on integrated and autonomous protectors, see Custom IRM Protectors.

For integrated IRM protectors:

SharePoint Foundation calls this method to unprotect rights-managed files of the file types associated with this protector.

This method must extract the document issuance license (IL) and server EUL from the protected file. (These certificates were included in the protected file when it was generated by the protector I_IrmProtector.HrProtect Method method.) The protector can then use these certificates to access I_IrmPolicyInfo Class methods to unprotect and decrypt the file.

For autonomous IRM protectors:

Autonomous protectors do not need to implement this method. An autonomous protector should return the HRESULT E_NOTIMPL if this method is called.