20 #include <winpr/platform.h>
21 #include <winpr/wtypes.h>
22 #include <winpr/config.h>
25 #define SEC_ENTRY __stdcall
26 #define SSPI_EXPORT __declspec(dllexport)
28 #include <winpr/winpr.h>
30 #define SSPI_EXPORT WINPR_API
35 typedef unsigned long ULONG;
37 typedef LONG SECURITY_STATUS;
39 WINPR_PRAGMA_DIAG_PUSH
40 WINPR_PRAGMA_DIAG_IGNORED_MISSING_PROTOTYPES
50 extern SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW(
void*,
void*);
52 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesW(
void* pcPackages,
55 return sspi_EnumerateSecurityPackagesW(pcPackages, ppPackageInfo);
58 extern SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA(
void*,
void*);
60 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EnumerateSecurityPackagesA(
void* pcPackages,
63 return sspi_EnumerateSecurityPackagesA(pcPackages, ppPackageInfo);
66 extern void* SEC_ENTRY sspi_InitSecurityInterfaceW(
void);
68 SSPI_EXPORT
void* SEC_ENTRY InitSecurityInterfaceW(
void)
70 return sspi_InitSecurityInterfaceW();
73 extern void* SEC_ENTRY sspi_InitSecurityInterfaceA(
void);
75 SSPI_EXPORT
void* SEC_ENTRY InitSecurityInterfaceA(
void)
77 return sspi_InitSecurityInterfaceA();
80 extern SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(
void*,
void*);
82 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoW(
void* pszPackageName,
85 return sspi_QuerySecurityPackageInfoW(pszPackageName, ppPackageInfo);
88 extern SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(
void*,
void*);
90 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityPackageInfoA(
void* pszPackageName,
93 return sspi_QuerySecurityPackageInfoA(pszPackageName, ppPackageInfo);
98 extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(
void*,
void*, ULONG,
void*,
void*,
99 void*,
void*,
void*,
void*);
101 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleW(
102 void* pszPrincipal,
void* pszPackage, ULONG fCredentialUse,
void* pvLogonID,
void* pAuthData,
103 void* pGetKeyFn,
void* pvGetKeyArgument,
void* phCredential,
void* ptsExpiry)
105 return sspi_AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse, pvLogonID,
106 pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential,
110 extern SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(
void*,
void*, ULONG,
void*,
void*,
111 void*,
void*,
void*,
void*);
113 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcquireCredentialsHandleA(
114 void* pszPrincipal,
void* pszPackage, ULONG fCredentialUse,
void* pvLogonID,
void* pAuthData,
115 void* pGetKeyFn,
void* pvGetKeyArgument,
void* phCredential,
void* ptsExpiry)
117 return sspi_AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse, pvLogonID,
118 pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential,
122 extern SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext(
void*, ULONG,
void*,
void**);
124 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ExportSecurityContext(
void* phContext, ULONG fFlags,
125 void* pPackedContext,
void** pToken)
127 return sspi_ExportSecurityContext(phContext, fFlags, pPackedContext, pToken);
130 extern SECURITY_STATUS SEC_ENTRY sspi_FreeCredentialsHandle(
void*);
132 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY FreeCredentialsHandle(
void* phCredential)
134 return sspi_FreeCredentialsHandle(phCredential);
137 extern SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW(
void*,
void*,
void*,
void*);
139 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextW(
void* pszPackage,
void* pPackedContext,
140 void* pToken,
void* phContext)
142 return sspi_ImportSecurityContextW(pszPackage, pPackedContext, pToken, phContext);
145 extern SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA(
void*,
void*,
void*,
void*);
147 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImportSecurityContextA(
void* pszPackage,
void* pPackedContext,
148 void* pToken,
void* phContext)
150 return sspi_ImportSecurityContextA(pszPackage, pPackedContext, pToken, phContext);
153 extern SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW(
void*, ULONG,
void*);
155 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesW(
void* phCredential,
156 ULONG ulAttribute,
void* pBuffer)
158 return sspi_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer);
161 extern SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(
void*, ULONG,
void*);
163 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryCredentialsAttributesA(
void* phCredential,
164 ULONG ulAttribute,
void* pBuffer)
166 return sspi_QueryCredentialsAttributesA(phCredential, ulAttribute, pBuffer);
171 extern SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(
void*,
void*,
void*, ULONG, ULONG,
172 void*,
void*,
void*,
void*);
174 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY AcceptSecurityContext(
void* phCredential,
void* phContext,
175 void* pInput, ULONG fContextReq,
176 ULONG TargetDataRep,
void* phNewContext,
177 void* pOutput,
void* pfContextAttr,
180 return sspi_AcceptSecurityContext(phCredential, phContext, pInput, fContextReq, TargetDataRep,
181 phNewContext, pOutput, pfContextAttr, ptsTimeStamp);
184 extern SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken(
void*,
void*);
186 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ApplyControlToken(
void* phContext,
void* pInput)
188 return sspi_ApplyControlToken(phContext, pInput);
191 extern SECURITY_STATUS SEC_ENTRY sspi_CompleteAuthToken(
void*,
void*);
193 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY CompleteAuthToken(
void* phContext,
void* pToken)
195 return sspi_CompleteAuthToken(phContext, pToken);
198 extern SECURITY_STATUS SEC_ENTRY sspi_DeleteSecurityContext(
void*);
200 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY DeleteSecurityContext(
void* phContext)
202 return sspi_DeleteSecurityContext(phContext);
205 extern SECURITY_STATUS SEC_ENTRY sspi_FreeContextBuffer(
void*);
207 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY FreeContextBuffer(
void* pvContextBuffer)
209 return sspi_FreeContextBuffer(pvContextBuffer);
212 extern SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext(
void*);
214 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY ImpersonateSecurityContext(
void* phContext)
216 return sspi_ImpersonateSecurityContext(phContext);
219 extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(
void*,
void*,
void*, ULONG, ULONG,
220 ULONG,
void*, ULONG,
void*,
void*,
223 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextW(
224 void* phCredential,
void* phContext,
void* pszTargetName, ULONG fContextReq, ULONG Reserved1,
225 ULONG TargetDataRep,
void* pInput, ULONG Reserved2,
void* phNewContext,
void* pOutput,
226 void* pfContextAttr,
void* ptsExpiry)
228 return sspi_InitializeSecurityContextW(phCredential, phContext, pszTargetName, fContextReq,
229 Reserved1, TargetDataRep, pInput, Reserved2,
230 phNewContext, pOutput, pfContextAttr, ptsExpiry);
233 extern SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(
void*,
void*,
void*, ULONG, ULONG,
234 ULONG,
void*, ULONG,
void*,
void*,
237 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY InitializeSecurityContextA(
238 void* phCredential,
void* phContext,
void* pszTargetName, ULONG fContextReq, ULONG Reserved1,
239 ULONG TargetDataRep,
void* pInput, ULONG Reserved2,
void* phNewContext,
void* pOutput,
240 void* pfContextAttr,
void* ptsExpiry)
242 return sspi_InitializeSecurityContextA(phCredential, phContext, pszTargetName, fContextReq,
243 Reserved1, TargetDataRep, pInput, Reserved2,
244 phNewContext, pOutput, pfContextAttr, ptsExpiry);
247 extern SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW(
void*, ULONG,
void*);
249 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesW(
void* phContext, ULONG ulAttribute,
252 return sspi_QueryContextAttributesW(phContext, ulAttribute, pBuffer);
255 extern SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA(
void*, ULONG,
void*);
257 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QueryContextAttributesA(
void* phContext, ULONG ulAttribute,
260 return sspi_QueryContextAttributesA(phContext, ulAttribute, pBuffer);
263 extern SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityContextToken(
void*,
void**);
265 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY QuerySecurityContextToken(
void* phContext,
void** phToken)
267 return sspi_QuerySecurityContextToken(phContext, phToken);
270 extern SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW(
void*, ULONG,
void*, ULONG);
272 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesW(
void* phContext, ULONG ulAttribute,
273 void* pBuffer, ULONG cbBuffer)
275 return sspi_SetContextAttributesW(phContext, ulAttribute, pBuffer, cbBuffer);
278 extern SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA(
void*, ULONG,
void*, ULONG);
280 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY SetContextAttributesA(
void* phContext, ULONG ulAttribute,
281 void* pBuffer, ULONG cbBuffer)
283 return sspi_SetContextAttributesA(phContext, ulAttribute, pBuffer, cbBuffer);
286 extern SECURITY_STATUS SEC_ENTRY sspi_SetCredentialsAttributesW(
void*, ULONG,
void*, ULONG);
288 static SECURITY_STATUS SEC_ENTRY SetCredentialsAttributesW(
void* phCredential, ULONG ulAttribute,
289 void* pBuffer, ULONG cbBuffer)
291 return sspi_SetCredentialsAttributesW(phCredential, ulAttribute, pBuffer, cbBuffer);
294 extern SECURITY_STATUS SEC_ENTRY sspi_SetCredentialsAttributesA(
void*, ULONG,
void*, ULONG);
296 static SECURITY_STATUS SEC_ENTRY SetCredentialsAttributesA(
void* phCredential, ULONG ulAttribute,
297 void* pBuffer, ULONG cbBuffer)
299 return sspi_SetCredentialsAttributesA(phCredential, ulAttribute, pBuffer, cbBuffer);
302 extern SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext(
void*);
304 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY RevertSecurityContext(
void* phContext)
306 return sspi_RevertSecurityContext(phContext);
311 extern SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage(
void*,
void*, ULONG,
void*);
313 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY DecryptMessage(
void* phContext,
void* pMessage,
314 ULONG MessageSeqNo,
void* pfQOP)
316 return sspi_DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP);
319 extern SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage(
void*, ULONG,
void*, ULONG);
321 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY EncryptMessage(
void* phContext, ULONG fQOP,
void* pMessage,
324 return sspi_EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo);
327 extern SECURITY_STATUS SEC_ENTRY sspi_MakeSignature(
void*, ULONG,
void*, ULONG);
329 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY MakeSignature(
void* phContext, ULONG fQOP,
void* pMessage,
332 return sspi_MakeSignature(phContext, fQOP, pMessage, MessageSeqNo);
335 extern SECURITY_STATUS SEC_ENTRY sspi_VerifySignature(
void*,
void*, ULONG,
void*);
337 SSPI_EXPORT SECURITY_STATUS SEC_ENTRY VerifySignature(
void* phContext,
void* pMessage,
338 ULONG MessageSeqNo,
void* pfQOP)
340 return sspi_VerifySignature(phContext, pMessage, MessageSeqNo, pfQOP);
345 WINPR_PRAGMA_DIAG_POP