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->WkstaInfo100 = calloc(1, sizeof(WKSTA_INFO_100));
57 if (WkstaInfo->WkstaInfo100 == NULL) {
58 return ERROR_NOT_ENOUGH_MEMORY;
62 * Remove any leading slashes since they are not part of the
65 for ( s=ServerName; *s == '\\' || *s == '/'; s++);
69 WkstaInfo->WkstaInfo100->wki100_computername = _wcsupr(wcsdup(s));
70 WkstaInfo->WkstaInfo100->wki100_langroup = _wcsdup(L"AFS");
71 WkstaInfo->WkstaInfo100->wki100_platform_id = PLATFORM_ID_AFS;
72 WkstaInfo->WkstaInfo100->wki100_ver_major = AFSPRODUCT_VERSION_MAJOR;
73 WkstaInfo->WkstaInfo100->wki100_ver_minor = AFSPRODUCT_VERSION_MINOR;
80 return ERROR_INVALID_LEVEL;
84 unsigned long NetrWkstaSetInfo(
85 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
86 /* [in] */ unsigned long Level,
87 /* [switch_is][in] */ LPWKSTA_INFO WkstaInfo,
88 /* [unique][out][in] */ unsigned long *ErrorParameter)
90 osi_Log0(afsd_logp, "NetrWkstaSetInfo not supported");
91 return ERROR_NOT_SUPPORTED;
94 unsigned long NetrWkstaUserEnum(
95 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
96 /* [out][in] */ LPWKSTA_USER_ENUM_STRUCT UserInfo,
97 /* [in] */ unsigned long PreferredMaximumLength,
98 /* [out] */ unsigned long *TotalEntries,
99 /* [unique][out][in] */ unsigned long *ResumeHandle)
101 osi_Log0(afsd_logp, "NetrWkstaUserEnum not supported");
102 return ERROR_NOT_SUPPORTED;
105 unsigned long NetrWkstaTransportEnum(
106 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
107 /* [out][in] */ LPWKSTA_TRANSPORT_ENUM_STRUCT TransportInfo,
108 /* [in] */ unsigned long PreferredMaximumLength,
109 /* [out] */ unsigned long *TotalEntries,
110 /* [unique][out][in] */ unsigned long *ResumeHandle)
112 osi_Log0(afsd_logp, "NetrWkstaTransportEnum not supported");
113 return ERROR_NOT_SUPPORTED;
116 unsigned long NetrWkstaTransportAdd(
117 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
118 /* [in] */ unsigned long Level,
119 /* [in] */ LPWKSTA_TRANSPORT_INFO_0 TransportInfo,
120 /* [unique][out][in] */ unsigned long *ErrorParameter)
122 osi_Log0(afsd_logp, "NetrWkstaTransportAdd not supported");
123 return ERROR_NOT_SUPPORTED;
126 unsigned long NetrWkstaTransportDel(
127 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
128 /* [unique][string][in] */ wchar_t *TransportName,
129 /* [in] */ unsigned long ForceLevel)
131 osi_Log0(afsd_logp, "NetrWkstaTransportDel not supported");
132 return ERROR_NOT_SUPPORTED;
135 unsigned long NetrWorkstationStatisticsGet(
136 /* [unique][string][in] */ WKSSVC_IDENTIFY_HANDLE ServerName,
137 /* [unique][string][in] */ wchar_t *ServiceName,
138 /* [in] */ unsigned long Level,
139 /* [in] */ unsigned long Options,
140 /* [out] */ LPSTAT_WORKSTATION_0 *Buffer)
142 osi_Log0(afsd_logp, "NetrWorkstationStatisticsGet not supported");
143 return ERROR_NOT_SUPPORTED;
146 unsigned long NetrGetJoinInformation(
147 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
148 /* [string][out][in] */ wchar_t **NameBuffer,
149 /* [out] */ PNETSETUP_JOIN_STATUS BufferType)
151 osi_Log0(afsd_logp, "NetrGetJoinInformation not supported");
152 return ERROR_NOT_SUPPORTED;
155 unsigned long NetrJoinDomain2(
156 /* [in] */ handle_t RpcBindingHandle,
157 /* [unique][string][in] */ wchar_t *ServerName,
158 /* [string][in] */ wchar_t *DomainName,
159 /* [unique][string][in] */ wchar_t *MachineAccountOU,
160 /* [unique][string][in] */ wchar_t *AccountName,
161 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
162 /* [in] */ unsigned long Options)
164 osi_Log0(afsd_logp, "NetrJoinDomain2 not supported");
165 return ERROR_NOT_SUPPORTED;
168 unsigned long NetrUnjoinDomain2(
169 /* [in] */ handle_t RpcBindingHandle,
170 /* [unique][string][in] */ wchar_t *ServerName,
171 /* [unique][string][in] */ wchar_t *AccountName,
172 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
173 /* [in] */ unsigned long Options)
175 osi_Log0(afsd_logp, "NetrUnjoinDomain2 not supported");
176 return ERROR_NOT_SUPPORTED;
179 unsigned long NetrRenameMachineInDomain2(
180 /* [in] */ handle_t RpcBindingHandle,
181 /* [unique][string][in] */ wchar_t *ServerName,
182 /* [unique][string][in] */ wchar_t *MachineName,
183 /* [unique][string][in] */ wchar_t *AccountName,
184 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
185 /* [in] */ unsigned long Options)
187 osi_Log0(afsd_logp, "NetrRenameMachineInDomain2 not supported");
188 return ERROR_NOT_SUPPORTED;
191 unsigned long NetrValidateName2(
192 /* [in] */ handle_t RpcBindingHandle,
193 /* [unique][string][in] */ wchar_t *ServerName,
194 /* [string][in] */ wchar_t *NameToValidate,
195 /* [unique][string][in] */ wchar_t *AccountName,
196 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
197 /* [in] */ NETSETUP_NAME_TYPE NameType)
199 osi_Log0(afsd_logp, "NetrValidateName2 not supported");
200 return ERROR_NOT_SUPPORTED;
203 unsigned long NetrGetJoinableOUs2(
204 /* [in] */ handle_t RpcBindingHandle,
205 /* [unique][string][in] */ wchar_t *ServerName,
206 /* [string][in] */ wchar_t *DomainName,
207 /* [unique][string][in] */ wchar_t *AccountName,
208 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD Password,
209 /* [out][in] */ unsigned long *OUCount,
210 /* [size_is][size_is][string][out] */ wchar_t ***OUs)
212 osi_Log0(afsd_logp, "NetrGetJoinableOUs2 not supported");
213 return ERROR_NOT_SUPPORTED;
216 unsigned long NetrAddAlternateComputerName(
217 /* [in] */ handle_t RpcBindingHandle,
218 /* [unique][string][in] */ wchar_t *ServerName,
219 /* [unique][string][in] */ wchar_t *AlternateName,
220 /* [unique][string][in] */ wchar_t *DomainAccount,
221 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
222 /* [in] */ unsigned long Reserved)
224 osi_Log0(afsd_logp, "NetrAddAlternateComputerName not supported");
225 return ERROR_NOT_SUPPORTED;
228 unsigned long NetrRemoveAlternateComputerName(
229 /* [in] */ handle_t RpcBindingHandle,
230 /* [unique][string][in] */ wchar_t *ServerName,
231 /* [unique][string][in] */ wchar_t *AlternateName,
232 /* [unique][string][in] */ wchar_t *DomainAccount,
233 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
234 /* [in] */ unsigned long Reserved)
236 osi_Log0(afsd_logp, "NetrRemoveAlternateComputerName not supported");
237 return ERROR_NOT_SUPPORTED;
240 unsigned long NetrSetPrimaryComputerName(
241 /* [in] */ handle_t RpcBindingHandle,
242 /* [unique][string][in] */ wchar_t *ServerName,
243 /* [unique][string][in] */ wchar_t *PrimaryName,
244 /* [unique][string][in] */ wchar_t *DomainAccount,
245 /* [unique][in] */ PJOINPR_ENCRYPTED_USER_PASSWORD EncryptedPassword,
246 /* [in] */ unsigned long Reserved)
248 osi_Log0(afsd_logp, "NetrSetPrimaryComputerName not supported");
249 return ERROR_NOT_SUPPORTED;
252 unsigned long NetrEnumerateComputerNames(
253 /* [unique][string][in] */ WKSSVC_IMPERSONATE_HANDLE ServerName,
254 /* [in] */ NET_COMPUTER_NAME_TYPE NameType,
255 /* [in] */ unsigned long Reserved,
256 /* [out] */ PNET_COMPUTER_NAME_ARRAY *ComputerNames)
258 osi_Log0(afsd_logp, "NetrEnumerateComputerName not supported");
259 return ERROR_NOT_SUPPORTED;
262 /* [nocode] */ void Opnum3NotUsedOnWire(
263 /* [in] */ handle_t IDL_handle)
267 /* [nocode] */ void Opnum4NotUsedOnWire(
268 /* [in] */ handle_t IDL_handle)
272 /* [nocode] */ void Opnum8NotUsedOnWire(
273 /* [in] */ handle_t IDL_handle)
277 /* [nocode] */ void Opnum9NotUsedOnWire(
278 /* [in] */ handle_t IDL_handle)
282 /* [nocode] */ void Opnum10NotUsedOnWire(
283 /* [in] */ handle_t IDL_handle)
287 /* [nocode] */ void Opnum11NotUsedOnWire(
288 /* [in] */ handle_t IDL_handle)
292 /* [nocode] */ void Opnum12NotUsedOnWire(
293 /* [in] */ handle_t IDL_handle)
298 /* [nocode] */ void Opnum14NotUsedOnWire(
299 /* [in] */ handle_t IDL_handle)
303 /* [nocode] */ void Opnum15NotUsedOnWire(
304 /* [in] */ handle_t IDL_handle)
308 /* [nocode] */ void Opnum16NotUsedOnWire(
309 /* [in] */ handle_t IDL_handle)
313 /* [nocode] */ void Opnum17NotUsedOnWire(
314 /* [in] */ handle_t IDL_handle)
318 /* [nocode] */ void Opnum18NotUsedOnWire(
319 /* [in] */ handle_t IDL_handle)
323 /* [nocode] */ void Opnum19NotUsedOnWire(
324 /* [in] */ handle_t IDL_handle)
329 /* [nocode] */ void Opnum21NotUsedOnWire(
330 /* [in] */ handle_t IDL_handle)