IOfflineFilesCache::GetEncryptionStatus method

Retrieves the current encryption state (encrypted or unencrypted) of the Offline Files cache.

Syntax

HRESULT GetEncryptionStatus(
  BOOL *pbEncrypted,
  BOOL *pbPartial
);

Parameters

pbEncrypted

Receives TRUE if the Offline Files cache is configured to be encrypted; FALSE if configured to be unencrypted.

pbPartial

Receives TRUE if the Offline Files cache is partially encrypted or partially unencrypted based on the value returned in pbEncrypted; FALSE if it is fully encrypted or unencrypted.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

This encryption state is read from the Offline Files cache and reflects the state of the cache at that instant.

This method returns two values that indicate if the cache is fully encrypted, partially encrypted, fully unencrypted or partially unencrypted.

To change the encryption state of the cache, use the IOfflineFilesCache::Encrypt method.

Examples

The following example shows how to use this method.

C++
    //
    // Assume we already have a cache ptr.
    //
    IOfflineFilesCache *pCache;
    BOOL bEncrypted;
    BOOL bPartial;
    HRESULT hr = pCache->GetEncryptionStatus(&bEncrypted, &bPartial);
    if (SUCCEEDED(hr))
    {
        if (bEncrypted)
        {
            if (bPartial)
            {
                // Cache is partially encrypted.
            }
            else
            {
                // Cache is fully encrypted.
            }
        }
        else
        {
            if (bPartial)
            {
                // Cache is partially unencrypted.
            }
            else
            {
                // Cache is fully unencrypted.
            }
        }
    }

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header cscobj.h
DLL CscSvc.dll; CscObj.dll

See Also

IOfflineFilesCache