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
December 2009
----- 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
1233 discussions
Start a n
N
ew thread
Juan Lang : cryptnet: Use helper function to check revocation with a CRL distribution points extension .
by Alexandre Julliard
18 Dec '09
18 Dec '09
Module: wine Branch: master Commit: 7a987b77148c6d7e5674b06c794142daf881c1f2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a987b77148c6d7e5674b06c7…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Dec 2 17:28:49 2009 -0800 cryptnet: Use helper function to check revocation with a CRL distribution points extension. --- dlls/cryptnet/cryptnet_main.c | 154 ++++++++++++++++++++++------------------- 1 files changed, 83 insertions(+), 71 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index bf7a2ab..10863a2 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1578,20 +1578,97 @@ static DWORD verify_cert_revocation_with_crl(PCCERT_CONTEXT cert, return error; } -static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index, +static DWORD verify_cert_revocation_from_dist_points_ext( + const CRYPT_DATA_BLOB *value, PCCERT_CONTEXT cert, DWORD index, FILETIME *pTime, DWORD dwFlags, PCERT_REVOCATION_PARA pRevPara, PCERT_REVOCATION_STATUS pRevStatus) { - BOOL ret; DWORD error = ERROR_SUCCESS, cbUrlArray; - ret = CryptGetObjectUrl(URL_OID_CERTIFICATE_CRL_DIST_POINT, (void *)cert, - 0, NULL, &cbUrlArray, NULL, NULL, NULL); - if (!ret && GetLastError() == CRYPT_E_NOT_FOUND) + if (CRYPT_GetUrlFromCRLDistPointsExt(value, NULL, &cbUrlArray, NULL, NULL)) + { + CRYPT_URL_ARRAY *urlArray = CryptMemAlloc(cbUrlArray); + + if (urlArray) + { + DWORD j, retrievalFlags = 0, startTime, endTime, timeout; + BOOL ret; + + ret = CRYPT_GetUrlFromCRLDistPointsExt(value, urlArray, + &cbUrlArray, NULL, NULL); + if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION) + retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL; + if (dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG && + pRevPara && pRevPara->cbSize >= offsetof(CERT_REVOCATION_PARA, + dwUrlRetrievalTimeout) + sizeof(DWORD)) + { + startTime = GetTickCount(); + endTime = startTime + pRevPara->dwUrlRetrievalTimeout; + timeout = pRevPara->dwUrlRetrievalTimeout; + } + else + endTime = timeout = 0; + if (!ret) + error = GetLastError(); + for (j = 0; !error && j < urlArray->cUrl; j++) + { + PCCRL_CONTEXT crl; + + ret = CryptRetrieveObjectByUrlW(urlArray->rgwszUrl[j], + CONTEXT_OID_CRL, retrievalFlags, timeout, (void **)&crl, + NULL, NULL, NULL, NULL); + if (ret) + { + error = verify_cert_revocation_with_crl(cert, crl, index, + pTime, pRevStatus); + if (!error && timeout) + { + DWORD time = GetTickCount(); + + if ((int)(endTime - time) <= 0) + { + error = ERROR_TIMEOUT; + pRevStatus->dwIndex = index; + } + else + timeout = endTime - time; + } + CertFreeCRLContext(crl); + } + else + error = CRYPT_E_REVOCATION_OFFLINE; + } + CryptMemFree(urlArray); + } + else + { + error = ERROR_OUTOFMEMORY; + pRevStatus->dwIndex = index; + } + } + else + { + error = GetLastError(); + pRevStatus->dwIndex = index; + } + return error; +} + +static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index, + FILETIME *pTime, DWORD dwFlags, PCERT_REVOCATION_PARA pRevPara, + PCERT_REVOCATION_STATUS pRevStatus) +{ + DWORD error = ERROR_SUCCESS; + PCERT_EXTENSION ext; + + if ((ext = CertFindExtension(szOID_CRL_DIST_POINTS, + cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension))) + error = verify_cert_revocation_from_dist_points_ext(&ext->Value, cert, + index, pTime, dwFlags, pRevPara, pRevStatus); + else { if (pRevPara && pRevPara->hCrlStore && pRevPara->pIssuerCert) { - PCERT_EXTENSION ext; PCCRL_CONTEXT crl = NULL; BOOL canSignCRLs; @@ -1654,71 +1731,6 @@ static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index, pRevStatus->dwIndex = index; } } - else if (ret) - { - CRYPT_URL_ARRAY *urlArray = CryptMemAlloc(cbUrlArray); - - if (urlArray) - { - DWORD j, retrievalFlags = 0, startTime, endTime, timeout; - - ret = CryptGetObjectUrl(URL_OID_CERTIFICATE_CRL_DIST_POINT, - (void *)cert, 0, urlArray, &cbUrlArray, NULL, NULL, NULL); - if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION) - retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL; - if (dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG && - pRevPara && pRevPara->cbSize >= offsetof(CERT_REVOCATION_PARA, - dwUrlRetrievalTimeout) + sizeof(DWORD)) - { - startTime = GetTickCount(); - endTime = startTime + pRevPara->dwUrlRetrievalTimeout; - timeout = pRevPara->dwUrlRetrievalTimeout; - } - else - endTime = timeout = 0; - if (!ret) - error = GetLastError(); - for (j = 0; !error && j < urlArray->cUrl; j++) - { - PCCRL_CONTEXT crl; - - ret = CryptRetrieveObjectByUrlW(urlArray->rgwszUrl[j], - CONTEXT_OID_CRL, retrievalFlags, timeout, (void **)&crl, - NULL, NULL, NULL, NULL); - if (ret) - { - error = verify_cert_revocation_with_crl(cert, crl, index, - pTime, pRevStatus); - if (!error && timeout) - { - DWORD time = GetTickCount(); - - if ((int)(endTime - time) <= 0) - { - error = ERROR_TIMEOUT; - pRevStatus->dwIndex = index; - } - else - timeout = endTime - time; - } - CertFreeCRLContext(crl); - } - else - error = CRYPT_E_REVOCATION_OFFLINE; - } - CryptMemFree(urlArray); - } - else - { - error = ERROR_OUTOFMEMORY; - pRevStatus->dwIndex = index; - } - } - else - { - error = GetLastError(); - pRevStatus->dwIndex = index; - } return error; }
1
0
0
0
Juan Lang : cryptnet: Use helper function to get a URL from a CRL distribution points extension.
by Alexandre Julliard
18 Dec '09
18 Dec '09
Module: wine Branch: master Commit: f1f231ca40c0815ac130ed1ef1b6a58a7e2f2589 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1f231ca40c0815ac130ed1ef…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Dec 2 17:07:47 2009 -0800 cryptnet: Use helper function to get a URL from a CRL distribution points extension. --- dlls/cryptnet/cryptnet_main.c | 187 +++++++++++++++++++++-------------------- 1 files changed, 97 insertions(+), 90 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index ef326f7..bf7a2ab 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -235,34 +235,65 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateIssuer(LPCSTR pszUrlOid, return ret; } -static BOOL WINAPI CRYPT_GetUrlFromCertificateCRLDistPoint(LPCSTR pszUrlOid, - LPVOID pvPara, DWORD dwFlags, PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, - PCRYPT_URL_INFO pUrlInfo, DWORD *pcbUrlInfo, LPVOID pvReserved) +static BOOL CRYPT_GetUrlFromCRLDistPointsExt(const CRYPT_DATA_BLOB *value, + PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, PCRYPT_URL_INFO pUrlInfo, + DWORD *pcbUrlInfo) { - PCCERT_CONTEXT cert = pvPara; - PCERT_EXTENSION ext; - BOOL ret = FALSE; + BOOL ret; + CRL_DIST_POINTS_INFO *info; + DWORD size; - /* The only applicable flag is CRYPT_GET_URL_FROM_EXTENSION */ - if (dwFlags && !(dwFlags & CRYPT_GET_URL_FROM_EXTENSION)) - { - SetLastError(CRYPT_E_NOT_FOUND); - return FALSE; - } - if ((ext = CertFindExtension(szOID_CRL_DIST_POINTS, - cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension))) + ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CRL_DIST_POINTS, + value->pbData, value->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size); + if (ret) { - CRL_DIST_POINTS_INFO *info; - DWORD size; + DWORD i, cUrl, bytesNeeded = sizeof(CRYPT_URL_ARRAY); - ret = CryptDecodeObjectEx(X509_ASN_ENCODING, X509_CRL_DIST_POINTS, - ext->Value.pbData, ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, - &info, &size); - if (ret) - { - DWORD i, cUrl, bytesNeeded = sizeof(CRYPT_URL_ARRAY); + for (i = 0, cUrl = 0; i < info->cDistPoint; i++) + if (info->rgDistPoint[i].DistPointName.dwDistPointNameChoice + == CRL_DIST_POINT_FULL_NAME) + { + DWORD j; + CERT_ALT_NAME_INFO *name = + &info->rgDistPoint[i].DistPointName.u.FullName; - for (i = 0, cUrl = 0; i < info->cDistPoint; i++) + for (j = 0; j < name->cAltEntry; j++) + if (name->rgAltEntry[j].dwAltNameChoice == + CERT_ALT_NAME_URL) + { + if (name->rgAltEntry[j].u.pwszURL) + { + cUrl++; + bytesNeeded += sizeof(LPWSTR) + + (lstrlenW(name->rgAltEntry[j].u.pwszURL) + 1) + * sizeof(WCHAR); + } + } + } + if (!pcbUrlArray) + { + SetLastError(E_INVALIDARG); + ret = FALSE; + } + else if (!pUrlArray) + *pcbUrlArray = bytesNeeded; + else if (*pcbUrlArray < bytesNeeded) + { + SetLastError(ERROR_MORE_DATA); + *pcbUrlArray = bytesNeeded; + ret = FALSE; + } + else + { + LPWSTR nextUrl; + + *pcbUrlArray = bytesNeeded; + pUrlArray->cUrl = 0; + pUrlArray->rgwszUrl = + (LPWSTR *)((BYTE *)pUrlArray + sizeof(CRYPT_URL_ARRAY)); + nextUrl = (LPWSTR)((BYTE *)pUrlArray + sizeof(CRYPT_URL_ARRAY) + + cUrl * sizeof(LPWSTR)); + for (i = 0; i < info->cDistPoint; i++) if (info->rgDistPoint[i].DistPointName.dwDistPointNameChoice == CRL_DIST_POINT_FULL_NAME) { @@ -276,83 +307,59 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateCRLDistPoint(LPCSTR pszUrlOid, { if (name->rgAltEntry[j].u.pwszURL) { - cUrl++; - bytesNeeded += sizeof(LPWSTR) + - (lstrlenW(name->rgAltEntry[j].u.pwszURL) + 1) - * sizeof(WCHAR); + lstrcpyW(nextUrl, + name->rgAltEntry[j].u.pwszURL); + pUrlArray->rgwszUrl[pUrlArray->cUrl++] = + nextUrl; + nextUrl += + (lstrlenW(name->rgAltEntry[j].u.pwszURL) + 1); } } } - if (!pcbUrlArray) - { - SetLastError(E_INVALIDARG); - ret = FALSE; - } - else if (!pUrlArray) - *pcbUrlArray = bytesNeeded; - else if (*pcbUrlArray < bytesNeeded) - { - SetLastError(ERROR_MORE_DATA); - *pcbUrlArray = bytesNeeded; - ret = FALSE; - } - else - { - LPWSTR nextUrl; - - *pcbUrlArray = bytesNeeded; - pUrlArray->cUrl = 0; - pUrlArray->rgwszUrl = - (LPWSTR *)((BYTE *)pUrlArray + sizeof(CRYPT_URL_ARRAY)); - nextUrl = (LPWSTR)((BYTE *)pUrlArray + sizeof(CRYPT_URL_ARRAY) - + cUrl * sizeof(LPWSTR)); - for (i = 0; i < info->cDistPoint; i++) - if (info->rgDistPoint[i].DistPointName.dwDistPointNameChoice - == CRL_DIST_POINT_FULL_NAME) - { - DWORD j; - CERT_ALT_NAME_INFO *name = - &info->rgDistPoint[i].DistPointName.u.FullName; - - for (j = 0; j < name->cAltEntry; j++) - if (name->rgAltEntry[j].dwAltNameChoice == - CERT_ALT_NAME_URL) - { - if (name->rgAltEntry[j].u.pwszURL) - { - lstrcpyW(nextUrl, - name->rgAltEntry[j].u.pwszURL); - pUrlArray->rgwszUrl[pUrlArray->cUrl++] = - nextUrl; - nextUrl += - (lstrlenW(name->rgAltEntry[j].u.pwszURL) + 1); - } - } - } - } - if (ret) + } + if (ret) + { + if (pcbUrlInfo) { - if (pcbUrlInfo) + FIXME("url info: stub\n"); + if (!pUrlInfo) + *pcbUrlInfo = sizeof(CRYPT_URL_INFO); + else if (*pcbUrlInfo < sizeof(CRYPT_URL_INFO)) { - FIXME("url info: stub\n"); - if (!pUrlInfo) - *pcbUrlInfo = sizeof(CRYPT_URL_INFO); - else if (*pcbUrlInfo < sizeof(CRYPT_URL_INFO)) - { - *pcbUrlInfo = sizeof(CRYPT_URL_INFO); - SetLastError(ERROR_MORE_DATA); - ret = FALSE; - } - else - { - *pcbUrlInfo = sizeof(CRYPT_URL_INFO); - memset(pUrlInfo, 0, sizeof(CRYPT_URL_INFO)); - } + *pcbUrlInfo = sizeof(CRYPT_URL_INFO); + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + *pcbUrlInfo = sizeof(CRYPT_URL_INFO); + memset(pUrlInfo, 0, sizeof(CRYPT_URL_INFO)); } } - LocalFree(info); } + LocalFree(info); + } + return ret; +} + +static BOOL WINAPI CRYPT_GetUrlFromCertificateCRLDistPoint(LPCSTR pszUrlOid, + LPVOID pvPara, DWORD dwFlags, PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, + PCRYPT_URL_INFO pUrlInfo, DWORD *pcbUrlInfo, LPVOID pvReserved) +{ + PCCERT_CONTEXT cert = pvPara; + PCERT_EXTENSION ext; + BOOL ret = FALSE; + + /* The only applicable flag is CRYPT_GET_URL_FROM_EXTENSION */ + if (dwFlags && !(dwFlags & CRYPT_GET_URL_FROM_EXTENSION)) + { + SetLastError(CRYPT_E_NOT_FOUND); + return FALSE; } + if ((ext = CertFindExtension(szOID_CRL_DIST_POINTS, + cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension))) + ret = CRYPT_GetUrlFromCRLDistPointsExt(&ext->Value, pUrlArray, + pcbUrlArray, pUrlInfo, pcbUrlInfo); else SetLastError(CRYPT_E_NOT_FOUND); return ret;
1
0
0
0
Juan Lang : cryptnet: Make sure an issuer certificate can sign CRLs before looking for a CRL.
by Alexandre Julliard
18 Dec '09
18 Dec '09
Module: wine Branch: master Commit: 0bfb7951a48372ea37c7bf77583a97469a978863 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0bfb7951a48372ea37c7bf775…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Dec 2 16:24:48 2009 -0800 cryptnet: Make sure an issuer certificate can sign CRLs before looking for a CRL. --- dlls/cryptnet/cryptnet_main.c | 50 +++++++++++++++++++++++++++++++++++----- 1 files changed, 43 insertions(+), 7 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 9e29daa..ef326f7 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1584,15 +1584,51 @@ static DWORD verify_cert_revocation(PCCERT_CONTEXT cert, DWORD index, { if (pRevPara && pRevPara->hCrlStore && pRevPara->pIssuerCert) { - PCCRL_CONTEXT crl; + PCERT_EXTENSION ext; + PCCRL_CONTEXT crl = NULL; + BOOL canSignCRLs; - /* If the caller was helpful enough to tell us where to find a CRL - * for the cert, look for one and check it. + /* If the caller told us about the issuer, make sure the issuer + * can sign CRLs before looking for one. */ - crl = CertFindCRLInStore(pRevPara->hCrlStore, - cert->dwCertEncodingType, - CRL_FIND_ISSUED_BY_SIGNATURE_FLAG | CRL_FIND_ISSUED_BY_AKI_FLAG, - CRL_FIND_ISSUED_BY, pRevPara->pIssuerCert, NULL); + if ((ext = CertFindExtension(szOID_KEY_USAGE, + pRevPara->pIssuerCert->pCertInfo->cExtension, + pRevPara->pIssuerCert->pCertInfo->rgExtension))) + { + CRYPT_BIT_BLOB usage; + DWORD size = sizeof(usage); + + if (!CryptDecodeObjectEx(cert->dwCertEncodingType, X509_BITS, + ext->Value.pbData, ext->Value.cbData, + CRYPT_DECODE_NOCOPY_FLAG, NULL, &usage, &size)) + canSignCRLs = FALSE; + else if (usage.cbData > 2) + { + /* The key usage extension only defines 9 bits => no more + * than 2 bytes are needed to encode all known usages. + */ + canSignCRLs = FALSE; + } + else + { + BYTE usageBits = usage.pbData[usage.cbData - 1]; + + canSignCRLs = usageBits & CERT_CRL_SIGN_KEY_USAGE; + } + } + else + canSignCRLs = TRUE; + if (canSignCRLs) + { + /* If the caller was helpful enough to tell us where to find a + * CRL for the cert, look for one and check it. + */ + crl = CertFindCRLInStore(pRevPara->hCrlStore, + cert->dwCertEncodingType, + CRL_FIND_ISSUED_BY_SIGNATURE_FLAG | + CRL_FIND_ISSUED_BY_AKI_FLAG, + CRL_FIND_ISSUED_BY, pRevPara->pIssuerCert, NULL); + } if (crl) { error = verify_cert_revocation_with_crl(cert, crl, index,
1
0
0
0
Alexandre Julliard : user32: Move EnumProps16 to wnd16.c.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: 6b78e24a098a10ce91b53eeb26eca36a85e66aa6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b78e24a098a10ce91b53eeb2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 17:24:16 2009 +0100 user32: Move EnumProps16 to wnd16.c. --- dlls/user32/property.c | 45 +---------------------------------- dlls/user32/wnd16.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 44 deletions(-) diff --git a/dlls/user32/property.c b/dlls/user32/property.c index d5b1bfd..52f389e 100644 --- a/dlls/user32/property.c +++ b/dlls/user32/property.c @@ -26,9 +26,8 @@ #include "windef.h" #include "winbase.h" -#include "wownt32.h" +#include "winuser.h" #include "wine/unicode.h" -#include "wine/winuser16.h" #include "wine/server.h" /* size of buffer needed to store an atom string */ @@ -252,45 +251,3 @@ INT WINAPI EnumPropsExW(HWND hwnd, PROPENUMPROCEXW func, LPARAM lParam) } return ret; } - - -/*********************************************************************** - * EnumProps (USER.27) - */ -INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func ) -{ - int ret = -1, i, count; - property_data_t *list = get_properties( HWND_32(hwnd), &count ); - - if (list) - { - char string[ATOM_BUFFER_SIZE]; - SEGPTR segptr = MapLS( string ); - WORD args[4]; - DWORD result; - - for (i = 0; i < count; i++) - { - if (list[i].string) /* it was a string originally */ - { - if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue; - args[3] = hwnd; - args[2] = SELECTOROF(segptr); - args[1] = OFFSETOF(segptr); - args[0] = LOWORD(list[i].data); - } - else - { - args[3] = hwnd; - args[2] = 0; - args[1] = list[i].atom; - args[0] = LOWORD(list[i].data); - } - WOWCallback16Ex( (DWORD)func, WCB16_PASCAL, sizeof(args), args, &result ); - if (!(ret = LOWORD(result))) break; - } - UnMapLS( segptr ); - HeapFree( GetProcessHeap(), 0, list ); - } - return ret; -} diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index 4c2f2f2..4873be7 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -22,6 +22,10 @@ #include "wownt32.h" #include "win.h" #include "user_private.h" +#include "wine/server.h" + +/* size of buffer needed to store an atom string */ +#define ATOM_BUFFER_SIZE 256 /* handle <--> handle16 conversions */ #define HANDLE_16(h32) (LOWORD(h32)) @@ -158,6 +162,64 @@ BOOL16 WINAPI SetProp16( HWND16 hwnd, LPCSTR str, HANDLE16 handle ) } +/*********************************************************************** + * EnumProps (USER.27) + */ +INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func ) +{ + int ret = -1, i, count, total = 32; + property_data_t *list; + + while (total) + { + if (!(list = HeapAlloc( GetProcessHeap(), 0, total * sizeof(*list) ))) break; + count = 0; + SERVER_START_REQ( get_window_properties ) + { + req->window = wine_server_user_handle( HWND_32(hwnd) ); + wine_server_set_reply( req, list, total * sizeof(*list) ); + if (!wine_server_call( req )) count = reply->total; + } + SERVER_END_REQ; + + if (count && count <= total) + { + char string[ATOM_BUFFER_SIZE]; + SEGPTR segptr = MapLS( string ); + WORD args[4]; + DWORD result; + + for (i = 0; i < count; i++) + { + if (list[i].string) /* it was a string originally */ + { + if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue; + args[3] = hwnd; + args[2] = SELECTOROF(segptr); + args[1] = OFFSETOF(segptr); + args[0] = LOWORD(list[i].data); + } + else + { + args[3] = hwnd; + args[2] = 0; + args[1] = list[i].atom; + args[0] = LOWORD(list[i].data); + } + WOWCallback16Ex( (DWORD)func, WCB16_PASCAL, sizeof(args), args, &result ); + if (!(ret = LOWORD(result))) break; + } + UnMapLS( segptr ); + HeapFree( GetProcessHeap(), 0, list ); + break; + } + HeapFree( GetProcessHeap(), 0, list ); + total = count; /* restart with larger buffer */ + } + return ret; +} + + /************************************************************************** * ClientToScreen (USER.28) */
1
0
0
0
Alexandre Julliard : user32: Move the 16-bit menu functions to user16.c.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: 15000f32b6a57393de41d6a59b23c345cf36ce8f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15000f32b6a57393de41d6a59…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 15:04:21 2009 +0100 user32: Move the 16-bit menu functions to user16.c. --- dlls/user32/menu.c | 90 +++++-------------------------------------- dlls/user32/user16.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/user32/win.c | 9 ---- 3 files changed, 114 insertions(+), 89 deletions(-) diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 230e412..2f0ffc2 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -51,9 +51,6 @@ #include "winbase.h" #include "wingdi.h" #include "winnls.h" -#include "wine/winbase16.h" -#include "wine/winuser16.h" -#include "wownt32.h" #include "wine/server.h" #include "wine/unicode.h" #include "wine/exception.h" @@ -2132,10 +2129,10 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags ) * * NOTE: flags is equivalent to the mtOption field */ -static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) +static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu ) { WORD flags, id = 0; - LPCSTR str; + LPCWSTR str; BOOL end_flag; do @@ -2150,23 +2147,18 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) id = GET_WORD(res); res += sizeof(WORD); } - str = res; - if (!unicode) res += strlen(str) + 1; - else res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR); + str = (LPCWSTR)res; + res += (strlenW(str) + 1) * sizeof(WCHAR); if (flags & MF_POPUP) { HMENU hSubMenu = CreatePopupMenu(); if (!hSubMenu) return NULL; - if (!(res = MENU_ParseResource( res, hSubMenu, unicode ))) - return NULL; - if (!unicode) AppendMenuA( hMenu, flags, (UINT_PTR)hSubMenu, str ); - else AppendMenuW( hMenu, flags, (UINT_PTR)hSubMenu, (LPCWSTR)str ); + if (!(res = MENU_ParseResource( res, hSubMenu ))) return NULL; + AppendMenuW( hMenu, flags, (UINT_PTR)hSubMenu, str ); } else /* Not a popup */ { - if (!unicode) AppendMenuA( hMenu, flags, id, *str ? str : NULL ); - else AppendMenuW( hMenu, flags, id, - *(LPCWSTR)str ? (LPCWSTR)str : NULL ); + AppendMenuW( hMenu, flags, id, *str ? str : NULL ); } } while (!end_flag); return res; @@ -3791,7 +3783,7 @@ static void MENU_mnu2mnuii( UINT flags, UINT_PTR id, LPCWSTR str, pmii->dwTypeData = (LPWSTR)str; } else if( flags & MFT_BITMAP){ pmii->fMask |= MIIM_BITMAP | MIIM_STRING; - pmii->hbmpItem = HBITMAP_32(LOWORD(str)); + pmii->hbmpItem = ULongToHandle(LOWORD(str)); } if( flags & MF_OWNERDRAW){ pmii->fMask |= MIIM_DATA; @@ -4326,39 +4318,6 @@ BOOL WINAPI EndMenu(void) } -/*********************************************************************** - * LookupMenuHandle (USER.217) - */ -HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id ) -{ - HMENU hmenu32 = HMENU_32(hmenu); - UINT id32 = id; - if (!MENU_FindItem( &hmenu32, &id32, MF_BYCOMMAND )) return 0; - else return HMENU_16(hmenu32); -} - - -/********************************************************************** - * LoadMenu (USER.150) - */ -HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, LPCSTR name ) -{ - HRSRC16 hRsrc; - HGLOBAL16 handle; - HMENU16 hMenu; - - if (HIWORD(name) && name[0] == '#') name = ULongToPtr(atoi( name + 1 )); - if (!name) return 0; - - instance = GetExePtr( instance ); - if (!(hRsrc = FindResource16( instance, name, (LPSTR)RT_MENU ))) return 0; - if (!(handle = LoadResource16( instance, hRsrc ))) return 0; - hMenu = LoadMenuIndirect16(LockResource16(handle)); - FreeResource16( handle ); - return hMenu; -} - - /***************************************************************** * LoadMenuA (USER32.@) */ @@ -4382,35 +4341,6 @@ HMENU WINAPI LoadMenuW( HINSTANCE instance, LPCWSTR name ) /********************************************************************** - * LoadMenuIndirect (USER.220) - */ -HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template ) -{ - HMENU hMenu; - WORD version, offset; - LPCSTR p = template; - - TRACE("(%p)\n", template ); - version = GET_WORD(p); - p += sizeof(WORD); - if (version) - { - WARN("version must be 0 for Win16\n" ); - return 0; - } - offset = GET_WORD(p); - p += sizeof(WORD) + offset; - if (!(hMenu = CreateMenu())) return 0; - if (!MENU_ParseResource( p, hMenu, FALSE )) - { - DestroyMenu( hMenu ); - return 0; - } - return HMENU_16(hMenu); -} - - -/********************************************************************** * LoadMenuIndirectW (USER32.@) */ HMENU WINAPI LoadMenuIndirectW( LPCVOID template ) @@ -4428,7 +4358,7 @@ HMENU WINAPI LoadMenuIndirectW( LPCVOID template ) offset = GET_WORD(p); p += sizeof(WORD) + offset; if (!(hMenu = CreateMenu())) return 0; - if (!MENU_ParseResource( p, hMenu, TRUE )) + if (!MENU_ParseResource( p, hMenu )) { DestroyMenu( hMenu ); return 0; @@ -4784,7 +4714,7 @@ static BOOL MENU_NormalizeMenuItemInfoStruct( const MENUITEMINFOW *pmii_in, pmii_out->fMask |= MIIM_STRING; } else if( (pmii_out->fType) & MFT_BITMAP){ pmii_out->fMask |= MIIM_BITMAP; - pmii_out->hbmpItem = HBITMAP_32(LOWORD(pmii_out->dwTypeData)); + pmii_out->hbmpItem = UlongToHandle(LOWORD(pmii_out->dwTypeData)); } } return TRUE; diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index 34133e5..1c5adb4 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -190,6 +190,15 @@ BOOL16 WINAPI GetCursorPos16( POINT16 *pt ) } +/******************************************************************* + * AnyPopup (USER.52) + */ +BOOL16 WINAPI AnyPopup16(void) +{ + return AnyPopup(); +} + + /*********************************************************************** * SetCursor (USER.69) */ @@ -511,6 +520,27 @@ INT16 WINAPI GetClipboardFormatName16( UINT16 id, LPSTR buffer, INT16 maxlen ) /********************************************************************** + * LoadMenu (USER.150) + */ +HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, LPCSTR name ) +{ + HRSRC16 hRsrc; + HGLOBAL16 handle; + HMENU16 hMenu; + + if (HIWORD(name) && name[0] == '#') name = ULongToPtr(atoi( name + 1 )); + if (!name) return 0; + + instance = GetExePtr( instance ); + if (!(hRsrc = FindResource16( instance, name, (LPSTR)RT_MENU ))) return 0; + if (!(handle = LoadResource16( instance, hRsrc ))) return 0; + hMenu = LoadMenuIndirect16(LockResource16(handle)); + FreeResource16( handle ); + return hMenu; +} + + +/********************************************************************** * CreateMenu (USER.151) */ HMENU16 WINAPI CreateMenu16(void) @@ -869,6 +899,80 @@ DWORD WINAPI UserSeeUserDo16(WORD wReqType, WORD wParam1, WORD wParam2, WORD wPa } +/*********************************************************************** + * LookupMenuHandle (USER.217) + */ +HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id ) +{ + FIXME( "%04x %04x: stub\n", hmenu, id ); + return hmenu; +} + + +static LPCSTR parse_menu_resource( LPCSTR res, HMENU hMenu ) +{ + WORD flags, id = 0; + LPCSTR str; + BOOL end_flag; + + do + { + flags = GET_WORD(res); + end_flag = flags & MF_END; + /* Remove MF_END because it has the same value as MF_HILITE */ + flags &= ~MF_END; + res += sizeof(WORD); + if (!(flags & MF_POPUP)) + { + id = GET_WORD(res); + res += sizeof(WORD); + } + str = res; + res += strlen(str) + 1; + if (flags & MF_POPUP) + { + HMENU hSubMenu = CreatePopupMenu(); + if (!hSubMenu) return NULL; + if (!(res = parse_menu_resource( res, hSubMenu ))) return NULL; + AppendMenuA( hMenu, flags, (UINT_PTR)hSubMenu, str ); + } + else /* Not a popup */ + { + AppendMenuA( hMenu, flags, id, *str ? str : NULL ); + } + } while (!end_flag); + return res; +} + +/********************************************************************** + * LoadMenuIndirect (USER.220) + */ +HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template ) +{ + HMENU hMenu; + WORD version, offset; + LPCSTR p = template; + + TRACE("(%p)\n", template ); + version = GET_WORD(p); + p += sizeof(WORD); + if (version) + { + WARN("version must be 0 for Win16\n" ); + return 0; + } + offset = GET_WORD(p); + p += sizeof(WORD) + offset; + if (!(hMenu = CreateMenu())) return 0; + if (!parse_menu_resource( p, hMenu )) + { + DestroyMenu( hMenu ); + return 0; + } + return HMENU_16(hMenu); +} + + /************************************************************************* * ScrollDC (USER.221) */ diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 8f43e92..9712beb 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3082,15 +3082,6 @@ BOOL WINAPI EnumChildWindows( HWND parent, WNDENUMPROC func, LPARAM lParam ) /******************************************************************* - * AnyPopup (USER.52) - */ -BOOL16 WINAPI AnyPopup16(void) -{ - return AnyPopup(); -} - - -/******************************************************************* * AnyPopup (USER32.@) */ BOOL WINAPI AnyPopup(void)
1
0
0
0
Alexandre Julliard : user32: Move 16-bit window creation functions to 16-bit files.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: 8494682f2d7bca32a89a82f266a5b97c979d92f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8494682f2d7bca32a89a82f26…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 15:03:32 2009 +0100 user32: Move 16-bit window creation functions to 16-bit files. --- dlls/user32/controls.h | 1 + dlls/user32/msg16.c | 67 ++++++++++++++++++++++++++++++++++++++ dlls/user32/win.c | 84 +---------------------------------------------- dlls/user32/win.h | 1 + dlls/user32/winproc.c | 1 + dlls/user32/wnd16.c | 13 +++++++ 6 files changed, 85 insertions(+), 82 deletions(-) diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 9abc997..e7aa408 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -98,6 +98,7 @@ struct wow_handlers32 LRESULT (*mdiclient_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); + HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,UINT); WNDPROC (*alloc_winproc)(WNDPROC,WNDPROC); }; diff --git a/dlls/user32/msg16.c b/dlls/user32/msg16.c index 27a47a4..0e57988 100644 --- a/dlls/user32/msg16.c +++ b/dlls/user32/msg16.c @@ -2003,6 +2003,73 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg ) /*********************************************************************** + * CreateWindowEx (USER.452) + */ +HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, + LPCSTR windowName, DWORD style, INT16 x, + INT16 y, INT16 width, INT16 height, + HWND16 parent, HMENU16 menu, + HINSTANCE16 instance, LPVOID data ) +{ + CREATESTRUCTA cs; + char buffer[256]; + HWND hwnd; + + /* Fix the coordinates */ + + cs.x = (x == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)x; + cs.y = (y == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)y; + cs.cx = (width == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)width; + cs.cy = (height == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)height; + + /* Create the window */ + + cs.lpCreateParams = data; + cs.hInstance = HINSTANCE_32(instance); + cs.hMenu = HMENU_32(menu); + cs.hwndParent = WIN_Handle32( parent ); + cs.style = style; + cs.lpszName = windowName; + cs.lpszClass = className; + cs.dwExStyle = exStyle; + + /* map to module handle */ + if (instance) instance = GetExePtr( instance ); + + /* load the menu */ + if (!menu && (style & (WS_CHILD | WS_POPUP)) != WS_CHILD) + { + WNDCLASSA class; + + if (GetClassInfoA( HINSTANCE_32(instance), className, &class )) + cs.hMenu = HMENU_32( LoadMenu16( instance, class.lpszMenuName )); + } + + if (!IS_INTRESOURCE(className)) + { + WCHAR bufferW[256]; + + if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) + return 0; + hwnd = wow_handlers32.create_window( (CREATESTRUCTW *)&cs, bufferW, + HINSTANCE_32(instance), 0 ); + } + else + { + if (!GlobalGetAtomNameA( LOWORD(className), buffer, sizeof(buffer) )) + { + ERR( "bad atom %x\n", LOWORD(className)); + return 0; + } + cs.lpszClass = buffer; + hwnd = wow_handlers32.create_window( (CREATESTRUCTW *)&cs, (LPCWSTR)className, + HINSTANCE_32(instance), 0 ); + } + return HWND_16( hwnd ); +} + + +/*********************************************************************** * button_proc16 */ static LRESULT button_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode ) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 9b2cc89..8f43e92 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -27,9 +27,6 @@ #include <string.h> #include "windef.h" #include "winbase.h" -#include "wine/winbase16.h" -#include "wine/winuser16.h" -#include "wownt32.h" #include "wine/server.h" #include "wine/unicode.h" #include "win.h" @@ -884,7 +881,7 @@ void WIN_DestroyThreadWindows( HWND hwnd ) */ static void WIN_FixCoordinates( CREATESTRUCTW *cs, INT *sw) { -#define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == CW_USEDEFAULT16) +#define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == (SHORT)0x8000) POINT pos[2]; if (cs->dwExStyle & WS_EX_MDICHILD) @@ -1072,7 +1069,7 @@ static void dump_window_styles( DWORD style, DWORD exstyle ) * * Implementation of CreateWindowEx(). */ -static HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UINT flags ) +HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UINT flags ) { INT cx, cy, style, sw = SW_SHOW; LRESULT result; @@ -1440,83 +1437,6 @@ failed: /*********************************************************************** - * CreateWindow (USER.41) - */ -HWND16 WINAPI CreateWindow16( LPCSTR className, LPCSTR windowName, - DWORD style, INT16 x, INT16 y, INT16 width, - INT16 height, HWND16 parent, HMENU16 menu, - HINSTANCE16 instance, LPVOID data ) -{ - return CreateWindowEx16( 0, className, windowName, style, - x, y, width, height, parent, menu, instance, data ); -} - - -/*********************************************************************** - * CreateWindowEx (USER.452) - */ -HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, - LPCSTR windowName, DWORD style, INT16 x, - INT16 y, INT16 width, INT16 height, - HWND16 parent, HMENU16 menu, - HINSTANCE16 instance, LPVOID data ) -{ - CREATESTRUCTA cs; - char buffer[256]; - - /* Fix the coordinates */ - - cs.x = (x == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)x; - cs.y = (y == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)y; - cs.cx = (width == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)width; - cs.cy = (height == CW_USEDEFAULT16) ? CW_USEDEFAULT : (INT)height; - - /* Create the window */ - - cs.lpCreateParams = data; - cs.hInstance = HINSTANCE_32(instance); - cs.hMenu = HMENU_32(menu); - cs.hwndParent = WIN_Handle32( parent ); - cs.style = style; - cs.lpszName = windowName; - cs.lpszClass = className; - cs.dwExStyle = exStyle; - - /* map to module handle */ - if (instance) instance = GetExePtr( instance ); - - /* load the menu */ - if (!menu && (style & (WS_CHILD | WS_POPUP)) != WS_CHILD) - { - WNDCLASSA class; - - if (GetClassInfoA( HINSTANCE_32(instance), className, &class )) - cs.hMenu = HMENU_32( LoadMenu16( instance, class.lpszMenuName )); - } - - if (!IS_INTRESOURCE(className)) - { - WCHAR bufferW[256]; - - if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) - return 0; - return HWND_16( WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, bufferW, HINSTANCE_32(instance), 0 )); - } - else - { - if (!GlobalGetAtomNameA( LOWORD(className), buffer, sizeof(buffer) )) - { - ERR( "bad atom %x\n", LOWORD(className)); - return 0; - } - cs.lpszClass = buffer; - return HWND_16( WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, (LPCWSTR)className, - HINSTANCE_32(instance), 0 )); - } -} - - -/*********************************************************************** * CreateWindowExA (USER32.@) */ HWND WINAPI CreateWindowExA( DWORD exStyle, LPCSTR className, diff --git a/dlls/user32/win.h b/dlls/user32/win.h index 743c67e..ab37e3e 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -87,6 +87,7 @@ extern ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPE extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient ) DECLSPEC_HIDDEN; extern LRESULT WIN_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN; extern void WIN_DestroyThreadWindows( HWND hwnd ) DECLSPEC_HIDDEN; +extern HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UINT flags ) DECLSPEC_HIDDEN; extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ) DECLSPEC_HIDDEN; extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN; extern LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, BOOL unicode ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 5bfd407..bd30b49 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -1135,6 +1135,7 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo orig->mdiclient_proc = MDIClientWndProc_common; orig->scrollbar_proc = ScrollBarWndProc_common; orig->static_proc = StaticWndProc_common; + orig->create_window = WIN_CreateWindowEx; orig->alloc_winproc = WINPROC_AllocProc; wow_handlers = *new; diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index f3f7e67..4c2f2f2 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -305,6 +305,19 @@ BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps ) } +/*********************************************************************** + * CreateWindow (USER.41) + */ +HWND16 WINAPI CreateWindow16( LPCSTR className, LPCSTR windowName, + DWORD style, INT16 x, INT16 y, INT16 width, + INT16 height, HWND16 parent, HMENU16 menu, + HINSTANCE16 instance, LPVOID data ) +{ + return CreateWindowEx16( 0, className, windowName, style, + x, y, width, height, parent, menu, instance, data ); +} + + /************************************************************************** * ShowWindow (USER.42) */
1
0
0
0
Alexandre Julliard : user32: Use W structures in window creation code.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: 4b3c0e31d0fef4508f70748a4371c5d6af09f91b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b3c0e31d0fef4508f70748a4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 15:00:38 2009 +0100 user32: Use W structures in window creation code. --- dlls/user32/win.c | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 18c2332..9b2cc89 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -882,7 +882,7 @@ void WIN_DestroyThreadWindows( HWND hwnd ) * Fix the coordinates - Helper for WIN_CreateWindowEx. * returns default show mode in sw. */ -static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw) +static void WIN_FixCoordinates( CREATESTRUCTW *cs, INT *sw) { #define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == CW_USEDEFAULT16) POINT pos[2]; @@ -1072,7 +1072,7 @@ static void dump_window_styles( DWORD style, DWORD exstyle ) * * Implementation of CreateWindowEx(). */ -static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, HINSTANCE module, UINT flags ) +static HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UINT flags ) { INT cx, cy, style, sw = SW_SHOW; LRESULT result; @@ -1080,12 +1080,12 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, HINSTANCE WND *wndPtr; HWND hwnd, parent, owner, top_child = 0; BOOL unicode = (flags & WIN_ISUNICODE) != 0; - MDICREATESTRUCTA mdi_cs; - CBT_CREATEWNDA cbtc; - CREATESTRUCTA cbcs; + MDICREATESTRUCTW mdi_cs; + CBT_CREATEWNDW cbtc; + CREATESTRUCTW cbcs; TRACE("%s %s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n", - unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName), + unicode ? debugstr_w(cs->lpszName) : debugstr_a((LPCSTR)cs->lpszName), debugstr_w(className), cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams ); @@ -1500,7 +1500,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) return 0; - return HWND_16( WIN_CreateWindowEx( &cs, bufferW, HINSTANCE_32(instance), 0 )); + return HWND_16( WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, bufferW, HINSTANCE_32(instance), 0 )); } else { @@ -1510,7 +1510,8 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, return 0; } cs.lpszClass = buffer; - return HWND_16( WIN_CreateWindowEx( &cs, (LPCWSTR)className, HINSTANCE_32(instance), 0 )); + return HWND_16( WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, (LPCWSTR)className, + HINSTANCE_32(instance), 0 )); } } @@ -1544,9 +1545,11 @@ HWND WINAPI CreateWindowExA( DWORD exStyle, LPCSTR className, WCHAR bufferW[256]; if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) return 0; - return WIN_CreateWindowEx( &cs, bufferW, instance, WIN_ISWIN32 ); + return WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, bufferW, instance, WIN_ISWIN32 ); } - return WIN_CreateWindowEx( &cs, (LPCWSTR)className, instance, WIN_ISWIN32 ); + /* Note: we rely on the fact that CREATESTRUCTA and */ + /* CREATESTRUCTW have the same layout. */ + return WIN_CreateWindowEx( (CREATESTRUCTW *)&cs, (LPCWSTR)className, instance, WIN_ISWIN32 ); } @@ -1574,9 +1577,7 @@ HWND WINAPI CreateWindowExW( DWORD exStyle, LPCWSTR className, cs.lpszClass = className; cs.dwExStyle = exStyle; - /* Note: we rely on the fact that CREATESTRUCTA and */ - /* CREATESTRUCTW have the same layout. */ - return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, className, instance, WIN_ISWIN32 | WIN_ISUNICODE ); + return WIN_CreateWindowEx( &cs, className, instance, WIN_ISWIN32 | WIN_ISUNICODE ); }
1
0
0
0
Alexandre Julliard : user32: Move loading of the 16-bit window menu to CreateWindowEx16.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: bfcfe437e2eebce2126b3cfb511cd880cc9529ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bfcfe437e2eebce2126b3cfb5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 14:48:06 2009 +0100 user32: Move loading of the 16-bit window menu to CreateWindowEx16. --- dlls/user32/win.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 51cc743..18c2332 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1282,14 +1282,10 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, HINSTANCE } else { - LPCSTR menuName = (LPCSTR)GetClassLongPtrA( hwnd, GCLP_MENUNAME ); + LPCWSTR menuName = (LPCWSTR)GetClassLongPtrW( hwnd, GCLP_MENUNAME ); if (menuName) { - if (!cs->hInstance || HIWORD(cs->hInstance)) - cs->hMenu = LoadMenuA(cs->hInstance,menuName); - else - cs->hMenu = HMENU_32(LoadMenu16(HINSTANCE_16(cs->hInstance),menuName)); - + cs->hMenu = LoadMenuW( cs->hInstance, menuName ); if (cs->hMenu) MENU_SetMenu( hwnd, cs->hMenu ); } } @@ -1489,6 +1485,15 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, /* map to module handle */ if (instance) instance = GetExePtr( instance ); + /* load the menu */ + if (!menu && (style & (WS_CHILD | WS_POPUP)) != WS_CHILD) + { + WNDCLASSA class; + + if (GetClassInfoA( HINSTANCE_32(instance), className, &class )) + cs.hMenu = HMENU_32( LoadMenu16( instance, class.lpszMenuName )); + } + if (!IS_INTRESOURCE(className)) { WCHAR bufferW[256];
1
0
0
0
Alexandre Julliard : user32: Move 16-bit instance normalization to CreateWindowEx16.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: aabe5f150f834fbf230787c7e228f4b68c39ee32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aabe5f150f834fbf230787c7e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 17 14:36:26 2009 +0100 user32: Move 16-bit instance normalization to CreateWindowEx16. --- dlls/user32/win.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index dbb8ef2..51cc743 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -187,10 +187,6 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name, struct tagCLASS *class = NULL; int extra_bytes = 0; - /* if 16-bit instance, map to module handle */ - if (instance && !HIWORD(instance)) - instance = HINSTANCE_32(GetExePtr(HINSTANCE_16(instance))); - SERVER_START_REQ( create_window ) { req->parent = wine_server_user_handle( parent ); @@ -1076,7 +1072,7 @@ static void dump_window_styles( DWORD style, DWORD exstyle ) * * Implementation of CreateWindowEx(). */ -static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags ) +static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, HINSTANCE module, UINT flags ) { INT cx, cy, style, sw = SW_SHOW; LRESULT result; @@ -1206,7 +1202,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags /* Create the window structure */ - if (!(wndPtr = create_window_handle( parent, owner, className, cs->hInstance, unicode ))) + if (!(wndPtr = create_window_handle( parent, owner, className, module, unicode ))) return 0; hwnd = wndPtr->obj.handle; @@ -1490,13 +1486,16 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, cs.lpszClass = className; cs.dwExStyle = exStyle; + /* map to module handle */ + if (instance) instance = GetExePtr( instance ); + if (!IS_INTRESOURCE(className)) { WCHAR bufferW[256]; if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) return 0; - return HWND_16( WIN_CreateWindowEx( &cs, bufferW, 0 )); + return HWND_16( WIN_CreateWindowEx( &cs, bufferW, HINSTANCE_32(instance), 0 )); } else { @@ -1506,7 +1505,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, return 0; } cs.lpszClass = buffer; - return HWND_16( WIN_CreateWindowEx( &cs, (LPCWSTR)className, 0 )); + return HWND_16( WIN_CreateWindowEx( &cs, (LPCWSTR)className, HINSTANCE_32(instance), 0 )); } } @@ -1540,9 +1539,9 @@ HWND WINAPI CreateWindowExA( DWORD exStyle, LPCSTR className, WCHAR bufferW[256]; if (!MultiByteToWideChar( CP_ACP, 0, className, -1, bufferW, sizeof(bufferW)/sizeof(WCHAR) )) return 0; - return WIN_CreateWindowEx( &cs, bufferW, WIN_ISWIN32 ); + return WIN_CreateWindowEx( &cs, bufferW, instance, WIN_ISWIN32 ); } - return WIN_CreateWindowEx( &cs, (LPCWSTR)className, WIN_ISWIN32 ); + return WIN_CreateWindowEx( &cs, (LPCWSTR)className, instance, WIN_ISWIN32 ); } @@ -1572,7 +1571,7 @@ HWND WINAPI CreateWindowExW( DWORD exStyle, LPCWSTR className, /* Note: we rely on the fact that CREATESTRUCTA and */ /* CREATESTRUCTW have the same layout. */ - return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, className, WIN_ISWIN32 | WIN_ISUNICODE ); + return WIN_CreateWindowEx( (CREATESTRUCTA *)&cs, className, instance, WIN_ISWIN32 | WIN_ISUNICODE ); }
1
0
0
0
Hans Leidekker : msi: Reset the ALLUSERS property from to 2 to 1.
by Alexandre Julliard
17 Dec '09
17 Dec '09
Module: wine Branch: master Commit: 178ebae4c01c6aed896138d4a0c174c489814f1b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=178ebae4c01c6aed896138d4a…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Dec 17 12:29:41 2009 +0100 msi: Reset the ALLUSERS property from to 2 to 1. --- dlls/msi/package.c | 12 +++ dlls/msi/tests/install.c | 191 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=178ebae4c01c6aed89613…
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
124
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200