FesfUtil2UpdateHeaderExclusive Function

Replaces the existing Solution Header on the file indicated by FileToUpdate with the Solution Header provided in NewHeader. Opens the file for exclusive access and requires both read and write access to the file.

Syntax (C++)

void

FesfUtil2UpdateHeaderExclusive(std::wstring_view FileToUpdate,

                               const FESF_UTIL2_SOLUTION_HEADER &NewHeader);

Syntax (C)

DWORD

FesfUtil2UpdateHeaderExclusive_C(

    [in] LPCWSTR FileToUpdate,

    [inout] PVOID HeaderBuffer,

    [in] DWORD HeaderLength);

Parameters

FileToUpdate

Fully qualified path of file to operate on.

NewHeader

Header to be substituted for the existing 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.

NewHeader must fit in the existing Solution Header space.  That is, it must not be larger than the MaxLength size returned when the existing Solution Header is read. To write a header that is larger than the existing maximum size, use FesfUtil2UpdateHeaderExclusiveWithExtension.

Replaces

IFesfDs:: UpdateHeader