Freigeben über


IpcfOpenFileOnILockBytes function

Gets an IPCF_FILE_HANDLE associated with an encrypted byte stream which can be used to access and modify that stream's data. This operation requires that the current user has at least the VIEW right for the content.

Syntax

EXTERN_C HRESULT WINAPI IpcfOpenFileOnILockBytes(
  _In_     ILockBytes        *pFileStream,
  _In_opt_ PCIPC_PROMPT_CTX  pContext,
           DWORD             dwFlags,
  _Out_    PIPCF_FILE_HANDLE phFile
);

Parameters

pFileStream [in]

Pointer to a byte stream that represents an encrypted file.

The function will fail for un-unencrypted files, or custom-encrypted files (i.e., files for which IpcfIsFileEncrypted returns IPCF_FILE_STATUS_ENCRYPTED_CUSTOM.

pFileStream must not be freed or modified until phFile is closed.

pContext [in, optional]

Optional pointer to information that helps the MSIPC client decide what the user prompt behavior should be.

dwFlags

Must be set to 0 (zero)

phFile [out]

Pointer to an IPCF_FILE_HANDLE which can be used to read/write the encrypted data. This pointer must be closed using the IpcCloseHandle function.

Return value

If the function succeeds, the return value is S_OK. If the function fails, it returns an HRESULT value that indicates the error.

For more information, see Error codes for a description of all RMS SDK 2.1 return values.

Possible values include, but are not limited to, those in the following list.

IPCERROR_FILE_NOT_ENCRYPTED

Function failed due to an un-unencrypted files.

Requirements

Minimum supported client
Windows Vista with SP2
Minimum supported server
Windows Server 2008
Header
Ipcfile.h (include Msipc.h)
Library
Msipc.lib
DLL
Msipc.dll