[WLDAP32] Sync with Wine Staging 3.3. CORE-14434
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 24 Mar 2018 12:20:30 +0000 (13:20 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 24 Mar 2018 12:20:30 +0000 (13:20 +0100)
26 files changed:
dll/win32/wldap32/CMakeLists.txt
dll/win32/wldap32/add.c
dll/win32/wldap32/ber.c
dll/win32/wldap32/bind.c
dll/win32/wldap32/compare.c
dll/win32/wldap32/control.c
dll/win32/wldap32/delete.c
dll/win32/wldap32/dn.c
dll/win32/wldap32/error.c
dll/win32/wldap32/extended.c
dll/win32/wldap32/init.c
dll/win32/wldap32/main.c
dll/win32/wldap32/misc.c
dll/win32/wldap32/modify.c
dll/win32/wldap32/modrdn.c
dll/win32/wldap32/option.c
dll/win32/wldap32/page.c
dll/win32/wldap32/parse.c
dll/win32/wldap32/precomp.h [new file with mode: 0644]
dll/win32/wldap32/rename.c
dll/win32/wldap32/search.c
dll/win32/wldap32/value.c
dll/win32/wldap32/winldap_private.h
dll/win32/wldap32/wldap32.h
dll/win32/wldap32/wldap32.rc
media/doc/README.WINE

index 0b7ef75..2f13750 100644 (file)
@@ -23,7 +23,7 @@ list(APPEND SOURCE
     rename.c
     search.c
     value.c
-    winldap_private.h
+    precomp.h
     ${CMAKE_CURRENT_BINARY_DIR}/wldap32_stubs.c)
 
 add_library(wldap32 SHARED
@@ -35,5 +35,5 @@ add_library(wldap32 SHARED
 set_module_type(wldap32 win32dll)
 target_link_libraries(wldap32 wine)
 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)
index 34bc186..0a24d95 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 #ifdef HAVE_LDAP
 static LDAPMod *nullattrs[] = { NULL };
index 6687fe1..c2c6f26 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <config.h>
+#include "config.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);
 
 #ifndef LBER_ERROR
index 057661b..0e9404e 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_bindA     (WLDAP32.@)
index c7df577..7cadc2a 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_compareA     (WLDAP32.@)
index dfe7986..c661f5e 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(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 )
 {
-    dst->bv_val = HeapAlloc( GetProcessHeap(), 0, src->bv_len );
-    if (dst->bv_val)
+    if ((dst->bv_val = heap_alloc( src->bv_len )))
     {
         memcpy( dst->bv_val, src->bv_val, src->bv_len );
         dst->bv_len = src->bv_len;
index 2665455..47e1cb4 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_deleteA     (WLDAP32.@)
index 49b766d..fbe1a0c 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_dn2ufnA     (WLDAP32.@)
index 39b0a64..2e09e9e 100644 (file)
  * 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 "winuser.h"
+#include "winnls.h"
+
 #include "winldap_private.h"
+#include "wldap32.h"
+#include "wine/debug.h"
 
-#include <winuser.h>
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 ULONG map_error( int error )
 {
index 839d171..b05c3c5 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_close_extended_op     (WLDAP32.@)
index 7b3e467..fdb7908 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
 
 #ifdef HAVE_LDAP
 /* Should eventually be determined by the algorithm documented on MSDN. */
@@ -47,10 +62,9 @@ static char **split_hostnames( const char *hostnames )
         p++;
     }
 
-    res = HeapAlloc( GetProcessHeap(), 0, (i + 1) * sizeof(char *) );
-    if (!res)
+    if (!(res = heap_alloc( (i + 1) * sizeof(char *) )))
     {
-        HeapFree( GetProcessHeap(), 0, str );
+        heap_free( str );
         return NULL;
     }
 
@@ -59,7 +73,7 @@ static char **split_hostnames( const char *hostnames )
 
     q = p;
     i = 0;
-    
+
     while (*p)
     {
         if (p[1] != '\0')
@@ -70,7 +84,7 @@ static char **split_hostnames( const char *hostnames )
                 res[i] = strdupU( q );
                 if (!res[i]) goto oom;
                 i++;
-            
+
                 while (isspace( *p )) p++;
                 q = p;
             }
@@ -85,14 +99,14 @@ static char **split_hostnames( const char *hostnames )
     }
     res[i] = NULL;
 
-    HeapFree( GetProcessHeap(), 0, str );
+    heap_free( str );
     return res;
 
 oom:
     while (i > 0) strfreeU( res[--i] );
 
-    HeapFree( GetProcessHeap(), 0, res );
-    HeapFree( GetProcessHeap(), 0, str );
+    heap_free( res );
+    heap_free( str );
 
     return NULL;
 }
@@ -139,9 +153,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum
     }
 
     size += (i - 1) * strlen( sep );
-    res = HeapAlloc( GetProcessHeap(), 0, size + 1 );
-    if (!res) return NULL;
+    if (!(res = heap_alloc( size + 1 ))) return NULL;
 
     p = res;
     for (v = hostnames; *v; v++)
@@ -189,6 +201,8 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port )
 }
 #endif
 
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
+
 #ifdef HAVE_LDAP
 static LDAP *create_context( const char *url )
 {
index ccd2a9b..ce9e603 100644 (file)
  * 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;
 
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
+
 BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
 {
     TRACE( "(%p, %d, %p)\n", hinst, reason, reserved );
index fb998b7..9c421f9 100644 (file)
  * 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>
+#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.@)
index 060ce59..292fa83 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 #ifdef HAVE_LDAP
 static LDAPMod *nullmods[] = { NULL };
index 5daebd2..3e2c867 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_modrdnA     (WLDAP32.@)
index 65caa75..ddc5ca4 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_get_optionA     (WLDAP32.@)
index fe92f8f..7cf7d93 100644 (file)
  * 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
 #define LDAP_MAXINT  2147483647
 #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.@)
  *
@@ -84,17 +99,15 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
         return WLDAP32_LDAP_NO_MEMORY;
 
     /* copy the berval so it can be properly freed by the caller */
-    val = HeapAlloc( GetProcessHeap(), 0, berval->bv_len );
-    if (!val) return WLDAP32_LDAP_NO_MEMORY;
+    if (!(val = heap_alloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY;
 
     len = berval->bv_len;
     memcpy( val, berval->bv_val, len );
     ber_bvfree( berval );
 
-    ctrl = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) );
-    if (!ctrl)
+    if (!(ctrl = heap_alloc( sizeof(LDAPControlW) )))
     {
-        HeapFree( GetProcessHeap(), 0, val );
+        heap_free( val );
         return WLDAP32_LDAP_NO_MEMORY;
     }
 
index 4594b2a..62ffdba 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_parse_extended_resultA     (WLDAP32.@)
diff --git a/dll/win32/wldap32/precomp.h b/dll/win32/wldap32/precomp.h
new file mode 100644 (file)
index 0000000..5729a39
--- /dev/null
@@ -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_ */
index cb25373..2de5081 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_rename_extA     (WLDAP32.@)
index 7680ac7..7e774f6 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_searchA     (WLDAP32.@)
index 0a8a23e..bcfa9a2 100644 (file)
  * 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 "wldap32.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 
 /***********************************************************************
  *      ldap_count_values_len     (WLDAP32.@)
@@ -140,8 +156,7 @@ static char *bv2str( struct berval *bv )
     char *str = NULL;
     unsigned int len = bv->bv_len;
 
-    str = HeapAlloc( GetProcessHeap(), 0, len + 1 );
-    if (str)
+    if ((str = heap_alloc( len + 1 )))
     {
         memcpy( str, bv->bv_val, len );
         str[len] = '\0';
@@ -160,8 +175,7 @@ static char **bv2str_array( struct berval **bv )
         len++;
         p++;
     }
-    str = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(char *) );
-    if (!str) return NULL;
+    if (!(str = heap_alloc( (len + 1) * sizeof(char *) ))) return NULL;
 
     p = bv;
     while (*p)
@@ -169,8 +183,8 @@ static char **bv2str_array( struct berval **bv )
         str[i] = bv2str( *p );
         if (!str[i])
         {
-            while (i > 0) HeapFree( GetProcessHeap(), 0, str[--i] );
-            HeapFree( GetProcessHeap(), 0, str );
+            while (i > 0) heap_free( str[--i] );
+            heap_free( str );
             return NULL;
         } 
         i++;
index 2da5611..c0039eb 100644 (file)
  * native headers.
  */
 
-#ifndef _WINLDAP_PRIVATE_H_
-#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"
+#pragma once
 
 typedef enum {
     WLDAP32_LDAP_SUCCESS                 =   0x00,
@@ -480,5 +458,3 @@ ULONG CDECL LdapGetLastError(void);
 ULONG CDECL LdapMapErrorToWin32(ULONG);
 int CDECL LdapUnicodeToUTF8(LPCWSTR,int,LPSTR,int);
 int CDECL LdapUTF8ToUnicode(LPCSTR,int,LPWSTR,int);
-
-#endif /* _WINLDAP_PRIVATE_H_ */
index 5a58fe8..4b80b83 100644 (file)
@@ -20,7 +20,8 @@
 
 #pragma once
 
-#include <wine/unicode.h>
+#include "wine/heap.h"
+#include "wine/unicode.h"
 
 extern HINSTANCE hwldap32 DECLSPEC_HIDDEN;
 
@@ -33,22 +34,16 @@ ULONG map_error( int ) DECLSPEC_HIDDEN;
 static inline char *strdupU( const char *src )
 {
     char *dst;
-
     if (!src) return NULL;
-    dst = HeapAlloc( GetProcessHeap(), 0, (strlen( src ) + 1) * sizeof(char) );
-    if (dst)
-        strcpy( dst, src );
+    if ((dst = heap_alloc( (strlen( src ) + 1) * sizeof(char) ))) strcpy( dst, src );
     return dst;
 }
 
 static inline WCHAR *strdupW( const WCHAR *src )
 {
     WCHAR *dst;
-
     if (!src) return NULL;
-    dst = HeapAlloc( GetProcessHeap(), 0, (strlenW( src ) + 1) * sizeof(WCHAR) );
-    if (dst)
-        strcpyW( dst, src );
+    if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src );
     return dst;
 }
 
@@ -58,7 +53,7 @@ static inline LPWSTR strAtoW( LPCSTR str )
     if (str)
     {
         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 );
     }
     return ret;
@@ -70,7 +65,7 @@ static inline LPSTR strWtoA( LPCWSTR str )
     if (str)
     {
         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 );
     }
     return ret;
@@ -82,7 +77,7 @@ static inline char *strWtoU( LPCWSTR str )
     if (str)
     {
         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 );
     }
     return ret;
@@ -94,7 +89,7 @@ static inline LPWSTR strUtoW( char *str )
     if (str)
     {
         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 );
     }
     return ret;
@@ -102,17 +97,17 @@ static inline LPWSTR strUtoW( char *str )
 
 static inline void strfreeA( LPSTR str )
 {
-    HeapFree( GetProcessHeap(), 0, str );
+    heap_free( str );
 }
 
 static inline void strfreeW( LPWSTR str )
 {
-    HeapFree( GetProcessHeap(), 0, str );
+    heap_free( str );
 }
 
 static inline void strfreeU( char *str )
 {
-    HeapFree( GetProcessHeap(), 0, str );
+    heap_free( str );
 }
 
 static inline DWORD strarraylenA( LPSTR *strarray )
@@ -144,9 +139,7 @@ static inline LPWSTR *strarrayAtoW( LPSTR *strarray )
     if (strarray)
     {
         size  = sizeof(WCHAR*) * (strarraylenA( strarray ) + 1);
-        strarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (strarrayW)
+        if ((strarrayW = heap_alloc( size )))
         {
             LPSTR *p = strarray;
             LPWSTR *q = strarrayW;
@@ -166,9 +159,7 @@ static inline LPSTR *strarrayWtoA( LPWSTR *strarray )
     if (strarray)
     {
         size = sizeof(LPSTR) * (strarraylenW( strarray ) + 1);
-        strarrayA = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (strarrayA)
+        if ((strarrayA = heap_alloc( size )))
         {
             LPWSTR *p = strarray;
             LPSTR *q = strarrayA;
@@ -188,9 +179,7 @@ static inline char **strarrayWtoU( LPWSTR *strarray )
     if (strarray)
     {
         size = sizeof(char*) * (strarraylenW( strarray ) + 1);
-        strarrayU = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (strarrayU)
+        if ((strarrayU = heap_alloc( size )))
         {
             LPWSTR *p = strarray;
             char **q = strarrayU;
@@ -210,9 +199,7 @@ static inline LPWSTR *strarrayUtoW( char **strarray )
     if (strarray)
     {
         size = sizeof(WCHAR*) * (strarraylenU( strarray ) + 1);
-        strarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (strarrayW)
+        if ((strarrayW = heap_alloc( size )))
         {
             char **p = strarray;
             LPWSTR *q = strarrayW;
@@ -230,7 +217,7 @@ static inline void strarrayfreeA( LPSTR *strarray )
     {
         LPSTR *p = strarray;
         while (*p) strfreeA( *p++ );
-        HeapFree( GetProcessHeap(), 0, strarray );
+        heap_free( strarray );
     }
 }
 
@@ -240,7 +227,7 @@ static inline void strarrayfreeW( LPWSTR *strarray )
     {
         LPWSTR *p = strarray;
         while (*p) strfreeW( *p++ );
-        HeapFree( GetProcessHeap(), 0, strarray );
+        heap_free( strarray );
     }
 }
 
@@ -250,7 +237,7 @@ static inline void strarrayfreeU( char **strarray )
     {
         char **p = strarray;
         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;
     DWORD size = sizeof(struct berval) + bv->bv_len;
 
-    berval = HeapAlloc( GetProcessHeap(), 0, size );
-    if (berval)
+    if ((berval = heap_alloc( size )))
     {
         char *val = (char *)berval + sizeof(struct berval);
 
@@ -288,9 +274,7 @@ static inline struct berval **bvarraydup( struct berval **bv )
     if (bv)
     {
         size = sizeof(struct berval *) * (bvarraylen( bv ) + 1);
-        berval = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (berval)
+        if ((berval = heap_alloc( size )))
         {
             struct berval **p = bv;
             struct berval **q = berval;
@@ -305,16 +289,15 @@ static inline struct berval **bvarraydup( struct berval **bv )
 static inline void bvarrayfree( struct berval **bv )
 {
     struct berval **p = bv;
-    while (*p) HeapFree( GetProcessHeap(), 0, *p++ );
-    HeapFree( GetProcessHeap(), 0, bv );
+    while (*p) heap_free( *p++ );
+    heap_free( bv );
 }
 
 static inline LDAPModW *modAtoW( LDAPModA *mod )
 {
     LDAPModW *modW;
 
-    modW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPModW) );
-    if (modW)
+    if ((modW = heap_alloc( sizeof(LDAPModW) )))
     {
         modW->mod_op = mod->mod_op;
         modW->mod_type = strAtoW( mod->mod_type );
@@ -331,8 +314,7 @@ static inline LDAPMod *modWtoU( LDAPModW *mod )
 {
     LDAPMod *modU;
 
-    modU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPMod) );
-    if (modU)
+    if ((modU = heap_alloc( sizeof(LDAPMod) )))
     {
         modU->mod_op = mod->mod_op;
         modU->mod_type = strWtoU( mod->mod_type );
@@ -351,7 +333,7 @@ static inline void modfreeW( LDAPModW *mod )
         bvarrayfree( mod->mod_vals.modv_bvals );
     else
         strarrayfreeW( mod->mod_vals.modv_strvals );
-    HeapFree( GetProcessHeap(), 0, mod );
+    heap_free( mod );
 }
 
 static inline void modfreeU( LDAPMod *mod )
@@ -360,7 +342,7 @@ static inline void modfreeU( LDAPMod *mod )
         bvarrayfree( mod->mod_vals.modv_bvals );
     else
         strarrayfreeU( mod->mod_vals.modv_strvals );
-    HeapFree( GetProcessHeap(), 0, mod );
+    heap_free( mod );
 }
 
 static inline DWORD modarraylenA( LDAPModA **modarray )
@@ -385,9 +367,7 @@ static inline LDAPModW **modarrayAtoW( LDAPModA **modarray )
     if (modarray)
     {
         size = sizeof(LDAPModW*) * (modarraylenA( modarray ) + 1);
-        modarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (modarrayW)
+        if ((modarrayW = heap_alloc( size )))
         {
             LDAPModA **p = modarray;
             LDAPModW **q = modarrayW;
@@ -407,9 +387,7 @@ static inline LDAPMod **modarrayWtoU( LDAPModW **modarray )
     if (modarray)
     {
         size = sizeof(LDAPMod*) * (modarraylenW( modarray ) + 1);
-        modarrayU = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (modarrayU)
+        if ((modarrayU = heap_alloc( size )))
         {
             LDAPModW **p = modarray;
             LDAPMod **q = modarrayU;
@@ -427,7 +405,7 @@ static inline void modarrayfreeW( LDAPModW **modarray )
     {
         LDAPModW **p = modarray;
         while (*p) modfreeW( *p++ );
-        HeapFree( GetProcessHeap(), 0, modarray );
+        heap_free( modarray );
     }
 }
 
@@ -437,7 +415,7 @@ static inline void modarrayfreeU( LDAPMod **modarray )
     {
         LDAPMod **p = modarray;
         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)
     {
-        val = HeapAlloc( GetProcessHeap(), 0, len );
-        if (!val) return NULL;
+        if (!(val = heap_alloc( len ))) return NULL;
         memcpy( val, control->ldctl_value.bv_val, len );
     }
 
-    controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) );
-    if (!controlW)
+    if (!(controlW = heap_alloc( sizeof(LDAPControlW) )))
     {
-        HeapFree( GetProcessHeap(), 0, val );
+        heap_free( val );
         return NULL;
     }
 
@@ -477,15 +453,13 @@ static inline LDAPControlA *controlWtoA( LDAPControlW *control )
 
     if (control->ldctl_value.bv_val)
     {
-        val = HeapAlloc( GetProcessHeap(), 0, len );
-        if (!val) return NULL;
+        if (!(val = heap_alloc( len ))) return NULL;
         memcpy( val, control->ldctl_value.bv_val, len );
     }
 
-    controlA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlA) );
-    if (!controlA)
+    if (!(controlA = heap_alloc( sizeof(LDAPControlA) )))
     {
-        HeapFree( GetProcessHeap(), 0, val );
+        heap_free( val );
         return NULL;
     }
 
@@ -505,15 +479,13 @@ static inline LDAPControl *controlWtoU( LDAPControlW *control )
 
     if (control->ldctl_value.bv_val)
     {
-        val = HeapAlloc( GetProcessHeap(), 0, len );
-        if (!val) return NULL;
+        if (!(val = heap_alloc( len ))) return NULL;
         memcpy( val, control->ldctl_value.bv_val, len );
     }
 
-    controlU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControl) );
-    if (!controlU)
+    if (!(controlU = heap_alloc( sizeof(LDAPControl) )))
     {
-        HeapFree( GetProcessHeap(), 0, val );
+        heap_free( val );
         return NULL;
     }
 
@@ -533,15 +505,13 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control )
 
     if (control->ldctl_value.bv_val)
     {
-        val = HeapAlloc( GetProcessHeap(), 0, len );
-        if (!val) return NULL;
+        if (!(val = heap_alloc( len ))) return NULL;
         memcpy( val, control->ldctl_value.bv_val, len );
     }
 
-    controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) );
-    if (!controlW)
+    if (!(controlW = heap_alloc( sizeof(LDAPControlW) )))
     {
-        HeapFree( GetProcessHeap(), 0, val );
+        heap_free( val );
         return NULL;
     }
 
@@ -549,7 +519,7 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control )
     controlW->ldctl_value.bv_len = len; 
     controlW->ldctl_value.bv_val = val; 
     controlW->ldctl_iscritical = control->ldctl_iscritical;
+
     return controlW;
 }
 
@@ -558,8 +528,8 @@ static inline void controlfreeA( LDAPControlA *control )
     if (control)
     {
         strfreeA( control->ldctl_oid );
-        HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val );
-        HeapFree( GetProcessHeap(), 0, control );
+        heap_free( control->ldctl_value.bv_val );
+        heap_free( control );
     }
 }
 
@@ -568,8 +538,8 @@ static inline void controlfreeW( LDAPControlW *control )
     if (control)
     {
         strfreeW( control->ldctl_oid );
-        HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val );
-        HeapFree( GetProcessHeap(), 0, control );
+        heap_free( control->ldctl_value.bv_val );
+        heap_free( control );
     }
 }
 
@@ -578,8 +548,8 @@ static inline void controlfreeU( LDAPControl *control )
     if (control)
     {
         strfreeU( control->ldctl_oid );
-        HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val );
-        HeapFree( GetProcessHeap(), 0, control );
+        heap_free( control->ldctl_value.bv_val );
+        heap_free( control );
     }
 }
 
@@ -612,9 +582,7 @@ static inline LDAPControlW **controlarrayAtoW( LDAPControlA **controlarray )
     if (controlarray)
     {
         size = sizeof(LDAPControlW*) * (controlarraylenA( controlarray ) + 1);
-        controlarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (controlarrayW)
+        if ((controlarrayW = heap_alloc( size )))
         {
             LDAPControlA **p = controlarray;
             LDAPControlW **q = controlarrayW;
@@ -634,9 +602,7 @@ static inline LDAPControlA **controlarrayWtoA( LDAPControlW **controlarray )
     if (controlarray)
     {
         size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1);
-        controlarrayA = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (controlarrayA)
+        if ((controlarrayA = heap_alloc( size )))
         {
             LDAPControlW **p = controlarray;
             LDAPControlA **q = controlarrayA;
@@ -656,9 +622,7 @@ static inline LDAPControl **controlarrayWtoU( LDAPControlW **controlarray )
     if (controlarray)
     {
         size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1);
-        controlarrayU = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (controlarrayU)
+        if ((controlarrayU = heap_alloc( size )))
         {
             LDAPControlW **p = controlarray;
             LDAPControl **q = controlarrayU;
@@ -678,9 +642,7 @@ static inline LDAPControlW **controlarrayUtoW( LDAPControl **controlarray )
     if (controlarray)
     {
         size = sizeof(LDAPControlW*) * (controlarraylenU( controlarray ) + 1);
-        controlarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (controlarrayW)
+        if ((controlarrayW = heap_alloc( size )))
         {
             LDAPControl **p = controlarray;
             LDAPControlW **q = controlarrayW;
@@ -698,7 +660,7 @@ static inline void controlarrayfreeA( LDAPControlA **controlarray )
     {
         LDAPControlA **p = controlarray;
         while (*p) controlfreeA( *p++ );
-        HeapFree( GetProcessHeap(), 0, controlarray );
+        heap_free( controlarray );
     }
 }
 
@@ -708,7 +670,7 @@ static inline void controlarrayfreeW( LDAPControlW **controlarray )
     {
         LDAPControlW **p = controlarray;
         while (*p) controlfreeW( *p++ );
-        HeapFree( GetProcessHeap(), 0, controlarray );
+        heap_free( controlarray );
     }
 }
 
@@ -718,7 +680,7 @@ static inline void controlarrayfreeU( LDAPControl **controlarray )
     {
         LDAPControl **p = controlarray;
         while (*p) controlfreeU( *p++ );
-        HeapFree( GetProcessHeap(), 0, controlarray );
+        heap_free( controlarray );
     }
 }
 
@@ -726,8 +688,7 @@ static inline LDAPSortKeyW *sortkeyAtoW( LDAPSortKeyA *sortkey )
 {
     LDAPSortKeyW *sortkeyW;
 
-    sortkeyW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyW) );
-    if (sortkeyW)
+    if ((sortkeyW = heap_alloc( sizeof(LDAPSortKeyW) )))
     {
         sortkeyW->sk_attrtype = strAtoW( sortkey->sk_attrtype );
         sortkeyW->sk_matchruleoid = strAtoW( sortkey->sk_matchruleoid );
@@ -740,8 +701,7 @@ static inline LDAPSortKeyA *sortkeyWtoA( LDAPSortKeyW *sortkey )
 {
     LDAPSortKeyA *sortkeyA;
 
-    sortkeyA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyA) );
-    if (sortkeyA)
+    if ((sortkeyA = heap_alloc( sizeof(LDAPSortKeyA) )))
     {
         sortkeyA->sk_attrtype = strWtoA( sortkey->sk_attrtype );
         sortkeyA->sk_matchruleoid = strWtoA( sortkey->sk_matchruleoid );
@@ -754,8 +714,7 @@ static inline LDAPSortKey *sortkeyWtoU( LDAPSortKeyW *sortkey )
 {
     LDAPSortKey *sortkeyU;
 
-    sortkeyU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKey) );
-    if (sortkeyU)
+    if ((sortkeyU = heap_alloc( sizeof(LDAPSortKey) )))
     {
         sortkeyU->attributeType = strWtoU( sortkey->sk_attrtype );
         sortkeyU->orderingRule = strWtoU( sortkey->sk_matchruleoid );
@@ -770,7 +729,7 @@ static inline void sortkeyfreeA( LDAPSortKeyA *sortkey )
     {
         strfreeA( sortkey->sk_attrtype );
         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_matchruleoid );
-        HeapFree( GetProcessHeap(), 0, sortkey );
+        heap_free( sortkey );
     }
 }
 
@@ -790,7 +749,7 @@ static inline void sortkeyfreeU( LDAPSortKey *sortkey )
     {
         strfreeU( sortkey->attributeType );
         strfreeU( sortkey->orderingRule );
-        HeapFree( GetProcessHeap(), 0, sortkey );
+        heap_free( sortkey );
     }
 }
 
@@ -816,9 +775,7 @@ static inline LDAPSortKeyW **sortkeyarrayAtoW( LDAPSortKeyA **sortkeyarray )
     if (sortkeyarray)
     {
         size = sizeof(LDAPSortKeyW*) * (sortkeyarraylenA( sortkeyarray ) + 1);
-        sortkeyarrayW = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (sortkeyarrayW)
+        if ((sortkeyarrayW = heap_alloc( size )))
         {
             LDAPSortKeyA **p = sortkeyarray;
             LDAPSortKeyW **q = sortkeyarrayW;
@@ -838,9 +795,7 @@ static inline LDAPSortKey **sortkeyarrayWtoU( LDAPSortKeyW **sortkeyarray )
     if (sortkeyarray)
     {
         size = sizeof(LDAPSortKey*) * (sortkeyarraylenW( sortkeyarray ) + 1);
-        sortkeyarrayU = HeapAlloc( GetProcessHeap(), 0, size );
-
-        if (sortkeyarrayU)
+        if ((sortkeyarrayU = heap_alloc( size )))
         {
             LDAPSortKeyW **p = sortkeyarray;
             LDAPSortKey **q = sortkeyarrayU;
@@ -858,7 +813,7 @@ static inline void sortkeyarrayfreeW( LDAPSortKeyW **sortkeyarray )
     {
         LDAPSortKeyW **p = sortkeyarray;
         while (*p) sortkeyfreeW( *p++ );
-        HeapFree( GetProcessHeap(), 0, sortkeyarray );
+        heap_free( sortkeyarray );
     }
 }
 
@@ -868,7 +823,7 @@ static inline void sortkeyarrayfreeU( LDAPSortKey **sortkeyarray )
     {
         LDAPSortKey **p = sortkeyarray;
         while (*p) sortkeyfreeU( *p++ );
-        HeapFree( GetProcessHeap(), 0, sortkeyarray );
+        heap_free( sortkeyarray );
     }
 }
 #endif /* HAVE_LDAP */
index a9c00c0..1af4e82 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <windef.h>
+#include "windef.h"
 
 /* UTF-8 */
 #pragma code_page(65001)
index b66f8a0..81a0f38 100644 (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/winscard            # 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/wmiutils            # Synced to WineStaging-2.9
 reactos/dll/win32/wmvcore             # Synced to Wine-3.0