~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/wldap32/delete.c

Version: ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~ [ wine-1.0-rc5 ] ~ [ wine-1.0-rc4 ] ~ [ wine-1.0-rc3 ] ~ [ wine-1.0-rc2 ] ~ [ wine-1.0-rc1 ] ~ [ wine-0.9.61 ] ~ [ wine-0.9.60 ] ~ [ wine-0.9.59 ] ~ [ wine-0.9.58 ] ~ [ wine-0.9.57 ] ~ [ wine-0.9.56 ] ~ [ wine-0.9.55 ] ~ [ wine-0.9.54 ] ~ [ wine-0.9.53 ] ~ [ wine-0.9.52 ] ~ [ wine-0.9.51 ] ~ [ wine-0.9.50 ] ~ [ wine-0.9.49 ] ~ [ wine-0.9.48 ] ~ [ wine-0.9.47 ] ~ [ wine-0.9.46 ] ~ [ wine-0.9.45 ] ~ [ wine-0.9.44 ] ~ [ wine-0.9.43 ] ~ [ wine-0.9.42 ] ~ [ wine-0.9.41 ] ~ [ wine-0.9.40 ] ~ [ wine-0.9.39 ] ~ [ wine-0.9.38 ] ~ [ wine-0.9.37 ] ~ [ wine-0.9.36 ] ~ [ wine-0.9.35 ] ~ [ wine-0.9.34 ] ~ [ wine-0.9.33 ] ~ [ wine-0.9.32 ] ~ [ wine-0.9.31 ] ~ [ wine-0.9.30 ] ~ [ wine-0.9.29 ] ~ [ wine-0.9.28 ] ~ [ wine-0.9.27 ] ~ [ wine-0.9.26 ] ~ [ wine-0.9.25 ] ~ [ wine-0.9.24 ] ~ [ wine-0.9.23 ] ~ [ wine-0.9.22 ] ~ [ wine-0.9.21 ] ~ [ wine-0.9.20 ] ~ [ wine-0.9.19 ] ~ [ wine-0.9.18 ] ~ [ wine-0.9.17 ] ~ [ wine-0.9.16 ] ~ [ wine-0.9.15 ] ~ [ wine-0.9.14 ] ~ [ wine-0.9.13 ] ~ [ wine-0.9.12 ] ~ [ wine-0.9.11 ] ~ [ wine-0.9.10 ] ~ [ wine-0.9.9 ] ~ [ wine-0.9.8 ] ~ [ wine-0.9.7 ] ~ [ wine-0.9.6 ] ~ [ wine-0.9.5 ] ~ [ wine-0.9.4 ] ~ [ wine-0.9.3 ] ~ [ wine-0.9.2 ] ~ [ wine-0.9.1 ] ~ [ wine-0.9 ] ~ [ wine20050930 ] ~ [ wine20050830 ] ~ [ wine20050725 ] ~ [ wine20050628 ] ~ [ wine20050524 ] ~ [ wine20050419 ] ~ [ wine20050310 ] ~ [ wine20050211 ] ~ [ wine20050111 ] ~ [ wine20041201 ] ~ [ wine20041019 ] ~ [ wine20040914 ] ~ [ wine20040813 ] ~ [ wine20040716 ] ~ [ wine20040615 ] ~ [ wine20040505 ] ~ [ wine20040408 ] ~ [ wine20040309 ] ~ [ wine20040213 ] ~ [ wine20040121 ] ~ [ wine20031212 ] ~ [ wine20031118 ] ~ [ wine20031016 ] ~ [ wine20030911 ] ~ [ wine20030813 ] ~ [ wine20030709 ] ~ [ wine20030618 ] ~ [ wine20030508 ] ~ [ wine20030408 ] ~ [ wine20030318 ] ~ [ wine20030219 ] ~ [ wine20030115 ] ~ [ wine20021219 ] ~ [ wine20021125 ] ~ [ wine20021031 ] ~ [ wine20021007 ] ~ [ wine20020904 ] ~ [ wine20020804 ] ~ [ wine20020710 ] ~ [ wine20020605 ] ~ [ wine20020509 ] ~ [ wine20020411 ] ~ [ wine20020310 ] ~ [ wine20020228 ] ~ [ wine20011226 ] ~ [ wine20011108 ] ~ [ wine20011004 ] ~ [ wine20010824 ] ~ [ wine20010731 ] ~ [ wine20010629 ] ~ [ wine20010510 ] ~ [ wine20010418 ] ~ [ wine20010326 ] ~ [ wine20010305 ] ~ [ wine20010216 ] ~ [ wine20010112 ] ~ [ wine20001222 ] ~ [ wine20001202 ] ~ [ wine20001026 ] ~ [ wine20001002 ] ~ [ wine20000909 ] ~ [ wine20000821 ] ~ [ wine20000801 ] ~ [ wine20000716 ] ~ [ wine20000326 ] ~ [ wine20000227 ] ~ [ wine20000130 ] ~ [ wine20000109 ] ~

  1 /*
  2  * WLDAP32 - LDAP support for Wine
  3  *
  4  * Copyright 2005 Hans Leidekker
  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 "config.h"
 22 
 23 #include "wine/port.h"
 24 #include "wine/debug.h"
 25 
 26 #include <stdarg.h>
 27 
 28 #include "windef.h"
 29 #include "winbase.h"
 30 #include "winnls.h"
 31 
 32 #ifdef HAVE_LDAP_H
 33 #include <ldap.h>
 34 #endif
 35 
 36 #include "winldap_private.h"
 37 #include "wldap32.h"
 38 
 39 WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 40 
 41 /***********************************************************************
 42  *      ldap_deleteA     (WLDAP32.@)
 43  *
 44  * See ldap_deleteW.
 45  */
 46 ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, PCHAR dn )
 47 {
 48     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
 49 #ifdef HAVE_LDAP
 50     WCHAR *dnW = NULL;
 51 
 52     TRACE( "(%p, %s)\n", ld, debugstr_a(dn) );
 53 
 54     if (!ld) return ~0UL;
 55 
 56     if (dn) {
 57         dnW = strAtoW( dn );
 58         if (!dnW) return WLDAP32_LDAP_NO_MEMORY;
 59     }
 60 
 61     ret = ldap_deleteW( ld, dnW );
 62     strfreeW( dnW );
 63 
 64 #endif
 65     return ret;
 66 }
 67 
 68 /***********************************************************************
 69  *      ldap_deleteW     (WLDAP32.@)
 70  *
 71  * Delete an entry from a directory tree (asynchronous operation).
 72  *
 73  * PARAMS
 74  *  ld      [I] Pointer to an LDAP context.
 75  *  dn      [I] DN of the entry to delete.
 76  *
 77  * RETURNS
 78  *  Success: Message ID of the add operation.
 79  *  Failure: An LDAP error code.
 80  *
 81  * NOTES
 82  *  Call ldap_result with the message ID to get the result of
 83  *  the operation. Cancel the operation by calling ldap_abandon
 84  *  with the message ID.
 85  */
 86 ULONG CDECL ldap_deleteW( WLDAP32_LDAP *ld, PWCHAR dn )
 87 {
 88     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
 89 #ifdef HAVE_LDAP
 90     char *dnU = NULL;
 91     int msg;
 92 
 93     TRACE( "(%p, %s)\n", ld, debugstr_w(dn) );
 94 
 95     if (!ld) return ~0UL;
 96 
 97     if (dn) {
 98         dnU = strWtoU( dn );
 99         if (!dnU) return WLDAP32_LDAP_NO_MEMORY;
100     }
101 
102     ret = ldap_delete_ext( ld, dn ? dnU : "", NULL, NULL, &msg );
103 
104     if (ret == LDAP_SUCCESS)
105         ret = msg;
106     else
107         ret = ~0UL;
108 
109     strfreeU( dnU );
110 
111 #endif
112     return ret;
113 }
114 
115 /***********************************************************************
116  *      ldap_delete_extA     (WLDAP32.@)
117  *
118  * See ldap_delete_extW.
119  */
120 ULONG CDECL ldap_delete_extA( WLDAP32_LDAP *ld, PCHAR dn, PLDAPControlA *serverctrls,
121     PLDAPControlA *clientctrls, ULONG *message )
122 {
123     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
124 #ifdef HAVE_LDAP
125     WCHAR *dnW = NULL;
126     LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
127 
128     TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_a(dn), serverctrls,
129            clientctrls, message );
130 
131     ret = WLDAP32_LDAP_NO_MEMORY;
132 
133     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
134 
135     if (dn) {
136         dnW = strAtoW( dn );
137         if (!dnW) goto exit;
138     }
139     if (serverctrls) {
140         serverctrlsW = controlarrayAtoW( serverctrls );
141         if (!serverctrlsW) goto exit;
142     }
143     if (clientctrls) {
144         clientctrlsW = controlarrayAtoW( clientctrls );
145         if (!clientctrlsW) goto exit;
146     }
147 
148     ret = ldap_delete_extW( ld, dnW, serverctrlsW, clientctrlsW, message );
149 
150 exit:
151     strfreeW( dnW );
152     controlarrayfreeW( serverctrlsW );
153     controlarrayfreeW( clientctrlsW );
154 
155 #endif
156     return ret;
157 }
158 
159 /***********************************************************************
160  *      ldap_delete_extW     (WLDAP32.@)
161  *
162  * Delete an entry from a directory tree (asynchronous operation).
163  *
164  * PARAMS
165  *  ld          [I] Pointer to an LDAP context.
166  *  dn          [I] DN of the entry to delete.
167  *  serverctrls [I] Array of LDAP server controls.
168  *  clientctrls [I] Array of LDAP client controls.
169  *  message     [O] Message ID of the delete operation.
170  *
171  * RETURNS
172  *  Success: LDAP_SUCCESS
173  *  Failure: An LDAP error code.
174  *
175  * NOTES
176  *  Call ldap_result with the message ID to get the result of
177  *  the operation. The serverctrls and clientctrls parameters are
178  *  optional and should be set to NULL if not used.
179  */
180 ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *serverctrls,
181     PLDAPControlW *clientctrls, ULONG *message )
182 {
183     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
184 #ifdef HAVE_LDAP
185     char *dnU = NULL;
186     LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
187     int dummy;
188 
189     TRACE( "(%p, %s, %p, %p, %p)\n", ld, debugstr_w(dn), serverctrls,
190            clientctrls, message );
191 
192     ret = WLDAP32_LDAP_NO_MEMORY;
193 
194     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
195 
196     if (dn) {
197         dnU = strWtoU( dn );
198         if (!dnU) goto exit;
199     }
200     if (serverctrls) {
201         serverctrlsU = controlarrayWtoU( serverctrls );
202         if (!serverctrlsU) goto exit;
203     }
204     if (clientctrls) {
205         clientctrlsU = controlarrayWtoU( clientctrls );
206         if (!clientctrlsU) goto exit;
207     }
208 
209     ret = map_error( ldap_delete_ext( ld, dn ? dnU : "", serverctrlsU, clientctrlsU,
210                                       message ? (int *)message : &dummy ));
211 
212 exit:
213     strfreeU( dnU );
214     controlarrayfreeU( serverctrlsU );
215     controlarrayfreeU( clientctrlsU );
216 
217 #endif
218     return ret;
219 }
220 
221 /***********************************************************************
222  *      ldap_delete_ext_sA     (WLDAP32.@)
223  *
224  * See ldap_delete_ext_sW.
225  */
226 ULONG CDECL ldap_delete_ext_sA( WLDAP32_LDAP *ld, PCHAR dn, PLDAPControlA *serverctrls,
227     PLDAPControlA *clientctrls )
228 {
229     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
230 #ifdef HAVE_LDAP
231     WCHAR *dnW = NULL;
232     LDAPControlW **serverctrlsW = NULL, **clientctrlsW = NULL;
233 
234     TRACE( "(%p, %s, %p, %p)\n", ld, debugstr_a(dn), serverctrls,
235            clientctrls );
236 
237     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
238 
239     if (dn) {
240         dnW = strAtoW( dn );
241         if (!dnW) goto exit;
242     }
243     if (serverctrls) {
244         serverctrlsW = controlarrayAtoW( serverctrls );
245         if (!serverctrlsW) goto exit;
246     }
247     if (clientctrls) {
248         clientctrlsW = controlarrayAtoW( clientctrls );
249         if (!clientctrlsW) goto exit;
250     }
251 
252     ret = ldap_delete_ext_sW( ld, dnW, serverctrlsW, clientctrlsW );
253 
254 exit:
255     strfreeW( dnW );
256     controlarrayfreeW( serverctrlsW );
257     controlarrayfreeW( clientctrlsW );
258 
259 #endif
260     return ret;
261 }
262 
263 /***********************************************************************
264  *      ldap_delete_ext_sW     (WLDAP32.@)
265  *
266  * Delete an entry from a directory tree (synchronous operation).
267  *
268  * PARAMS
269  *  ld          [I] Pointer to an LDAP context.
270  *  dn          [I] DN of the entry to delete.
271  *  serverctrls [I] Array of LDAP server controls.
272  *  clientctrls [I] Array of LDAP client controls.
273  *
274  * RETURNS
275  *  Success: LDAP_SUCCESS
276  *  Failure: An LDAP error code.
277  *
278  * NOTES
279  *  The serverctrls and clientctrls parameters are optional and
280  *  should be set to NULL if not used.
281  */
282 ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *serverctrls,
283     PLDAPControlW *clientctrls )
284 {
285     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
286 #ifdef HAVE_LDAP
287     char *dnU = NULL;
288     LDAPControl **serverctrlsU = NULL, **clientctrlsU = NULL;
289 
290     TRACE( "(%p, %s, %p, %p)\n", ld, debugstr_w(dn), serverctrls,
291            clientctrls );
292 
293     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
294 
295     if (dn) {
296         dnU = strWtoU( dn );
297         if (!dnU) goto exit;
298     }
299     if (serverctrls) {
300         serverctrlsU = controlarrayWtoU( serverctrls );
301         if (!serverctrlsU) goto exit;
302     }
303     if (clientctrls) {
304         clientctrlsU = controlarrayWtoU( clientctrls );
305         if (!clientctrlsU) goto exit;
306     }
307 
308     ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", serverctrlsU, clientctrlsU ));
309 
310 exit:
311     strfreeU( dnU );
312     controlarrayfreeU( serverctrlsU );
313     controlarrayfreeU( clientctrlsU );
314 
315 #endif
316     return ret;
317 }
318  
319 /***********************************************************************
320  *      ldap_delete_sA     (WLDAP32.@)
321  *
322  * See ldap_delete_sW.
323  */
324 ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, PCHAR dn )
325 {
326     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
327 #ifdef HAVE_LDAP
328     WCHAR *dnW = NULL;
329 
330     TRACE( "(%p, %s)\n", ld, debugstr_a(dn) );
331 
332     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
333 
334     if (dn) {
335         dnW = strAtoW( dn );
336         if (!dnW) return WLDAP32_LDAP_NO_MEMORY;
337     }
338 
339     ret = ldap_delete_sW( ld, dnW );
340     strfreeW( dnW );
341 
342 #endif
343     return ret;
344 }
345 
346 /***********************************************************************
347  *      ldap_delete_sW     (WLDAP32.@)
348  *
349  * Delete an entry from a directory tree (synchronous operation).
350  *
351  * PARAMS
352  *  ld      [I] Pointer to an LDAP context.
353  *  dn      [I] DN of the entry to delete.
354  *
355  * RETURNS
356  *  Success: LDAP_SUCCESS
357  *  Failure: An LDAP error code.
358  */
359 ULONG CDECL ldap_delete_sW( WLDAP32_LDAP *ld, PWCHAR dn )
360 {
361     ULONG ret = WLDAP32_LDAP_NOT_SUPPORTED;
362 #ifdef HAVE_LDAP
363     char *dnU = NULL;
364 
365     TRACE( "(%p, %s)\n", ld, debugstr_w(dn) );
366 
367     if (!ld) return WLDAP32_LDAP_PARAM_ERROR;
368 
369     if (dn) {
370         dnU = strWtoU( dn );
371         if (!dnU) return WLDAP32_LDAP_NO_MEMORY;
372     }
373 
374     ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", NULL, NULL ));
375     strfreeU( dnU );
376 
377 #endif
378     return ret;
379 }
380 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.