FesfUtil2ReadHeaderUnsafe Function

Reads and returns the Solution Header for an FESF encrypted file. Opens the file "shared" and therefore presents a risk of other programs simultaneously accessing (and possibly updating) the file's header directly via a call to FesfUtil2 or via FESF.  When possible, use the function FesfUtil2ReadHeaderExclusive in preference to this function.

Syntax (C++)

FESF_UTIL2_SOLUTION_HEADER

FesfUtil2ReadHeaderUnsafe(std::wstring_view FileToRead);

Syntax (C)

DWORD

FesfUtil2ReadHeaderUnsafe_C(
     [in] LPCWSTR FileToRead,

     [out] PVOID HeaderBuffer,

     [inout] DWORD* HeaderLength,

     [Out] DWORD* MaxHeaderSize)

Parameters

FileToRead

Fully qualified path name for the file.

Return value

Returns an FESF_UTIL2_SOLUTION_HEADER instance that describes and contains the file's Solution Policy Header.

Throws

Throws an FEU2Exception if an error is encountered.

Remarks

Requires the caller to have SeRestorePrivilege.  If the privilege is not already activated, it will be activated by the function and deactivated before return.

This function only supports local files. It can NOT be used to read the header of a file that is accessed via the network.

Replaces

IFesfUtil2:: ReadHeaderUnsafe and IFesfUtil2:: ReadHeaderUnsafeFQP