2 * Copyright 2006 Robert Reif
4 * netapi32 local group functions
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.
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.
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
24 #define WIN32_NO_STATUS
34 #include "wine/debug.h"
35 #include "wine/unicode.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
39 /************************************************************
40 * NetLocalGroupAdd (NETAPI32.@)
42 NET_API_STATUS WINAPI NetLocalGroupAdd(
48 FIXME("(%s %d %p %p) stub!\n", debugstr_w(servername), level, buf,
53 /************************************************************
54 * NetLocalGroupAddMember (NETAPI32.@)
56 NET_API_STATUS WINAPI NetLocalGroupAddMember(
61 FIXME("(%s %s %p) stub!\n", debugstr_w(servername),
62 debugstr_w(groupname), membersid);
66 /************************************************************
67 * NetLocalGroupAddMembers (NETAPI32.@)
69 NET_API_STATUS WINAPI NetLocalGroupAddMembers(
76 FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
77 debugstr_w(groupname), level, buf, totalentries);
81 /************************************************************
82 * NetLocalGroupDel (NETAPI32.@)
84 NET_API_STATUS WINAPI NetLocalGroupDel(
88 FIXME("(%s %s) stub!\n", debugstr_w(servername), debugstr_w(groupname));
92 /************************************************************
93 * NetLocalGroupDelMember (NETAPI32.@)
95 NET_API_STATUS WINAPI NetLocalGroupDelMember(
100 FIXME("(%s %s %p) stub!\n", debugstr_w(servername),
101 debugstr_w(groupname), membersid);
105 /************************************************************
106 * NetLocalGroupDelMembers (NETAPI32.@)
108 NET_API_STATUS WINAPI NetLocalGroupDelMembers(
115 FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
116 debugstr_w(groupname), level, buf, totalentries);
120 /************************************************************
121 * NetLocalGroupEnum (NETAPI32.@)
123 NET_API_STATUS WINAPI NetLocalGroupEnum(
129 LPDWORD totalentries,
130 PDWORD_PTR resumehandle)
132 FIXME("(%s %d %p %d %p %p %p) stub!\n", debugstr_w(servername),
133 level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
139 /************************************************************
140 * NetLocalGroupGetInfo (NETAPI32.@)
142 NET_API_STATUS WINAPI NetLocalGroupGetInfo(
148 static const WCHAR commentW[]={'N','o',' ','c','o','m','m','e','n','t',0};
149 LOCALGROUP_INFO_1* info;
152 FIXME("(%s %s %d %p) semi-stub!\n", debugstr_w(servername),
153 debugstr_w(groupname), level, bufptr);
155 size = sizeof(*info) + sizeof(WCHAR) * (lstrlenW(groupname)+1) + sizeof(commentW);
156 NetApiBufferAllocate(size, (LPVOID*)&info);
158 info->lgrpi1_name = (LPWSTR)(info + 1);
159 lstrcpyW(info->lgrpi1_name, groupname);
161 info->lgrpi1_comment = info->lgrpi1_name + lstrlenW(groupname) + 1;
162 lstrcpyW(info->lgrpi1_comment, commentW);
164 *bufptr = (LPBYTE)info;
169 /************************************************************
170 * NetLocalGroupGetMembers (NETAPI32.@)
172 NET_API_STATUS WINAPI NetLocalGroupGetMembers(
174 LPCWSTR localgroupname,
179 LPDWORD totalentries,
180 PDWORD_PTR resumehandle)
182 FIXME("(%s %s %d %p %d, %p %p %p) stub!\n", debugstr_w(servername),
183 debugstr_w(localgroupname), level, bufptr, prefmaxlen, entriesread,
184 totalentries, resumehandle);
188 WCHAR userName[MAX_COMPUTERNAME_LENGTH + 1];
191 PLOCALGROUP_MEMBERS_INFO_3 ptr;
193 /* still a stub, current user is belonging to all groups */
198 userNameLen = MAX_COMPUTERNAME_LENGTH + 1;
199 if (!GetUserNameW(userName,&userNameLen))
200 return ERROR_NOT_ENOUGH_MEMORY;
202 needlen = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
203 (userNameLen+2) * sizeof(WCHAR);
204 if (prefmaxlen != MAX_PREFERRED_LENGTH)
205 len = min(prefmaxlen,needlen);
209 NetApiBufferAllocate(len, (LPVOID *) bufptr);
211 return ERROR_MORE_DATA;
213 ptr = (PLOCALGROUP_MEMBERS_INFO_3)*bufptr;
214 ptr->lgrmi3_domainandname = (LPWSTR)(*bufptr+sizeof(LOCALGROUP_MEMBERS_INFO_3));
215 lstrcpyW(ptr->lgrmi3_domainandname,userName);
223 /************************************************************
224 * NetLocalGroupSetInfo (NETAPI32.@)
226 NET_API_STATUS WINAPI NetLocalGroupSetInfo(
233 FIXME("(%s %s %d %p %p) stub!\n", debugstr_w(servername),
234 debugstr_w(groupname), level, buf, parm_err);
238 /************************************************************
239 * NetLocalGroupSetMember (NETAPI32.@)
241 NET_API_STATUS WINAPI NetLocalGroupSetMembers(
248 FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
249 debugstr_w(groupname), level, buf, totalentries);