wined3d: Use ARB_internalformat_query2 for the other texture format caps too.
[wine] / dlls / netapi32 / local_group.c
1 /*
2  * Copyright 2006 Robert Reif
3  *
4  * netapi32 local group functions
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 "winerror.h"
28 #include "lmcons.h"
29 #include "lmaccess.h"
30 #include "lmapibuf.h"
31 #include "lmerr.h"
32 #include "winreg.h"
33 #include "ntsecapi.h"
34 #include "wine/debug.h"
35 #include "wine/unicode.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
38
39 /************************************************************
40  *                NetLocalGroupAdd  (NETAPI32.@)
41  */
42 NET_API_STATUS WINAPI NetLocalGroupAdd(
43     LPCWSTR servername,
44     DWORD level,
45     LPBYTE buf,
46     LPDWORD parm_err)
47 {
48     FIXME("(%s %d %p %p) stub!\n", debugstr_w(servername), level, buf,
49           parm_err);
50     return NERR_Success;
51 }
52
53 /************************************************************
54  *                NetLocalGroupAddMember  (NETAPI32.@)
55  */
56 NET_API_STATUS WINAPI NetLocalGroupAddMember(
57     LPCWSTR servername,
58     LPCWSTR groupname,
59     PSID membersid)
60 {
61     FIXME("(%s %s %p) stub!\n", debugstr_w(servername),
62           debugstr_w(groupname), membersid);
63     return NERR_Success;
64 }
65
66 /************************************************************
67  *                NetLocalGroupAddMembers  (NETAPI32.@)
68  */
69 NET_API_STATUS WINAPI NetLocalGroupAddMembers(
70     LPCWSTR servername,
71     LPCWSTR groupname,
72     DWORD level,
73     LPBYTE buf,
74     DWORD totalentries)
75 {
76     FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
77           debugstr_w(groupname), level, buf, totalentries);
78     return NERR_Success;
79 }
80
81 /************************************************************
82  *                NetLocalGroupDel  (NETAPI32.@)
83  */
84 NET_API_STATUS WINAPI NetLocalGroupDel(
85     LPCWSTR servername,
86     LPCWSTR groupname)
87 {
88     FIXME("(%s %s) stub!\n", debugstr_w(servername), debugstr_w(groupname));
89     return NERR_Success;
90 }
91
92 /************************************************************
93  *                NetLocalGroupDelMember  (NETAPI32.@)
94  */
95 NET_API_STATUS WINAPI NetLocalGroupDelMember(
96     LPCWSTR servername,
97     LPCWSTR groupname,
98     PSID membersid)
99 {
100     FIXME("(%s %s %p) stub!\n", debugstr_w(servername),
101           debugstr_w(groupname), membersid);
102     return NERR_Success;
103 }
104
105 /************************************************************
106  *                NetLocalGroupDelMembers  (NETAPI32.@)
107  */
108 NET_API_STATUS WINAPI NetLocalGroupDelMembers(
109     LPCWSTR servername,
110     LPCWSTR groupname,
111     DWORD level,
112     LPBYTE buf,
113     DWORD totalentries)
114 {
115     FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
116           debugstr_w(groupname), level, buf, totalentries);
117     return NERR_Success;
118 }
119
120 /************************************************************
121  *                NetLocalGroupEnum  (NETAPI32.@)
122  */
123 NET_API_STATUS WINAPI NetLocalGroupEnum(
124     LPCWSTR servername,
125     DWORD level,
126     LPBYTE* bufptr,
127     DWORD prefmaxlen,
128     LPDWORD entriesread,
129     LPDWORD totalentries,
130     PDWORD_PTR resumehandle)
131 {
132     FIXME("(%s %d %p %d %p %p %p) stub!\n", debugstr_w(servername),
133           level, bufptr, prefmaxlen, entriesread, totalentries, resumehandle);
134     *entriesread = 0;
135     *totalentries = 0;
136     return NERR_Success;
137 }
138
139 /************************************************************
140  *                NetLocalGroupGetInfo  (NETAPI32.@)
141  */
142 NET_API_STATUS WINAPI NetLocalGroupGetInfo(
143     LPCWSTR servername,
144     LPCWSTR groupname,
145     DWORD level,
146     LPBYTE* bufptr)
147 {
148     static const WCHAR commentW[]={'N','o',' ','c','o','m','m','e','n','t',0};
149     LOCALGROUP_INFO_1* info;
150     DWORD size;
151
152     FIXME("(%s %s %d %p) semi-stub!\n", debugstr_w(servername),
153           debugstr_w(groupname), level, bufptr);
154
155     size = sizeof(*info) + sizeof(WCHAR) * (lstrlenW(groupname)+1) + sizeof(commentW);
156     NetApiBufferAllocate(size, (LPVOID*)&info);
157
158     info->lgrpi1_name = (LPWSTR)(info + 1);
159     lstrcpyW(info->lgrpi1_name, groupname);
160
161     info->lgrpi1_comment = info->lgrpi1_name + lstrlenW(groupname) + 1;
162     lstrcpyW(info->lgrpi1_comment, commentW);
163
164     *bufptr = (LPBYTE)info;
165
166     return NERR_Success;
167 }
168
169 /************************************************************
170  *                NetLocalGroupGetMembers  (NETAPI32.@)
171  */
172 NET_API_STATUS WINAPI NetLocalGroupGetMembers(
173     LPCWSTR servername,
174     LPCWSTR localgroupname,
175     DWORD level,
176     LPBYTE* bufptr,
177     DWORD prefmaxlen,
178     LPDWORD entriesread,
179     LPDWORD totalentries,
180     PDWORD_PTR resumehandle)
181 {
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);
185
186     if (level == 3)
187     {
188         WCHAR userName[MAX_COMPUTERNAME_LENGTH + 1];
189         DWORD userNameLen;
190         DWORD len,needlen;
191         PLOCALGROUP_MEMBERS_INFO_3 ptr;
192
193         /* still a stub,  current user is belonging to all groups */
194
195         *totalentries = 1;
196         *entriesread = 0;
197
198         userNameLen = MAX_COMPUTERNAME_LENGTH + 1;
199         if (!GetUserNameW(userName,&userNameLen))
200             return ERROR_NOT_ENOUGH_MEMORY;
201
202         needlen = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
203              (userNameLen+2) * sizeof(WCHAR);
204         if (prefmaxlen != MAX_PREFERRED_LENGTH)
205             len = min(prefmaxlen,needlen);
206         else
207             len = needlen;
208
209         NetApiBufferAllocate(len, (LPVOID *) bufptr);
210         if (len < needlen)
211             return ERROR_MORE_DATA;
212
213         ptr = (PLOCALGROUP_MEMBERS_INFO_3)*bufptr;
214         ptr->lgrmi3_domainandname = (LPWSTR)(*bufptr+sizeof(LOCALGROUP_MEMBERS_INFO_3));
215         lstrcpyW(ptr->lgrmi3_domainandname,userName);
216
217         *entriesread = 1;
218     }
219
220     return NERR_Success;
221 }
222
223 /************************************************************
224  *                NetLocalGroupSetInfo  (NETAPI32.@)
225  */
226 NET_API_STATUS WINAPI NetLocalGroupSetInfo(
227     LPCWSTR servername,
228     LPCWSTR groupname,
229     DWORD level,
230     LPBYTE buf,
231     LPDWORD parm_err)
232 {
233     FIXME("(%s %s %d %p %p) stub!\n", debugstr_w(servername),
234           debugstr_w(groupname), level, buf, parm_err);
235     return NERR_Success;
236 }
237
238 /************************************************************
239  *                NetLocalGroupSetMember (NETAPI32.@)
240  */
241 NET_API_STATUS WINAPI NetLocalGroupSetMembers(
242     LPCWSTR servername,
243     LPCWSTR groupname,
244     DWORD level,
245     LPBYTE buf,
246     DWORD totalentries)
247 {
248     FIXME("(%s %s %d %p %d) stub!\n", debugstr_w(servername),
249             debugstr_w(groupname), level, buf, totalentries);
250     return NERR_Success;
251 }