TakeOwn Sample: Granting Administrator Access

Click to open or copy the files for the TakeOwn sample.

The TakeOwn sample implements a recovery scheme to give an Administrator access to a file that has had its access denied to all.

This sample must be run from an Administrator account in order to perform reliably.

Building SDK Samples

This sample uses the following keywords:

allocateandinitializesid; asserttakeownership; getcurrentprocessid; getlasterror; gettokenhandle; initializesecuritydescriptor; lookupprivilegevalue; openprocess; printf; setfilesecurity; variableinitialization