FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
sspicli.h
1
20#ifndef WINPR_SSPICLI_H
21#define WINPR_SSPICLI_H
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26#include <winpr/winpr.h>
27#include <winpr/wtypes.h>
28
29#ifndef _WIN32
30
31#define LOGON32_LOGON_INTERACTIVE 2
32#define LOGON32_LOGON_NETWORK 3
33#define LOGON32_LOGON_BATCH 4
34#define LOGON32_LOGON_SERVICE 5
35#define LOGON32_LOGON_UNLOCK 7
36#define LOGON32_LOGON_NETWORK_CLEARTEXT 8
37#define LOGON32_LOGON_NEW_CREDENTIALS 9
38
39#define LOGON32_PROVIDER_DEFAULT 0
40#define LOGON32_PROVIDER_WINNT35 1
41#define LOGON32_PROVIDER_WINNT40 2
42#define LOGON32_PROVIDER_WINNT50 3
43#define LOGON32_PROVIDER_VIRTUAL 4
44
45typedef struct
46{
47 size_t PagedPoolLimit;
48 size_t NonPagedPoolLimit;
49 size_t MinimumWorkingSetSize;
50 size_t MaximumWorkingSetSize;
51 size_t PagefileLimit;
52 LARGE_INTEGER TimeLimit;
54
55typedef enum
56{
57 /* An unknown name type */
58 NameUnknown = 0,
59
60 /* The fully qualified distinguished name (for example, CN=Jeff
61 Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com) */
62 NameFullyQualifiedDN = 1,
63
64 /*
65 * A legacy account name (for example, Engineering\JSmith).
66 * The domain-only version includes trailing backslashes (\\‍)
67 */
68 NameSamCompatible = 2,
69
70 /*
71 * A "friendly" display name (for example, Jeff Smith).
72 * The display name is not necessarily the defining relative distinguished name (RDN)
73 */
74 NameDisplay = 3,
75
76 /* A GUID string that the IIDFromString function returns (for example,
77 {4fa050f0-f561-11cf-bdd9-00aa003a77b6}) */
78 NameUniqueId = 6,
79
80 /*
81 * The complete canonical name (for example, engineering.microsoft.com/software/someone).
82 * The domain-only version includes a trailing forward slash (/)
83 */
84 NameCanonical = 7,
85
86 /* The user principal name (for example, someone@example.com) */
87 NameUserPrincipal = 8,
88
89 /*
90 * The same as NameCanonical except that the rightmost forward slash (/)
91 * is replaced with a new line character (\n), even in a domain-only case
92 * (for example, engineering.microsoft.com/software\nJSmith)
93 */
94 NameCanonicalEx = 9,
95
96 /* The generalized service principal name (for example, www/www.microsoft.com@microsoft.com) */
97 NameServicePrincipal = 10,
98
99 /* The DNS domain name followed by a backward-slash and the SAM user name */
100 NameDnsDomain = 12
101
102} EXTENDED_NAME_FORMAT,
103 *PEXTENDED_NAME_FORMAT;
104
105#ifdef __cplusplus
106extern "C"
107{
108#endif
109
110 WINPR_API BOOL LogonUserA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
111 DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
112
113 WINPR_API BOOL LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
114 DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
115
116 WINPR_API BOOL LogonUserExA(LPCSTR lpszUsername, LPCSTR lpszDomain, LPCSTR lpszPassword,
117 DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken,
118 PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength,
119 PQUOTA_LIMITS pQuotaLimits);
120
121 WINPR_API BOOL LogonUserExW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword,
122 DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken,
123 PSID* ppLogonSid, PVOID* ppProfileBuffer, LPDWORD pdwProfileLength,
124 PQUOTA_LIMITS pQuotaLimits);
125
126 WINPR_API BOOL GetUserNameExA(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer,
127 PULONG nSize);
128 WINPR_API BOOL GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer,
129 PULONG nSize);
130
131#ifdef __cplusplus
132}
133#endif
134
135#ifdef UNICODE
136#define LogonUser LogonUserW
137#define LogonUserEx LogonUserExW
138#define GetUserNameEx GetUserNameExW
139#else
140#define LogonUser LogonUserA
141#define LogonUserEx LogonUserExA
142#define GetUserNameEx GetUserNameExA
143#endif
144
145#endif
146
147#endif /* WINPR_SSPICLI_H */