¡@

Home 

c# Programming Glossary: advapi32.dll

Convert a username to a SID string in C#/.NET

http://stackoverflow.com/questions/1040623/convert-a-username-to-a-sid-string-in-c-net

works when that won't and works on .NET 1.1 also DllImport advapi32.dll CharSet CharSet.Auto SetLastError true public static extern.. ref int cbReferencedDomainName out int use DllImport advapi32.dll CharSet CharSet.Auto SetLastError true internal static extern..

Detect if running as Administrator with or without elevated privileges?

http://stackoverflow.com/questions/1220213/detect-if-running-as-administrator-with-or-without-elevated-privileges

uint TOKEN_READ STANDARD_RIGHTS_READ TOKEN_QUERY DllImport advapi32.dll SetLastError true return MarshalAs UnmanagedType.Bool static.. UInt32 DesiredAccess out IntPtr TokenHandle DllImport advapi32.dll SetLastError true public static extern bool GetTokenInformation..

How to get the logon SID in c#

http://stackoverflow.com/questions/2146153/how-to-get-the-logon-sid-in-c-sharp

static extern IntPtr LocalFree IntPtr hMem DllImport advapi32.dll SetLastError true static extern bool GetTokenInformation IntPtr..

Process.Start with different credentials with UAC on

http://stackoverflow.com/questions/2313553/process-start-with-different-credentials-with-uac-on

UInt32 SessionId ref IntPtr phToken DllImport advapi32.dll SetLastError true static extern Boolean LookupPrivilegeValue.. MarshalAs UnmanagedType.Struct ref LUID lpLuid DllImport advapi32.dll EntryPoint CreateProcessAsUser SetLastError true CharSet CharSet.Ansi.. out PROCESS_INFORMATION lpProcessInformation DllImport advapi32.dll EntryPoint DuplicateTokenEx extern static Boolean DuplicateTokenEx..

How do I pass credentials to a machine so I can use Microsoft.Win32.RegistryKey.OpenRemoteBaseKey() on it?

http://stackoverflow.com/questions/2541504/how-do-i-pass-credentials-to-a-machine-so-i-can-use-microsoft-win32-registrykey

a computer is the following code #region imports DllImport advapi32.dll SetLastError true private static extern bool LogonUser string.. static extern bool CloseHandle IntPtr handle DllImport advapi32.dll CharSet CharSet.Auto SetLastError true public extern static..

Accessing Password Protected Network Drives in Windows in C#?

http://stackoverflow.com/questions/2563724/accessing-password-protected-network-drives-in-windows-in-c

error information call GetLastError. returns DllImport advapi32.dll CharSet CharSet.Unicode SetLastError true return MarshalAs UnmanagedType.Bool.. error information call GetLastError. returns DllImport advapi32.dll CharSet CharSet.Unicode SetLastError true return MarshalAs UnmanagedType.Bool..

Using Process.Start() to start a process as a different user from within a Windows Service

http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo

public uint ProcessId public uint ThreadId DllImport advapi32.dll SetLastError true static extern bool InitializeSecurityDescriptor.. const uint SECURITY_DESCRIPTOR_REVISION 1 DllImport advapi32.dll SetLastError true static extern bool SetSecurityDescriptorDacl.. bool daclPresent IntPtr dacl bool daclDefaulted DllImport advapi32.dll CharSet CharSet.Auto SetLastError true extern static bool DuplicateTokenEx..