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
February 2018
----- 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
2 participants
804 discussions
Start a n
N
ew thread
Hans Leidekker : kerberos: Allocate a buffer for the package info structure in kerberos_SpQueryContextAttributes.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: c6e607ff1f9219b9c3209e3490f6c954e40f9277 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c6e607ff1f9219b9c3209e34…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Feb 8 11:53:59 2018 +0100 kerberos: Allocate a buffer for the package info structure in kerberos_SpQueryContextAttributes. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kerberos/krb5_ap.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c index e4011ff..767a86e 100644 --- a/dlls/kerberos/krb5_ap.c +++ b/dlls/kerberos/krb5_ap.c @@ -46,6 +46,7 @@ #include "wine/heap.h" #include "wine/library.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(kerberos); @@ -1059,6 +1060,24 @@ static NTSTATUS NTAPI kerberos_SpDeleteContext( LSA_SEC_HANDLE context ) #endif } +static SecPkgInfoW *build_package_info( const SecPkgInfoW *info ) +{ + SecPkgInfoW *ret; + DWORD size_name = (strlenW(info->Name) + 1) * sizeof(WCHAR); + DWORD size_comment = (strlenW(info->Comment) + 1) * sizeof(WCHAR); + + if (!(ret = heap_alloc( sizeof(*ret) + size_name + size_comment ))) return NULL; + ret->fCapabilities = info->fCapabilities; + ret->wVersion = info->wVersion; + ret->wRPCID = info->wRPCID; + ret->cbMaxToken = info->cbMaxToken; + ret->Name = (SEC_WCHAR *)(ret + 1); + memcpy( ret->Name, info->Name, size_name ); + ret->Comment = (SEC_WCHAR *)((char *)ret->Name + size_name); + memcpy( ret->Comment, info->Comment, size_comment ); + return ret; +} + static NTSTATUS NTAPI kerberos_SpQueryContextAttributes( LSA_SEC_HANDLE context, ULONG attribute, void *buffer ) { TRACE( "(%lx %u %p)\n", context, attribute, buffer ); @@ -1103,7 +1122,7 @@ static NTSTATUS NTAPI kerberos_SpQueryContextAttributes( LSA_SEC_HANDLE context, case SECPKG_ATTR_NEGOTIATION_INFO: { SecPkgContext_NegotiationInfoW *info = (SecPkgContext_NegotiationInfoW *)buffer; - info->PackageInfo = (SecPkgInfoW *)&infoW; + if (!(info->PackageInfo = build_package_info( &infoW ))) return SEC_E_INSUFFICIENT_MEMORY; info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE; return SEC_E_OK; }
1
0
0
0
Hans Leidekker : kerberos: Simplify kerberos_SpInitLsaModeContext.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 64cbf292bb87f65b841143db0c8f24802ea7c42a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=64cbf292bb87f65b841143db…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Feb 8 11:53:58 2018 +0100 kerberos: Simplify kerberos_SpInitLsaModeContext. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kerberos/krb5_ap.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c index 78ec6d3..e4011ff 100644 --- a/dlls/kerberos/krb5_ap.c +++ b/dlls/kerberos/krb5_ap.c @@ -919,16 +919,11 @@ static NTSTATUS NTAPI kerberos_SpInitLsaModeContext( LSA_SEC_HANDLE credential, cred_handle = credhandle_sspi_to_gss( credential ); ctxt_handle = ctxthandle_sspi_to_gss( context ); - if (!input) input_token.length = 0; + if (!input || (idx = get_buffer_index( input, SECBUFFER_TOKEN )) == -1) input_token.length = 0; else { - if ((idx = get_buffer_index( input, SECBUFFER_TOKEN )) == -1) - input_token.length = 0; - else - { - input_token.length = input->pBuffers[idx].cbBuffer; - input_token.value = input->pBuffers[idx].pvBuffer; - } + input_token.length = input->pBuffers[idx].cbBuffer; + input_token.value = input->pBuffers[idx].pvBuffer; } if ((idx = get_buffer_index( output, SECBUFFER_TOKEN )) == -1) return SEC_E_INVALID_TOKEN;
1
0
0
0
Hans Leidekker : kerberos: Don' t fail on caller supplied credentials in kerberos_SpAcquireCredentialsHandle.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 574446923420a9ec23f6d73bedc216fe960b4060 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=574446923420a9ec23f6d73b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Feb 8 11:53:57 2018 +0100 kerberos: Don't fail on caller supplied credentials in kerberos_SpAcquireCredentialsHandle. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kerberos/krb5_ap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c index 99673b0..78ec6d3 100644 --- a/dlls/kerberos/krb5_ap.c +++ b/dlls/kerberos/krb5_ap.c @@ -832,11 +832,7 @@ static NTSTATUS NTAPI kerberos_SpAcquireCredentialsHandle( TRACE( "(%s 0x%08x %p %p %p %p %p %p)\n", debugstr_us(principal_us), credential_use, logon_id, auth_data, get_key_fn, get_key_arg, credential, ts_expiry ); - if (auth_data) - { - FIXME( "specific credentials not supported\n" ); - return SEC_E_UNKNOWN_CREDENTIALS; - } + if (auth_data) FIXME( "specific credentials not supported\n" ); switch (credential_use) {
1
0
0
0
Hans Leidekker : secur32: Implement SECPKG_ATTR_NEGOTIATION_INFO for NTLM.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 54dea1dc6a4b6a98c7b7e15ac6bda44872a362f3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54dea1dc6a4b6a98c7b7e15a…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Feb 8 11:53:56 2018 +0100 secur32: Implement SECPKG_ATTR_NEGOTIATION_INFO for NTLM. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/secur32/ntlm.c | 149 +++++++++++++++++++++++++++++++--------------- dlls/secur32/tests/ntlm.c | 2 - 2 files changed, 100 insertions(+), 51 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 94b94f4..6a94d42 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -1421,6 +1421,87 @@ SECURITY_STATUS SEC_ENTRY ntlm_DeleteSecurityContext(PCtxtHandle phContext) return SEC_E_OK; } +#define NTLM_COMMENT \ + { 'N', 'T', 'L', 'M', ' ', \ + 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', \ + 'P', 'a', 'c', 'k', 'a', 'g', 'e', 0} + +static CHAR ntlm_comment_A[] = NTLM_COMMENT; +static WCHAR ntlm_comment_W[] = NTLM_COMMENT; + +#define NTLM_NAME {'N', 'T', 'L', 'M', 0} + +static char ntlm_name_A[] = NTLM_NAME; +static WCHAR ntlm_name_W[] = NTLM_NAME; + +#define NTLM_CAPS ( \ + SECPKG_FLAG_INTEGRITY | \ + SECPKG_FLAG_PRIVACY | \ + SECPKG_FLAG_TOKEN_ONLY | \ + SECPKG_FLAG_CONNECTION | \ + SECPKG_FLAG_MULTI_REQUIRED | \ + SECPKG_FLAG_IMPERSONATION | \ + SECPKG_FLAG_ACCEPT_WIN32_NAME | \ + SECPKG_FLAG_NEGOTIABLE | \ + SECPKG_FLAG_LOGON | \ + SECPKG_FLAG_RESTRICTED_TOKENS ) + +static const SecPkgInfoW infoW = { + NTLM_CAPS, + 1, + RPC_C_AUTHN_WINNT, + NTLM_MAX_BUF, + ntlm_name_W, + ntlm_comment_W +}; + +static const SecPkgInfoA infoA = { + NTLM_CAPS, + 1, + RPC_C_AUTHN_WINNT, + NTLM_MAX_BUF, + ntlm_name_A, + ntlm_comment_A +}; + +SecPkgInfoA *ntlm_package_infoA = (SecPkgInfoA *)&infoA; +SecPkgInfoW *ntlm_package_infoW = (SecPkgInfoW *)&infoW; + +static SecPkgInfoW *build_package_infoW( const SecPkgInfoW *info ) +{ + SecPkgInfoW *ret; + DWORD size_name = (strlenW(info->Name) + 1) * sizeof(WCHAR); + DWORD size_comment = (strlenW(info->Comment) + 1) * sizeof(WCHAR); + + if (!(ret = HeapAlloc( GetProcessHeap(), 0, sizeof(*ret) + size_name + size_comment ))) return NULL; + ret->fCapabilities = info->fCapabilities; + ret->wVersion = info->wVersion; + ret->wRPCID = info->wRPCID; + ret->cbMaxToken = info->cbMaxToken; + ret->Name = (SEC_WCHAR *)(ret + 1); + memcpy( ret->Name, info->Name, size_name ); + ret->Comment = (SEC_WCHAR *)((char *)ret->Name + size_name); + memcpy( ret->Comment, info->Comment, size_comment ); + return ret; +} + +static SecPkgInfoA *build_package_infoA( const SecPkgInfoA *info ) +{ + SecPkgInfoA *ret; + DWORD size_name = strlen(info->Name) + 1, size_comment = strlen(info->Comment) + 1; + + if (!(ret = HeapAlloc( GetProcessHeap(), 0, sizeof(*ret) + size_name + size_comment ))) return NULL; + ret->fCapabilities = info->fCapabilities; + ret->wVersion = info->wVersion; + ret->wRPCID = info->wRPCID; + ret->cbMaxToken = info->cbMaxToken; + ret->Name = (SEC_CHAR *)(ret + 1); + memcpy( ret->Name, info->Name, size_name ); + ret->Comment = ret->Name + size_name; + memcpy( ret->Comment, info->Comment, size_comment ); + return ret; +} + /*********************************************************************** * QueryContextAttributesW */ @@ -1453,7 +1534,13 @@ SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, _x(SECPKG_ATTR_LIFESPAN); _x(SECPKG_ATTR_NAMES); _x(SECPKG_ATTR_NATIVE_NAMES); - _x(SECPKG_ATTR_NEGOTIATION_INFO); + case SECPKG_ATTR_NEGOTIATION_INFO: + { + SecPkgContext_NegotiationInfoW *info = (SecPkgContext_NegotiationInfoW *)pBuffer; + if (!(info->PackageInfo = build_package_infoW( &infoW ))) return SEC_E_INSUFFICIENT_MEMORY; + info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE; + return SEC_E_OK; + } _x(SECPKG_ATTR_PACKAGE_INFO); _x(SECPKG_ATTR_PASSWORD_EXPIRY); _x(SECPKG_ATTR_SESSION_KEY); @@ -1482,7 +1569,18 @@ SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesW(PCtxtHandle phContext, SECURITY_STATUS SEC_ENTRY ntlm_QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer) { - return ntlm_QueryContextAttributesW(phContext, ulAttribute, pBuffer); + switch(ulAttribute) + { + case SECPKG_ATTR_NEGOTIATION_INFO: + { + SecPkgContext_NegotiationInfoA *info = (SecPkgContext_NegotiationInfoA *)pBuffer; + if (!(info->PackageInfo = build_package_infoA( &infoA ))) return SEC_E_INSUFFICIENT_MEMORY; + info->NegotiationState = SECPKG_NEGOTIATION_COMPLETE; + return SEC_E_OK; + } + default: + return ntlm_QueryContextAttributesW( phContext, ulAttribute, pBuffer ); + } } /*********************************************************************** @@ -1976,53 +2074,6 @@ static const SecurityFunctionTableW ntlmTableW = { NULL, /* SetContextAttributesW */ }; -#define NTLM_COMMENT \ - { 'N', 'T', 'L', 'M', ' ', \ - 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ', \ - 'P', 'a', 'c', 'k', 'a', 'g', 'e', 0} - -static CHAR ntlm_comment_A[] = NTLM_COMMENT; -static WCHAR ntlm_comment_W[] = NTLM_COMMENT; - -#define NTLM_NAME {'N', 'T', 'L', 'M', 0} - -static char ntlm_name_A[] = NTLM_NAME; -static WCHAR ntlm_name_W[] = NTLM_NAME; - -/* According to Windows, NTLM has the following capabilities. */ -#define CAPS ( \ - SECPKG_FLAG_INTEGRITY | \ - SECPKG_FLAG_PRIVACY | \ - SECPKG_FLAG_TOKEN_ONLY | \ - SECPKG_FLAG_CONNECTION | \ - SECPKG_FLAG_MULTI_REQUIRED | \ - SECPKG_FLAG_IMPERSONATION | \ - SECPKG_FLAG_ACCEPT_WIN32_NAME | \ - SECPKG_FLAG_NEGOTIABLE | \ - SECPKG_FLAG_LOGON | \ - SECPKG_FLAG_RESTRICTED_TOKENS ) - -static const SecPkgInfoW infoW = { - CAPS, - 1, - RPC_C_AUTHN_WINNT, - NTLM_MAX_BUF, - ntlm_name_W, - ntlm_comment_W -}; - -static const SecPkgInfoA infoA = { - CAPS, - 1, - RPC_C_AUTHN_WINNT, - NTLM_MAX_BUF, - ntlm_name_A, - ntlm_comment_A -}; - -SecPkgInfoA *ntlm_package_infoA = (SecPkgInfoA *)&infoA; -SecPkgInfoW *ntlm_package_infoW = (SecPkgInfoW *)&infoW; - void SECUR32_initNTLMSP(void) { PNegoHelper helper; diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index c060420..b9fdf6f 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -916,12 +916,10 @@ static void testAuth(ULONG data_rep, BOOL fake) memset(&info, 0, sizeof(info)); sec_status = QueryContextAttributesA(&client.ctxt, SECPKG_ATTR_NEGOTIATION_INFO, &info); -todo_wine ok(sec_status == SEC_E_OK, "QueryContextAttributesA returned %08x\n", sec_status); pi = info.PackageInfo; ok(info.NegotiationState == SECPKG_NEGOTIATION_COMPLETE, "got %u\n", info.NegotiationState); -todo_wine ok(pi != NULL, "expected non-NULL PackageInfo\n"); if (pi) {
1
0
0
0
Dmitry Timoshkov : kerberos: Slightly simplify name_sspi_to_gss.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 0d44fc790492afb616727ca2f1991c9f193468c6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0d44fc790492afb616727ca2…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Feb 8 09:42:43 2018 +0800 kerberos: Slightly simplify name_sspi_to_gss. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kerberos/krb5_ap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c index e3ede45..99673b0 100644 --- a/dlls/kerberos/krb5_ap.c +++ b/dlls/kerberos/krb5_ap.c @@ -748,10 +748,9 @@ static SECURITY_STATUS name_sspi_to_gss( const UNICODE_STRING *name_str, gss_nam gss_OID type = GSS_C_NO_OID; /* FIXME: detect the appropriate value for this ourselves? */ gss_buffer_desc buf; - buf.length = WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), NULL, 0, NULL, NULL ) + 1; + buf.length = WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), NULL, 0, NULL, NULL ); if (!(buf.value = heap_alloc( buf.length ))) return SEC_E_INSUFFICIENT_MEMORY; WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), buf.value, buf.length, NULL, NULL ); - buf.length--; ret = pgss_import_name( &minor_status, &buf, type, name ); TRACE( "gss_import_name returned %08x minor status %08x\n", ret, minor_status );
1
0
0
0
Akihiro Sagawa : gdi32: Fix ABC width calculations when using vertical font.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: c17a8f32c412cf9d825da87f5ccf682d52f2b1ce URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c17a8f32c412cf9d825da87f…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 4 21:02:13 2018 +0900 gdi32: Fix ABC width calculations when using vertical font. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 3 ++- dlls/gdi32/tests/font.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 7016095..3833147 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7050,6 +7050,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, pFT_Vector_Transform(&vec, &transMat); origin_x = (vec.x + left) & -64; origin_y = (vec.y + top + 63) & -64; + lsb -= metrics.horiBearingY; } else { @@ -7074,7 +7075,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, else abc->abcA = -((pFT_Vector_Length(&vec) + 63) >> 6); /* We use lsb again to avoid rounding errors */ - vec.x = lsb + metrics.width; + vec.x = lsb + (tategaki ? metrics.height : metrics.width); vec.y = 0; pFT_Vector_Transform(&vec, &transMatUnrotated); abc->abcB = ((pFT_Vector_Length(&vec) + 63) >> 6) - abc->abcA; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index d5f04ff..d6fe9e3 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -5959,9 +5959,9 @@ static void check_vertical_metrics(const char *face) ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n"); ret = GetCharABCWidthsW(hdc, code, code, &vabc); ok(ret, "GetCharABCWidthsW failed\n"); - todo_wine ok(vabc.abcA == vgm.gmptGlyphOrigin.x, "expected %d, got %d\n", + ok(vabc.abcA == vgm.gmptGlyphOrigin.x, "expected %d, got %d\n", vabc.abcA, vgm.gmptGlyphOrigin.x); - todo_wine ok(vabc.abcB == vgm.gmBlackBoxX, "expected %d, got %d\n", + ok(vabc.abcB == vgm.gmBlackBoxX, "expected %d, got %d\n", vabc.abcB, vgm.gmBlackBoxX); ok(vabc.abcA + vabc.abcB + vabc.abcC == vgm.gmCellIncX, "expected %d, got %d\n",
1
0
0
0
Akihiro Sagawa : gdi32/tests: Add more ABC width tests with vertical font.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 34c4687f254c349049bd7cb7fcbae99e9dbff9aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=34c4687f254c349049bd7cb7…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 4 21:02:11 2018 +0900 gdi32/tests: Add more ABC width tests with vertical font. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/tests/font.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 7a74565..d5f04ff 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -5929,7 +5929,7 @@ static void check_vertical_metrics(const char *face) GLYPHMETRICS rgm, vgm; const UINT code = 0x5EAD, height = 1000; WORD idx; - ABC abc; + ABC abc, vabc; OUTLINETEXTMETRICA otm; USHORT numOfLongVerMetrics; @@ -5957,6 +5957,15 @@ static void check_vertical_metrics(const char *face) hfont_prev = SelectObject(hdc, hfont); ret = GetGlyphOutlineW(hdc, code, GGO_METRICS, &vgm, 0, NULL, &mat); ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n"); + ret = GetCharABCWidthsW(hdc, code, code, &vabc); + ok(ret, "GetCharABCWidthsW failed\n"); + todo_wine ok(vabc.abcA == vgm.gmptGlyphOrigin.x, "expected %d, got %d\n", + vabc.abcA, vgm.gmptGlyphOrigin.x); + todo_wine ok(vabc.abcB == vgm.gmBlackBoxX, "expected %d, got %d\n", + vabc.abcB, vgm.gmBlackBoxX); + ok(vabc.abcA + vabc.abcB + vabc.abcC == vgm.gmCellIncX, + "expected %d, got %d\n", + vabc.abcA + vabc.abcB + vabc.abcC, vgm.gmCellIncX); memset(&otm, 0, sizeof(otm)); otm.otmSize = sizeof(otm);
1
0
0
0
Akihiro Sagawa : gdi32/tests: Add more ABC width tests in various widths.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: da63c2356dffbfdcfe0566d312a05202900a547d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=da63c2356dffbfdcfe0566d3…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 4 21:02:09 2018 +0900 gdi32/tests: Add more ABC width tests in various widths. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/tests/font.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 4bac19a..7a74565 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1340,6 +1340,56 @@ static void test_GetCharABCWidths(void) "got %d, expected %d (C)\n", abc[0].abcC, abcw[0].abcC); DeleteObject(SelectObject(hdc, hfont)); + + /* test abcA == gmptGlyphOrigin.x && abcB == gmBlackBoxX + in various widths. */ + for (i = 1; i <= 2; i++) + { + UINT j; + UINT code; + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = 20; + switch(i) + { + case 1: + strcpy(lf.lfFaceName, "Tahoma"); + code = 'a'; + break; + case 2: + strcpy(lf.lfFaceName, "Times New Roman"); + lf.lfItalic = TRUE; + code = 'f'; + break; + } + if (!is_truetype_font_installed(lf.lfFaceName)) + { + skip("%s is not installed\n", lf.lfFaceName); + continue; + } + for (j = 1; j <= 80; j++) + { + GLYPHMETRICS gm; + + lf.lfWidth = j; + hfont = CreateFontIndirectA(&lf); + hfont = SelectObject(hdc, hfont); + + nb = GetGlyphOutlineA(hdc, code, GGO_METRICS, &gm, 0, NULL, &mat); + ok(nb, "GetGlyphOutlineA should have succeeded at width %d\n", i); + + ret = GetCharABCWidthsA(hdc, code, code, abc); + ok(ret, "GetCharABCWidthsA should have succeeded at width %d\n", i); + + ok(abc[0].abcA == gm.gmptGlyphOrigin.x, + "abcA(%d) and gmptGlyphOrigin.x(%d) values are different at width %d\n", + abc[0].abcA, gm.gmptGlyphOrigin.x, i); + ok(abc[0].abcB == gm.gmBlackBoxX, + "abcB(%d) and gmBlackBoxX(%d) values are different at width %d\n", + abc[0].abcB, gm.gmBlackBoxX, i); + DeleteObject(SelectObject(hdc, hfont)); + } + } ReleaseDC(NULL, hdc); trace("ABC sign test for a variety of transforms:\n");
1
0
0
0
Akihiro Sagawa : gdi32: Fix ABC width calculations when applying transformations internally.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 2a402a427a7d3bad1ea8043b9d7db011727cbc6b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2a402a427a7d3bad1ea8043b…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Feb 4 21:02:07 2018 +0900 gdi32: Fix ABC width calculations when applying transformations internally. This fixes a regression introduced by f6bc356860a1ea2e5b4aed43e38ddf8b7d24a8b0. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 15 ++++++++------- dlls/gdi32/tests/font.c | 44 +++++++++++++++++++------------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 4db1c7e..7016095 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7008,7 +7008,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, origin_x = left; origin_y = top; abc->abcA = origin_x >> 6; - abc->abcB = metrics.width >> 6; + abc->abcB = (metrics.width + 63) >> 6; } else { INT xc, yc; FT_Vector vec; @@ -7064,19 +7064,20 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, gm.gmCellIncY = adv.y >> 6; adv = get_advance_metric(incoming_font, font, &metrics, &transMatUnrotated, vertical_metrics); + adv.x = pFT_Vector_Length(&adv); + adv.y = 0; vec.x = lsb; vec.y = 0; pFT_Vector_Transform(&vec, &transMatUnrotated); - abc->abcA = vec.x >> 6; + if(lsb > 0) abc->abcA = pFT_Vector_Length(&vec) >> 6; + else abc->abcA = -((pFT_Vector_Length(&vec) + 63) >> 6); - vec.x = metrics.width; + /* We use lsb again to avoid rounding errors */ + vec.x = lsb + metrics.width; vec.y = 0; pFT_Vector_Transform(&vec, &transMatUnrotated); - if (vec.x >= 0) - abc->abcB = vec.x >> 6; - else - abc->abcB = -vec.x >> 6; + abc->abcB = ((pFT_Vector_Length(&vec) + 63) >> 6) - abc->abcA; } width = (right - left) >> 6; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 70e44f3..4bac19a 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1128,7 +1128,7 @@ static int CALLBACK create_font_proc(const LOGFONTA *lpelfe, return 1; } -static void ABCWidths_helper(const char* description, HDC hdc, WORD *glyphs, ABC *base_abci, ABC *base_abcw, ABCFLOAT *base_abcf, INT todo) +static void ABCWidths_helper(const char* description, HDC hdc, WORD *glyphs, const ABC *base_abci, const ABC *base_abcw, const ABCFLOAT *base_abcf) { ABC abc[1]; ABCFLOAT abcf[1]; @@ -1137,26 +1137,20 @@ static void ABCWidths_helper(const char* description, HDC hdc, WORD *glyphs, ABC ret = pGetCharABCWidthsI(hdc, 0, 1, glyphs, abc); ok(ret, "%s: GetCharABCWidthsI should have succeeded\n", description); ok ((INT)abc->abcB > 0, "%s: abcB should be positive\n", description); - todo_wine_if (todo) - ok(abc->abcA * base_abci->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); - todo_wine_if (todo) - ok(abc->abcC * base_abci->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); + ok(abc->abcA * base_abci->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + ok(abc->abcC * base_abci->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); ret = pGetCharABCWidthsW(hdc, 'i', 'i', abc); ok(ret, "%s: GetCharABCWidthsW should have succeeded\n", description); ok ((INT)abc->abcB > 0, "%s: abcB should be positive\n", description); - todo_wine_if (todo) - ok(abc->abcA * base_abcw->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); - todo_wine_if (todo) - ok(abc->abcC * base_abcw->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); + ok(abc->abcA * base_abcw->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + ok(abc->abcC * base_abcw->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); ret = pGetCharABCWidthsFloatW(hdc, 'i', 'i', abcf); ok(ret, "%s: GetCharABCWidthsFloatW should have succeeded\n", description); ok (abcf->abcfB > 0.0, "%s: abcfB should be positive\n", description); - todo_wine_if (todo) - ok(abcf->abcfA * base_abcf->abcfA >= 0.0, "%s: abcfA's sign should be unchanged\n", description); - todo_wine_if (todo) - ok(abcf->abcfC * base_abcf->abcfC >= 0.0, "%s: abcfC's sign should be unchanged\n", description); + ok(abcf->abcfA * base_abcf->abcfA >= 0.0, "%s: abcfA's sign should be unchanged\n", description); + ok(abcf->abcfC * base_abcf->abcfC >= 0.0, "%s: abcfC's sign should be unchanged\n", description); } static void test_GetCharABCWidths(void) @@ -1369,17 +1363,17 @@ static void test_GetCharABCWidths(void) ret = pGetCharABCWidthsFloatW(hdc, 'i', 'i', abcf); ok(ret, "GetCharABCWidthsFloatW should have succeeded\n"); - ABCWidths_helper("LTR", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("LTR", hdc, glyphs, abc, abcw, abcf); SetWindowExtEx(hdc, -1, -1, NULL); SetGraphicsMode(hdc, GM_COMPATIBLE); - ABCWidths_helper("LTR -1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("LTR -1 compatible", hdc, glyphs, abc, abcw, abcf); SetGraphicsMode(hdc, GM_ADVANCED); - ABCWidths_helper("LTR -1 advanced", hdc, glyphs, abc, abcw, abcf, 1); + ABCWidths_helper("LTR -1 advanced", hdc, glyphs, abc, abcw, abcf); SetWindowExtEx(hdc, 1, 1, NULL); SetGraphicsMode(hdc, GM_COMPATIBLE); - ABCWidths_helper("LTR 1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("LTR 1 compatible", hdc, glyphs, abc, abcw, abcf); SetGraphicsMode(hdc, GM_ADVANCED); - ABCWidths_helper("LTR 1 advanced", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("LTR 1 advanced", hdc, glyphs, abc, abcw, abcf); ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); @@ -1391,17 +1385,17 @@ static void test_GetCharABCWidths(void) SetMapMode(hdc, MM_ANISOTROPIC); SelectObject(hdc, hfont); - ABCWidths_helper("RTL", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("RTL", hdc, glyphs, abc, abcw, abcf); SetWindowExtEx(hdc, -1, -1, NULL); SetGraphicsMode(hdc, GM_COMPATIBLE); - ABCWidths_helper("RTL -1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("RTL -1 compatible", hdc, glyphs, abc, abcw, abcf); SetGraphicsMode(hdc, GM_ADVANCED); - ABCWidths_helper("RTL -1 advanced", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("RTL -1 advanced", hdc, glyphs, abc, abcw, abcf); SetWindowExtEx(hdc, 1, 1, NULL); SetGraphicsMode(hdc, GM_COMPATIBLE); - ABCWidths_helper("RTL 1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + ABCWidths_helper("RTL 1 compatible", hdc, glyphs, abc, abcw, abcf); SetGraphicsMode(hdc, GM_ADVANCED); - ABCWidths_helper("RTL 1 advanced", hdc, glyphs, abc, abcw, abcf, 1); + ABCWidths_helper("RTL 1 advanced", hdc, glyphs, abc, abcw, abcf); ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); @@ -6372,7 +6366,7 @@ static void test_GetCharWidth32(void) SetGraphicsMode(hdc, GM_ADVANCED); ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); ok(ret, "GetCharWidth32W should have succeeded\n"); - todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + ok (bufferW > 0," Width should be greater than zero\n"); SetWindowExtEx(hdc, 1,1,NULL); SetGraphicsMode(hdc, GM_COMPATIBLE); ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); @@ -6412,7 +6406,7 @@ static void test_GetCharWidth32(void) SetGraphicsMode(hdc, GM_ADVANCED); ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); ok(ret, "GetCharWidth32W should have succeeded\n"); - todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + ok (bufferW > 0," Width should be greater than zero\n"); ReleaseDC(hwnd, hdc); DestroyWindow(hwnd);
1
0
0
0
Michael Stefaniuc : reg: Use the global HeapAlloc() wrappers.
by Alexandre Julliard
08 Feb '18
08 Feb '18
Module: wine Branch: master Commit: 6542c3e8607fff57756ab16f2096601c3eaf01e0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6542c3e8607fff57756ab16f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Feb 7 23:48:40 2018 +0100 reg: Use the global HeapAlloc() wrappers. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/export.c | 1 + programs/reg/import.c | 1 + programs/reg/reg.c | 15 +++------------ programs/reg/reg.h | 1 - 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/programs/reg/export.c b/programs/reg/export.c index 39001c8..622e7ca 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <wine/unicode.h> +#include <wine/heap.h> #include "reg.h" diff --git a/programs/reg/import.c b/programs/reg/import.c index 8350fa7..f2ce80e 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -23,6 +23,7 @@ #include <wine/unicode.h> #include <wine/debug.h> +#include <wine/heap.h> #include "reg.h" diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 8d510f7..455d3dd 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <wine/unicode.h> #include <wine/debug.h> +#include <wine/heap.h> #include "reg.h" WINE_DEFAULT_DEBUG_CHANNEL(reg); @@ -81,7 +82,7 @@ static const WCHAR newlineW[] = {'\n',0}; void *heap_xalloc(size_t size) { - void *buf = HeapAlloc(GetProcessHeap(), 0, size); + void *buf = heap_alloc(size); if (!buf) { ERR("Out of memory!\n"); @@ -92,12 +93,7 @@ void *heap_xalloc(size_t size) void *heap_xrealloc(void *buf, size_t size) { - void *new_buf; - - if (buf) - new_buf = HeapReAlloc(GetProcessHeap(), 0, buf, size); - else - new_buf = HeapAlloc(GetProcessHeap(), 0, size); + void *new_buf = heap_realloc(buf, size); if (!new_buf) { @@ -108,11 +104,6 @@ void *heap_xrealloc(void *buf, size_t size) return new_buf; } -BOOL heap_free(void *buf) -{ - return HeapFree(GetProcessHeap(), 0, buf); -} - void output_writeconsole(const WCHAR *str, DWORD wlen) { DWORD count, ret; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index eb792bb..dbce738 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -27,7 +27,6 @@ /* reg.c */ void *heap_xalloc(size_t size); void *heap_xrealloc(void *buf, size_t size); -BOOL heap_free(void *buf); void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...); BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info);
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
81
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
Results per page:
10
25
50
100
200