Blame winpr/include/winpr/sspicli.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * WinPR: Windows Portable Runtime
Packit 1fb8d4
 * Security Support Provider Interface
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifndef WINPR_SSPICLI_H
Packit 1fb8d4
#define WINPR_SSPICLI_H
Packit 1fb8d4
Packit 1fb8d4
#include <stdio.h>
Packit 1fb8d4
#include <stdlib.h>
Packit 1fb8d4
#include <string.h>
Packit 1fb8d4
#include <winpr/winpr.h>
Packit 1fb8d4
#include <winpr/wtypes.h>
Packit 1fb8d4
Packit 1fb8d4
#ifndef _WIN32
Packit 1fb8d4
Packit Service 5a9772
#define LOGON32_LOGON_INTERACTIVE 2
Packit Service 5a9772
#define LOGON32_LOGON_NETWORK 3
Packit Service 5a9772
#define LOGON32_LOGON_BATCH 4
Packit Service 5a9772
#define LOGON32_LOGON_SERVICE 5
Packit Service 5a9772
#define LOGON32_LOGON_UNLOCK 7
Packit Service 5a9772
#define LOGON32_LOGON_NETWORK_CLEARTEXT 8
Packit Service 5a9772
#define LOGON32_LOGON_NEW_CREDENTIALS 9
Packit Service 5a9772
Packit Service 5a9772
#define LOGON32_PROVIDER_DEFAULT 0
Packit Service 5a9772
#define LOGON32_PROVIDER_WINNT35 1
Packit Service 5a9772
#define LOGON32_PROVIDER_WINNT40 2
Packit Service 5a9772
#define LOGON32_PROVIDER_WINNT50 3
Packit Service 5a9772
#define LOGON32_PROVIDER_VIRTUAL 4
Packit 1fb8d4
Packit 1fb8d4
typedef struct _QUOTA_LIMITS
Packit 1fb8d4
{
Packit 1fb8d4
	SIZE_T PagedPoolLimit;
Packit 1fb8d4
	SIZE_T NonPagedPoolLimit;
Packit 1fb8d4
	SIZE_T MinimumWorkingSetSize;
Packit 1fb8d4
	SIZE_T MaximumWorkingSetSize;
Packit 1fb8d4
	SIZE_T PagefileLimit;
Packit 1fb8d4
	LARGE_INTEGER TimeLimit;
Packit 1fb8d4
} QUOTA_LIMITS, *PQUOTA_LIMITS;
Packit 1fb8d4
Packit 1fb8d4
typedef enum
Packit 1fb8d4
{
Packit 1fb8d4
	/* An unknown name type */
Packit 1fb8d4
	NameUnknown = 0,
Packit 1fb8d4
Packit Service 5a9772
	/* The fully qualified distinguished name (for example, CN=Jeff
Packit Service 5a9772
	   Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com) */
Packit 1fb8d4
	NameFullyQualifiedDN = 1,
Packit 1fb8d4
Packit Service 5a9772
	/*
Packit 1fb8d4
	 * A legacy account name (for example, Engineering\JSmith).
Packit 1fb8d4
	 * The domain-only version includes trailing backslashes (\\)
Packit 1fb8d4
	 */
Packit 1fb8d4
	NameSamCompatible = 2,
Packit 1fb8d4
Packit 1fb8d4
	/*
Packit 1fb8d4
	 * A "friendly" display name (for example, Jeff Smith).
Packit 1fb8d4
	 * The display name is not necessarily the defining relative distinguished name (RDN)
Packit 1fb8d4
	 */
Packit 1fb8d4
	NameDisplay = 3,
Packit 1fb8d4
Packit Service 5a9772
	/* A GUID string that the IIDFromString function returns (for example,
Packit Service 5a9772
	   {4fa050f0-f561-11cf-bdd9-00aa003a77b6}) */
Packit 1fb8d4
	NameUniqueId = 6,
Packit 1fb8d4
Packit Service 5a9772
	/*
Packit 1fb8d4
	 * The complete canonical name (for example, engineering.microsoft.com/software/someone).
Packit 1fb8d4
	 * The domain-only version includes a trailing forward slash (/)
Packit 1fb8d4
	 */
Packit 1fb8d4
	NameCanonical = 7,
Packit 1fb8d4
Packit 1fb8d4
	/* The user principal name (for example, someone@example.com) */
Packit 1fb8d4
	NameUserPrincipal = 8,
Packit 1fb8d4
Packit Service 5a9772
	/*
Packit 1fb8d4
	 * The same as NameCanonical except that the rightmost forward slash (/)
Packit 1fb8d4
	 * is replaced with a new line character (\n), even in a domain-only case
Packit 1fb8d4
	 * (for example, engineering.microsoft.com/software\nJSmith)
Packit 1fb8d4
	 */
Packit 1fb8d4
	NameCanonicalEx = 9,
Packit 1fb8d4
Packit 1fb8d4
	/* The generalized service principal name (for example, www/www.microsoft.com@microsoft.com)  */
Packit 1fb8d4
	NameServicePrincipal = 10,
Packit 1fb8d4
Packit 1fb8d4
	/* The DNS domain name followed by a backward-slash and the SAM user name */
Packit 1fb8d4
	NameDnsDomain = 12
Packit 1fb8d4
Packit Service 5a9772
} EXTENDED_NAME_FORMAT,
Packit Service 5a9772
    *PEXTENDED_NAME_FORMAT;
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit Service 5a9772
extern "C"
Packit Service 5a9772
{
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
	WINPR_API BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
Packit Service 5a9772
	                          DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
Packit 1fb8d4
Packit Service 5a9772
	WINPR_API BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
Packit Service 5a9772
	                          DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
Packit 1fb8d4
Packit Service 5a9772
	WINPR_API BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
Packit Service 5a9772
	                            DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken,
Packit Service 5a9772
	                            PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength,
Packit Service 5a9772
	                            PQUOTA_LIMITS pQuotaLimits);
Packit 1fb8d4
Packit Service 5a9772
	WINPR_API BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
Packit Service 5a9772
	                            DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken,
Packit Service 5a9772
	                            PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength,
Packit Service 5a9772
	                            PQUOTA_LIMITS pQuotaLimits);
Packit 1fb8d4
Packit Service 5a9772
	WINPR_API BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer,
Packit Service 5a9772
	                              PULONG nSize);
Packit Service 5a9772
	WINPR_API BOOL GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer,
Packit Service 5a9772
	                              PULONG nSize);
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit 1fb8d4
}
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#ifdef UNICODE
Packit Service 5a9772
#define LogonUser LogonUserW
Packit Service 5a9772
#define LogonUserEx LogonUserExW
Packit Service 5a9772
#define GetUserNameEx GetUserNameExW
Packit 1fb8d4
#else
Packit Service 5a9772
#define LogonUser LogonUserA
Packit Service 5a9772
#define LogonUserEx LogonUserExA
Packit Service 5a9772
#define GetUserNameEx GetUserNameExA
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif /* WINPR_SSPICLI_H */