Documentation ¶
Index ¶
- Variables
- func CreateProcessWithLogon(lpUsername *uint16, lpDomain *uint16, lpPassword *uint16, dwLogonFlags uint32, ...) error
- func CreateProcessWithTokenW(...) (err error)
- func ImpersonateLoggedOnUser(hToken windows.Token) (err error)
- func LogonUser(lpszUsername *uint16, lpszDomain *uint16, lpszPassword *uint16, ...) (token *unsafe.Pointer, err error)
- func LookupPrivilegeName(luid windows.LUID) (privilege string, err error)
Constants ¶
This section is empty.
Variables ¶
var Advapi32 = windows.NewLazySystemDLL("Advapi32.dll")
Functions ¶
func CreateProcessWithLogon ¶
func CreateProcessWithLogon(lpUsername *uint16, lpDomain *uint16, lpPassword *uint16, dwLogonFlags uint32, lpApplicationName *uint16, lpCommandLine *uint16, dwCreationFlags uint32, lpEnvironment uintptr, lpCurrentDirectory *uint16, lpStartupInfo *windows.StartupInfo, lpProcessInformation *windows.ProcessInformation) error
CreateProcessWithLogon Creates a new process and its primary thread. Then the new process runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for a specified user. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithlogonw
func CreateProcessWithTokenW ¶
func CreateProcessWithTokenW(hToken, dwLogonFlags, lpApplicationName, lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation uintptr) (err error)
CreateProcessWithTokenW creates a new process and its primary thread. The new process runs in the security context of the specified token. It can optionally load the user profile for the specified user. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithtokenw
func ImpersonateLoggedOnUser ¶
ImpersonateLoggedOnUser lets the calling thread impersonate the security context of a logged-on user. The user is represented by a token handle. https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-impersonateloggedonuser
func LogonUser ¶
func LogonUser(lpszUsername *uint16, lpszDomain *uint16, lpszPassword *uint16, dwLogonType uint32, dwLogonProvider uint32) (token *unsafe.Pointer, err error)
LogonUser attempts to log a user on to the local computer. The local computer is the computer from which LogonUser was called. You cannot use LogonUser to log on to a remote computer. You specify the user with a user name and domain and authenticate the user with a plaintext password. If the function succeeds, you receive a handle to a token that represents the logged-on user. You can then use this token handle to impersonate the specified user or, in most cases, to create a process that runs in the context of the specified user. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-logonuserw
func LookupPrivilegeName ¶
LookupPrivilegeName retrieves the name that corresponds to the privilege represented on a specific system by a specified locally unique identifier (LUID). https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegenamew
Types ¶
This section is empty.