[DllImport("advapi32.dll", SetLastError=true)]
static extern bool RevertToSelf();
Declare Function RevertToSelf Lib "advapi32.dll" () As Integer
None.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/reverttoself.asp
Make sure you catch errors correctly:
if (!RevertToSelf())
{
int win32error = Marshal.GetLastWin32Error();
throw new System.ComponentModel.Win32Exception(win32error);
}
Do you know one? Please contribute it!