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
29 #include "ms-wkssvc.h"
30 #include "AFS_component_version_number.h"
32 #define PLATFORM_ID_AFS 800
34 #pragma warning( disable: 4027 ) /* func w/o formal parameter list */
36 unsigned long NetrWkstaGetInfo(
37 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
38 /* [in] */ unsigned long Level,
39 /* [switch_is][out] */ LPWKSTA_INFO WkstaInfo)
43 osi_Log1(afsd_logp, "NetrWkstaGetInfo level %u", Level);
46 * How much space do we need and do we have that much room?
47 * For now, just assume we can return everything in one shot
48 * because the reality is that in this function call we do
49 * not know the max size of the RPC response.
53 WkstaInfo->WkstaInfo102 = calloc(1, sizeof(WKSTA_INFO_102));
56 WkstaInfo->WkstaInfo101 = calloc(1, sizeof(WKSTA_INFO_101));
59 WkstaInfo->WkstaInfo100 = calloc(1, sizeof(WKSTA_INFO_100));
63 if (WkstaInfo->WkstaInfo100 == NULL) {
64 return ERROR_INVALID_LEVEL;
68 * Remove any leading slashes since they are not part of the
71 for ( s=ServerName; *s == '\\' || *s == '/'; s++);
75 WkstaInfo->WkstaInfo102->wki102_logged_on_users = 0;
77 WkstaInfo->WkstaInfo101->wki101_lanroot = NULL;
79 WkstaInfo->WkstaInfo100->wki100_computername = _wcsupr(wcsdup(s));
80 WkstaInfo->WkstaInfo100->wki100_langroup = _wcsdup(L"AFS");
81 WkstaInfo->WkstaInfo100->wki100_platform_id = PLATFORM_ID_AFS;
82 WkstaInfo->WkstaInfo100->wki100_ver_major = AFSPRODUCT_VERSION_MAJOR;
83 WkstaInfo->WkstaInfo100->wki100_ver_minor = AFSPRODUCT_VERSION_MINOR;
90 return ERROR_INVALID_LEVEL;
94 unsigned long NetrWkstaSetInfo(
95 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
96 /* [in] */ unsigned long Level,
97 /* [switch_is][in] */ LPWKSTA_INFO WkstaInfo,
98 /* [unique][out][in] */ unsigned long *ErrorParameter)
100 osi_Log0(afsd_logp, "NetrWkstaSetInfo not supported");
101 return ERROR_NOT_SUPPORTED;
104 unsigned long NetrWkstaUserEnum(
105 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
106 /* [out][in] */ LPWKSTA_USER_ENUM_STRUCT UserInfo,
107 /* [in] */ unsigned long PreferredMaximumLength,
108 /* [out] */ unsigned long *TotalEntries,
109 /* [unique][out][in] */ unsigned long *ResumeHandle)
111 osi_Log0(afsd_logp, "NetrWkstaUserEnum not supported");
112 return ERROR_NOT_SUPPORTED;
115 unsigned long NetrWkstaTransportEnum(
116 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
117 /* [out][in] */ LPWKSTA_TRANSPORT_ENUM_STRUCT TransportInfo,
118 /* [in] */ unsigned long PreferredMaximumLength,
119 /* [out] */ unsigned long *TotalEntries,
120 /* [unique][out][in] */ unsigned long *ResumeHandle)
122 osi_Log0(afsd_logp, "NetrWkstaTransportEnum not supported");
123 return ERROR_NOT_SUPPORTED;
126 unsigned long NetrWkstaTransportAdd(
127 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
128 /* [in] */ unsigned long Level,
129 /* [in] */ LPWKSTA_TRANSPORT_INFO_0 TransportInfo,
130 /* [unique][out][in] */ unsigned long *ErrorParameter)
132 osi_Log0(afsd_logp, "NetrWkstaTransportAdd not supported");
133 return ERROR_NOT_SUPPORTED;
136 unsigned long NetrWkstaTransportDel(
137 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
138 /* [unique][string][in] */ wchar_t *TransportName,
139 /* [in] */ unsigned long ForceLevel)
141 osi_Log0(afsd_logp, "NetrWkstaTransportDel not supported");
142 return ERROR_NOT_SUPPORTED;
145 unsigned long NetrWorkstationStatisticsGet(
146 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
147 /* [unique][string][in] */ wchar_t *ServiceName,
148 /* [in] */ unsigned long Level,
149 /* [in] */ unsigned long Options,
150 /* [out] */ LPSTAT_WORKSTATION_0 *Buffer)
152 osi_Log0(afsd_logp, "NetrWorkstationStatisticsGet not supported");
153 return ERROR_NOT_SUPPORTED;
156 unsigned long NetrGetJoinInformation(
157 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
158 /* [string][out][in] */ wchar_t **NameBuffer,
159 /* [out] */ PNETSETUP_JOIN_STATUS BufferType)
161 osi_Log0(afsd_logp, "NetrGetJoinInformation not supported");
162 return ERROR_NOT_SUPPORTED;
165 unsigned long NetrJoinDomain2(
166 /* [in] */ handle_t RpcBindingHandle,
167 /* [unique][string][in] */ wchar_t *ServerName,
168 /* [string][in] */ wchar_t *DomainName,
169 /* [unique][string][in] */ wchar_t *MachineAccountOU,
170 /* [unique][string][in] */ wchar_t *AccountName,
171 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
172 /* [in] */ unsigned long Options)
174 osi_Log0(afsd_logp, "NetrJoinDomain2 not supported");
175 return ERROR_NOT_SUPPORTED;
178 unsigned long NetrUnjoinDomain2(
179 /* [in] */ handle_t RpcBindingHandle,
180 /* [unique][string][in] */ wchar_t *ServerName,
181 /* [unique][string][in] */ wchar_t *AccountName,
182 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
183 /* [in] */ unsigned long Options)
185 osi_Log0(afsd_logp, "NetrUnjoinDomain2 not supported");
186 return ERROR_NOT_SUPPORTED;
189 unsigned long NetrRenameMachineInDomain2(
190 /* [in] */ handle_t RpcBindingHandle,
191 /* [unique][string][in] */ wchar_t *ServerName,
192 /* [unique][string][in] */ wchar_t *MachineName,
193 /* [unique][string][in] */ wchar_t *AccountName,
194 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
195 /* [in] */ unsigned long Options)
197 osi_Log0(afsd_logp, "NetrRenameMachineInDomain2 not supported");
198 return ERROR_NOT_SUPPORTED;
201 unsigned long NetrValidateName2(
202 /* [in] */ handle_t RpcBindingHandle,
203 /* [unique][string][in] */ wchar_t *ServerName,
204 /* [string][in] */ wchar_t *NameToValidate,
205 /* [unique][string][in] */ wchar_t *AccountName,
206 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
207 /* [in] */ NETSETUP_NAME_TYPE NameType)
209 osi_Log0(afsd_logp, "NetrValidateName2 not supported");
210 return ERROR_NOT_SUPPORTED;
213 unsigned long NetrGetJoinableOUs2(
214 /* [in] */ handle_t RpcBindingHandle,
215 /* [unique][string][in] */ wchar_t *ServerName,
216 /* [string][in] */ wchar_t *DomainName,
217 /* [unique][string][in] */ wchar_t *AccountName,
218 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
219 /* [out][in] */ unsigned long *OUCount,
220 /* [size_is][size_is][string][out] */ wchar_t ***OUs)
222 osi_Log0(afsd_logp, "NetrGetJoinableOUs2 not supported");
223 return ERROR_NOT_SUPPORTED;
226 unsigned long NetrAddAlternateComputerName(
227 /* [in] */ handle_t RpcBindingHandle,
228 /* [unique][string][in] */ wchar_t *ServerName,
229 /* [unique][string][in] */ wchar_t *AlternateName,
230 /* [unique][string][in] */ wchar_t *DomainAccount,
231 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
232 /* [in] */ unsigned long Reserved)
234 osi_Log0(afsd_logp, "NetrAddAlternateComputerName not supported");
235 return ERROR_NOT_SUPPORTED;
238 unsigned long NetrRemoveAlternateComputerName(
239 /* [in] */ handle_t RpcBindingHandle,
240 /* [unique][string][in] */ wchar_t *ServerName,
241 /* [unique][string][in] */ wchar_t *AlternateName,
242 /* [unique][string][in] */ wchar_t *DomainAccount,
243 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
244 /* [in] */ unsigned long Reserved)
246 osi_Log0(afsd_logp, "NetrRemoveAlternateComputerName not supported");
247 return ERROR_NOT_SUPPORTED;
250 unsigned long NetrSetPrimaryComputerName(
251 /* [in] */ handle_t RpcBindingHandle,
252 /* [unique][string][in] */ wchar_t *ServerName,
253 /* [unique][string][in] */ wchar_t *PrimaryName,
254 /* [unique][string][in] */ wchar_t *DomainAccount,
255 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
256 /* [in] */ unsigned long Reserved)
258 osi_Log0(afsd_logp, "NetrSetPrimaryComputerName not supported");
259 return ERROR_NOT_SUPPORTED;
262 unsigned long NetrEnumerateComputerNames(
263 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
264 /* [in] */ NET_COMPUTER_NAME_TYPE NameType,
265 /* [in] */ unsigned long Reserved,
266 /* [out] */ PNET_COMPUTER_NAME_ARRAY *ComputerNames)
268 osi_Log0(afsd_logp, "NetrEnumerateComputerName not supported");
269 return ERROR_NOT_SUPPORTED;
272 /* [nocode] */ void Opnum3NotUsedOnWire(
273 /* [in] */ handle_t IDL_handle)
277 /* [nocode] */ void Opnum4NotUsedOnWire(
278 /* [in] */ handle_t IDL_handle)
282 /* [nocode] */ void Opnum8NotUsedOnWire(
283 /* [in] */ handle_t IDL_handle)
287 /* [nocode] */ void Opnum9NotUsedOnWire(
288 /* [in] */ handle_t IDL_handle)
292 /* [nocode] */ void Opnum10NotUsedOnWire(
293 /* [in] */ handle_t IDL_handle)
297 /* [nocode] */ void Opnum11NotUsedOnWire(
298 /* [in] */ handle_t IDL_handle)
302 /* [nocode] */ void Opnum12NotUsedOnWire(
303 /* [in] */ handle_t IDL_handle)
308 /* [nocode] */ void Opnum14NotUsedOnWire(
309 /* [in] */ handle_t IDL_handle)
313 /* [nocode] */ void Opnum15NotUsedOnWire(
314 /* [in] */ handle_t IDL_handle)
318 /* [nocode] */ void Opnum16NotUsedOnWire(
319 /* [in] */ handle_t IDL_handle)
323 /* [nocode] */ void Opnum17NotUsedOnWire(
324 /* [in] */ handle_t IDL_handle)
328 /* [nocode] */ void Opnum18NotUsedOnWire(
329 /* [in] */ handle_t IDL_handle)
333 /* [nocode] */ void Opnum19NotUsedOnWire(
334 /* [in] */ handle_t IDL_handle)
339 /* [nocode] */ void Opnum21NotUsedOnWire(
340 /* [in] */ handle_t IDL_handle)