[WLDAP32] Sync with Wine Staging 3.3. CORE-14434

This commit is contained in:
Amine Khaldi 2018-03-24 13:20:30 +01:00
parent 7756e32bcb
commit e6368408c2
26 changed files with 416 additions and 175 deletions

View file

@ -23,7 +23,7 @@ list(APPEND SOURCE
rename.c rename.c
search.c search.c
value.c value.c
winldap_private.h precomp.h
${CMAKE_CURRENT_BINARY_DIR}/wldap32_stubs.c) ${CMAKE_CURRENT_BINARY_DIR}/wldap32_stubs.c)
add_library(wldap32 SHARED add_library(wldap32 SHARED
@ -35,5 +35,5 @@ add_library(wldap32 SHARED
set_module_type(wldap32 win32dll) set_module_type(wldap32 win32dll)
target_link_libraries(wldap32 wine) target_link_libraries(wldap32 wine)
add_importlibs(wldap32 user32 msvcrt kernel32 ntdll) add_importlibs(wldap32 user32 msvcrt kernel32 ntdll)
add_pch(wldap32 winldap_private.h SOURCE) add_pch(wldap32 precomp.h SOURCE)
add_cd_file(TARGET wldap32 DESTINATION reactos/system32 FOR all) add_cd_file(TARGET wldap32 DESTINATION reactos/system32 FOR all)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
#ifdef HAVE_LDAP #ifdef HAVE_LDAP
static LDAPMod *nullattrs[] = { NULL }; static LDAPMod *nullattrs[] = { NULL };

View file

@ -18,15 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <config.h> #include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winldap.h"
#include "wine/debug.h"
#include <windef.h>
#include <winbase.h>
#include <winldap.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
#ifndef LBER_ERROR #ifndef LBER_ERROR

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_bindA (WLDAP32.@) * ldap_bindA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_compareA (WLDAP32.@) * ldap_compareA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_control_freeA (WLDAP32.@) * ldap_control_freeA (WLDAP32.@)
@ -260,8 +276,7 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_berval *dst ) static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_berval *dst )
{ {
dst->bv_val = HeapAlloc( GetProcessHeap(), 0, src->bv_len ); if ((dst->bv_val = heap_alloc( src->bv_len )))
if (dst->bv_val)
{ {
memcpy( dst->bv_val, src->bv_val, src->bv_len ); memcpy( dst->bv_val, src->bv_val, src->bv_len );
dst->bv_len = src->bv_len; dst->bv_len = src->bv_len;

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_deleteA (WLDAP32.@) * ldap_deleteA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_dn2ufnA (WLDAP32.@) * ldap_dn2ufnA (WLDAP32.@)

View file

@ -18,9 +18,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "winldap_private.h" #include "config.h"
#include "wine/port.h"
#include <winuser.h> #include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
ULONG map_error( int error ) ULONG map_error( int error )
{ {

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_close_extended_op (WLDAP32.@) * ldap_close_extended_op (WLDAP32.@)

View file

@ -18,7 +18,22 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
#ifdef HAVE_LDAP #ifdef HAVE_LDAP
/* Should eventually be determined by the algorithm documented on MSDN. */ /* Should eventually be determined by the algorithm documented on MSDN. */
@ -47,10 +62,9 @@ static char **split_hostnames( const char *hostnames )
p++; p++;
} }
res = HeapAlloc( GetProcessHeap(), 0, (i + 1) * sizeof(char *) ); if (!(res = heap_alloc( (i + 1) * sizeof(char *) )))
if (!res)
{ {
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
return NULL; return NULL;
} }
@ -85,14 +99,14 @@ static char **split_hostnames( const char *hostnames )
} }
res[i] = NULL; res[i] = NULL;
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
return res; return res;
oom: oom:
while (i > 0) strfreeU( res[--i] ); while (i > 0) strfreeU( res[--i] );
HeapFree( GetProcessHeap(), 0, res ); heap_free( res );
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
return NULL; return NULL;
} }
@ -139,9 +153,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum
} }
size += (i - 1) * strlen( sep ); size += (i - 1) * strlen( sep );
if (!(res = heap_alloc( size + 1 ))) return NULL;
res = HeapAlloc( GetProcessHeap(), 0, size + 1 );
if (!res) return NULL;
p = res; p = res;
for (v = hostnames; *v; v++) for (v = hostnames; *v; v++)
@ -189,6 +201,8 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port )
} }
#endif #endif
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
#ifdef HAVE_LDAP #ifdef HAVE_LDAP
static LDAP *create_context( const char *url ) static LDAP *create_context( const char *url )
{ {

View file

@ -18,10 +18,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "winldap_private.h" #include "config.h"
#include "wine/debug.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
HINSTANCE hwldap32; HINSTANCE hwldap32;
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{ {
TRACE( "(%p, %d, %p)\n", hinst, reason, reserved ); TRACE( "(%p, %d, %p)\n", hinst, reason, reserved );

View file

@ -18,9 +18,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "winldap_private.h" #include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_abandon (WLDAP32.@) * ldap_abandon (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
#ifdef HAVE_LDAP #ifdef HAVE_LDAP
static LDAPMod *nullmods[] = { NULL }; static LDAPMod *nullmods[] = { NULL };

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_modrdnA (WLDAP32.@) * ldap_modrdnA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_get_optionA (WLDAP32.@) * ldap_get_optionA (WLDAP32.@)

View file

@ -18,12 +18,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "winldap_private.h" #include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#ifndef LDAP_MAXINT #ifndef LDAP_MAXINT
#define LDAP_MAXINT 2147483647 #define LDAP_MAXINT 2147483647
#endif #endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_create_page_controlA (WLDAP32.@) * ldap_create_page_controlA (WLDAP32.@)
* *
@ -84,17 +99,15 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
return WLDAP32_LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
/* copy the berval so it can be properly freed by the caller */ /* copy the berval so it can be properly freed by the caller */
val = HeapAlloc( GetProcessHeap(), 0, berval->bv_len ); if (!(val = heap_alloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY;
if (!val) return WLDAP32_LDAP_NO_MEMORY;
len = berval->bv_len; len = berval->bv_len;
memcpy( val, berval->bv_val, len ); memcpy( val, berval->bv_val, len );
ber_bvfree( berval ); ber_bvfree( berval );
ctrl = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); if (!(ctrl = heap_alloc( sizeof(LDAPControlW) )))
if (!ctrl)
{ {
HeapFree( GetProcessHeap(), 0, val ); heap_free( val );
return WLDAP32_LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
} }

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_parse_extended_resultA (WLDAP32.@) * ldap_parse_extended_resultA (WLDAP32.@)

View file

@ -0,0 +1,25 @@
#ifndef _WINLDAP_PRECOMP_H_
#define _WINLDAP_PRECOMP_H_
#include <wine/config.h>
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <wine/debug.h>
#include "winldap_private.h"
#include "wldap32.h"
#endif /* !_WINLDAP_PRECOMP_H_ */

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_rename_extA (WLDAP32.@) * ldap_rename_extA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_searchA (WLDAP32.@) * ldap_searchA (WLDAP32.@)

View file

@ -18,7 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winldap_private.h" #include "winldap_private.h"
#include "wldap32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
/*********************************************************************** /***********************************************************************
* ldap_count_values_len (WLDAP32.@) * ldap_count_values_len (WLDAP32.@)
@ -140,8 +156,7 @@ static char *bv2str( struct berval *bv )
char *str = NULL; char *str = NULL;
unsigned int len = bv->bv_len; unsigned int len = bv->bv_len;
str = HeapAlloc( GetProcessHeap(), 0, len + 1 ); if ((str = heap_alloc( len + 1 )))
if (str)
{ {
memcpy( str, bv->bv_val, len ); memcpy( str, bv->bv_val, len );
str[len] = '\0'; str[len] = '\0';
@ -160,8 +175,7 @@ static char **bv2str_array( struct berval **bv )
len++; len++;
p++; p++;
} }
str = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(char *) ); if (!(str = heap_alloc( (len + 1) * sizeof(char *) ))) return NULL;
if (!str) return NULL;
p = bv; p = bv;
while (*p) while (*p)
@ -169,8 +183,8 @@ static char **bv2str_array( struct berval **bv )
str[i] = bv2str( *p ); str[i] = bv2str( *p );
if (!str[i]) if (!str[i])
{ {
while (i > 0) HeapFree( GetProcessHeap(), 0, str[--i] ); while (i > 0) heap_free( str[--i] );
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
return NULL; return NULL;
} }
i++; i++;

View file

@ -22,29 +22,7 @@
* native headers. * native headers.
*/ */
#ifndef _WINLDAP_PRIVATE_H_ #pragma once
#define _WINLDAP_PRIVATE_H_
#include <wine/config.h>
#include <stdarg.h>
#ifdef HAVE_LDAP_H
#include <ldap.h>
#endif
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
#include "wldap32.h"
typedef enum { typedef enum {
WLDAP32_LDAP_SUCCESS = 0x00, WLDAP32_LDAP_SUCCESS = 0x00,
@ -480,5 +458,3 @@ ULONG CDECL LdapGetLastError(void);
ULONG CDECL LdapMapErrorToWin32(ULONG); ULONG CDECL LdapMapErrorToWin32(ULONG);
int CDECL LdapUnicodeToUTF8(LPCWSTR,int,LPSTR,int); int CDECL LdapUnicodeToUTF8(LPCWSTR,int,LPSTR,int);
int CDECL LdapUTF8ToUnicode(LPCSTR,int,LPWSTR,int); int CDECL LdapUTF8ToUnicode(LPCSTR,int,LPWSTR,int);
#endif /* _WINLDAP_PRIVATE_H_ */

View file

@ -20,7 +20,8 @@
#pragma once #pragma once
#include <wine/unicode.h> #include "wine/heap.h"
#include "wine/unicode.h"
extern HINSTANCE hwldap32 DECLSPEC_HIDDEN; extern HINSTANCE hwldap32 DECLSPEC_HIDDEN;
@ -33,22 +34,16 @@ ULONG map_error( int ) DECLSPEC_HIDDEN;
static inline char *strdupU( const char *src ) static inline char *strdupU( const char *src )
{ {
char *dst; char *dst;
if (!src) return NULL; if (!src) return NULL;
dst = HeapAlloc( GetProcessHeap(), 0, (strlen( src ) + 1) * sizeof(char) ); if ((dst = heap_alloc( (strlen( src ) + 1) * sizeof(char) ))) strcpy( dst, src );
if (dst)
strcpy( dst, src );
return dst; return dst;
} }
static inline WCHAR *strdupW( const WCHAR *src ) static inline WCHAR *strdupW( const WCHAR *src )
{ {
WCHAR *dst; WCHAR *dst;
if (!src) return NULL; if (!src) return NULL;
dst = HeapAlloc( GetProcessHeap(), 0, (strlenW( src ) + 1) * sizeof(WCHAR) ); if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src );
if (dst)
strcpyW( dst, src );
return dst; return dst;
} }
@ -58,7 +53,7 @@ static inline LPWSTR strAtoW( LPCSTR str )
if (str) if (str)
{ {
DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) if ((ret = heap_alloc( len * sizeof(WCHAR) )))
MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
} }
return ret; return ret;
@ -70,7 +65,7 @@ static inline LPSTR strWtoA( LPCWSTR str )
if (str) if (str)
{ {
DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) if ((ret = heap_alloc( len )))
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
} }
return ret; return ret;
@ -82,7 +77,7 @@ static inline char *strWtoU( LPCWSTR str )
if (str) if (str)
{ {
DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL ); DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) if ((ret = heap_alloc( len )))
WideCharToMultiByte( CP_UTF8, 0, str, -1, ret, len, NULL, NULL ); WideCharToMultiByte( CP_UTF8, 0, str, -1, ret, len, NULL, NULL );
} }
return ret; return ret;
@ -94,7 +89,7 @@ static inline LPWSTR strUtoW( char *str )
if (str) if (str)
{ {
DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 ); DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) if ((ret = heap_alloc( len * sizeof(WCHAR) )))
MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len ); MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
} }
return ret; return ret;
@ -102,17 +97,17 @@ static inline LPWSTR strUtoW( char *str )
static inline void strfreeA( LPSTR str ) static inline void strfreeA( LPSTR str )
{ {
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
} }
static inline void strfreeW( LPWSTR str ) static inline void strfreeW( LPWSTR str )
{ {
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
} }
static inline void strfreeU( char *str ) static inline void strfreeU( char *str )
{ {
HeapFree( GetProcessHeap(), 0, str ); heap_free( str );
} }
static inline DWORD strarraylenA( LPSTR *strarray ) static inline DWORD strarraylenA( LPSTR *strarray )
@ -144,9 +139,7 @@ static inline LPWSTR *strarrayAtoW( LPSTR *strarray )
if (strarray) if (strarray)
{ {
size = sizeof(WCHAR*) * (strarraylenA( strarray ) + 1); size = sizeof(WCHAR*) * (strarraylenA( strarray ) + 1);
strarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((strarrayW = heap_alloc( size )))
if (strarrayW)
{ {
LPSTR *p = strarray; LPSTR *p = strarray;
LPWSTR *q = strarrayW; LPWSTR *q = strarrayW;
@ -166,9 +159,7 @@ static inline LPSTR *strarrayWtoA( LPWSTR *strarray )
if (strarray) if (strarray)
{ {
size = sizeof(LPSTR) * (strarraylenW( strarray ) + 1); size = sizeof(LPSTR) * (strarraylenW( strarray ) + 1);
strarrayA = HeapAlloc( GetProcessHeap(), 0, size ); if ((strarrayA = heap_alloc( size )))
if (strarrayA)
{ {
LPWSTR *p = strarray; LPWSTR *p = strarray;
LPSTR *q = strarrayA; LPSTR *q = strarrayA;
@ -188,9 +179,7 @@ static inline char **strarrayWtoU( LPWSTR *strarray )
if (strarray) if (strarray)
{ {
size = sizeof(char*) * (strarraylenW( strarray ) + 1); size = sizeof(char*) * (strarraylenW( strarray ) + 1);
strarrayU = HeapAlloc( GetProcessHeap(), 0, size ); if ((strarrayU = heap_alloc( size )))
if (strarrayU)
{ {
LPWSTR *p = strarray; LPWSTR *p = strarray;
char **q = strarrayU; char **q = strarrayU;
@ -210,9 +199,7 @@ static inline LPWSTR *strarrayUtoW( char **strarray )
if (strarray) if (strarray)
{ {
size = sizeof(WCHAR*) * (strarraylenU( strarray ) + 1); size = sizeof(WCHAR*) * (strarraylenU( strarray ) + 1);
strarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((strarrayW = heap_alloc( size )))
if (strarrayW)
{ {
char **p = strarray; char **p = strarray;
LPWSTR *q = strarrayW; LPWSTR *q = strarrayW;
@ -230,7 +217,7 @@ static inline void strarrayfreeA( LPSTR *strarray )
{ {
LPSTR *p = strarray; LPSTR *p = strarray;
while (*p) strfreeA( *p++ ); while (*p) strfreeA( *p++ );
HeapFree( GetProcessHeap(), 0, strarray ); heap_free( strarray );
} }
} }
@ -240,7 +227,7 @@ static inline void strarrayfreeW( LPWSTR *strarray )
{ {
LPWSTR *p = strarray; LPWSTR *p = strarray;
while (*p) strfreeW( *p++ ); while (*p) strfreeW( *p++ );
HeapFree( GetProcessHeap(), 0, strarray ); heap_free( strarray );
} }
} }
@ -250,7 +237,7 @@ static inline void strarrayfreeU( char **strarray )
{ {
char **p = strarray; char **p = strarray;
while (*p) strfreeU( *p++ ); while (*p) strfreeU( *p++ );
HeapFree( GetProcessHeap(), 0, strarray ); heap_free( strarray );
} }
} }
@ -261,8 +248,7 @@ static inline struct berval *bvdup( struct berval *bv )
struct berval *berval; struct berval *berval;
DWORD size = sizeof(struct berval) + bv->bv_len; DWORD size = sizeof(struct berval) + bv->bv_len;
berval = HeapAlloc( GetProcessHeap(), 0, size ); if ((berval = heap_alloc( size )))
if (berval)
{ {
char *val = (char *)berval + sizeof(struct berval); char *val = (char *)berval + sizeof(struct berval);
@ -288,9 +274,7 @@ static inline struct berval **bvarraydup( struct berval **bv )
if (bv) if (bv)
{ {
size = sizeof(struct berval *) * (bvarraylen( bv ) + 1); size = sizeof(struct berval *) * (bvarraylen( bv ) + 1);
berval = HeapAlloc( GetProcessHeap(), 0, size ); if ((berval = heap_alloc( size )))
if (berval)
{ {
struct berval **p = bv; struct berval **p = bv;
struct berval **q = berval; struct berval **q = berval;
@ -305,16 +289,15 @@ static inline struct berval **bvarraydup( struct berval **bv )
static inline void bvarrayfree( struct berval **bv ) static inline void bvarrayfree( struct berval **bv )
{ {
struct berval **p = bv; struct berval **p = bv;
while (*p) HeapFree( GetProcessHeap(), 0, *p++ ); while (*p) heap_free( *p++ );
HeapFree( GetProcessHeap(), 0, bv ); heap_free( bv );
} }
static inline LDAPModW *modAtoW( LDAPModA *mod ) static inline LDAPModW *modAtoW( LDAPModA *mod )
{ {
LDAPModW *modW; LDAPModW *modW;
modW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPModW) ); if ((modW = heap_alloc( sizeof(LDAPModW) )))
if (modW)
{ {
modW->mod_op = mod->mod_op; modW->mod_op = mod->mod_op;
modW->mod_type = strAtoW( mod->mod_type ); modW->mod_type = strAtoW( mod->mod_type );
@ -331,8 +314,7 @@ static inline LDAPMod *modWtoU( LDAPModW *mod )
{ {
LDAPMod *modU; LDAPMod *modU;
modU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPMod) ); if ((modU = heap_alloc( sizeof(LDAPMod) )))
if (modU)
{ {
modU->mod_op = mod->mod_op; modU->mod_op = mod->mod_op;
modU->mod_type = strWtoU( mod->mod_type ); modU->mod_type = strWtoU( mod->mod_type );
@ -351,7 +333,7 @@ static inline void modfreeW( LDAPModW *mod )
bvarrayfree( mod->mod_vals.modv_bvals ); bvarrayfree( mod->mod_vals.modv_bvals );
else else
strarrayfreeW( mod->mod_vals.modv_strvals ); strarrayfreeW( mod->mod_vals.modv_strvals );
HeapFree( GetProcessHeap(), 0, mod ); heap_free( mod );
} }
static inline void modfreeU( LDAPMod *mod ) static inline void modfreeU( LDAPMod *mod )
@ -360,7 +342,7 @@ static inline void modfreeU( LDAPMod *mod )
bvarrayfree( mod->mod_vals.modv_bvals ); bvarrayfree( mod->mod_vals.modv_bvals );
else else
strarrayfreeU( mod->mod_vals.modv_strvals ); strarrayfreeU( mod->mod_vals.modv_strvals );
HeapFree( GetProcessHeap(), 0, mod ); heap_free( mod );
} }
static inline DWORD modarraylenA( LDAPModA **modarray ) static inline DWORD modarraylenA( LDAPModA **modarray )
@ -385,9 +367,7 @@ static inline LDAPModW **modarrayAtoW( LDAPModA **modarray )
if (modarray) if (modarray)
{ {
size = sizeof(LDAPModW*) * (modarraylenA( modarray ) + 1); size = sizeof(LDAPModW*) * (modarraylenA( modarray ) + 1);
modarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((modarrayW = heap_alloc( size )))
if (modarrayW)
{ {
LDAPModA **p = modarray; LDAPModA **p = modarray;
LDAPModW **q = modarrayW; LDAPModW **q = modarrayW;
@ -407,9 +387,7 @@ static inline LDAPMod **modarrayWtoU( LDAPModW **modarray )
if (modarray) if (modarray)
{ {
size = sizeof(LDAPMod*) * (modarraylenW( modarray ) + 1); size = sizeof(LDAPMod*) * (modarraylenW( modarray ) + 1);
modarrayU = HeapAlloc( GetProcessHeap(), 0, size ); if ((modarrayU = heap_alloc( size )))
if (modarrayU)
{ {
LDAPModW **p = modarray; LDAPModW **p = modarray;
LDAPMod **q = modarrayU; LDAPMod **q = modarrayU;
@ -427,7 +405,7 @@ static inline void modarrayfreeW( LDAPModW **modarray )
{ {
LDAPModW **p = modarray; LDAPModW **p = modarray;
while (*p) modfreeW( *p++ ); while (*p) modfreeW( *p++ );
HeapFree( GetProcessHeap(), 0, modarray ); heap_free( modarray );
} }
} }
@ -437,7 +415,7 @@ static inline void modarrayfreeU( LDAPMod **modarray )
{ {
LDAPMod **p = modarray; LDAPMod **p = modarray;
while (*p) modfreeU( *p++ ); while (*p) modfreeU( *p++ );
HeapFree( GetProcessHeap(), 0, modarray ); heap_free( modarray );
} }
} }
@ -449,15 +427,13 @@ static inline LDAPControlW *controlAtoW( LDAPControlA *control )
if (control->ldctl_value.bv_val) if (control->ldctl_value.bv_val)
{ {
val = HeapAlloc( GetProcessHeap(), 0, len ); if (!(val = heap_alloc( len ))) return NULL;
if (!val) return NULL;
memcpy( val, control->ldctl_value.bv_val, len ); memcpy( val, control->ldctl_value.bv_val, len );
} }
controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); if (!(controlW = heap_alloc( sizeof(LDAPControlW) )))
if (!controlW)
{ {
HeapFree( GetProcessHeap(), 0, val ); heap_free( val );
return NULL; return NULL;
} }
@ -477,15 +453,13 @@ static inline LDAPControlA *controlWtoA( LDAPControlW *control )
if (control->ldctl_value.bv_val) if (control->ldctl_value.bv_val)
{ {
val = HeapAlloc( GetProcessHeap(), 0, len ); if (!(val = heap_alloc( len ))) return NULL;
if (!val) return NULL;
memcpy( val, control->ldctl_value.bv_val, len ); memcpy( val, control->ldctl_value.bv_val, len );
} }
controlA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlA) ); if (!(controlA = heap_alloc( sizeof(LDAPControlA) )))
if (!controlA)
{ {
HeapFree( GetProcessHeap(), 0, val ); heap_free( val );
return NULL; return NULL;
} }
@ -505,15 +479,13 @@ static inline LDAPControl *controlWtoU( LDAPControlW *control )
if (control->ldctl_value.bv_val) if (control->ldctl_value.bv_val)
{ {
val = HeapAlloc( GetProcessHeap(), 0, len ); if (!(val = heap_alloc( len ))) return NULL;
if (!val) return NULL;
memcpy( val, control->ldctl_value.bv_val, len ); memcpy( val, control->ldctl_value.bv_val, len );
} }
controlU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControl) ); if (!(controlU = heap_alloc( sizeof(LDAPControl) )))
if (!controlU)
{ {
HeapFree( GetProcessHeap(), 0, val ); heap_free( val );
return NULL; return NULL;
} }
@ -533,15 +505,13 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control )
if (control->ldctl_value.bv_val) if (control->ldctl_value.bv_val)
{ {
val = HeapAlloc( GetProcessHeap(), 0, len ); if (!(val = heap_alloc( len ))) return NULL;
if (!val) return NULL;
memcpy( val, control->ldctl_value.bv_val, len ); memcpy( val, control->ldctl_value.bv_val, len );
} }
controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); if (!(controlW = heap_alloc( sizeof(LDAPControlW) )))
if (!controlW)
{ {
HeapFree( GetProcessHeap(), 0, val ); heap_free( val );
return NULL; return NULL;
} }
@ -558,8 +528,8 @@ static inline void controlfreeA( LDAPControlA *control )
if (control) if (control)
{ {
strfreeA( control->ldctl_oid ); strfreeA( control->ldctl_oid );
HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); heap_free( control->ldctl_value.bv_val );
HeapFree( GetProcessHeap(), 0, control ); heap_free( control );
} }
} }
@ -568,8 +538,8 @@ static inline void controlfreeW( LDAPControlW *control )
if (control) if (control)
{ {
strfreeW( control->ldctl_oid ); strfreeW( control->ldctl_oid );
HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); heap_free( control->ldctl_value.bv_val );
HeapFree( GetProcessHeap(), 0, control ); heap_free( control );
} }
} }
@ -578,8 +548,8 @@ static inline void controlfreeU( LDAPControl *control )
if (control) if (control)
{ {
strfreeU( control->ldctl_oid ); strfreeU( control->ldctl_oid );
HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); heap_free( control->ldctl_value.bv_val );
HeapFree( GetProcessHeap(), 0, control ); heap_free( control );
} }
} }
@ -612,9 +582,7 @@ static inline LDAPControlW **controlarrayAtoW( LDAPControlA **controlarray )
if (controlarray) if (controlarray)
{ {
size = sizeof(LDAPControlW*) * (controlarraylenA( controlarray ) + 1); size = sizeof(LDAPControlW*) * (controlarraylenA( controlarray ) + 1);
controlarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((controlarrayW = heap_alloc( size )))
if (controlarrayW)
{ {
LDAPControlA **p = controlarray; LDAPControlA **p = controlarray;
LDAPControlW **q = controlarrayW; LDAPControlW **q = controlarrayW;
@ -634,9 +602,7 @@ static inline LDAPControlA **controlarrayWtoA( LDAPControlW **controlarray )
if (controlarray) if (controlarray)
{ {
size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1); size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1);
controlarrayA = HeapAlloc( GetProcessHeap(), 0, size ); if ((controlarrayA = heap_alloc( size )))
if (controlarrayA)
{ {
LDAPControlW **p = controlarray; LDAPControlW **p = controlarray;
LDAPControlA **q = controlarrayA; LDAPControlA **q = controlarrayA;
@ -656,9 +622,7 @@ static inline LDAPControl **controlarrayWtoU( LDAPControlW **controlarray )
if (controlarray) if (controlarray)
{ {
size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1); size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1);
controlarrayU = HeapAlloc( GetProcessHeap(), 0, size ); if ((controlarrayU = heap_alloc( size )))
if (controlarrayU)
{ {
LDAPControlW **p = controlarray; LDAPControlW **p = controlarray;
LDAPControl **q = controlarrayU; LDAPControl **q = controlarrayU;
@ -678,9 +642,7 @@ static inline LDAPControlW **controlarrayUtoW( LDAPControl **controlarray )
if (controlarray) if (controlarray)
{ {
size = sizeof(LDAPControlW*) * (controlarraylenU( controlarray ) + 1); size = sizeof(LDAPControlW*) * (controlarraylenU( controlarray ) + 1);
controlarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((controlarrayW = heap_alloc( size )))
if (controlarrayW)
{ {
LDAPControl **p = controlarray; LDAPControl **p = controlarray;
LDAPControlW **q = controlarrayW; LDAPControlW **q = controlarrayW;
@ -698,7 +660,7 @@ static inline void controlarrayfreeA( LDAPControlA **controlarray )
{ {
LDAPControlA **p = controlarray; LDAPControlA **p = controlarray;
while (*p) controlfreeA( *p++ ); while (*p) controlfreeA( *p++ );
HeapFree( GetProcessHeap(), 0, controlarray ); heap_free( controlarray );
} }
} }
@ -708,7 +670,7 @@ static inline void controlarrayfreeW( LDAPControlW **controlarray )
{ {
LDAPControlW **p = controlarray; LDAPControlW **p = controlarray;
while (*p) controlfreeW( *p++ ); while (*p) controlfreeW( *p++ );
HeapFree( GetProcessHeap(), 0, controlarray ); heap_free( controlarray );
} }
} }
@ -718,7 +680,7 @@ static inline void controlarrayfreeU( LDAPControl **controlarray )
{ {
LDAPControl **p = controlarray; LDAPControl **p = controlarray;
while (*p) controlfreeU( *p++ ); while (*p) controlfreeU( *p++ );
HeapFree( GetProcessHeap(), 0, controlarray ); heap_free( controlarray );
} }
} }
@ -726,8 +688,7 @@ static inline LDAPSortKeyW *sortkeyAtoW( LDAPSortKeyA *sortkey )
{ {
LDAPSortKeyW *sortkeyW; LDAPSortKeyW *sortkeyW;
sortkeyW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyW) ); if ((sortkeyW = heap_alloc( sizeof(LDAPSortKeyW) )))
if (sortkeyW)
{ {
sortkeyW->sk_attrtype = strAtoW( sortkey->sk_attrtype ); sortkeyW->sk_attrtype = strAtoW( sortkey->sk_attrtype );
sortkeyW->sk_matchruleoid = strAtoW( sortkey->sk_matchruleoid ); sortkeyW->sk_matchruleoid = strAtoW( sortkey->sk_matchruleoid );
@ -740,8 +701,7 @@ static inline LDAPSortKeyA *sortkeyWtoA( LDAPSortKeyW *sortkey )
{ {
LDAPSortKeyA *sortkeyA; LDAPSortKeyA *sortkeyA;
sortkeyA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyA) ); if ((sortkeyA = heap_alloc( sizeof(LDAPSortKeyA) )))
if (sortkeyA)
{ {
sortkeyA->sk_attrtype = strWtoA( sortkey->sk_attrtype ); sortkeyA->sk_attrtype = strWtoA( sortkey->sk_attrtype );
sortkeyA->sk_matchruleoid = strWtoA( sortkey->sk_matchruleoid ); sortkeyA->sk_matchruleoid = strWtoA( sortkey->sk_matchruleoid );
@ -754,8 +714,7 @@ static inline LDAPSortKey *sortkeyWtoU( LDAPSortKeyW *sortkey )
{ {
LDAPSortKey *sortkeyU; LDAPSortKey *sortkeyU;
sortkeyU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKey) ); if ((sortkeyU = heap_alloc( sizeof(LDAPSortKey) )))
if (sortkeyU)
{ {
sortkeyU->attributeType = strWtoU( sortkey->sk_attrtype ); sortkeyU->attributeType = strWtoU( sortkey->sk_attrtype );
sortkeyU->orderingRule = strWtoU( sortkey->sk_matchruleoid ); sortkeyU->orderingRule = strWtoU( sortkey->sk_matchruleoid );
@ -770,7 +729,7 @@ static inline void sortkeyfreeA( LDAPSortKeyA *sortkey )
{ {
strfreeA( sortkey->sk_attrtype ); strfreeA( sortkey->sk_attrtype );
strfreeA( sortkey->sk_matchruleoid ); strfreeA( sortkey->sk_matchruleoid );
HeapFree( GetProcessHeap(), 0, sortkey ); heap_free( sortkey );
} }
} }
@ -780,7 +739,7 @@ static inline void sortkeyfreeW( LDAPSortKeyW *sortkey )
{ {
strfreeW( sortkey->sk_attrtype ); strfreeW( sortkey->sk_attrtype );
strfreeW( sortkey->sk_matchruleoid ); strfreeW( sortkey->sk_matchruleoid );
HeapFree( GetProcessHeap(), 0, sortkey ); heap_free( sortkey );
} }
} }
@ -790,7 +749,7 @@ static inline void sortkeyfreeU( LDAPSortKey *sortkey )
{ {
strfreeU( sortkey->attributeType ); strfreeU( sortkey->attributeType );
strfreeU( sortkey->orderingRule ); strfreeU( sortkey->orderingRule );
HeapFree( GetProcessHeap(), 0, sortkey ); heap_free( sortkey );
} }
} }
@ -816,9 +775,7 @@ static inline LDAPSortKeyW **sortkeyarrayAtoW( LDAPSortKeyA **sortkeyarray )
if (sortkeyarray) if (sortkeyarray)
{ {
size = sizeof(LDAPSortKeyW*) * (sortkeyarraylenA( sortkeyarray ) + 1); size = sizeof(LDAPSortKeyW*) * (sortkeyarraylenA( sortkeyarray ) + 1);
sortkeyarrayW = HeapAlloc( GetProcessHeap(), 0, size ); if ((sortkeyarrayW = heap_alloc( size )))
if (sortkeyarrayW)
{ {
LDAPSortKeyA **p = sortkeyarray; LDAPSortKeyA **p = sortkeyarray;
LDAPSortKeyW **q = sortkeyarrayW; LDAPSortKeyW **q = sortkeyarrayW;
@ -838,9 +795,7 @@ static inline LDAPSortKey **sortkeyarrayWtoU( LDAPSortKeyW **sortkeyarray )
if (sortkeyarray) if (sortkeyarray)
{ {
size = sizeof(LDAPSortKey*) * (sortkeyarraylenW( sortkeyarray ) + 1); size = sizeof(LDAPSortKey*) * (sortkeyarraylenW( sortkeyarray ) + 1);
sortkeyarrayU = HeapAlloc( GetProcessHeap(), 0, size ); if ((sortkeyarrayU = heap_alloc( size )))
if (sortkeyarrayU)
{ {
LDAPSortKeyW **p = sortkeyarray; LDAPSortKeyW **p = sortkeyarray;
LDAPSortKey **q = sortkeyarrayU; LDAPSortKey **q = sortkeyarrayU;
@ -858,7 +813,7 @@ static inline void sortkeyarrayfreeW( LDAPSortKeyW **sortkeyarray )
{ {
LDAPSortKeyW **p = sortkeyarray; LDAPSortKeyW **p = sortkeyarray;
while (*p) sortkeyfreeW( *p++ ); while (*p) sortkeyfreeW( *p++ );
HeapFree( GetProcessHeap(), 0, sortkeyarray ); heap_free( sortkeyarray );
} }
} }
@ -868,7 +823,7 @@ static inline void sortkeyarrayfreeU( LDAPSortKey **sortkeyarray )
{ {
LDAPSortKey **p = sortkeyarray; LDAPSortKey **p = sortkeyarray;
while (*p) sortkeyfreeU( *p++ ); while (*p) sortkeyfreeU( *p++ );
HeapFree( GetProcessHeap(), 0, sortkeyarray ); heap_free( sortkeyarray );
} }
} }
#endif /* HAVE_LDAP */ #endif /* HAVE_LDAP */

View file

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <windef.h> #include "windef.h"
/* UTF-8 */ /* UTF-8 */
#pragma code_page(65001) #pragma code_page(65001)

View file

@ -207,7 +207,7 @@ reactos/dll/win32/winmm/midimap # Forked at Wine-20050628
reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
reactos/dll/win32/winscard # Synced to WineStaging-3.3 reactos/dll/win32/winscard # Synced to WineStaging-3.3
reactos/dll/win32/wintrust # Synced to WineStaging-3.3 reactos/dll/win32/wintrust # Synced to WineStaging-3.3
reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wldap32 # Synced to WineStaging-3.3
reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmi # Synced to WineStaging-2.9
reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9
reactos/dll/win32/wmvcore # Synced to Wine-3.0 reactos/dll/win32/wmvcore # Synced to Wine-3.0