winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2008
----- 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
999 discussions
Start a n
N
ew thread
Alexandre Julliard : libwine: Abstract part of the utf8 char decoding to a separate function.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: dbefd038ac437a8f5ffae9bb170b0eb67040873b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dbefd038ac437a8f5ffae9bb1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Feb 15 12:06:42 2008 +0100 libwine: Abstract part of the utf8 char decoding to a separate function. --- libs/wine/utf8.c | 95 +++++++++++++++++++++++------------------------------ 1 files changed, 41 insertions(+), 54 deletions(-) diff --git a/libs/wine/utf8.c b/libs/wine/utf8.c index fcbbeb0..fcb4e23 100644 --- a/libs/wine/utf8.c +++ b/libs/wine/utf8.c @@ -155,10 +155,38 @@ int wine_utf8_wcstombs( int flags, const WCHAR *src, int srclen, char *dst, int return dstlen - len; } +/* helper for the various utf8 mbstowcs functions */ +static inline unsigned int decode_utf8_char( unsigned char ch, const char **str, const char *strend ) +{ + unsigned int len = utf8_length[ch-0x80]; + unsigned int res = ch & utf8_mask[len]; + const char *end = *str + len; + + if (end > strend) return ~0; + switch(len) + { + case 3: + if ((ch = end[-3] ^ 0x80) >= 0x40) break; + res = (res << 6) | ch; + (*str)++; + case 2: + if ((ch = end[-2] ^ 0x80) >= 0x40) break; + res = (res << 6) | ch; + (*str)++; + case 1: + if ((ch = end[-1] ^ 0x80) >= 0x40) break; + res = (res << 6) | ch; + (*str)++; + if (res < utf8_minval[len]) break; + return res; + } + return ~0; +} + /* query necessary dst length for src string */ static inline int get_length_mbs_utf8( int flags, const char *src, int srclen ) { - int len, ret = 0; + int ret = 0; unsigned int res; const char *srcend = src + srclen; @@ -170,32 +198,12 @@ static inline int get_length_mbs_utf8( int flags, const char *src, int srclen ) ret++; continue; } - len = utf8_length[ch-0x80]; - if (src + len > srcend) goto bad; - res = ch & utf8_mask[len]; - - switch(len) + if ((res = decode_utf8_char( ch, &src, srcend )) <= 0x10ffff) { - case 3: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - case 2: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - case 1: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - if (res < utf8_minval[len]) goto bad; - if (res > 0x10ffff) goto bad; if (res > 0xffff) ret++; ret++; - continue; } - bad: - if (flags & MB_ERR_INVALID_CHARS) return -2; /* bad char */ + else if (flags & MB_ERR_INVALID_CHARS) return -2; /* bad char */ /* otherwise ignore it */ } return ret; @@ -205,7 +213,6 @@ static inline int get_length_mbs_utf8( int flags, const char *src, int srclen ) /* return -1 on dst buffer overflow, -2 on invalid input char */ int wine_utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int dstlen ) { - int len; unsigned int res; const char *srcend = src + srclen; WCHAR *dstend = dst + dstlen; @@ -220,38 +227,18 @@ int wine_utf8_mbstowcs( int flags, const char *src, int srclen, WCHAR *dst, int *dst++ = ch; continue; } - len = utf8_length[ch-0x80]; - if (src + len > srcend) goto bad; - res = ch & utf8_mask[len]; - - switch(len) + if ((res = decode_utf8_char( ch, &src, srcend )) <= 0xffff) { - case 3: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - case 2: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - case 1: - if ((ch = *src ^ 0x80) >= 0x40) goto bad; - res = (res << 6) | ch; - src++; - if (res < utf8_minval[len]) goto bad; - if (res > 0x10ffff) goto bad; - if (res <= 0xffff) *dst++ = res; - else /* we need surrogates */ - { - if (dst == dstend - 1) return -1; /* overflow */ - res -= 0x10000; - *dst++ = 0xd800 | (res >> 10); - *dst++ = 0xdc00 | (res & 0x3ff); - } - continue; + *dst++ = res; + } + else if (res <= 0x10ffff) /* we need surrogates */ + { + if (dst == dstend - 1) return -1; /* overflow */ + res -= 0x10000; + *dst++ = 0xd800 | (res >> 10); + *dst++ = 0xdc00 | (res & 0x3ff); } - bad: - if (flags & MB_ERR_INVALID_CHARS) return -2; /* bad char */ + else if (flags & MB_ERR_INVALID_CHARS) return -2; /* bad char */ /* otherwise ignore it */ } if (src < srcend) return -1; /* overflow */
1
0
0
0
Andrew Talbot : crypt32: Assign to structs instead of using memcpy.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: 70c4b66781093e9062b977f206a5e7d9bd52301b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=70c4b66781093e9062b977f20…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Feb 13 21:16:19 2008 +0000 crypt32: Assign to structs instead of using memcpy. --- dlls/crypt32/chain.c | 6 ++---- dlls/crypt32/msg.c | 4 ++-- dlls/crypt32/sip.c | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index 65ca674..362eddc 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -986,8 +986,7 @@ static BOOL CRYPT_BuildCandidateChainFromCert(HCERTCHAINENGINE hChainEngine, chain->ref = 1; chain->world = world; chain->context.cbSize = sizeof(CERT_CHAIN_CONTEXT); - memcpy(&chain->context.TrustStatus, &simpleChain->TrustStatus, - sizeof(CERT_TRUST_STATUS)); + chain->context.TrustStatus = simpleChain->TrustStatus; chain->context.cChain = 1; chain->context.rgpChain = CryptMemAlloc(sizeof(PCERT_SIMPLE_CHAIN)); chain->context.rgpChain[0] = simpleChain; @@ -1029,8 +1028,7 @@ static PCERT_SIMPLE_CHAIN CRYPT_CopySimpleChainToElement( if (element) { - memcpy(element, chain->rgpElement[i], - sizeof(CERT_CHAIN_ELEMENT)); + *element = *chain->rgpElement[i]; element->pCertContext = CertDuplicateCertificateContext( chain->rgpElement[i]->pCertContext); /* Reset the trust status of the copied element, it'll get diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 94e1df8..f06b8ea 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -78,7 +78,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, if (pStreamInfo) { msg->streamed = TRUE; - memcpy(&msg->stream_info, pStreamInfo, sizeof(msg->stream_info)); + msg->stream_info = *pStreamInfo; } else { @@ -1124,7 +1124,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, CRYPT_SIGNED_INFO info; char oid_rsa_data[] = szOID_RSA_data; - memcpy(&info, msg->msg_data.info, sizeof(info)); + info = *msg->msg_data.info; /* Quirk: OID is only encoded messages if an update has happened */ if (msg->base.state != MsgStateInit) info.content.pszObjId = oid_rsa_data; diff --git a/dlls/crypt32/sip.c b/dlls/crypt32/sip.c index 6a56021..869e2a9 100644 --- a/dlls/crypt32/sip.c +++ b/dlls/crypt32/sip.c @@ -325,7 +325,7 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid dos = (IMAGE_DOS_HEADER *)pMapped; if (dos->e_magic == IMAGE_DOS_SIGNATURE) { - memcpy(pgSubject, &unknown, sizeof(GUID)); + *pgSubject = unknown; SetLastError(S_OK); bRet = TRUE; goto cleanup1; @@ -435,8 +435,8 @@ static void CRYPT_CacheSIP(const GUID *pgSubject, SIP_DISPATCH_INFO *info) if (prov) { - memcpy(&prov->subject, pgSubject, sizeof(prov->subject)); - memcpy(&prov->info, info, sizeof(prov->info)); + prov->subject = *pgSubject; + prov->info = *info; EnterCriticalSection(&providers_cs); list_add_tail(&providers, &prov->entry); LeaveCriticalSection(&providers_cs);
1
0
0
0
Andrew Talbot : comdlg32: Rename some identifiers to reflect their width.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: 649d8b52983c54f26f66fcd2de37150a24da80b9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=649d8b52983c54f26f66fcd2d…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Feb 13 21:16:22 2008 +0000 comdlg32: Rename some identifiers to reflect their width. --- dlls/comdlg32/printdlg.c | 152 +++++++++++++++++++++++----------------------- 1 files changed, 76 insertions(+), 76 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=649d8b52983c54f26f66f…
1
0
0
0
Francois Gouget : advapi32/tests: Check that a credential type is supported before testing it. Test CRED_TYPE_DOMAIN_VISIBLE_PASSWORD credentials. Factorize the CredentialBlob checks.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: 79333bd1c0f64e471514677fd0fce690215eca64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79333bd1c0f64e471514677fd…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 13 22:10:55 2008 +0100 advapi32/tests: Check that a credential type is supported before testing it. Test CRED_TYPE_DOMAIN_VISIBLE_PASSWORD credentials. Factorize the CredentialBlob checks. --- dlls/advapi32/tests/cred.c | 80 +++++++++++++++++++++++++++++++++----------- 1 files changed, 60 insertions(+), 20 deletions(-) diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c index 7e9a9a3..6d7b758 100644 --- a/dlls/advapi32/tests/cred.c +++ b/dlls/advapi32/tests/cred.c @@ -30,6 +30,7 @@ static BOOL (WINAPI *pCredDeleteA)(LPCSTR,DWORD,DWORD); static BOOL (WINAPI *pCredEnumerateA)(LPCSTR,DWORD,DWORD *,PCREDENTIALA **); static VOID (WINAPI *pCredFree)(PVOID); +static BOOL (WINAPI *pCredGetSessionTypes)(DWORD,LPDWORD); static BOOL (WINAPI *pCredReadA)(LPCSTR,DWORD,DWORD,PCREDENTIALA *); static BOOL (WINAPI *pCredRenameA)(LPCSTR,LPCSTR,DWORD,DWORD); static BOOL (WINAPI *pCredWriteA)(PCREDENTIALA,DWORD); @@ -124,6 +125,25 @@ static void test_CredDeleteA(void) GetLastError()); } +static void check_blob(int line, DWORD cred_type, PCREDENTIALA cred) +{ + if (cred_type == CRED_TYPE_DOMAIN_PASSWORD) + { + todo_wine + ok_(__FILE__, line)(cred->CredentialBlobSize == 0, "expected CredentialBlobSize of 0 but got %d\n", cred->CredentialBlobSize); + todo_wine + ok_(__FILE__, line)(!cred->CredentialBlob, "expected NULL credentials but got %p\n", cred->CredentialBlob); + } + else + { + DWORD size=sizeof(TEST_PASSWORD); + ok_(__FILE__, line)(cred->CredentialBlobSize == size, "expected CredentialBlobSize of %u but got %u\n", size, cred->CredentialBlobSize); + ok_(__FILE__, line)(cred->CredentialBlob != NULL, "CredentialBlob should be present\n"); + if (cred->CredentialBlob) + ok_(__FILE__, line)(!memcmp(cred->CredentialBlob, TEST_PASSWORD, size), "wrong CredentialBlob\n"); + } +} + static void test_generic(void) { BOOL ret; @@ -158,10 +178,7 @@ static void test_generic(void) ok(creds[i]->Type == CRED_TYPE_GENERIC, "expected creds[%d]->Type CRED_TYPE_GENERIC but got %d\n", i, creds[i]->Type); ok(!creds[i]->Flags, "expected creds[%d]->Flags 0 but got 0x%x\n", i, creds[i]->Flags); ok(!strcmp(creds[i]->Comment, "Comment"), "expected creds[%d]->Comment \"Comment\" but got \"%s\"\n", i, creds[i]->Comment); - ok(creds[i]->CredentialBlobSize == sizeof(TEST_PASSWORD), "wrong CredentialBlobSize %d\n", creds[i]->CredentialBlobSize); - ok(creds[i]->CredentialBlob != NULL, "CredentialBlob should be present\n"); - if (creds[i]->CredentialBlob) - ok(!memcmp(creds[i]->CredentialBlob, TEST_PASSWORD, sizeof(TEST_PASSWORD)), "credentials don't match\n"); + check_blob(__LINE__, CRED_TYPE_GENERIC, creds[i]); ok(creds[i]->Persist, "expected creds[%d]->Persist CRED_PERSIST_ENTERPRISE but got %d\n", i, creds[i]->Persist); ok(!strcmp(creds[i]->UserName, "winetest"), "expected creds[%d]->UserName \"winetest\" but got \"%s\"\n", i, creds[i]->UserName); found = TRUE; @@ -178,7 +195,7 @@ static void test_generic(void) ok(ret, "CredDeleteA failed with error %d\n", GetLastError()); } -static void test_domain_password(void) +static void test_domain_password(DWORD cred_type) { BOOL ret; DWORD count, i; @@ -188,7 +205,7 @@ static void test_domain_password(void) BOOL found = FALSE; new_cred.Flags = 0; - new_cred.Type = CRED_TYPE_DOMAIN_PASSWORD; + new_cred.Type = cred_type; new_cred.TargetName = (char *)TEST_TARGET_NAME; new_cred.Comment = (char *)"Comment"; new_cred.CredentialBlobSize = sizeof(TEST_PASSWORD); @@ -208,13 +225,10 @@ static void test_domain_password(void) { if (!strcmp(creds[i]->TargetName, TEST_TARGET_NAME)) { - ok(creds[i]->Type == CRED_TYPE_DOMAIN_PASSWORD, "expected creds[%d]->Type CRED_TYPE_DOMAIN_PASSWORD but got %d\n", i, creds[i]->Type); + ok(creds[i]->Type == cred_type, "expected creds[%d]->Type CRED_TYPE_DOMAIN_PASSWORD but got %d\n", i, creds[i]->Type); ok(!creds[i]->Flags, "expected creds[%d]->Flags 0 but got 0x%x\n", i, creds[i]->Flags); ok(!strcmp(creds[i]->Comment, "Comment"), "expected creds[%d]->Comment \"Comment\" but got \"%s\"\n", i, creds[i]->Comment); - todo_wine - ok(creds[i]->CredentialBlobSize == 0, "expected CredentialBlobSize of 0 but got %d\n", creds[i]->CredentialBlobSize); - todo_wine - ok(!creds[i]->CredentialBlob, "expected NULL credentials but got %p\n", creds[i]->CredentialBlob); + check_blob(__LINE__, cred_type, creds[i]); ok(creds[i]->Persist, "expected creds[%d]->Persist CRED_PERSIST_ENTERPRISE but got %d\n", i, creds[i]->Persist); ok(!strcmp(creds[i]->UserName, "test\\winetest"), "expected creds[%d]->UserName \"winetest\" but got \"%s\"\n", i, creds[i]->UserName); found = TRUE; @@ -223,25 +237,25 @@ static void test_domain_password(void) pCredFree(creds); ok(found, "credentials not found\n"); - ret = pCredReadA(TEST_TARGET_NAME, CRED_TYPE_DOMAIN_PASSWORD, 0, &cred); + ret = pCredReadA(TEST_TARGET_NAME, cred_type, 0, &cred); ok(ret, "CredReadA failed with error %d\n", GetLastError()); if (ret) /* don't check the values of cred, if CredReadA failed. */ { - todo_wine - ok(cred->CredentialBlobSize == 0, "expected CredentialBlobSize of 0 but got %d\n", cred->CredentialBlobSize); - todo_wine - ok(!cred->CredentialBlob, "expected NULL credentials but got %p\n", cred->CredentialBlob); + check_blob(__LINE__, cred_type, cred); pCredFree(cred); } - ret = pCredDeleteA(TEST_TARGET_NAME, CRED_TYPE_DOMAIN_PASSWORD, 0); + ret = pCredDeleteA(TEST_TARGET_NAME, cred_type, 0); ok(ret, "CredDeleteA failed with error %d\n", GetLastError()); } START_TEST(cred) { + DWORD persists[CRED_TYPE_MAXIMUM]; + pCredEnumerateA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredEnumerateA"); pCredFree = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredFree"); + pCredGetSessionTypes = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredGetSessionTypes"); pCredWriteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredWriteA"); pCredDeleteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredDeleteA"); pCredReadA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadA"); @@ -254,12 +268,38 @@ START_TEST(cred) return; } + if (pCredGetSessionTypes) + { + BOOL ret; + DWORD i; + ret = pCredGetSessionTypes(CRED_TYPE_MAXIMUM, persists); + ok(ret, "CredGetSessionTypes failed with error %d\n", GetLastError()); + ok(persists[0] == CRED_PERSIST_NONE, "persists[0] = %u instead of CRED_PERSIST_NONE\n", persists[0]); + for (i=0; i < CRED_TYPE_MAXIMUM; i++) + ok(persists[i] <= CRED_PERSIST_ENTERPRISE, "bad value for persists[%u]: %u\n", i, persists[i]); + } + else + memset(persists, CRED_PERSIST_ENTERPRISE, sizeof(persists)); + test_CredReadA(); test_CredWriteA(); test_CredDeleteA(); trace("generic:\n"); - test_generic(); - trace("domain password:\n"); - test_domain_password(); + if (persists[CRED_TYPE_GENERIC] == CRED_PERSIST_NONE) + skip("CRED_TYPE_GENERIC credentials are not supported or are disabled. Skipping\n"); + else + test_generic(); + + trace("domain password:\n"); + if (persists[CRED_TYPE_DOMAIN_PASSWORD] == CRED_PERSIST_NONE) + skip("CRED_TYPE_DOMAIN_PASSWORD credentials are not supported or are disabled. Skipping\n"); + else + test_domain_password(CRED_TYPE_DOMAIN_PASSWORD); + + trace("domain visible password:\n"); + if (persists[CRED_TYPE_DOMAIN_VISIBLE_PASSWORD] == CRED_PERSIST_NONE) + skip("CRED_TYPE_DOMAIN_VISIBLE_PASSWORD credentials are not supported or are disabled. Skipping\n"); + else + test_domain_password(CRED_TYPE_DOMAIN_VISIBLE_PASSWORD); }
1
0
0
0
Francois Gouget : advapi32/tests: Factorize the password constants.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: 6552f86ff98ba8458ae07b9c04d415001b1bad7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6552f86ff98ba8458ae07b9c0…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 13 22:07:08 2008 +0100 advapi32/tests: Factorize the password constants. --- dlls/advapi32/tests/cred.c | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c index 2fbd1c7..7e9a9a3 100644 --- a/dlls/advapi32/tests/cred.c +++ b/dlls/advapi32/tests/cred.c @@ -36,6 +36,7 @@ static BOOL (WINAPI *pCredWriteA)(PCREDENTIALA,DWORD); #define TEST_TARGET_NAME "
credtest.winehq.org
" #define TEST_TARGET_NAME2 "
credtest2.winehq.org
" +static const WCHAR TEST_PASSWORD[] = {'p','4','$','$','w','0','r','d','!',0}; static void test_CredReadA(void) { @@ -130,15 +131,14 @@ static void test_generic(void) PCREDENTIALA *creds; CREDENTIALA new_cred; PCREDENTIALA cred; - static const WCHAR password[] = {'p','4','$','$','w','0','r','d','!',0}; BOOL found = FALSE; new_cred.Flags = 0; new_cred.Type = CRED_TYPE_GENERIC; new_cred.TargetName = (char *)TEST_TARGET_NAME; new_cred.Comment = (char *)"Comment"; - new_cred.CredentialBlobSize = sizeof(password); - new_cred.CredentialBlob = (LPBYTE)password; + new_cred.CredentialBlobSize = sizeof(TEST_PASSWORD); + new_cred.CredentialBlob = (LPBYTE)TEST_PASSWORD; new_cred.Persist = CRED_PERSIST_ENTERPRISE; new_cred.AttributeCount = 0; new_cred.Attributes = NULL; @@ -158,10 +158,10 @@ static void test_generic(void) ok(creds[i]->Type == CRED_TYPE_GENERIC, "expected creds[%d]->Type CRED_TYPE_GENERIC but got %d\n", i, creds[i]->Type); ok(!creds[i]->Flags, "expected creds[%d]->Flags 0 but got 0x%x\n", i, creds[i]->Flags); ok(!strcmp(creds[i]->Comment, "Comment"), "expected creds[%d]->Comment \"Comment\" but got \"%s\"\n", i, creds[i]->Comment); - ok(creds[i]->CredentialBlobSize == sizeof(password), "wrong CredentialBlobSize %d\n", creds[i]->CredentialBlobSize); + ok(creds[i]->CredentialBlobSize == sizeof(TEST_PASSWORD), "wrong CredentialBlobSize %d\n", creds[i]->CredentialBlobSize); ok(creds[i]->CredentialBlob != NULL, "CredentialBlob should be present\n"); if (creds[i]->CredentialBlob) - ok(!memcmp(creds[i]->CredentialBlob, password, sizeof(password)), "credentials don't match\n"); + ok(!memcmp(creds[i]->CredentialBlob, TEST_PASSWORD, sizeof(TEST_PASSWORD)), "credentials don't match\n"); ok(creds[i]->Persist, "expected creds[%d]->Persist CRED_PERSIST_ENTERPRISE but got %d\n", i, creds[i]->Persist); ok(!strcmp(creds[i]->UserName, "winetest"), "expected creds[%d]->UserName \"winetest\" but got \"%s\"\n", i, creds[i]->UserName); found = TRUE; @@ -185,15 +185,14 @@ static void test_domain_password(void) PCREDENTIALA *creds; CREDENTIALA new_cred; PCREDENTIALA cred; - static const WCHAR password[] = {'p','4','$','$','w','0','r','d','!',0}; BOOL found = FALSE; new_cred.Flags = 0; new_cred.Type = CRED_TYPE_DOMAIN_PASSWORD; new_cred.TargetName = (char *)TEST_TARGET_NAME; new_cred.Comment = (char *)"Comment"; - new_cred.CredentialBlobSize = sizeof(password); - new_cred.CredentialBlob = (LPBYTE)password; + new_cred.CredentialBlobSize = sizeof(TEST_PASSWORD); + new_cred.CredentialBlob = (LPBYTE)TEST_PASSWORD; new_cred.Persist = CRED_PERSIST_ENTERPRISE; new_cred.AttributeCount = 0; new_cred.Attributes = NULL;
1
0
0
0
Francois Gouget : advapi32: Add a rudimentary implementation of CredGetSessionTypes().
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: ddab29b7d16bc0184f33cf63887dd8c74c0ad201 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ddab29b7d16bc0184f33cf638…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 13 22:06:44 2008 +0100 advapi32: Add a rudimentary implementation of CredGetSessionTypes(). --- dlls/advapi32/advapi32.spec | 2 +- dlls/advapi32/cred.c | 20 ++++++++++++++++++++ include/wincred.h | 1 + 3 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 738b4df..17dac6d 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -107,7 +107,7 @@ @ stdcall CredEnumerateA(str long ptr ptr) @ stdcall CredEnumerateW(wstr long ptr ptr) @ stdcall CredFree(ptr) -# @ stub CredGetSessionTypes +@ stdcall CredGetSessionTypes(long ptr) # @ stub CredGetTargetInfoA # @ stub CredGetTargetInfoW # @ stub CredIsMarshaledCredentialA diff --git a/dlls/advapi32/cred.c b/dlls/advapi32/cred.c index e81a171..ab988da 100644 --- a/dlls/advapi32/cred.c +++ b/dlls/advapi32/cred.c @@ -1670,3 +1670,23 @@ BOOL WINAPI CredWriteW(PCREDENTIALW Credential, DWORD Flags) } return TRUE; } + +/****************************************************************************** + * CredGetSessionTypes [ADVAPI32.@] + */ +WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD persistCount, LPDWORD persists) +{ + TRACE("(%u, %p)\n", persistCount, persists); + + memset(persists, CRED_PERSIST_NONE, persistCount*sizeof(*persists)); + if (CRED_TYPE_GENERIC < persistCount) + { + persists[CRED_TYPE_GENERIC] = CRED_PERSIST_ENTERPRISE; + + if (CRED_TYPE_DOMAIN_PASSWORD < persistCount) + { + persists[CRED_TYPE_DOMAIN_PASSWORD] = CRED_PERSIST_ENTERPRISE; + } + } + return TRUE; +} diff --git a/include/wincred.h b/include/wincred.h index 2b606a4..5865063 100644 --- a/include/wincred.h +++ b/include/wincred.h @@ -185,6 +185,7 @@ WINADVAPI BOOL WINAPI CredEnumerateA(LPCSTR,DWORD,DWORD *,PCREDENTIALA **); WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **); #define CredEnumerate WINELIB_NAME_AW(CredEnumerate) WINADVAPI VOID WINAPI CredFree(PVOID); +WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD,LPDWORD); WINADVAPI BOOL WINAPI CredReadA(LPCSTR,DWORD,DWORD,PCREDENTIALA *); WINADVAPI BOOL WINAPI CredReadW(LPCWSTR,DWORD,DWORD,PCREDENTIALW *); #define CredRead WINELIB_NAME_AW(CredRead)
1
0
0
0
Francois Gouget : advapi32: Add some missing CRED_TYPE_XXX constants.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: 8edfee18ccd410d9c92a87d83c2a2a395e56cb9d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8edfee18ccd410d9c92a87d83…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 13 22:05:49 2008 +0100 advapi32: Add some missing CRED_TYPE_XXX constants. --- include/wincred.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/wincred.h b/include/wincred.h index 34c4f35..2b606a4 100644 --- a/include/wincred.h +++ b/include/wincred.h @@ -147,7 +147,9 @@ DECL_WINELIB_TYPE_AW(PCREDUI_INFO) #define CRED_TYPE_DOMAIN_PASSWORD 2 #define CRED_TYPE_DOMAIN_CERTIFICATE 3 #define CRED_TYPE_DOMAIN_VISIBLE_PASSWORD 4 -#define CRED_TYPE_MAXIMUM 5 +#define CRED_TYPE_GENERIC_CERTIFICATE 5 +#define CRED_TYPE_MAXIMUM 6 +#define CRED_TYPE_MAXIMUM_EX (CRED_TYPE_MAXIMUM+1000) /* values for CREDENTIAL::Persist */ #define CRED_PERSIST_NONE 0
1
0
0
0
Mikołaj Zalewski : browseui: Implement PROGDLG_NOMINIMIZE.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: cd7e1417b1ae6c025182714c8394e48d7e2f1b53 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cd7e1417b1ae6c025182714c8…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Feb 13 15:28:20 2008 +0100 browseui: Implement PROGDLG_NOMINIMIZE. --- dlls/browseui/progressdlg.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c index be77edf..aa568e7 100644 --- a/dlls/browseui/progressdlg.c +++ b/dlls/browseui/progressdlg.c @@ -179,6 +179,8 @@ static INT_PTR CALLBACK dialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ShowWindow(GetDlgItem(hwnd, IDCANCEL), SW_HIDE); if (This->dwFlags & PROGDLG_MARQUEEPROGRESS) set_progress_marquee(This); + if (This->dwFlags & PROGDLG_NOMINIMIZE) + SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) & (~WS_MINIMIZEBOX)); update_dialog(This, 0xffffffff); This->dwUpdate = 0; @@ -328,8 +330,6 @@ static HRESULT WINAPI ProgressDialog_StartProgressDialog(IProgressDialog *iface, FIXME("Flags PROGDLG_AUTOTIME not supported\n"); if (dwFlags & PROGDLG_NOTIME) FIXME("Flags PROGDLG_NOTIME not supported\n"); - if (dwFlags & PROGDLG_NOMINIMIZE) - FIXME("Flags PROGDLG_NOMINIMIZE not supported\n"); EnterCriticalSection(&This->cs);
1
0
0
0
Mikołaj Zalewski : browseui: aclmulti: Follow the Windows Vista behavious in Expand.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: a17e222d025559831b518ae669036b0dbdaa7bf6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a17e222d025559831b518ae66…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Feb 13 18:24:55 2008 +0100 browseui: aclmulti: Follow the Windows Vista behavious in Expand. --- dlls/browseui/aclmulti.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/browseui/aclmulti.c b/dlls/browseui/aclmulti.c index 3fb49b8..b0a0ec8 100644 --- a/dlls/browseui/aclmulti.c +++ b/dlls/browseui/aclmulti.c @@ -257,8 +257,7 @@ static HRESULT WINAPI ACLMulti_Expand(IACList *iface, LPCWSTR wstr) if (!This->objs[i].pACL) continue; res = IACList_Expand(This->objs[i].pACL, wstr); - if (res == S_OK) - break; + /* Vista behaviour - XP would break out of the loop if res == S_OK (usually calling Expand only once) */ } return res; }
1
0
0
0
Mikołaj Zalewski : browseui/tests: make the ACLMulti test pass under Windows Vista.
by Alexandre Julliard
15 Feb '08
15 Feb '08
Module: wine Branch: master Commit: c9492a5bf400f47bce5de6a3e48bb7ae121e188c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9492a5bf400f47bce5de6a3e…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Wed Feb 13 18:24:19 2008 +0100 browseui/tests: make the ACLMulti test pass under Windows Vista. --- dlls/browseui/tests/autocomplete.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/browseui/tests/autocomplete.c b/dlls/browseui/tests/autocomplete.c index ba52b66..bddaa52 100644 --- a/dlls/browseui/tests/autocomplete.c +++ b/dlls/browseui/tests/autocomplete.c @@ -273,7 +273,8 @@ static void test_ACLMulti(void) ole_ok(acl->lpVtbl->Expand(acl, exp)); ok(acl1->expcount == 1, "expcount - expected 1, got %d\n", acl1->expcount); - ok(acl2->expcount == 0, "expcount - expected 0, got %d\n", acl2->expcount); + ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 1 /* Vista */, + "expcount - expected 0 or 1, got %d\n", acl2->expcount); ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); ok(i == 1, "Expected i == 1, got %d\n", i); @@ -282,15 +283,18 @@ static void test_ACLMulti(void) ole_ok(obj->lpVtbl->Next(obj, 15, wstrtab, &i)); ole_ok(acl->lpVtbl->Expand(acl, exp)); ok(acl1->expcount == 2, "expcount - expected 1, got %d\n", acl1->expcount); - ok(acl2->expcount == 0, "expcount - expected 0, got %d\n", acl2->expcount); + ok(acl2->expcount == 0 /* XP */ || acl2->expcount == 2 /* Vista */, + "expcount - expected 0 or 2, got %d\n", acl2->expcount); acl1->expret = S_FALSE; ole_ok(acl->lpVtbl->Expand(acl, exp)); ok(acl1->expcount == 3, "expcount - expected 1, got %d\n", acl1->expcount); - ok(acl2->expcount == 1, "expcount - expected 0, got %d\n", acl2->expcount); + ok(acl2->expcount == 1 /* XP */ || acl2->expcount == 3 /* Vista */, + "expcount - expected 0 or 3, got %d\n", acl2->expcount); acl1->expret = E_NOTIMPL; ole_ok(acl->lpVtbl->Expand(acl, exp)); ok(acl1->expcount == 4, "expcount - expected 1, got %d\n", acl1->expcount); - ok(acl2->expcount == 2, "expcount - expected 0, got %d\n", acl2->expcount); + ok(acl2->expcount == 2 /* XP */ || acl2->expcount == 4 /* Vista */, + "expcount - expected 0 or 4, got %d\n", acl2->expcount); acl2->expret = E_OUTOFMEMORY; ok(acl->lpVtbl->Expand(acl, exp) == E_OUTOFMEMORY, "Unexpected Expand return\n"); acl2->expret = E_FAIL;
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
100
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
Results per page:
10
25
50
100
200