winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
920 discussions
Start a n
N
ew thread
Alex Henrie : wldap32: Implement setting LDAP_OPT_CLIENT_CERTIFICATE.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 16e4b086f2bbdd6a251ba022a251facbb981a41a URL:
https://gitlab.winehq.org/wine/wine/-/commit/16e4b086f2bbdd6a251ba022a251fa…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Sep 1 20:13:35 2023 -0600 wldap32: Implement setting LDAP_OPT_CLIENT_CERTIFICATE. Since most LDAP servers do not require mTLS, for now the callback function is saved but not called. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55507
--- dlls/wldap32/init.c | 4 ++++ dlls/wldap32/option.c | 7 +++++-- dlls/wldap32/winldap_private.h | 4 ++++ include/winldap.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index 47063122b04..44fc44ee485 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -250,6 +250,7 @@ exit: */ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) { + QUERYCLIENTCERT *client_cert_callback = CLIENT_CERT_CALLBACK(ld); VERIFYSERVERCERT *server_cert_callback = SERVER_CERT_CALLBACK(ld); int ret; @@ -258,6 +259,9 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (CONNECTED(ld)) return WLDAP32_LDAP_SUCCESS; + if (client_cert_callback) + FIXME( "mTLS is not implemented\n" ); + if (timeout && (timeout->tv_sec || timeout->tv_usec)) FIXME( "ignoring timeout\n" ); if ((ret = ldap_connect( CTX(ld) ))) return map_error( ret ); diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c index 41dfe5fd9cd..00c08e0108c 100644 --- a/dlls/wldap32/option.c +++ b/dlls/wldap32/option.c @@ -341,6 +341,7 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) return ret; } case WLDAP32_LDAP_OPT_AUTO_RECONNECT: + case WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE: case WLDAP32_LDAP_OPT_DEREF: case WLDAP32_LDAP_OPT_DESC: case WLDAP32_LDAP_OPT_ENCRYPT: @@ -384,7 +385,6 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) return WLDAP32_LDAP_UNWILLING_TO_PERFORM; case WLDAP32_LDAP_OPT_AREC_EXCLUSIVE: - case WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE: case WLDAP32_LDAP_OPT_DNSDOMAIN_NAME: case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: @@ -541,6 +541,10 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) return map_error( ldap_set_option( CTX(ld), LDAP_OPT_RESTART, value ) ); } + case WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE: + CLIENT_CERT_CALLBACK(ld) = value; + return WLDAP32_LDAP_SUCCESS; + case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: return map_error( ldap_set_option( CTX(ld), LDAP_OPT_REFHOPLIMIT, value ) ); @@ -620,7 +624,6 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) return WLDAP32_LDAP_SUCCESS; /* fall through */ case WLDAP32_LDAP_OPT_AREC_EXCLUSIVE: - case WLDAP32_LDAP_OPT_CLIENT_CERTIFICATE: case WLDAP32_LDAP_OPT_DNSDOMAIN_NAME: case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h index 3393c031007..d75ba425774 100644 --- a/dlls/wldap32/winldap_private.h +++ b/dlls/wldap32/winldap_private.h @@ -23,6 +23,7 @@ #include "winternl.h" #include "wincrypt.h" #include "winnls.h" +#include "schannel.h" #define LDAP_NEEDS_PROTOTYPES #include <lber.h> @@ -222,12 +223,14 @@ typedef struct ldap ULONG ld_options; } LDAP, *PLDAP; +typedef BOOLEAN (CDECL QUERYCLIENTCERT)(LDAP *, SecPkgContext_IssuerListInfoEx *, const CERT_CONTEXT **); typedef BOOLEAN (CDECL VERIFYSERVERCERT)(LDAP *, const CERT_CONTEXT **); struct private_data { LDAP *ctx; struct berval **server_ctrls; + QUERYCLIENTCERT *client_cert_callback; VERIFYSERVERCERT *server_cert_callback; BOOL connected; }; @@ -235,6 +238,7 @@ C_ASSERT(sizeof(struct private_data) < FIELD_OFFSET(struct ld_sb, sb_naddr) - FI #define CTX(ld) (((struct private_data *)ld->ld_sb.Reserved1)->ctx) #define SERVER_CTRLS(ld) (((struct private_data *)ld->ld_sb.Reserved1)->server_ctrls) +#define CLIENT_CERT_CALLBACK(ld) (((struct private_data *)ld->ld_sb.Reserved1)->client_cert_callback) #define SERVER_CERT_CALLBACK(ld) (((struct private_data *)ld->ld_sb.Reserved1)->server_cert_callback) #define CONNECTED(ld) (((struct private_data *)ld->ld_sb.Reserved1)->connected) diff --git a/include/winldap.h b/include/winldap.h index 9e91d0e653a..4f2543a05aa 100644 --- a/include/winldap.h +++ b/include/winldap.h @@ -391,6 +391,7 @@ typedef struct ldap_apifeature_infoW DECL_WINELIB_TYPE_AW(LDAPAPIFeatureInfo) +typedef BOOLEAN (CDECL QUERYCLIENTCERT)(LDAP*,SecPkgContext_IssuerListInfoEx*,const CERT_CONTEXT**); typedef BOOLEAN (CDECL VERIFYSERVERCERT)(LDAP*,const CERT_CONTEXT**);
1
0
0
0
Alex Henrie : wldap32: Rename cert_callback to server_cert_callback.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: ca249a915d6a47b966063befdb10dd4d5ab4ecf5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ca249a915d6a47b966063befdb10dd…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Sep 1 19:40:26 2023 -0600 wldap32: Rename cert_callback to server_cert_callback. --- dlls/wldap32/init.c | 6 +++--- dlls/wldap32/option.c | 2 +- dlls/wldap32/winldap_private.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index c5b11a4de28..47063122b04 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -250,7 +250,7 @@ exit: */ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) { - VERIFYSERVERCERT *cert_callback = CERT_CALLBACK(ld); + VERIFYSERVERCERT *server_cert_callback = SERVER_CERT_CALLBACK(ld); int ret; TRACE( "(%p, %p)\n", ld, timeout ); @@ -261,7 +261,7 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) if (timeout && (timeout->tv_sec || timeout->tv_usec)) FIXME( "ignoring timeout\n" ); if ((ret = ldap_connect( CTX(ld) ))) return map_error( ret ); - if (cert_callback) + if (server_cert_callback) { CtxtHandle *tls_context; const CERT_CONTEXT *cert; @@ -271,7 +271,7 @@ ULONG CDECL WLDAP32_ldap_connect( LDAP *ld, struct l_timeval *timeout ) if (QueryContextAttributesA( tls_context, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &cert ) == SEC_E_OK) { - if (cert_callback( ld, &cert )) + if (server_cert_callback( ld, &cert )) { TRACE( "accepted\n" ); } diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c index 1d6f692b7fa..41dfe5fd9cd 100644 --- a/dlls/wldap32/option.c +++ b/dlls/wldap32/option.c @@ -545,7 +545,7 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) return map_error( ldap_set_option( CTX(ld), LDAP_OPT_REFHOPLIMIT, value ) ); case WLDAP32_LDAP_OPT_SERVER_CERTIFICATE: - CERT_CALLBACK(ld) = value; + SERVER_CERT_CALLBACK(ld) = value; return WLDAP32_LDAP_SUCCESS; case WLDAP32_LDAP_OPT_DEREF: diff --git a/dlls/wldap32/winldap_private.h b/dlls/wldap32/winldap_private.h index ce9a7cc3fa8..3393c031007 100644 --- a/dlls/wldap32/winldap_private.h +++ b/dlls/wldap32/winldap_private.h @@ -228,14 +228,14 @@ struct private_data { LDAP *ctx; struct berval **server_ctrls; - VERIFYSERVERCERT *cert_callback; + VERIFYSERVERCERT *server_cert_callback; BOOL connected; }; C_ASSERT(sizeof(struct private_data) < FIELD_OFFSET(struct ld_sb, sb_naddr) - FIELD_OFFSET(struct ld_sb, Reserved1)); #define CTX(ld) (((struct private_data *)ld->ld_sb.Reserved1)->ctx) #define SERVER_CTRLS(ld) (((struct private_data *)ld->ld_sb.Reserved1)->server_ctrls) -#define CERT_CALLBACK(ld) (((struct private_data *)ld->ld_sb.Reserved1)->cert_callback) +#define SERVER_CERT_CALLBACK(ld) (((struct private_data *)ld->ld_sb.Reserved1)->server_cert_callback) #define CONNECTED(ld) (((struct private_data *)ld->ld_sb.Reserved1)->connected) #define MSG(entry) (entry->Request)
1
0
0
0
Dmitry Timoshkov : wldap32: Add support for ldap_set_option(LDAP_OPT_HOST_NAME).
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 2e5a8595ed81a810f6304ecf248e492a1139e183 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2e5a8595ed81a810f6304ecf248e49…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Jul 21 16:27:51 2023 +0300 wldap32: Add support for ldap_set_option(LDAP_OPT_HOST_NAME). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/wldap32/option.c | 66 +++++++++++++++++++++++++++++++++++++++++++--- dlls/wldap32/tests/parse.c | 28 ++++++++++++++++++++ 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c index cc416389276..1d6f692b7fa 100644 --- a/dlls/wldap32/option.c +++ b/dlls/wldap32/option.c @@ -105,6 +105,24 @@ ULONG CDECL ldap_get_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: return ldap_get_optionW( ld, LDAP_OPT_REFHOPLIMIT, value ); + case WLDAP32_LDAP_OPT_HOST_NAME: + { + WCHAR *hostW; + char *host; + + ret = ldap_get_optionW( ld, option, &hostW ); + if (!ret) + { + host = strWtoA( hostW ); + if (!host) + ret = WLDAP32_LDAP_NO_MEMORY; + else + *(char **)value = host; + free( hostW ); + } + return map_error( ret ); + } + case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_STRATEGY: @@ -122,7 +140,6 @@ ULONG CDECL ldap_get_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: case WLDAP32_LDAP_OPT_GETDSNAME_FLAGS: - case WLDAP32_LDAP_OPT_HOST_NAME: case WLDAP32_LDAP_OPT_HOST_REACHABLE: case WLDAP32_LDAP_OPT_PING_KEEP_ALIVE: case WLDAP32_LDAP_OPT_PING_LIMIT: @@ -238,6 +255,24 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_REFERRAL_HOP_LIMIT: return map_error( ldap_get_option( CTX(ld), LDAP_OPT_REFHOPLIMIT, value ) ); + case WLDAP32_LDAP_OPT_HOST_NAME: + { + WCHAR *hostW; + char *host; + + ret = ldap_get_option( CTX(ld), LDAP_OPT_HOST_NAME, &host ); + if (!ret) + { + hostW = strUtoW( host ); + if (!hostW) + ret = WLDAP32_LDAP_NO_MEMORY; + else + *(WCHAR **)value = hostW; + free( host ); + } + return map_error( ret ); + } + case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_STRATEGY: @@ -255,7 +290,6 @@ ULONG CDECL ldap_get_optionW( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: case WLDAP32_LDAP_OPT_GETDSNAME_FLAGS: - case WLDAP32_LDAP_OPT_HOST_NAME: case WLDAP32_LDAP_OPT_HOST_REACHABLE: case WLDAP32_LDAP_OPT_PING_KEEP_ALIVE: case WLDAP32_LDAP_OPT_PING_LIMIT: @@ -322,6 +356,19 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_TIMELIMIT: return ldap_set_optionW( ld, option, value ); + case WLDAP32_LDAP_OPT_HOST_NAME: + { + char **host = value; + WCHAR *hostW; + + hostW = strAtoW( *host ); + if (!hostW) return WLDAP32_LDAP_NO_MEMORY; + + ret = ldap_set_optionW( ld, option, &hostW ); + free( hostW ); + return map_error( ret ); + } + case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_STRATEGY: @@ -342,7 +389,6 @@ ULONG CDECL ldap_set_optionA( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: case WLDAP32_LDAP_OPT_GETDSNAME_FLAGS: - case WLDAP32_LDAP_OPT_HOST_NAME: case WLDAP32_LDAP_OPT_HOST_REACHABLE: case WLDAP32_LDAP_OPT_PING_KEEP_ALIVE: case WLDAP32_LDAP_OPT_PING_LIMIT: @@ -540,6 +586,19 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) return ret; } + case WLDAP32_LDAP_OPT_HOST_NAME: + { + WCHAR **hostW = value; + char *host; + + host = strWtoU( *hostW ); + if (!host) return WLDAP32_LDAP_NO_MEMORY; + + ret = ldap_set_option( CTX(ld), LDAP_OPT_HOST_NAME, host ); + free( host ); + return map_error( ret ); + } + case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: case WLDAP32_LDAP_OPT_CACHE_STRATEGY: @@ -566,7 +625,6 @@ ULONG CDECL ldap_set_optionW( LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_ERROR_STRING: case WLDAP32_LDAP_OPT_FAST_CONCURRENT_BIND: case WLDAP32_LDAP_OPT_GETDSNAME_FLAGS: - case WLDAP32_LDAP_OPT_HOST_NAME: case WLDAP32_LDAP_OPT_HOST_REACHABLE: case WLDAP32_LDAP_OPT_PING_KEEP_ALIVE: case WLDAP32_LDAP_OPT_PING_LIMIT: diff --git a/dlls/wldap32/tests/parse.c b/dlls/wldap32/tests/parse.c index 573ab172ebf..726b814081b 100644 --- a/dlls/wldap32/tests/parse.c +++ b/dlls/wldap32/tests/parse.c @@ -632,10 +632,38 @@ static void test_opt_auto_reconnect(void) ok( ret == LDAP_PARAM_ERROR, "ldap_set_optionA should fail, got %#lx\n", ret ); } +static void test_ldap_host_name(void) +{ + LDAP *ld; + char *value; + ULONG ret; + + ld = ldap_initA( NULL, 389 ); + ok(ld != NULL, "ldap_init failed\n"); + + value = (char *)"deadbeef"; + ret = ldap_get_optionA( ld, LDAP_OPT_HOST_NAME, &value ); + ok( !ret, "ldap_get_option error %#lx\n", ret ); + todo_wine + ok( !value, "got %s\n", value ); + + value = (char *)"deadbeef"; + ret = ldap_set_optionA( ld, LDAP_OPT_HOST_NAME, &value ); + ok( !ret, "ldap_set_option error %#lx\n", ret ); + + value = (char *)""; + ret = ldap_get_optionA( ld, LDAP_OPT_HOST_NAME, &value ); + ok( !ret, "ldap_get_option error %#lx\n", ret ); + ok( !strcmp(value, "deadbeef") || !strcmp(value, "deadbeef:389"), "got %s\n", value ); + + ldap_unbind( ld ); +} + START_TEST (parse) { LDAP *ld; + test_ldap_host_name(); test_ldap_paged_search(); test_ldap_server_control(); test_ldap_bind_sA();
1
0
0
0
Rémi Bernon : dmsynth: Use CRT allocation functions.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 6dedfec9c323dafe6d6bab33fee68c12606d6466 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6dedfec9c323dafe6d6bab33fee68c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Aug 29 15:19:11 2023 +0200 dmsynth: Use CRT allocation functions. --- dlls/dmsynth/synth.c | 9 +++------ dlls/dmsynth/synthsink.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 30b7eee6808..00883505377 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -96,7 +96,7 @@ static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface) if (!ref) { if (This->latency_clock) IReferenceClock_Release(This->latency_clock); - HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; @@ -744,11 +744,8 @@ HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) TRACE("(%s, %p)\n", debugstr_guid(riid), ppobj); - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); - if (NULL == obj) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } + *ppobj = NULL; + if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; obj->IDirectMusicSynth8_iface.lpVtbl = &synth_vtbl; obj->IKsControl_iface.lpVtbl = &synth_control_vtbl; obj->ref = 1; diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 73c623585be..fce325681ee 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -92,7 +92,7 @@ static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) IReferenceClock_Release(This->latency_clock); if (This->master_clock) IReferenceClock_Release(This->master_clock); - HeapFree(GetProcessHeap(), 0, This); + free(This); } return ref; @@ -315,10 +315,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) *ret_iface = NULL; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct synth_sink)); - if (!obj) - return E_OUTOFMEMORY; - + if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; obj->IDirectMusicSynthSink_iface.lpVtbl = &synth_sink_vtbl; obj->IKsControl_iface.lpVtbl = &synth_sink_control; obj->ref = 1; @@ -326,7 +323,7 @@ HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) hr = CoCreateInstance(&CLSID_SystemClock, NULL, CLSCTX_INPROC_SERVER, &IID_IReferenceClock, (LPVOID*)&obj->latency_clock); if (FAILED(hr)) { - HeapFree(GetProcessHeap(), 0, obj); + free(obj); return hr; }
1
0
0
0
Rémi Bernon : dmsynth: Get rid of the IDirectMusicSynth8Impl typedef.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 5e29d14789407a49576ad7be296bbd80b3ff773f URL:
https://gitlab.winehq.org/wine/wine/-/commit/5e29d14789407a49576ad7be296bbd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Aug 24 15:30:25 2023 +0200 dmsynth: Get rid of the IDirectMusicSynth8Impl typedef. --- dlls/dmsynth/synth.c | 68 +++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 35 deletions(-)
1
0
0
0
Rémi Bernon : dmsynth: Rename IDirectMusicSynth8Impl method prefix to synth.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 011dd289e66b2d1db121ec6e21d2dfe2275b8840 URL:
https://gitlab.winehq.org/wine/wine/-/commit/011dd289e66b2d1db121ec6e21d2df…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 18 21:51:42 2023 +0200 dmsynth: Rename IDirectMusicSynth8Impl method prefix to synth. --- dlls/dmsynth/synth.c | 146 ++++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 72 deletions(-)
1
0
0
0
Rémi Bernon : dmsynth: Move IDirectMusicSynthImpl struct to where it is used.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 68b356142c67343b6a69f0a22a42edf045c0a46d URL:
https://gitlab.winehq.org/wine/wine/-/commit/68b356142c67343b6a69f0a22a42ed…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 18 21:34:24 2023 +0200 dmsynth: Move IDirectMusicSynthImpl struct to where it is used. --- dlls/dmsynth/dmsynth_private.h | 20 -------------------- dlls/dmsynth/synth.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index b9f160f000d..35c87775cf7 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -40,32 +40,12 @@ #include "dmusics.h" #include "dmksctrl.h" -/***************************************************************************** - * Interfaces - */ -typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; - /***************************************************************************** * ClassFactory */ extern HRESULT DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj); extern HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ppobj); -/***************************************************************************** - * IDirectMusicSynth8Impl implementation structure - */ -struct IDirectMusicSynth8Impl { - IDirectMusicSynth8 IDirectMusicSynth8_iface; - IKsControl IKsControl_iface; - LONG ref; - DMUS_PORTCAPS caps; - DMUS_PORTPARAMS params; - BOOL active; - BOOL open; - IReferenceClock *latency_clock; - IDirectMusicSynthSink *sink; -}; - /***************************************************************************** * Misc. */ diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index bcfc6e0ab37..1855d4d1bc5 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -28,6 +28,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmsynth); +typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; + +struct IDirectMusicSynth8Impl +{ + IDirectMusicSynth8 IDirectMusicSynth8_iface; + IKsControl IKsControl_iface; + LONG ref; + + DMUS_PORTCAPS caps; + DMUS_PORTPARAMS params; + BOOL active; + BOOL open; + IReferenceClock *latency_clock; + IDirectMusicSynthSink *sink; +}; + static inline IDirectMusicSynth8Impl *impl_from_IDirectMusicSynth8(IDirectMusicSynth8 *iface) { return CONTAINING_RECORD(iface, IDirectMusicSynth8Impl, IDirectMusicSynth8_iface);
1
0
0
0
Rémi Bernon : dmsynth: Get rid of the IDirectMusicSynthSinkImpl typedef.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 1f990e59c002180028979e1b0373ddd7a28216fd URL:
https://gitlab.winehq.org/wine/wine/-/commit/1f990e59c002180028979e1b0373dd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Aug 24 15:29:23 2023 +0200 dmsynth: Get rid of the IDirectMusicSynthSinkImpl typedef. --- dlls/dmsynth/synthsink.c | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index 8d6e648d4b5..73c623585be 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -25,9 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmsynth); -typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl; - -struct IDirectMusicSynthSinkImpl +struct synth_sink { IDirectMusicSynthSink IDirectMusicSynthSink_iface; IKsControl IKsControl_iface; @@ -39,15 +37,15 @@ struct IDirectMusicSynthSinkImpl BOOL active; }; -static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) +static inline struct synth_sink *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface); + return CONTAINING_RECORD(iface, struct synth_sink, IDirectMusicSynthSink_iface); } static HRESULT WINAPI synth_sink_QueryInterface(IDirectMusicSynthSink *iface, REFIID riid, void **ret_iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); TRACE("(%p)->(%s, %p)\n", iface, debugstr_dmguid(riid), ret_iface); @@ -74,7 +72,7 @@ static HRESULT WINAPI synth_sink_QueryInterface(IDirectMusicSynthSink *iface, static ULONG WINAPI synth_sink_AddRef(IDirectMusicSynthSink *iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p): new ref = %lu\n", This, ref); @@ -84,7 +82,7 @@ static ULONG WINAPI synth_sink_AddRef(IDirectMusicSynthSink *iface) static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p): new ref = %lu\n", This, ref); @@ -103,7 +101,7 @@ static ULONG WINAPI synth_sink_Release(IDirectMusicSynthSink *iface) static HRESULT WINAPI synth_sink_Init(IDirectMusicSynthSink *iface, IDirectMusicSynth *synth) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); TRACE("(%p)->(%p)\n", This, synth); @@ -117,7 +115,7 @@ static HRESULT WINAPI synth_sink_Init(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SetMasterClock(IDirectMusicSynthSink *iface, IReferenceClock *clock) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); TRACE("(%p)->(%p)\n", This, clock); @@ -135,7 +133,7 @@ static HRESULT WINAPI synth_sink_SetMasterClock(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_GetLatencyClock(IDirectMusicSynthSink *iface, IReferenceClock **clock) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); TRACE("(%p)->(%p)\n", iface, clock); @@ -151,7 +149,7 @@ static HRESULT WINAPI synth_sink_GetLatencyClock(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_Activate(IDirectMusicSynthSink *iface, BOOL enable) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); FIXME("(%p)->(%d): stub\n", This, enable); @@ -161,7 +159,7 @@ static HRESULT WINAPI synth_sink_Activate(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SampleToRefTime(IDirectMusicSynthSink *iface, LONGLONG sample_time, REFERENCE_TIME *ref_time) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); FIXME("(%p)->(0x%s, %p): stub\n", This, wine_dbgstr_longlong(sample_time), ref_time); @@ -171,7 +169,7 @@ static HRESULT WINAPI synth_sink_SampleToRefTime(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_RefTimeToSample(IDirectMusicSynthSink *iface, REFERENCE_TIME ref_time, LONGLONG *sample_time) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); FIXME("(%p)->(0x%s, %p): stub\n", This, wine_dbgstr_longlong(ref_time), sample_time); @@ -181,7 +179,7 @@ static HRESULT WINAPI synth_sink_RefTimeToSample(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_SetDirectSound(IDirectMusicSynthSink *iface, IDirectSound *dsound, IDirectSoundBuffer *dsound_buffer) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); FIXME("(%p)->(%p, %p): stub\n", This, dsound, dsound_buffer); @@ -191,7 +189,7 @@ static HRESULT WINAPI synth_sink_SetDirectSound(IDirectMusicSynthSink *iface, static HRESULT WINAPI synth_sink_GetDesiredBufferSize(IDirectMusicSynthSink *iface, DWORD *size) { - IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + struct synth_sink *This = impl_from_IDirectMusicSynthSink(iface); WAVEFORMATEX format; DWORD fmtsize = sizeof(format); @@ -224,28 +222,28 @@ static const IDirectMusicSynthSinkVtbl synth_sink_vtbl = synth_sink_GetDesiredBufferSize, }; -static inline IDirectMusicSynthSinkImpl *impl_from_IKsControl(IKsControl *iface) +static inline struct synth_sink *impl_from_IKsControl(IKsControl *iface) { - return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IKsControl_iface); + return CONTAINING_RECORD(iface, struct synth_sink, IKsControl_iface); } static HRESULT WINAPI synth_sink_control_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface); return synth_sink_QueryInterface(&This->IDirectMusicSynthSink_iface, riid, ppobj); } static ULONG WINAPI synth_sink_control_AddRef(IKsControl* iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface); return synth_sink_AddRef(&This->IDirectMusicSynthSink_iface); } static ULONG WINAPI synth_sink_control_Release(IKsControl* iface) { - IDirectMusicSynthSinkImpl *This = impl_from_IKsControl(iface); + struct synth_sink *This = impl_from_IKsControl(iface); return synth_sink_Release(&This->IDirectMusicSynthSink_iface); } @@ -310,14 +308,14 @@ static const IKsControlVtbl synth_sink_control = HRESULT DMUSIC_CreateDirectMusicSynthSinkImpl(REFIID riid, void **ret_iface) { - IDirectMusicSynthSinkImpl *obj; + struct synth_sink *obj; HRESULT hr; TRACE("(%s, %p)\n", debugstr_guid(riid), ret_iface); *ret_iface = NULL; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl)); + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct synth_sink)); if (!obj) return E_OUTOFMEMORY;
1
0
0
0
Rémi Bernon : dmsynth: Rename IDirectMusicSynthSinkImpl method prefix to synth_sink.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: 1f7629dc0a22f4304f78e61e9c9330081d7b1449 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1f7629dc0a22f4304f78e61e9c9330…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 18 21:49:49 2023 +0200 dmsynth: Rename IDirectMusicSynthSinkImpl method prefix to synth_sink. --- dlls/dmsynth/synthsink.c | 90 +++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 44 deletions(-)
1
0
0
0
Rémi Bernon : dmsynth: Move IDirectMusicSynthSinkImpl struct to where it is used.
by Alexandre Julliard
04 Sep '23
04 Sep '23
Module: wine Branch: master Commit: da256c4426baff6dafb26c1d524d13b3fc018ac1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/da256c4426baff6dafb26c1d524d13…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Aug 18 21:34:24 2023 +0200 dmsynth: Move IDirectMusicSynthSinkImpl struct to where it is used. --- dlls/dmsynth/dmsynth_private.h | 14 -------------- dlls/dmsynth/synthsink.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index 3a3e76dfaf4..b9f160f000d 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -44,7 +44,6 @@ * Interfaces */ typedef struct IDirectMusicSynth8Impl IDirectMusicSynth8Impl; -typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl; /***************************************************************************** * ClassFactory @@ -67,19 +66,6 @@ struct IDirectMusicSynth8Impl { IDirectMusicSynthSink *sink; }; -/***************************************************************************** - * IDirectMusicSynthSinkImpl implementation structure - */ -struct IDirectMusicSynthSinkImpl { - IDirectMusicSynthSink IDirectMusicSynthSink_iface; - IKsControl IKsControl_iface; - LONG ref; - IReferenceClock *latency_clock; - IReferenceClock *master_clock; - IDirectMusicSynth *synth; /* No reference hold! */ - BOOL active; -}; - /***************************************************************************** * Misc. */ diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index b9d9a31012c..94d5463bc20 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -25,6 +25,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmsynth); +typedef struct IDirectMusicSynthSinkImpl IDirectMusicSynthSinkImpl; + +struct IDirectMusicSynthSinkImpl +{ + IDirectMusicSynthSink IDirectMusicSynthSink_iface; + IKsControl IKsControl_iface; + LONG ref; + + IReferenceClock *latency_clock; + IReferenceClock *master_clock; + IDirectMusicSynth *synth; /* No reference hold! */ + BOOL active; +}; + static inline IDirectMusicSynthSinkImpl *impl_from_IDirectMusicSynthSink(IDirectMusicSynthSink *iface) { return CONTAINING_RECORD(iface, IDirectMusicSynthSinkImpl, IDirectMusicSynthSink_iface);
1
0
0
0
← Newer
1
...
86
87
88
89
90
91
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200