ReactOS  0.4.15-dev-1384-g878186b
lsamode.c
Go to the documentation of this file.
1 /*
2  * LSA-mode functions of the SChannel security provider
3  *
4  * Copyright 2007 Yuval Fledel
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <stdarg.h>
22 
23 #include "ntstatus.h"
24 #define WIN32_NO_STATUS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "sspi.h"
28 #include "ntsecapi.h"
29 #include "ntsecpkg.h"
30 #include "schannel.h"
31 
32 #include "wine/debug.h"
33 
35 
36 /***********************************************************************
37  * SpGetInfoUnified
38  */
40 {
41  TRACE("(%p)\n", PackageInfo);
42 
43  PackageInfo->fCapabilities = SECPKG_FLAG_MUTUAL_AUTH |
48  PackageInfo->wVersion = 1;
49  PackageInfo->wRPCID = UNISP_RPC_ID;
50  PackageInfo->cbMaxToken = 0x4000;
51  PackageInfo->Name = (LPWSTR)UNISP_NAME_W;
52  PackageInfo->Comment = (LPWSTR)UNISP_NAME_W;
53 
54  return STATUS_SUCCESS;
55 }
56 
57 static SEC_WCHAR schannelCommentW[] = { 'S','c','h','a','n','n','e','l',
58  ' ','S','e','c','u','r','i','t','y',' ','P','a','c','k','a','g','e',0 };
59 
60 /***********************************************************************
61  * SpGetInfoSChannel
62  */
64 {
65  TRACE("(%p)\n", PackageInfo);
66 
67  PackageInfo->fCapabilities = SECPKG_FLAG_MUTUAL_AUTH |
72  PackageInfo->wVersion = 1;
73  PackageInfo->wRPCID = UNISP_RPC_ID;
74  PackageInfo->cbMaxToken = 0x4000;
75  PackageInfo->Name = (LPWSTR)SCHANNEL_NAME_W;
76  PackageInfo->Comment = schannelCommentW;
77 
78  return STATUS_SUCCESS;
79 }
80 
82 { {
83  NULL, /* InitializePackage */
84  NULL, /* LsaLogonUser */
85  NULL, /* CallPackage */
86  NULL, /* LogonTerminated */
87  NULL, /* CallPackageUntrusted */
88  NULL, /* CallPackagePassthrough */
89  NULL, /* LogonUserEx */
90  NULL, /* LogonUserEx2 */
91  NULL, /* Initialize */
92  NULL, /* Shutdown */
94  NULL, /* AcceptCredentials */
95  NULL, /* SpAcquireCredentialsHandle */
96  NULL, /* SpQueryCredentialsAttributes */
97  NULL, /* FreeCredentialsHandle */
98  NULL, /* SaveCredentials */
99  NULL, /* GetCredentials */
100  NULL, /* DeleteCredentials */
101  NULL, /* InitLsaModeContext */
102  NULL, /* AcceptLsaModeContext */
103  NULL, /* DeleteContext */
104  NULL, /* ApplyControlToken */
105  NULL, /* GetUserInfo */
106  NULL, /* GetExtendedInformation */
107  NULL, /* SpQueryContextAttributes */
108  NULL, /* SpAddCredentials */
109  NULL, /* SetExtendedInformation */
110  NULL, /* SetContextAttributes */
111  NULL, /* SetCredentialsAttributes */
112  NULL, /* ChangeAccountPassword */
113  NULL, /* QueryMetaData */
114  NULL, /* ExchangeMetaData */
115  NULL, /* GetCredUIContext */
116  NULL, /* UpdateCredentials */
117  NULL, /* ValidateTargetInfo */
118  NULL, /* PostLogonUser */
119  }, {
120  NULL, /* InitializePackage */
121  NULL, /* LsaLogonUser */
122  NULL, /* CallPackage */
123  NULL, /* LogonTerminated */
124  NULL, /* CallPackageUntrusted */
125  NULL, /* CallPackagePassthrough */
126  NULL, /* LogonUserEx */
127  NULL, /* LogonUserEx2 */
128  NULL, /* Initialize */
129  NULL, /* Shutdown */
131  NULL, /* AcceptCredentials */
132  NULL, /* SpAcquireCredentialsHandle */
133  NULL, /* SpQueryCredentialsAttributes */
134  NULL, /* FreeCredentialsHandle */
135  NULL, /* SaveCredentials */
136  NULL, /* GetCredentials */
137  NULL, /* DeleteCredentials */
138  NULL, /* InitLsaModeContext */
139  NULL, /* AcceptLsaModeContext */
140  NULL, /* DeleteContext */
141  NULL, /* ApplyControlToken */
142  NULL, /* GetUserInfo */
143  NULL, /* GetExtendedInformation */
144  NULL, /* SpQueryContextAttributes */
145  NULL, /* SpAddCredentials */
146  NULL, /* SetExtendedInformation */
147  NULL, /* SetContextAttributes */
148  NULL, /* SetCredentialsAttributes */
149  NULL, /* ChangeAccountPassword */
150  NULL, /* QueryMetaData */
151  NULL, /* ExchangeMetaData */
152  NULL, /* GetCredUIContext */
153  NULL, /* UpdateCredentials */
154  NULL, /* ValidateTargetInfo */
155  NULL, /* PostLogonUser */
156  }
157 };
158 
159 /***********************************************************************
160  * SpLsaModeInitialize (SCHANNEL.@)
161  */
162 NTSTATUS WINAPI SpLsaModeInitialize(ULONG LsaVersion, PULONG PackageVersion,
163  PSECPKG_FUNCTION_TABLE *ppTables, PULONG pcTables)
164 {
165  TRACE("(%u, %p, %p, %p)\n", LsaVersion, PackageVersion, ppTables, pcTables);
166 
167  *PackageVersion = SECPKG_INTERFACE_VERSION_7;
168  *pcTables = 2;
169  *ppTables = secPkgFunctionTable;
170 
171  return STATUS_SUCCESS;
172 }
SEC_WCHAR * Comment
Definition: sspi.h:119
WCHAR SEC_WCHAR
Definition: sspi.h:29
LONG NTSTATUS
Definition: precomp.h:26
unsigned short wVersion
Definition: sspi.h:115
#define SECPKG_FLAG_IMPERSONATION
Definition: sspi.h:134
#define SECPKG_FLAG_INTEGRITY
Definition: sspi.h:126
ULONG fCapabilities
Definition: sspi.h:114
static NTSTATUS WINAPI SpGetInfoUnified(PSecPkgInfoW PackageInfo)
Definition: lsamode.c:39
ULONG cbMaxToken
Definition: sspi.h:117
SEC_WCHAR * Name
Definition: sspi.h:118
unsigned short wRPCID
Definition: sspi.h:116
static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2]
Definition: lsamode.c:81
static SEC_WCHAR schannelCommentW[]
Definition: lsamode.c:57
WINE_DEFAULT_DEBUG_CHANNEL(schannel)
static NTSTATUS WINAPI SpGetInfoSChannel(PSecPkgInfoW PackageInfo)
Definition: lsamode.c:63
#define SECPKG_FLAG_MULTI_REQUIRED
Definition: sspi.h:131
#define TRACE(s)
Definition: solgame.cpp:4
#define SECPKG_INTERFACE_VERSION_7
Definition: ntsecpkg.h:40
#define WINAPI
Definition: msvc.h:6
#define UNISP_RPC_ID
Definition: schannel.h:82
#define SECPKG_FLAG_ACCEPT_WIN32_NAME
Definition: sspi.h:135
#define SCHANNEL_NAME_W
Definition: schannel.h:11
#define SECPKG_FLAG_PRIVACY
Definition: sspi.h:127
#define SECPKG_FLAG_EXTENDED_ERROR
Definition: sspi.h:133
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
#define UNISP_NAME_W
Definition: sspi.h:38
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
#define SECPKG_FLAG_CONNECTION
Definition: sspi.h:130
WCHAR * LPWSTR
Definition: xmlstorage.h:184
NTSTATUS WINAPI SpLsaModeInitialize(ULONG LsaVersion, PULONG PackageVersion, PSECPKG_FUNCTION_TABLE *ppTables, PULONG pcTables)
Definition: lsamode.c:162
#define SECPKG_FLAG_MUTUAL_AUTH
Definition: sspi.h:142
#define SECPKG_FLAG_STREAM
Definition: sspi.h:136