IsFileEncrypted method

This method is deprecated.

Determines if a given file is stored in FESF encrypted format.

Syntax

HRESULT

IsFileEncrypted(

    [in]           BSTR  FullPath,

    [out, retval]  VARIANT_BOOL* Encrypted

)

Parameters

FullPath [in]

A string containing the fully qualified path of a file to check.

Encrypted [out, retval]

A pointer to a VARIANT_BOOL that will receive the result on success.  Set to VARIANT_TRUE if the file indicated by FullPath is in FESF encrypted format.

Return value

S_OK on success.  E_POINTER if the FullPath parameter is not provided.  Other standard HRESULT values may be returned indicating the failure of the operation.

Remarks

Important: This method is deprecated and is pending removal from FESF. Do not use it. Convert existing code that uses it as soon as possible. Use the equivalent function provided by the FesfUtil2 Library.

If the file indicated by FullPath is encrypted, the HRESULT from this method will be S_OK and the value returned in Encrypted will be VARIANT_TRUE.

This method relies on support from the FESF Kernel Mode Components.  Note that methods in the FESF Utility library are only designed for use when FESF is installed and the FESF Kernel Mode Components are running.

Examples

// form the fully qualified file path

 

CString file(basePath + findData.cFileName);

 

VARIANT_BOOL answer;

hr = spUtil->IsFileEncrypted(CComBSTR(file), &answer);

 

bool fileIsEncrypted = (answer == VARIANT_TRUE);

 

if (fileIsEncrypted)

{

    wprintf(L"%-20ws: is encrypted!\n",

           wcsrchr(file, L'\\') + 1);

 

    continue;

}

See Also

The provided UM_Sample solution contains several examples that illustrate the use of this methods.

Requirements

Software version

FESF V1 (or later)

DLL

FESFUtility.DLL

Supported FESF State

FESF Online State

Type Library

\UM_FESF\UMLIB\FESFUTILITY.TLB

IID

IFesfUtil  (please use the defintion from the Type Library)

CLSID

FesfUtil (please use the definition from the Type Library)