2 * Copyright (c) 2009 Secure Endpoints Inc.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #include <afsconfig.h>
27 #include <afs/param.h>
34 #include "ms-wkssvc.h"
35 #include "AFS_component_version_number.h"
37 #define PLATFORM_ID_AFS 800
39 #pragma warning( disable: 4027 ) /* func w/o formal parameter list */
41 unsigned long NetrWkstaGetInfo(
42 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
43 /* [in] */ unsigned long Level,
44 /* [switch_is][out] */ LPWKSTA_INFO WkstaInfo)
48 osi_Log1(afsd_logp, "NetrWkstaGetInfo level %u", Level);
51 * How much space do we need and do we have that much room?
52 * For now, just assume we can return everything in one shot
53 * because the reality is that in this function call we do
54 * not know the max size of the RPC response.
58 WkstaInfo->WkstaInfo102 = MIDL_user_allocate(sizeof(WKSTA_INFO_102));
61 WkstaInfo->WkstaInfo101 = MIDL_user_allocate(sizeof(WKSTA_INFO_101));
64 WkstaInfo->WkstaInfo100 = MIDL_user_allocate(sizeof(WKSTA_INFO_100));
68 if (WkstaInfo->WkstaInfo100 == NULL) {
69 return ERROR_INVALID_LEVEL;
73 * Remove any leading slashes since they are not part of the
76 for ( s=ServerName; *s == '\\' || *s == '/'; s++);
80 WkstaInfo->WkstaInfo102->wki102_logged_on_users = 0;
82 WkstaInfo->WkstaInfo101->wki101_lanroot = NULL;
84 WkstaInfo->WkstaInfo100->wki100_computername = _wcsupr(wcsdup(s));
85 WkstaInfo->WkstaInfo100->wki100_langroup = wcsdup(L"AFS");
86 WkstaInfo->WkstaInfo100->wki100_platform_id = PLATFORM_ID_AFS;
87 WkstaInfo->WkstaInfo100->wki100_ver_major = AFSPRODUCT_VERSION_MAJOR;
88 WkstaInfo->WkstaInfo100->wki100_ver_minor = AFSPRODUCT_VERSION_MINOR;
95 return ERROR_INVALID_LEVEL;
99 unsigned long NetrWkstaSetInfo(
100 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
101 /* [in] */ unsigned long Level,
102 /* [switch_is][in] */ LPWKSTA_INFO WkstaInfo,
103 /* [unique][out][in] */ unsigned long *ErrorParameter)
105 osi_Log0(afsd_logp, "NetrWkstaSetInfo not supported");
106 return ERROR_NOT_SUPPORTED;
109 unsigned long NetrWkstaUserEnum(
110 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
111 /* [out][in] */ LPWKSTA_USER_ENUM_STRUCT UserInfo,
112 /* [in] */ unsigned long PreferredMaximumLength,
113 /* [out] */ unsigned long *TotalEntries,
114 /* [unique][out][in] */ unsigned long *ResumeHandle)
116 osi_Log0(afsd_logp, "NetrWkstaUserEnum not supported");
117 return ERROR_NOT_SUPPORTED;
120 unsigned long NetrWkstaTransportEnum(
121 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
122 /* [out][in] */ LPWKSTA_TRANSPORT_ENUM_STRUCT TransportInfo,
123 /* [in] */ unsigned long PreferredMaximumLength,
124 /* [out] */ unsigned long *TotalEntries,
125 /* [unique][out][in] */ unsigned long *ResumeHandle)
127 osi_Log0(afsd_logp, "NetrWkstaTransportEnum not supported");
128 return ERROR_NOT_SUPPORTED;
131 unsigned long NetrWkstaTransportAdd(
132 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
133 /* [in] */ unsigned long Level,
134 /* [in] */ LPWKSTA_TRANSPORT_INFO_0 TransportInfo,
135 /* [unique][out][in] */ unsigned long *ErrorParameter)
137 osi_Log0(afsd_logp, "NetrWkstaTransportAdd not supported");
138 return ERROR_NOT_SUPPORTED;
141 unsigned long NetrWkstaTransportDel(
142 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
143 /* [unique][string][in] */ wchar_t *TransportName,
144 /* [in] */ unsigned long ForceLevel)
146 osi_Log0(afsd_logp, "NetrWkstaTransportDel not supported");
147 return ERROR_NOT_SUPPORTED;
150 unsigned long NetrWorkstationStatisticsGet(
151 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
152 /* [unique][string][in] */ wchar_t *ServiceName,
153 /* [in] */ unsigned long Level,
154 /* [in] */ unsigned long Options,
155 /* [out] */ LPSTAT_WORKSTATION_0 *Buffer)
157 osi_Log0(afsd_logp, "NetrWorkstationStatisticsGet not supported");
158 return ERROR_NOT_SUPPORTED;
161 unsigned long NetrGetJoinInformation(
162 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
163 /* [string][out][in] */ wchar_t **NameBuffer,
164 /* [out] */ PNETSETUP_JOIN_STATUS BufferType)
166 osi_Log0(afsd_logp, "NetrGetJoinInformation not supported");
167 return ERROR_NOT_SUPPORTED;
170 unsigned long NetrJoinDomain2(
171 /* [in] */ handle_t RpcBindingHandle,
172 /* [unique][string][in] */ wchar_t *ServerName,
173 /* [string][in] */ wchar_t *DomainName,
174 /* [unique][string][in] */ wchar_t *MachineAccountOU,
175 /* [unique][string][in] */ wchar_t *AccountName,
176 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
177 /* [in] */ unsigned long Options)
179 osi_Log0(afsd_logp, "NetrJoinDomain2 not supported");
180 return ERROR_NOT_SUPPORTED;
183 unsigned long NetrUnjoinDomain2(
184 /* [in] */ handle_t RpcBindingHandle,
185 /* [unique][string][in] */ wchar_t *ServerName,
186 /* [unique][string][in] */ wchar_t *AccountName,
187 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
188 /* [in] */ unsigned long Options)
190 osi_Log0(afsd_logp, "NetrUnjoinDomain2 not supported");
191 return ERROR_NOT_SUPPORTED;
194 unsigned long NetrRenameMachineInDomain2(
195 /* [in] */ handle_t RpcBindingHandle,
196 /* [unique][string][in] */ wchar_t *ServerName,
197 /* [unique][string][in] */ wchar_t *MachineName,
198 /* [unique][string][in] */ wchar_t *AccountName,
199 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
200 /* [in] */ unsigned long Options)
202 osi_Log0(afsd_logp, "NetrRenameMachineInDomain2 not supported");
203 return ERROR_NOT_SUPPORTED;
206 unsigned long NetrValidateName2(
207 /* [in] */ handle_t RpcBindingHandle,
208 /* [unique][string][in] */ wchar_t *ServerName,
209 /* [string][in] */ wchar_t *NameToValidate,
210 /* [unique][string][in] */ wchar_t *AccountName,
211 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
212 /* [in] */ NETSETUP_NAME_TYPE NameType)
214 osi_Log0(afsd_logp, "NetrValidateName2 not supported");
215 return ERROR_NOT_SUPPORTED;
218 unsigned long NetrGetJoinableOUs2(
219 /* [in] */ handle_t RpcBindingHandle,
220 /* [unique][string][in] */ wchar_t *ServerName,
221 /* [string][in] */ wchar_t *DomainName,
222 /* [unique][string][in] */ wchar_t *AccountName,
223 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
224 /* [out][in] */ unsigned long *OUCount,
225 /* [size_is][size_is][string][out] */ wchar_t ***OUs)
227 osi_Log0(afsd_logp, "NetrGetJoinableOUs2 not supported");
228 return ERROR_NOT_SUPPORTED;
231 unsigned long NetrAddAlternateComputerName(
232 /* [in] */ handle_t RpcBindingHandle,
233 /* [unique][string][in] */ wchar_t *ServerName,
234 /* [unique][string][in] */ wchar_t *AlternateName,
235 /* [unique][string][in] */ wchar_t *DomainAccount,
236 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
237 /* [in] */ unsigned long Reserved)
239 osi_Log0(afsd_logp, "NetrAddAlternateComputerName not supported");
240 return ERROR_NOT_SUPPORTED;
243 unsigned long NetrRemoveAlternateComputerName(
244 /* [in] */ handle_t RpcBindingHandle,
245 /* [unique][string][in] */ wchar_t *ServerName,
246 /* [unique][string][in] */ wchar_t *AlternateName,
247 /* [unique][string][in] */ wchar_t *DomainAccount,
248 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
249 /* [in] */ unsigned long Reserved)
251 osi_Log0(afsd_logp, "NetrRemoveAlternateComputerName not supported");
252 return ERROR_NOT_SUPPORTED;
255 unsigned long NetrSetPrimaryComputerName(
256 /* [in] */ handle_t RpcBindingHandle,
257 /* [unique][string][in] */ wchar_t *ServerName,
258 /* [unique][string][in] */ wchar_t *PrimaryName,
259 /* [unique][string][in] */ wchar_t *DomainAccount,
260 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
261 /* [in] */ unsigned long Reserved)
263 osi_Log0(afsd_logp, "NetrSetPrimaryComputerName not supported");
264 return ERROR_NOT_SUPPORTED;
267 unsigned long NetrEnumerateComputerNames(
268 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
269 /* [in] */ NET_COMPUTER_NAME_TYPE NameType,
270 /* [in] */ unsigned long Reserved,
271 /* [out] */ PNET_COMPUTER_NAME_ARRAY *ComputerNames)
273 osi_Log0(afsd_logp, "NetrEnumerateComputerName not supported");
274 return ERROR_NOT_SUPPORTED;
277 /* [nocode] */ void Opnum3NotUsedOnWire(
278 /* [in] */ handle_t IDL_handle)
282 /* [nocode] */ void Opnum4NotUsedOnWire(
283 /* [in] */ handle_t IDL_handle)
287 /* [nocode] */ void Opnum8NotUsedOnWire(
288 /* [in] */ handle_t IDL_handle)
292 /* [nocode] */ void Opnum9NotUsedOnWire(
293 /* [in] */ handle_t IDL_handle)
297 /* [nocode] */ void Opnum10NotUsedOnWire(
298 /* [in] */ handle_t IDL_handle)
302 /* [nocode] */ void Opnum11NotUsedOnWire(
303 /* [in] */ handle_t IDL_handle)
307 /* [nocode] */ void Opnum12NotUsedOnWire(
308 /* [in] */ handle_t IDL_handle)
313 /* [nocode] */ void Opnum14NotUsedOnWire(
314 /* [in] */ handle_t IDL_handle)
318 /* [nocode] */ void Opnum15NotUsedOnWire(
319 /* [in] */ handle_t IDL_handle)
323 /* [nocode] */ void Opnum16NotUsedOnWire(
324 /* [in] */ handle_t IDL_handle)
328 /* [nocode] */ void Opnum17NotUsedOnWire(
329 /* [in] */ handle_t IDL_handle)
333 /* [nocode] */ void Opnum18NotUsedOnWire(
334 /* [in] */ handle_t IDL_handle)
338 /* [nocode] */ void Opnum19NotUsedOnWire(
339 /* [in] */ handle_t IDL_handle)
344 /* [nocode] */ void Opnum21NotUsedOnWire(
345 /* [in] */ handle_t IDL_handle)