ReactOS 0.4.15-dev-8614-gbc76250
|
#include <advapi32.h>
Go to the source code of this file.
Variables | |
static const CHAR | AdvapiTokenSourceName [] = "Advapi " |
HANDLE | LsaHandle = NULL |
ULONG | AuthenticationPackage = 0 |
C_ASSERT | ( | sizeof(AdvapiTokenSourceName) | = =RTL_FIELD_SIZE(TOKEN_SOURCE, SourceName)+1 | ) |
|
static |
Creates a default security descriptor that is going to be used by both the newly created process and thread by a call to CreateProcessAsUserA/W. This descriptor also serves for the newly duplicated token object that is going to be set for the token which acts as the main user.
[in] | TokenHandle | A handle to a token. The function will use this token to query security details such as the owner and primary group associated with the security context of this token. The obtained information will then be assigned to the security descriptor. |
[out] | Sd | A pointer to an allocated security descriptor that is given to the caller. |
!!!NOTE!!! – On Windows the security descriptor is created by using CreatePrivateObjectSecurity(Ex) API call. Whilst the way the security descriptor is created in our end is not wrong per se, this function serves a placeholder until CreatePrivateObjectSecurity is implemented.
Definition at line 129 of file logon.c.
Referenced by CreateProcessAsUserCommon().
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserA | ( | _In_opt_ HANDLE | hToken, |
_In_opt_ LPCSTR | lpApplicationName, | ||
_Inout_opt_ LPSTR | lpCommandLine, | ||
_In_opt_ LPSECURITY_ATTRIBUTES | lpProcessAttributes, | ||
_In_opt_ LPSECURITY_ATTRIBUTES | lpThreadAttributes, | ||
_In_ BOOL | bInheritHandles, | ||
_In_ DWORD | dwCreationFlags, | ||
_In_opt_ LPVOID | lpEnvironment, | ||
_In_opt_ LPCSTR | lpCurrentDirectory, | ||
_In_ LPSTARTUPINFOA | lpStartupInfo, | ||
_Out_ LPPROCESS_INFORMATION | lpProcessInformation | ||
) |
Definition at line 945 of file logon.c.
Referenced by test_token_security_descriptor().
|
static |
Internal function that serves as a helper for CreateProcessAsUserW/A routines on creating a process within the context of the logged in user.
[in] | hToken | A handle to an access token that is associated with the logged in user. If the caller does not submit a token, the helper will immediately quit and return success, and the newly created process will be created upon using the default security context. |
[in] | dwCreationFlags | Bit masks containing the creation process flags. The function uses this parameter to determine if the process wasn't created in a suspended way and if not the function will resume the main thread. |
[in] | lpProcessAttributes | A pointer to process attributes. This function uses this parameter to gather the security descriptor, if ever present. If it is, this descriptor takes precedence over the default one when setting new security information to the process. |
[in] | lpThreadAttributes | A pointer to thread attributes. This function uses this parameter to gather the security descriptor, if ever present. If it is, this descriptor takes precedence over the default one when setting new security information to the thread. |
[in,out] | lpProcessInformation | A pointer to a structure that contains process creation information data. Such pointer contains the process and thread handles and whatnot. |
Definition at line 645 of file logon.c.
Referenced by CreateProcessAsUserA(), and CreateProcessAsUserW().
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW | ( | _In_opt_ HANDLE | hToken, |
_In_opt_ LPCWSTR | lpApplicationName, | ||
_Inout_opt_ LPWSTR | lpCommandLine, | ||
_In_opt_ LPSECURITY_ATTRIBUTES | lpProcessAttributes, | ||
_In_opt_ LPSECURITY_ATTRIBUTES | lpThreadAttributes, | ||
_In_ BOOL | bInheritHandles, | ||
_In_ DWORD | dwCreationFlags, | ||
_In_opt_ LPVOID | lpEnvironment, | ||
_In_opt_ LPCWSTR | lpCurrentDirectory, | ||
_In_ LPSTARTUPINFOW | lpStartupInfo, | ||
_Out_ LPPROCESS_INFORMATION | lpProcessInformation | ||
) |
Definition at line 993 of file logon.c.
Referenced by custom_start_server(), InstallDevice(), LaunchProcess(), ScmStartUserModeService(), SeclCreateProcessWithLogonW(), StartScreenSaver(), and WlxStartApplication().
|
static |
Changes the object security information of a process and thread that belongs to the process with new security data, basically by replacing the previous security descriptor with a new one.
[in] | ProcessHandle | A handle to a valid process of which security information is to be changed by setting up a new security descriptor. |
[in] | ThreadHandle | A handle to a valid thread of which security information is to be changed by setting up a new security descriptor. |
[in] | ProcessSecurity | A pointer to a security descriptor that is for the process. |
[in] | ThreadSecurity | A pointer to a security descriptor that is for the thread. |
Definition at line 404 of file logon.c.
Referenced by CreateProcessAsUserCommon().
|
static |
Sets a primary token to the newly created process. The primary token that gets assigned to is a token whose security context is associated with the logged in user. For futher documentation information, see Remarks.
[in] | ImpersonateAsSelf | If set to TRUE, the function will act on behalf of the calling process by impersonating its security context. Generally the caller will disable impersonation and attempt to act on behalf of the said main process as a first tentative to acquire the needed privilege in order to assign a token to the process. If set to FALSE, the function won't act on behalf of the calling process. |
[in] | ProcessHandle | A handle to the newly created process. The function will use it as a mean to assign the primary token to this process. |
[in] | ThreadHandle | A handle to the newly and primary created thread associated with the process. |
[in] | DuplicatedTokenHandle | A handle to a duplicated access token. This token represents as a primary one, initially duplicated in form as a primary type from an impersonation type. |
The caller will either succeed or fail at acquiring SE_ASSIGNPRIMARYTOKEN_PRIVILEGE privilege depending on the security context of the user. If it's allowed, the caller would generally acquire such privilege immediately but if not, the caller will attempt to do a second try.
Definition at line 482 of file logon.c.
Referenced by CreateProcessAsUserCommon().
BOOL WINAPI LogonUserA | ( | _In_ LPSTR | lpszUsername, |
_In_opt_ LPSTR | lpszDomain, | ||
_In_opt_ LPSTR | lpszPassword, | ||
_In_ DWORD | dwLogonType, | ||
_In_ DWORD | dwLogonProvider, | ||
_Out_opt_ PHANDLE | phToken | ||
) |
Definition at line 1040 of file logon.c.
BOOL WINAPI LogonUserExA | ( | _In_ LPSTR | lpszUsername, |
_In_opt_ LPSTR | lpszDomain, | ||
_In_opt_ LPSTR | lpszPassword, | ||
_In_ DWORD | dwLogonType, | ||
_In_ DWORD | dwLogonProvider, | ||
_Out_opt_ PHANDLE | phToken, | ||
_Out_opt_ PSID * | ppLogonSid, | ||
_Out_opt_ PVOID * | ppProfileBuffer, | ||
_Out_opt_ LPDWORD | pdwProfileLength, | ||
_Out_opt_ PQUOTA_LIMITS | pQuotaLimits | ||
) |
Definition at line 1066 of file logon.c.
Referenced by LogonUserA().
BOOL WINAPI LogonUserExW | ( | _In_ LPWSTR | lpszUsername, |
_In_opt_ LPWSTR | lpszDomain, | ||
_In_opt_ LPWSTR | lpszPassword, | ||
_In_ DWORD | dwLogonType, | ||
_In_ DWORD | dwLogonProvider, | ||
_Out_opt_ PHANDLE | phToken, | ||
_Out_opt_ PSID * | ppLogonSid, | ||
_Out_opt_ PVOID * | ppProfileBuffer, | ||
_Out_opt_ LPDWORD | pdwProfileLength, | ||
_Out_opt_ PQUOTA_LIMITS | pQuotaLimits | ||
) |
Definition at line 1163 of file logon.c.
Referenced by LogonUserExA(), and LogonUserW().
BOOL WINAPI LogonUserW | ( | _In_ LPWSTR | lpszUsername, |
_In_opt_ LPWSTR | lpszDomain, | ||
_In_opt_ LPWSTR | lpszPassword, | ||
_In_ DWORD | dwLogonType, | ||
_In_ DWORD | dwLogonProvider, | ||
_Out_opt_ PHANDLE | phToken | ||
) |
Definition at line 1137 of file logon.c.
Referenced by ScmLogonService().
Definition at line 24 of file logon.c.
Referenced by LogonUserExW().
WINE_DEFAULT_DEBUG_CHANNEL | ( | advapi | ) |
Definition at line 14 of file logon.c.
Referenced by LogonUserExW().
ULONG AuthenticationPackage = 0 |
Definition at line 18 of file logon.c.
Referenced by LogonUserExW(), LsaCallAuthenticationPackage(), LsaLogonUser(), LsaLookupAuthenticationPackage(), MyLogonUser(), NetUserChangePassword(), OpenLogonLsaHandle(), and WinMain().
Definition at line 17 of file logon.c.
Referenced by CloseLogonLsaHandle(), LogonUserExW(), and OpenLogonLsaHandle().