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
August 2006
----- 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
5 participants
746 discussions
Start a n
N
ew thread
Kai Blin : secur32: Fix heap error.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: c22e98fad07599ede9384f70545887f6bf9bf71e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=c22e98fad07599ede9384f7…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Mon Aug 14 12:04:41 2006 +0200 secur32: Fix heap error. --- dlls/secur32/dispatcher.c | 1 - dlls/secur32/ntlm.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/secur32/dispatcher.c b/dlls/secur32/dispatcher.c index 5e26d41..d9dfeef 100644 --- a/dlls/secur32/dispatcher.c +++ b/dlls/secur32/dispatcher.c @@ -264,7 +264,6 @@ void cleanup_helper(PNegoHelper helper) HeapFree(GetProcessHeap(), 0, helper->password); HeapFree(GetProcessHeap(), 0, helper->com_buf); - HeapFree(GetProcessHeap(), 0, helper->session_key); /* closing stdin will terminate ntlm_auth */ close(helper->pipe_out); diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index fb9495b..1b0bd8c 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -1240,6 +1240,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Fr PNegoHelper helper = (PNegoHelper) phCredential->dwLower; phCredential->dwUpper = 0; phCredential->dwLower = 0; + HeapFree(GetProcessHeap(), 0, helper->session_key); cleanup_helper(helper); ret = SEC_E_OK; }
1
0
0
0
Kai Blin : secur32: Add handling for SECPKG_CONTEXT_FLAGS to QueryContextAttributes, unify indentation.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: 3cf9c85f83d2693b323b5948d11eeda1d4404c57 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=3cf9c85f83d2693b323b594…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Sun Aug 13 14:44:39 2006 +0200 secur32: Add handling for SECPKG_CONTEXT_FLAGS to QueryContextAttributes, unify indentation. --- dlls/secur32/ntlm.c | 29 ++++++++++++++++++++--------- 1 files changed, 20 insertions(+), 9 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 2f16cd4..fb9495b 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -1019,7 +1019,18 @@ #define _x(x) case (x) : FIXME(#x" stub\ _x(SECPKG_ATTR_ACCESS_TOKEN); _x(SECPKG_ATTR_AUTHORITY); _x(SECPKG_ATTR_DCE_INFO); - _x(SECPKG_ATTR_FLAGS); + case SECPKG_ATTR_FLAGS: + { + PSecPkgContext_Flags spcf = (PSecPkgContext_Flags)pBuffer; + PNegoHelper helper = (PNegoHelper)phContext->dwLower; + + spcf->Flags = 0; + if(helper->neg_flags & NTLMSSP_NEGOTIATE_SIGN) + spcf->Flags |= ISC_RET_INTEGRITY; + if(helper->neg_flags & NTLMSSP_NEGOTIATE_SEAL) + spcf->Flags |= ISC_RET_CONFIDENTIALITY; + return SEC_E_OK; + } _x(SECPKG_ATTR_KEY_INFO); _x(SECPKG_ATTR_LIFESPAN); _x(SECPKG_ATTR_NAMES); @@ -1029,14 +1040,14 @@ #define _x(x) case (x) : FIXME(#x" stub\ _x(SECPKG_ATTR_PASSWORD_EXPIRY); _x(SECPKG_ATTR_SESSION_KEY); case SECPKG_ATTR_SIZES: - { - PSecPkgContext_Sizes spcs = (PSecPkgContext_Sizes)pBuffer; - spcs->cbMaxToken = NTLM_MAX_BUF; - spcs->cbMaxSignature = 16; - spcs->cbBlockSize = 0; - spcs->cbSecurityTrailer = 16; - return SEC_E_OK; - } + { + PSecPkgContext_Sizes spcs = (PSecPkgContext_Sizes)pBuffer; + spcs->cbMaxToken = NTLM_MAX_BUF; + spcs->cbMaxSignature = 16; + spcs->cbBlockSize = 0; + spcs->cbSecurityTrailer = 16; + return SEC_E_OK; + } _x(SECPKG_ATTR_STREAM_SIZES); _x(SECPKG_ATTR_TARGET_INFORMATION); #undef _x
1
0
0
0
Kai Blin : secur32: Cast helper to ULONG_PTR instead of DWORD.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: 9cd2f28603a840eb003a1fba84a58bd42a1862b0 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=9cd2f28603a840eb003a1fb…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Mon Aug 14 11:08:37 2006 +0200 secur32: Cast helper to ULONG_PTR instead of DWORD. --- dlls/secur32/ntlm.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index c18d0f0..2f16cd4 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -117,7 +117,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac { helper->mode = NTLM_SERVER; phCredential->dwUpper = fCredentialUse; - phCredential->dwLower = (DWORD)helper; + phCredential->dwLower = (ULONG_PTR)helper; } ret = SEC_E_OK; break; @@ -229,7 +229,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac } phCredential->dwUpper = fCredentialUse; - phCredential->dwLower = (DWORD)helper; + phCredential->dwLower = (ULONG_PTR)helper; TRACE("ACH phCredential->dwUpper: 0x%08lx, dwLower: 0x%08lx\n", phCredential->dwUpper, phCredential->dwLower); } @@ -632,7 +632,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_In } phNewContext->dwUpper = ctxt_attr; - phNewContext->dwLower = (DWORD)helper; + phNewContext->dwLower = (ULONG_PTR)helper; ret = SEC_E_OK; } @@ -956,7 +956,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac } phNewContext->dwUpper = ctxt_attr; - phNewContext->dwLower = ret; + phNewContext->dwLower = (ULONG_PTR)helper; HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, bin);
1
0
0
0
Kai Blin : secur32: Implement simple VerifySignature.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: 8289ddb0d1638a01ac7797bd53fc00703ee52204 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=8289ddb0d1638a01ac7797b…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Sun Aug 13 12:46:00 2006 +0200 secur32: Implement simple VerifySignature. --- dlls/secur32/ntlm.c | 57 ++++++++++++++++++++++++++++++++++++++++----- dlls/secur32/tests/ntlm.c | 11 +++++++-- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 9b49f24..c18d0f0 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -1158,18 +1158,63 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ma static SECURITY_STATUS SEC_ENTRY ntlm_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP) { - SECURITY_STATUS ret; + PNegoHelper helper; + ULONG fQOP = 0; TRACE("%p %p %ld %p\n", phContext, pMessage, MessageSeqNo, pfQOP); - if (phContext) + if(!phContext) + return SEC_E_INVALID_HANDLE; + + if(!pMessage || !pMessage->pBuffers || pMessage->cBuffers < 2 || + pMessage->pBuffers[0].BufferType != SECBUFFER_TOKEN || + !pMessage->pBuffers[0].pvBuffer) + return SEC_E_INVALID_TOKEN; + + if(pMessage->pBuffers[0].cbBuffer < 16) + return SEC_E_BUFFER_TOO_SMALL; + + if(MessageSeqNo) + FIXME("Ignoring MessageSeqNo\n"); + + helper = (PNegoHelper)phContext->dwLower; + TRACE("Negotiated flags: 0x%08lx\n", helper->neg_flags); + + if(helper->neg_flags & NTLMSSP_NEGOTIATE_NTLM2) { - ret = SEC_E_UNSUPPORTED_FUNCTION; + FIXME("Can't handle NTLMv2 signing yet. Aborting.\n"); + return SEC_E_UNSUPPORTED_FUNCTION; } - else + + if(helper->neg_flags & NTLMSSP_NEGOTIATE_SIGN) { - ret = SEC_E_INVALID_HANDLE; + FIXME("Can't handle real signing yet. Aborting.\n"); + return SEC_E_UNSUPPORTED_FUNCTION; } - return ret; + + if(helper->neg_flags & NTLMSSP_NEGOTIATE_KEY_EXCHANGE) + { + FIXME("Can't handle encrypted session keys yet. Aborting.\n"); + return SEC_E_UNSUPPORTED_FUNCTION; + } + + if(helper->neg_flags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN) + { + const BYTE dummy_sig[] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + TRACE("Assuming dummy signature.\n"); + if(memcmp(pMessage->pBuffers[0].pvBuffer, dummy_sig, sizeof(dummy_sig)) != 0) + { + TRACE("Failed to verify the packet signature. Not a dummy signature?\n"); + return SEC_E_MESSAGE_ALTERED; + } + else + { + pfQOP = &fQOP; + return SEC_E_OK; + } + } + + return SEC_E_UNSUPPORTED_FUNCTION; } /*********************************************************************** diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index 0284a12..240a01d 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -177,6 +177,7 @@ #define _SEC_ERR(x) case (x): return #x; _SEC_ERR(SEC_E_LOGON_DENIED); _SEC_ERR(SEC_E_NO_CREDENTIALS); _SEC_ERR(SEC_E_OUT_OF_SEQUENCE); + _SEC_ERR(SEC_E_MESSAGE_ALTERED); default: sprintf(buf, "%08lx\n", status); return buf; @@ -789,13 +790,19 @@ static void testSignSeal() crypt->pBuffers[0].cbBuffer), "Signature is not as expected.\n"); data[0].cbBuffer = sizeof(message_signature); + + memcpy(data[0].pvBuffer, crypt_trailer_client, data[0].cbBuffer); + + sec_status = pVerifySignature(client.ctxt, crypt, 0, &qop); + ok(sec_status == SEC_E_MESSAGE_ALTERED, + "VerifySignature returned %s, not SEC_E_MESSAGE_ALTERED.\n", + getSecError(sec_status)); + memcpy(data[0].pvBuffer, message_signature, data[0].cbBuffer); sec_status = pVerifySignature(client.ctxt, crypt, 0, &qop); - todo_wine { ok(sec_status == SEC_E_OK, "VerifySignature returned %s, not SEC_E_OK.\n", getSecError(sec_status)); - } sec_status = pEncryptMessage(client.ctxt, 0, crypt, 0); todo_wine{
1
0
0
0
Kai Blin : secur32: Implement simple MakeSignature.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: 9b480ef06e79815b22d11bcb38bf3022ad7b5b71 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=9b480ef06e79815b22d11bc…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Sat Aug 12 19:19:49 2006 +0200 secur32: Implement simple MakeSignature. --- dlls/secur32/dispatcher.c | 5 + dlls/secur32/ntlm.c | 192 ++++++++++++++++++++++++++++++++++--------- dlls/secur32/secur32_priv.h | 23 +++++ dlls/secur32/tests/ntlm.c | 31 ++++++- 4 files changed, 208 insertions(+), 43 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=9b480ef06e79815b22d…
1
0
0
0
Kai Blin : secur32: Make AcceptSecurityContext behaviour consistent with Windows.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: c8c7bf61ada0bbb18f62109ed160495598031e72 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=c8c7bf61ada0bbb18f62109…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Mon Aug 14 11:08:29 2006 +0200 secur32: Make AcceptSecurityContext behaviour consistent with Windows. --- dlls/secur32/ntlm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index c483b5e..a6a5507 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -875,7 +875,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_Ac return SEC_E_INVALID_TOKEN; } } - + pOutput->pBuffers[0].cbBuffer = 0; ret = SEC_E_OK; }
1
0
0
0
Benjamin Arai : oleaut32: Conformance test for olefont:AddRefHfont.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: bf6867024cb5ecd01429ba38ce79c1d4fda48354 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=bf6867024cb5ecd01429ba3…
Author: Benjamin Arai <me(a)benjaminarai.com> Date: Sun Aug 13 23:33:11 2006 -0700 oleaut32: Conformance test for olefont:AddRefHfont. --- dlls/oleaut32/tests/olefont.c | 136 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 136 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 73c460f..1192dc9 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -671,6 +671,141 @@ static void test_ReleaseHfont(void) IFont_Release(ifnt2); } +static void test_AddRefHfont(void) +{ + FONTDESC fd; + static const WCHAR system_font[] = { 'S','y','s','t','e','m',0 }; + static const WCHAR arial_font[] = { 'A','r','i','a','l',0 }; + LPVOID pvObj1 = NULL; + LPVOID pvObj2 = NULL; + LPVOID pvObj3 = NULL; + IFont* ifnt1 = NULL; + IFont* ifnt2 = NULL; + IFont* ifnt3 = NULL; + HFONT hfnt1 = 0; + HFONT hfnt2 = 0; + HFONT hfnt3 = 0; + HRESULT hres; + + /* Basic font description */ + fd.cbSizeofstruct = sizeof(FONTDESC); + fd.lpstrName = (WCHAR*)system_font; + S(fd.cySize).Lo = 100; + S(fd.cySize).Hi = 100; + fd.sWeight = 0; + fd.sCharset = 0; + fd.fItalic = 0; + fd.fUnderline = 0; + fd.fStrikethrough = 0; + + /* Create HFONTs and IFONTs */ + pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj1); + ifnt1 = pvObj1; + IFont_get_hFont(ifnt1,&hfnt1); + fd.lpstrName = (WCHAR*)arial_font; + pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj2); + ifnt2 = pvObj2; + IFont_get_hFont(ifnt2,&hfnt2); + + /* Try invalid HFONT */ + hres = IFont_AddRefHfont(ifnt1,(HFONT)0); + ok(hres == E_INVALIDARG, + "IFont_AddRefHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx\n", + hres); + + /* Try to add a bad HFONT */ + hres = IFont_AddRefHfont(ifnt1,(HFONT)32); + todo_wine{ ok(hres == S_FALSE, + "IFont_AddRefHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx\n", + hres);} + + /* Add simple IFONT HFONT pair */ + hres = IFont_AddRefHfont(ifnt1,hfnt1); + ok(hres == S_OK, + "IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n", + hres); + + /* IFONT and HFONT do not have to be the same (always looks at HFONT) */ + hres = IFont_AddRefHfont(ifnt2,hfnt1); + todo_wine {ok(hres == S_OK, + "IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n", + hres);} + + /* Release all hfnt1 refs */ + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres); + + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + todo_wine {ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres);} + + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + todo_wine {ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres);} + + /* Check if hfnt1 is empty */ + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n", + hres);} + + /* Release all hfnt2 refs */ + hres = IFont_ReleaseHfont(ifnt2,hfnt2); + ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres); + + /* Check if hfnt2 is empty */ + hres = IFont_ReleaseHfont(ifnt2,hfnt2); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n", + hres);} + + /* Show that releasing an IFONT does not always release it from the HFONT cache. */ + + IFont_Release(ifnt1); + + /* Add a reference for destroyed hfnt1 */ + hres = IFont_AddRefHfont(ifnt2,hfnt1); + todo_wine {ok(hres == S_OK, + "IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n", + hres);} + + /* Decrement reference for destroyed hfnt1 */ + hres = IFont_ReleaseHfont(ifnt2,hfnt1); + todo_wine {ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres);} + + /* Shows that releasing all IFONT's does clear the HFONT cache. */ + + IFont_Release(ifnt2); + + /* Need to make a new IFONT for testing */ + fd.fUnderline = 1; + pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj3); + ifnt3 = pvObj3; + IFont_get_hFont(ifnt3,&hfnt3); + + /* Add a reference for destroyed hfnt1 */ + hres = IFont_AddRefHfont(ifnt3,hfnt1); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n", + hres);} + + /* Decrement reference for destroyed hfnt1 */ + hres = IFont_ReleaseHfont(ifnt3,hfnt1); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres);} + + hres = IFont_Release(ifnt3); +} + START_TEST(olefont) { hOleaut32 = LoadLibraryA("oleaut32.dll"); @@ -696,4 +831,5 @@ START_TEST(olefont) test_Invoke(); test_IsEqual(); test_ReleaseHfont(); + test_AddRefHfont(); }
1
0
0
0
Benjamin Arai : oleaut32: Conformance test for olefont:ReleaseHfont.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: c4ba8a8c87b3fab44422546f70f1bf0dfc433fa4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=c4ba8a8c87b3fab44422546…
Author: Benjamin Arai <me(a)benjaminarai.com> Date: Sun Aug 13 23:32:23 2006 -0700 oleaut32: Conformance test for olefont:ReleaseHfont. --- dlls/oleaut32/tests/olefont.c | 77 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 75 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 42eb332..73c460f 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -599,6 +599,78 @@ static void test_IsEqual() IFont_Release(ifnt); } +static void test_ReleaseHfont(void) +{ + FONTDESC fd; + static const WCHAR system_font[] = { 'S','y','s','t','e','m',0 }; + static const WCHAR arial_font[] = { 'A','r','i','a','l',0 }; + LPVOID pvObj1 = NULL; + LPVOID pvObj2 = NULL; + IFont* ifnt1 = NULL; + IFont* ifnt2 = NULL; + HFONT hfnt1 = 0; + HFONT hfnt2 = 0; + HRESULT hres; + + /* Basic font description */ + fd.cbSizeofstruct = sizeof(FONTDESC); + fd.lpstrName = (WCHAR*)system_font; + S(fd.cySize).Lo = 100; + S(fd.cySize).Hi = 100; + fd.sWeight = 0; + fd.sCharset = 0; + fd.fItalic = 0; + fd.fUnderline = 0; + fd.fStrikethrough = 0; + + /* Create HFONTs and IFONTs */ + pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj1); + ifnt1 = pvObj1; + IFont_get_hFont(ifnt1,&hfnt1); + fd.lpstrName = (WCHAR*)arial_font; + pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj2); + ifnt2 = pvObj2; + IFont_get_hFont(ifnt2,&hfnt2); + + /* Try invalid HFONT */ + hres = IFont_ReleaseHfont(ifnt1,(HFONT)0); + ok(hres == E_INVALIDARG, + "IFont_ReleaseHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx\n", + hres); + + /* Try to add a bad HFONT */ + hres = IFont_ReleaseHfont(ifnt1,(HFONT)32); + todo_wine {ok(hres == S_FALSE, + "IFont_ReleaseHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx\n", + hres);} + + /* Release all refs */ + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres); + + hres = IFont_ReleaseHfont(ifnt2,hfnt2); + ok(hres == S_OK, + "IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n", + hres); + + /* Check that both lists are empty */ + hres = IFont_ReleaseHfont(ifnt1,hfnt1); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n", + hres);} + + /* The list should be empty */ + hres = IFont_ReleaseHfont(ifnt2,hfnt2); + todo_wine {ok(hres == S_FALSE, + "IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n", + hres);} + + IFont_Release(ifnt1); + IFont_Release(ifnt2); +} + START_TEST(olefont) { hOleaut32 = LoadLibraryA("oleaut32.dll"); @@ -616,11 +688,12 @@ START_TEST(olefont) test_ifont_sizes(180000, 0, 72, 1270, -36, "ratio2"); /* 2nd part of ratio */ /* These depend on details of how IFont rounds sizes internally. */ - /* test_ifont_sizes(0, 0, 72, 2540, 0, "zero size"); */ /* zero size */ - /* test_ifont_sizes(186000, 0, 72, 2540, -19, "rounding"); */ /* test rounding */ + test_ifont_sizes(0, 0, 72, 2540, 0, "zero size"); /* zero size */ + test_ifont_sizes(186000, 0, 72, 2540, -19, "rounding"); /* test rounding */ test_font_events_disp(); test_GetIDsOfNames(); test_Invoke(); test_IsEqual(); + test_ReleaseHfont(); }
1
0
0
0
Mike McCormack : oleaut32: Calculate icon data if the picture is dirty, or there's no icon data.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: eb9f46037c2599caa240c1ebbd008d9b142d751f URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=eb9f46037c2599caa240c1e…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Mon Aug 14 14:07:30 2006 +0900 oleaut32: Calculate icon data if the picture is dirty, or there's no icon data. --- dlls/oleaut32/olepicture.c | 45 ++++++++++++++++++-------------------------- 1 files changed, 18 insertions(+), 27 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 66a76df..569fe15 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -1826,41 +1826,32 @@ static HRESULT WINAPI OLEPictureImpl_Sav unsigned int iDataSize; ULONG dummy; int iSerializeResult = 0; + OLEPictureImpl *This = impl_from_IPersistStream(iface); - OLEPictureImpl *This = impl_from_IPersistStream(iface); + TRACE("%p %p %d\n", This, pStm, fClearDirty); switch (This->desc.picType) { case PICTYPE_ICON: - if (This->bIsDirty) { - if (serializeIcon(This->desc.u.icon.hicon, &pIconData, &iDataSize)) { - if (This->loadtime_magic != 0xdeadbeef) { - DWORD header[2]; - - header[0] = This->loadtime_magic; - header[1] = iDataSize; - IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy); - } - IStream_Write(pStm, pIconData, iDataSize, &dummy); - - HeapFree(GetProcessHeap(), 0, This->data); - This->data = pIconData; - This->datalen = iDataSize; - hResult = S_OK; - } else { - FIXME("(%p,%p,%d), unable to serializeIcon()!\n",This,pStm,fClearDirty); + if (This->bIsDirty || !This->data) { + if (!serializeIcon(This->desc.u.icon.hicon, &pIconData, &iDataSize)) { + ERR("(%p,%p,%d), serializeIcon() failed\n", This, pStm, fClearDirty); hResult = E_FAIL; + break; } - } else { - if (This->loadtime_magic != 0xdeadbeef) { - DWORD header[2]; + This->data = pIconData; + This->datalen = iDataSize; + } + if (This->loadtime_magic != 0xdeadbeef) { + DWORD header[2]; - header[0] = This->loadtime_magic; - header[1] = This->datalen; - IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy); - } - IStream_Write(pStm, This->data, This->datalen, &dummy); - hResult = S_OK; + header[0] = This->loadtime_magic; + header[1] = This->datalen; + IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy); } + IStream_Write(pStm, This->data, This->datalen, &dummy); + + HeapFree(GetProcessHeap(), 0, This->data); + hResult = S_OK; break; case PICTYPE_BITMAP: if (This->bIsDirty) {
1
0
0
0
Mike McCormack : oleaut32: Print an IID in the trace, not just a pointer to it.
by Alexandre Julliard
14 Aug '06
14 Aug '06
Module: wine Branch: master Commit: cbfc35602e0fad386f01b2fed4715765f6536498 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cbfc35602e0fad386f01b2f…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Mon Aug 14 14:07:14 2006 +0900 oleaut32: Print an IID in the trace, not just a pointer to it. --- dlls/oleaut32/olepicture.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 83ef0aa..66a76df 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -2228,7 +2228,7 @@ HRESULT WINAPI OleCreatePictureIndirect( OLEPictureImpl* newPict = NULL; HRESULT hr = S_OK; - TRACE("(%p,%p,%d,%p)\n", lpPictDesc, riid, fOwn, ppvObj); + TRACE("(%p,%s,%d,%p)\n", lpPictDesc, debugstr_guid(riid), fOwn, ppvObj); /* * Sanity check
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
75
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
Results per page:
10
25
50
100
200