IpcfIsFileStreamEncrypted function

Determines whether a file stream is encrypted.

Syntax

HRESULT WINAPI IpcfIsFileStreamEncrypted(
  _In_  ILockBytes *pInputFileStream,
  _In_  LPCWSTR    wszInputFilePath,
  _Out_ LPDWORD    pdwFileStatus
);

Parameters

pInputFileStream [in]

Pointer to the byte stream that represents the file to be queried.

wszInputFilePath [in]

The path to the file to query. The path must include the file name and, if one exists, the file name extension.

This parameter is only used determine the file format, based on the file name extension of the file in the input file stream.

The path is limited to MAX_PATH characters. To extend this limit to 32,767 characters, prepend "\\?\" to the path. For more information, see Naming Files, Paths, and Namespaces.

pdwFileStatus [out]

A pointer to a variable that receives a DWORD that indicates whether and how the file is protected. When the function returns, this parameter can be one of the following values.

IPCF_FILE_STATUS_DECRYPTED (0)

The file is not encrypted.

IPCF_FILE_STATUS_ENCRYPTED_CUSTOM (1)

The file is encrypted using native protection; that is, using an AD RMS file format that is based on its MIME type. Some RMS functionality may not be available.

IPCF_FILE_STATUS_ENCRYPTED (2)

The file is encrypted.

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.

Remarks

For supporting information on using the File API part of RMS SDK 2.1 see, Supported File Formats, File API configuration and Setting the API security mode in the AD RMS developer notes topic.

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

See also

Naming Files, Paths, and Namespaces

Supported File Formats

File API configuration

Setting the API security

AD RMS developer notes

Error codes