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
January 2010
----- 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
3 participants
615 discussions
Start a n
N
ew thread
Juan Lang : wintrust: Return error directly from SOFTPUB_DecodeInnerContent .
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 6099adf79a639a9652d38424c9f4fa1c235c0b02 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6099adf79a639a9652d38424c…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:40:32 2010 -0800 wintrust: Return error directly from SOFTPUB_DecodeInnerContent. --- dlls/wintrust/softpub.c | 39 ++++++++++++++++++++++++++------------- 1 files changed, 26 insertions(+), 13 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index a9f8f29..2524df3 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -216,56 +216,70 @@ static DWORD SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) static DWORD SOFTPUB_DecodeInnerContent(CRYPT_PROVIDER_DATA *data) { BOOL ret; - DWORD size; + DWORD size, err = ERROR_SUCCESS; LPSTR oid = NULL; LPBYTE buf = NULL; ret = CryptMsgGetParam(data->hMsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, NULL, &size); if (!ret) + { + err = GetLastError(); goto error; + } oid = data->psPfns->pfnAlloc(size); if (!oid) { - SetLastError(ERROR_OUTOFMEMORY); - ret = FALSE; + err = ERROR_OUTOFMEMORY; goto error; } ret = CryptMsgGetParam(data->hMsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, oid, &size); if (!ret) + { + err = GetLastError(); goto error; + } ret = CryptMsgGetParam(data->hMsg, CMSG_CONTENT_PARAM, 0, NULL, &size); if (!ret) + { + err = GetLastError(); goto error; + } buf = data->psPfns->pfnAlloc(size); if (!buf) { - SetLastError(ERROR_OUTOFMEMORY); - ret = FALSE; + err = ERROR_OUTOFMEMORY; goto error; } ret = CryptMsgGetParam(data->hMsg, CMSG_CONTENT_PARAM, 0, buf, &size); if (!ret) + { + err = GetLastError(); goto error; + } ret = CryptDecodeObject(data->dwEncoding, oid, buf, size, 0, NULL, &size); if (!ret) + { + err = GetLastError(); goto error; + } data->u.pPDSip->psIndirectData = data->psPfns->pfnAlloc(size); if (!data->u.pPDSip->psIndirectData) { - SetLastError(ERROR_OUTOFMEMORY); - ret = FALSE; + err = ERROR_OUTOFMEMORY; goto error; } ret = CryptDecodeObject(data->dwEncoding, oid, buf, size, 0, data->u.pPDSip->psIndirectData, &size); + if (!ret) + err = GetLastError(); error: - TRACE("returning %d\n", ret); + TRACE("returning %d\n", err); data->psPfns->pfnFree(oid); data->psPfns->pfnFree(buf); - return ret; + return err; } static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) @@ -347,8 +361,8 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_CreateStoreFromMessage(data); if (err) goto error; - if (!SOFTPUB_DecodeInnerContent(data)) - err = GetLastError(); + err = SOFTPUB_DecodeInnerContent(data); + error: return err; } @@ -385,8 +399,7 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_CreateStoreFromMessage(data); if (err) goto error; - if (!SOFTPUB_DecodeInnerContent(data)) - err = GetLastError(); + err = SOFTPUB_DecodeInnerContent(data); /* FIXME: this loads the catalog file, but doesn't validate the member. */ error: CloseHandle(catalog);
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_CreateStoreFromMessage.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 8085ea5fe07afa67a16cfb76af45fbf70d7c5078 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8085ea5fe07afa67a16cfb76a…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:37:59 2010 -0800 wintrust: Return error directly from SOFTPUB_CreateStoreFromMessage. --- dlls/wintrust/softpub.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 680afcd..a9f8f29 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -194,20 +194,23 @@ static DWORD SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, return err; } -static BOOL SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) { - BOOL ret = FALSE; + DWORD err = ERROR_SUCCESS; HCERTSTORE store; store = CertOpenStore(CERT_STORE_PROV_MSG, data->dwEncoding, data->hProv, CERT_STORE_NO_CRYPT_RELEASE_FLAG, data->hMsg); if (store) { - ret = data->psPfns->pfnAddStore2Chain(data, store); + if (!data->psPfns->pfnAddStore2Chain(data, store)) + err = GetLastError(); CertCloseStore(store, 0); } - TRACE("returning %d\n", ret); - return ret; + else + err = GetLastError(); + TRACE("returning %d\n", err); + return err; } static DWORD SOFTPUB_DecodeInnerContent(CRYPT_PROVIDER_DATA *data) @@ -341,11 +344,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) data->pWintrustData->u.pFile->pcwszFilePath); if (err) goto error; - if (!SOFTPUB_CreateStoreFromMessage(data)) - { - err = GetLastError(); + err = SOFTPUB_CreateStoreFromMessage(data); + if (err) goto error; - } if (!SOFTPUB_DecodeInnerContent(data)) err = GetLastError(); error: @@ -381,11 +382,9 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) data->pWintrustData->u.pFile->pcwszFilePath); if (err) goto error; - if (!SOFTPUB_CreateStoreFromMessage(data)) - { - err = GetLastError(); + err = SOFTPUB_CreateStoreFromMessage(data); + if (err) goto error; - } if (!SOFTPUB_DecodeInnerContent(data)) err = GetLastError(); /* FIXME: this loads the catalog file, but doesn't validate the member. */
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_GetMessageFromFile .
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 568b0025c7c2fc4e7b9af8bd4cbd756af8d8e1ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=568b0025c7c2fc4e7b9af8bd4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:35:07 2010 -0800 wintrust: Return error directly from SOFTPUB_GetMessageFromFile. --- dlls/wintrust/softpub.c | 44 +++++++++++++++++++------------------------- 1 files changed, 19 insertions(+), 25 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index a6edfe2..680afcd 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -146,9 +146,10 @@ static DWORD SOFTPUB_GetSIP(CRYPT_PROVIDER_DATA *data) /* Assumes data->u.pPDSip has been loaded, and data->u.pPDSip->pSip allocated. * Calls data->u.pPDSip->pSip->pfGet to construct data->hMsg. */ -static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, +static DWORD SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, LPCWSTR filePath) { + DWORD err = ERROR_SUCCESS; BOOL ret; LPBYTE buf = NULL; DWORD size = 0; @@ -156,10 +157,7 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, data->u.pPDSip->psSipSubjectInfo = data->psPfns->pfnAlloc(sizeof(SIP_SUBJECTINFO)); if (!data->u.pPDSip->psSipSubjectInfo) - { - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } + return ERROR_OUTOFMEMORY; data->u.pPDSip->psSipSubjectInfo->cbSize = sizeof(SIP_SUBJECTINFO); data->u.pPDSip->psSipSubjectInfo->pgSubjectType = &data->u.pPDSip->gSubject; @@ -169,17 +167,11 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, ret = data->u.pPDSip->pSip->pfGet(data->u.pPDSip->psSipSubjectInfo, &data->dwEncoding, 0, &size, 0); if (!ret) - { - SetLastError(TRUST_E_NOSIGNATURE); - return FALSE; - } + return TRUST_E_NOSIGNATURE; buf = data->psPfns->pfnAlloc(size); if (!buf) - { - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } + return ERROR_OUTOFMEMORY; ret = data->u.pPDSip->pSip->pfGet(data->u.pPDSip->psSipSubjectInfo, &data->dwEncoding, 0, &size, buf); @@ -188,12 +180,18 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, data->hMsg = CryptMsgOpenToDecode(data->dwEncoding, 0, 0, data->hProv, NULL, NULL); if (data->hMsg) + { ret = CryptMsgUpdate(data->hMsg, buf, size, TRUE); + if (!ret) + err = GetLastError(); + } } + else + err = GetLastError(); data->psPfns->pfnFree(buf); - TRACE("returning %d\n", ret); - return ret; + TRACE("returning %d\n", err); + return err; } static BOOL SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) @@ -339,12 +337,10 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_GetSIP(data); if (err) goto error; - if (!SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, - data->pWintrustData->u.pFile->pcwszFilePath)) - { - err = GetLastError(); + err = SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, + data->pWintrustData->u.pFile->pcwszFilePath); + if (err) goto error; - } if (!SOFTPUB_CreateStoreFromMessage(data)) { err = GetLastError(); @@ -381,12 +377,10 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_GetSIP(data); if (err) goto error; - if (!SOFTPUB_GetMessageFromFile(data, catalog, - data->pWintrustData->u.pCatalog->pcwszCatalogFilePath)) - { - err = GetLastError(); + err = SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, + data->pWintrustData->u.pFile->pcwszFilePath); + if (err) goto error; - } if (!SOFTPUB_CreateStoreFromMessage(data)) { err = GetLastError();
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_GetSIP.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 2c12de4b7e4536460aab1baeea1dda78da132fa1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2c12de4b7e4536460aab1baee…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:31:26 2010 -0800 wintrust: Return error directly from SOFTPUB_GetSIP. --- dlls/wintrust/softpub.c | 28 ++++++++++++---------------- 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 356d8fe..a6edfe2 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -127,20 +127,20 @@ static DWORD SOFTPUB_GetFileSubject(CRYPT_PROVIDER_DATA *data) /* Assumes data->u.pPDSip exists, and its gSubject member set. * Allocates data->u.pPDSip->pSip and loads it, if possible. */ -static BOOL SOFTPUB_GetSIP(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_GetSIP(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + DWORD err = ERROR_SUCCESS; data->u.pPDSip->pSip = data->psPfns->pfnAlloc(sizeof(SIP_DISPATCH_INFO)); if (data->u.pPDSip->pSip) - ret = CryptSIPLoad(&data->u.pPDSip->gSubject, 0, data->u.pPDSip->pSip); - else { - SetLastError(ERROR_OUTOFMEMORY); - ret = FALSE; + if (!CryptSIPLoad(&data->u.pPDSip->gSubject, 0, data->u.pPDSip->pSip)) + err = GetLastError(); } - TRACE("returning %d\n", ret); - return ret; + else + err = ERROR_OUTOFMEMORY; + TRACE("returning %d\n", err); + return err; } /* Assumes data->u.pPDSip has been loaded, and data->u.pPDSip->pSip allocated. @@ -336,11 +336,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_GetFileSubject(data); if (err) goto error; - if (!SOFTPUB_GetSIP(data)) - { - err = GetLastError(); + err = SOFTPUB_GetSIP(data); + if (err) goto error; - } if (!SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, data->pWintrustData->u.pFile->pcwszFilePath)) { @@ -380,11 +378,9 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) err = GetLastError(); goto error; } - if (!SOFTPUB_GetSIP(data)) - { - err = GetLastError(); + err = SOFTPUB_GetSIP(data); + if (err) goto error; - } if (!SOFTPUB_GetMessageFromFile(data, catalog, data->pWintrustData->u.pCatalog->pcwszCatalogFilePath)) {
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_GetFileSubject.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: b5fbb87470e42064765467aad1de67937c231c71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5fbb87470e42064765467aad…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:29:35 2010 -0800 wintrust: Return error directly from SOFTPUB_GetFileSubject. --- dlls/wintrust/softpub.c | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 1ff0599..356d8fe 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -104,26 +104,24 @@ static DWORD SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data) /* Assumes data->pWintrustData->u.pFile exists. Sets data->pPDSip->gSubject to * the file's subject GUID. */ -static BOOL SOFTPUB_GetFileSubject(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_GetFileSubject(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + DWORD err = ERROR_SUCCESS; if (!WVT_ISINSTRUCT(WINTRUST_FILE_INFO, data->pWintrustData->u.pFile->cbStruct, pgKnownSubject) || !data->pWintrustData->u.pFile->pgKnownSubject) { - ret = CryptSIPRetrieveSubjectGuid( + if (!CryptSIPRetrieveSubjectGuid( data->pWintrustData->u.pFile->pcwszFilePath, data->pWintrustData->u.pFile->hFile, - &data->u.pPDSip->gSubject); + &data->u.pPDSip->gSubject)) + err = GetLastError(); } else - { data->u.pPDSip->gSubject = *data->pWintrustData->u.pFile->pgKnownSubject; - ret = TRUE; - } - TRACE("returning %d\n", ret); - return ret; + TRACE("returning %d\n", err); + return err; } /* Assumes data->u.pPDSip exists, and its gSubject member set. @@ -335,11 +333,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_OpenFile(data); if (err) goto error; - if (!SOFTPUB_GetFileSubject(data)) - { - err = GetLastError(); + err = SOFTPUB_GetFileSubject(data); + if (err) goto error; - } if (!SOFTPUB_GetSIP(data)) { err = GetLastError();
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_OpenFile.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: fc1fbf61074fed98b1423cf501580ecb57d5b995 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc1fbf61074fed98b1423cf50…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:27:49 2010 -0800 wintrust: Return error directly from SOFTPUB_OpenFile. --- dlls/wintrust/softpub.c | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 967bb1a..1ff0599 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -75,9 +75,9 @@ HRESULT WINAPI DriverFinalPolicy(CRYPT_PROVIDER_DATA *data) /* Assumes data->pWintrustData->u.pFile exists. Makes sure a file handle is * open for the file. */ -static BOOL SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data) { - BOOL ret = TRUE; + DWORD err = ERROR_SUCCESS; /* PSDK implies that all values should be initialized to NULL, so callers * typically have hFile as NULL rather than INVALID_HANDLE_VALUE. Check @@ -92,13 +92,13 @@ static BOOL SOFTPUB_OpenFile(CRYPT_PROVIDER_DATA *data) if (data->pWintrustData->u.pFile->hFile != INVALID_HANDLE_VALUE) data->fOpenedFile = TRUE; else - ret = FALSE; + err = GetLastError(); } - if (ret) + if (!err) GetFileTime(data->pWintrustData->u.pFile->hFile, &data->sftSystemTime, NULL, NULL); - TRACE("returning %d\n", ret); - return ret; + TRACE("returning %d\n", err); + return err; } /* Assumes data->pWintrustData->u.pFile exists. Sets data->pPDSip->gSubject to @@ -332,11 +332,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) err = ERROR_INVALID_PARAMETER; goto error; } - if (!SOFTPUB_OpenFile(data)) - { - err = GetLastError(); + err = SOFTPUB_OpenFile(data); + if (err) goto error; - } if (!SOFTPUB_GetFileSubject(data)) { err = GetLastError();
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_LoadCatalogMessage .
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 528876c40230f0e8c0fefa39b9b77088892b7319 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=528876c40230f0e8c0fefa39b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:26:36 2010 -0800 wintrust: Return error directly from SOFTPUB_LoadCatalogMessage. --- dlls/wintrust/softpub.c | 41 +++++++++++++++++++++++++---------------- 1 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 9d13b4a..967bb1a 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -364,9 +364,9 @@ error: return err; } -static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + DWORD err; HANDLE catalog = INVALID_HANDLE_VALUE; if (!data->pWintrustData->u.pCatalog) @@ -378,27 +378,36 @@ static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (catalog == INVALID_HANDLE_VALUE) - return FALSE; - ret = CryptSIPRetrieveSubjectGuid( + return GetLastError(); + if (!CryptSIPRetrieveSubjectGuid( data->pWintrustData->u.pCatalog->pcwszCatalogFilePath, catalog, - &data->u.pPDSip->gSubject); - if (!ret) + &data->u.pPDSip->gSubject)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetSIP(data); - if (!ret) + } + if (!SOFTPUB_GetSIP(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetMessageFromFile(data, catalog, - data->pWintrustData->u.pCatalog->pcwszCatalogFilePath); - if (!ret) + } + if (!SOFTPUB_GetMessageFromFile(data, catalog, + data->pWintrustData->u.pCatalog->pcwszCatalogFilePath)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_CreateStoreFromMessage(data); - if (!ret) + } + if (!SOFTPUB_CreateStoreFromMessage(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_DecodeInnerContent(data); + } + if (!SOFTPUB_DecodeInnerContent(data)) + err = GetLastError(); /* FIXME: this loads the catalog file, but doesn't validate the member. */ error: CloseHandle(catalog); - return ret; + return err; } HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) @@ -420,7 +429,7 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) err = SOFTPUB_LoadFileMessage(data); break; case WTD_CHOICE_CATALOG: - ret = SOFTPUB_LoadCatalogMessage(data); + err = SOFTPUB_LoadCatalogMessage(data); break; default: FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice);
1
0
0
0
Juan Lang : wintrust: Return error directly from SOFTPUB_LoadFileMessage.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 9e8e14ed127fd5a017777cc7ac91087cdc59c72e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e8e14ed127fd5a017777cc7a…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Jan 27 10:25:48 2010 -0800 wintrust: Return error directly from SOFTPUB_LoadFileMessage. --- dlls/wintrust/softpub.c | 54 ++++++++++++++++++++++++++++++---------------- 1 files changed, 35 insertions(+), 19 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 47b76b2..9d13b4a 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -323,35 +323,45 @@ static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) return ret; } -static BOOL SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) +static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + DWORD err = ERROR_SUCCESS; if (!data->pWintrustData->u.pFile) { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; + err = ERROR_INVALID_PARAMETER; goto error; } - ret = SOFTPUB_OpenFile(data); - if (!ret) + if (!SOFTPUB_OpenFile(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetFileSubject(data); - if (!ret) + } + if (!SOFTPUB_GetFileSubject(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetSIP(data); - if (!ret) + } + if (!SOFTPUB_GetSIP(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, - data->pWintrustData->u.pFile->pcwszFilePath); - if (!ret) + } + if (!SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, + data->pWintrustData->u.pFile->pcwszFilePath)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_CreateStoreFromMessage(data); - if (!ret) + } + if (!SOFTPUB_CreateStoreFromMessage(data)) + { + err = GetLastError(); goto error; - ret = SOFTPUB_DecodeInnerContent(data); + } + if (!SOFTPUB_DecodeInnerContent(data)) + err = GetLastError(); error: - return ret; + return err; } static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) @@ -393,7 +403,8 @@ error: HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) { - BOOL ret; + BOOL ret = TRUE; + DWORD err = ERROR_SUCCESS; TRACE("(%p)\n", data); @@ -406,7 +417,7 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) ret = SOFTPUB_LoadCertMessage(data); break; case WTD_CHOICE_FILE: - ret = SOFTPUB_LoadFileMessage(data); + err = SOFTPUB_LoadFileMessage(data); break; case WTD_CHOICE_CATALOG: ret = SOFTPUB_LoadCatalogMessage(data); @@ -420,6 +431,11 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) if (!ret) data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = GetLastError(); + else if (err) + { + data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = err; + ret = FALSE; + } TRACE("returning %d (%08x)\n", ret ? S_OK : S_FALSE, data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]); return ret ? S_OK : S_FALSE;
1
0
0
0
Matijn Woudt : winhttp/tests: Add tests for WinHttpSetTimeouts.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 5a712037aff785e943bc29f15fb065bb3cb48c3a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a712037aff785e943bc29f15…
Author: Matijn Woudt <tijnema(a)gmail.com> Date: Wed Jan 27 23:01:29 2010 +0100 winhttp/tests: Add tests for WinHttpSetTimeouts. --- dlls/winhttp/tests/winhttp.c | 108 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 108 insertions(+), 0 deletions(-) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index f0b46b6..bddf871 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -1031,6 +1031,113 @@ static void test_set_default_proxy_config(void) GetLastError()); } +static void test_Timeouts (void) +{ + BOOL ret; + HINTERNET ses, req, con; + static const WCHAR codeweavers[] = {'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m',0}; + + + ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ok(ses != NULL, "failed to open session %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, -2, 0, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, 0, -2, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, 0, 0, -2, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, 0, 0, 0, -2); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, -1, -1, -1, -1); + todo_wine ok(ret, "%u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(ses, 0, 0, 0, 0); + todo_wine ok(ret, "%u\n", GetLastError()); + + con = WinHttpConnect(ses, codeweavers, 0, 0); + ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, -2, 0, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, 0, -2, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, 0, 0, -2, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, 0, 0, 0, -2); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, -1, -1, -1, -1); + ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, + "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(con, 0, 0, 0, 0); + ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, + "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + + req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, -2, 0, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, 0, -2, 0, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, 0, 0, -2, 0); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, 0, 0, 0, -2); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, -1, -1, -1, -1); + ok(ret, "%u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WinHttpSetTimeouts(req, 0, 0, 0, 0); + ok(ret, "%u\n", GetLastError()); + + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); +} + START_TEST (winhttp) { test_OpenRequest(); @@ -1043,4 +1150,5 @@ START_TEST (winhttp) test_QueryOption(); test_set_default_proxy_config(); test_empty_headers_param(); + test_Timeouts(); }
1
0
0
0
Erich Hoover : hhctrl.ocx: Handle Index tab sub-topics.
by Alexandre Julliard
28 Jan '10
28 Jan '10
Module: wine Branch: master Commit: 6ae7fe659e4171e98ec011c544fd0d60a45a41d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ae7fe659e4171e98ec011c54…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Wed Jan 27 01:12:32 2010 -0700 hhctrl.ocx: Handle Index tab sub-topics. --- dlls/hhctrl.ocx/help.c | 193 +++++++++++++++++++++++++++++++++++++++++++++- dlls/hhctrl.ocx/hhctrl.h | 7 ++ 2 files changed, 199 insertions(+), 1 deletions(-) diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 64f7b24..60614c2 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -429,7 +429,25 @@ static LRESULT OnTopicChange(HWND hwnd, void *user_data) return 0; } if(iiter->nItems > 1) { - FIXME("Support for sub-topics not implemented.\n"); + int i = 0; + LVITEMW lvi; + + SendMessageW(info->popup.hwndList, LVM_DELETEALLITEMS, 0, 0); + for(i=0;i<iiter->nItems;i++) { + IndexSubItem *item = &iiter->items[i]; + WCHAR *name = iiter->keyword; + + if(item->name) + name = item->name; + memset(&lvi, 0, sizeof(lvi)); + lvi.iItem = i; + lvi.mask = LVIF_TEXT|LVIF_PARAM; + lvi.cchTextMax = strlenW(name)+1; + lvi.pszText = name; + lvi.lParam = (LPARAM) item; + SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi); + } + ShowWindow(info->popup.hwndPopup, SW_SHOW); return 0; } name = iiter->items[0].name; @@ -825,6 +843,176 @@ static BOOL AddIndexTab(HHInfo *info) return TRUE; } +/* The Index tab's sub-topic popup */ + +static void ResizePopupChild(HHInfo *info) +{ + int scroll_width = GetSystemMetrics(SM_CXVSCROLL); + int border_width = GetSystemMetrics(SM_CXBORDER); + int edge_width = GetSystemMetrics(SM_CXEDGE); + INT width, height; + RECT rect; + + if(!info) + return; + + GetClientRect(info->popup.hwndPopup, &rect); + SetWindowPos(info->popup.hwndCallback, HWND_TOP, 0, 0, + rect.right, rect.bottom, SWP_NOMOVE); + + rect.left = TAB_MARGIN; + rect.top = TAB_TOP_PADDING + TAB_MARGIN; + rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN; + rect.bottom -= TAB_MARGIN; + width = rect.right-rect.left; + height = rect.bottom-rect.top; + + SetWindowPos(info->popup.hwndList, NULL, rect.left, rect.top, width, height, + SWP_NOZORDER | SWP_NOACTIVATE); + + SendMessageW(info->popup.hwndList, LVM_SETCOLUMNWIDTH, 0, + width-scroll_width-2*border_width-2*edge_width); +} + +static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + HHInfo *info = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + + switch (message) + { + case WM_SIZE: + ResizePopupChild(info); + return 0; + case WM_DESTROY: + DestroyWindow(hWnd); + return 0; + case WM_CLOSE: + ShowWindow(hWnd, SW_HIDE); + return 0; + + default: + return DefWindowProcW(hWnd, message, wParam, lParam); + } + + return 0; +} + +static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_NOTIFY: { + NMHDR *nmhdr = (NMHDR*)lParam; + if(nmhdr->code == NM_DBLCLK) { + HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + IndexSubItem *iter; + + if(info == 0 || lParam == 0) + return 0; + iter = (IndexSubItem*) ((NMITEMACTIVATE *)lParam)->lParam; + if(iter == 0) + return 0; + NavigateToChm(info, info->index->merge.chm_file, iter->local); + ShowWindow(info->popup.hwndPopup, SW_HIDE); + return 0; + } + break; + } + default: + return DefWindowProcW(hWnd, message, wParam, lParam); + } + + return 0; +} + +static BOOL AddIndexPopup(HHInfo *info) +{ + static const WCHAR szPopupChildClass[] = {'H','H',' ','P','o','p','u','p',' ','C','h','i','l','d',0}; + static const WCHAR windowCaptionW[] = {'S','e','l','e','c','t',' ','T','o','p','i','c',':',0}; + static const WCHAR windowClassW[] = {'H','H',' ','P','o','p','u','p',0}; + HWND hwndList, hwndPopup, hwndCallback; + char hidden_column[] = "Column"; + WNDCLASSEXW wcex; + LVCOLUMNA lvc; + + if(info->tabs[TAB_INDEX].id == -1) + return TRUE; /* No "Index" tab */ + + wcex.cbSize = sizeof(WNDCLASSEXW); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = HelpPopup_WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hhctrl_hinstance; + wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1); + wcex.lpszMenuName = NULL; + wcex.lpszClassName = windowClassW; + wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + RegisterClassExW(&wcex); + + wcex.cbSize = sizeof(WNDCLASSEXW); + wcex.style = 0; + wcex.lpfnWndProc = PopupChild_WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hhctrl_hinstance; + wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wcex.lpszMenuName = NULL; + wcex.lpszClassName = szPopupChildClass; + wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + RegisterClassExW(&wcex); + + hwndPopup = CreateWindowExW(WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW + | WS_EX_WINDOWEDGE | WS_EX_RIGHTSCROLLBAR, + windowClassW, windowCaptionW, WS_POPUPWINDOW + | WS_OVERLAPPEDWINDOW | WS_VISIBLE + | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, CW_USEDEFAULT, + CW_USEDEFAULT, 300, 200, info->WinType.hwndHelp, + NULL, hhctrl_hinstance, NULL); + if (!hwndPopup) + return FALSE; + + hwndCallback = CreateWindowExW(WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR, + szPopupChildClass, szEmpty, WS_CHILDWINDOW | WS_VISIBLE, + 0, 0, 0, 0, + hwndPopup, NULL, hhctrl_hinstance, NULL); + if (!hwndCallback) + return FALSE; + + ShowWindow(hwndPopup, SW_HIDE); + hwndList = CreateWindowExW(WS_EX_CLIENTEDGE, WC_LISTVIEWW, szEmpty, + WS_CHILD | WS_BORDER | LVS_SINGLESEL | LVS_REPORT + | LVS_NOCOLUMNHEADER, 50, 50, 100, 100, + hwndCallback, NULL, hhctrl_hinstance, NULL); + if(!hwndList) { + ERR("Could not create popup ListView control\n"); + return FALSE; + } + memset(&lvc, 0, sizeof(lvc)); + lvc.mask = LVCF_TEXT; + lvc.pszText = hidden_column; + if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1) + { + ERR("Could not create popup ListView column\n"); + return FALSE; + } + + info->popup.hwndCallback = hwndCallback; + info->popup.hwndPopup = hwndPopup; + info->popup.hwndList = hwndList; + SetWindowLongPtrW(hwndPopup, GWLP_USERDATA, (LONG_PTR)info); + SetWindowLongPtrW(hwndCallback, GWLP_USERDATA, (LONG_PTR)info); + + ResizePopupChild(info); + ShowWindow(hwndList, SW_SHOW); + + return TRUE; +} + /* Viewer Window */ static LRESULT Help_OnSize(HWND hWnd) @@ -1003,6 +1191,9 @@ static BOOL CreateViewer(HHInfo *pHHInfo) if (!AddIndexTab(pHHInfo)) return FALSE; + if (!AddIndexPopup(pHHInfo)) + return FALSE; + InitContent(pHHInfo); InitIndex(pHHInfo); diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index 8a3329e..d0c1545 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -108,6 +108,12 @@ typedef struct { } HHTab; typedef struct { + HWND hwndList; + HWND hwndPopup; + HWND hwndCallback; +} IndexPopup; + +typedef struct { IOleClientSite *client_site; IWebBrowser2 *web_browser; IOleObject *wb_object; @@ -129,6 +135,7 @@ typedef struct { CHMInfo *pCHMInfo; ContentItem *content; IndexItem *index; + IndexPopup popup; HWND hwndTabCtrl; HWND hwndSizeBar; HFONT hFont;
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
62
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
Results per page:
10
25
50
100
200