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
November 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
910 discussions
Start a n
N
ew thread
Juan Lang : crypt32: Implement CertAddEncodedCertificateToSystemStoreA/W.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: d8094382a89c980ffadaa84b98a061972a63cdcd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8094382a89c980ffadaa84b9…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Nov 3 13:54:15 2009 -0800 crypt32: Implement CertAddEncodedCertificateToSystemStoreA/W. --- dlls/crypt32/cert.c | 38 ++++++++++++++++++++++++++++++++++++++ dlls/crypt32/crypt32.spec | 4 ++-- include/wincrypt.h | 7 +++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 208f3fc..2a65290 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -71,6 +71,44 @@ BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, return ret; } +BOOL WINAPI CertAddEncodedCertificateToSystemStoreA(LPCSTR pszCertStoreName, + const BYTE *pbCertEncoded, DWORD cbCertEncoded) +{ + HCERTSTORE store; + BOOL ret = FALSE; + + TRACE("(%s, %p, %d)\n", debugstr_a(pszCertStoreName), pbCertEncoded, + cbCertEncoded); + + store = CertOpenSystemStoreA(0, pszCertStoreName); + if (store) + { + ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + pbCertEncoded, cbCertEncoded, CERT_STORE_ADD_USE_EXISTING, NULL); + CertCloseStore(store, 0); + } + return ret; +} + +BOOL WINAPI CertAddEncodedCertificateToSystemStoreW(LPCWSTR pszCertStoreName, + const BYTE *pbCertEncoded, DWORD cbCertEncoded) +{ + HCERTSTORE store; + BOOL ret = FALSE; + + TRACE("(%s, %p, %d)\n", debugstr_w(pszCertStoreName), pbCertEncoded, + cbCertEncoded); + + store = CertOpenSystemStoreW(0, pszCertStoreName); + if (store) + { + ret = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, + pbCertEncoded, cbCertEncoded, CERT_STORE_ADD_USE_EXISTING, NULL); + CertCloseStore(store, 0); + } + return ret; +} + BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext) diff --git a/dlls/crypt32/crypt32.spec b/dlls/crypt32/crypt32.spec index ef5d6e6..b096c09 100644 --- a/dlls/crypt32/crypt32.spec +++ b/dlls/crypt32/crypt32.spec @@ -5,8 +5,8 @@ @ stdcall CertAddEncodedCRLToStore(ptr long ptr long long ptr) @ stdcall CertAddEncodedCTLToStore(ptr long ptr long long ptr) @ stdcall CertAddEncodedCertificateToStore(ptr long ptr long long ptr) -@ stub CertAddEncodedCertificateToSystemStoreA -@ stub CertAddEncodedCertificateToSystemStoreW +@ stdcall CertAddEncodedCertificateToSystemStoreA(str ptr long) +@ stdcall CertAddEncodedCertificateToSystemStoreW(wstr ptr long) @ stdcall CertAddEnhancedKeyUsageIdentifier(ptr str) @ stdcall CertAddSerializedElementToStore(ptr ptr long long long long ptr ptr) @ stdcall CertAddStoreToCollection(ptr ptr long long) diff --git a/include/wincrypt.h b/include/wincrypt.h index 32b523d..4e2f60b 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -4054,6 +4054,13 @@ BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext); +BOOL WINAPI CertAddEncodedCertificateToSystemStoreA(LPCSTR pszCertStoreName, + const BYTE *pbCertEncoded, DWORD cbCertEncoded); +BOOL WINAPI CertAddEncodedCertificateToSystemStoreW(LPCWSTR pszCertStoreName, + const BYTE *pbCertEncoded, DWORD cbCertEncoded); +#define CertAddEncodedCertificateToSystemStore \ + WINELIB_NAME_AW(CertAddEncodedCertificateToSystemStore) + BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext);
1
0
0
0
Jeremy White : advapi32/tests: Only release providers and free keys if we' ve had success creating them.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 5df2626aaeab15a13364f0c1e660d933b577ffd3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5df2626aaeab15a13364f0c1e…
Author: Jeremy White <jwhite(a)codeweavers.com> Date: Mon Nov 2 16:46:07 2009 -0600 advapi32/tests: Only release providers and free keys if we've had success creating them. --- dlls/advapi32/tests/crypt.c | 185 +++++++++++++++++++++++-------------------- 1 files changed, 99 insertions(+), 86 deletions(-) diff --git a/dlls/advapi32/tests/crypt.c b/dlls/advapi32/tests/crypt.c index 131e605..9eacbd4 100644 --- a/dlls/advapi32/tests/crypt.c +++ b/dlls/advapi32/tests/crypt.c @@ -956,70 +956,78 @@ static void test_rc2_keylen(void) ret = pCryptAcquireContextA(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContext error %u\n", GetLastError()); - - key_blob.header.bType = PLAINTEXTKEYBLOB; - key_blob.header.bVersion = CUR_BLOB_VERSION; - key_blob.header.reserved = 0; - key_blob.header.aiKeyAlg = CALG_RC2; - key_blob.key_size = sizeof(key); - memcpy(key_blob.key_data, key, key_length); - - /* Importing a 16-byte key works with the default provider. */ - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, CRYPT_IPSEC_HMAC_KEY, &hkey); - /* CRYPT_IPSEC_HMAC_KEY is not supported on W2K and lower */ - todo_wine - ok(ret || - broken(!ret && GetLastError() == NTE_BAD_FLAGS), - "CryptImportKey error %08x\n", GetLastError()); - - pCryptDestroyKey(hkey); - pCryptReleaseContext(provider, 0); + if (ret) + { + key_blob.header.bType = PLAINTEXTKEYBLOB; + key_blob.header.bVersion = CUR_BLOB_VERSION; + key_blob.header.reserved = 0; + key_blob.header.aiKeyAlg = CALG_RC2; + key_blob.key_size = sizeof(key); + memcpy(key_blob.key_data, key, key_length); + + /* Importing a 16-byte key works with the default provider. */ + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, CRYPT_IPSEC_HMAC_KEY, &hkey); + /* CRYPT_IPSEC_HMAC_KEY is not supported on W2K and lower */ + todo_wine + ok(ret || + broken(!ret && GetLastError() == NTE_BAD_FLAGS), + "CryptImportKey error %08x\n", GetLastError()); + + if (ret) + pCryptDestroyKey(hkey); + pCryptReleaseContext(provider, 0); + } SetLastError(0xdeadbeef); ret = pCryptAcquireContextA(&provider, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContext error %08x\n", GetLastError()); - /* Importing a 16-byte key doesn't work with the base provider.. */ - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, 0, &hkey); - ok(!ret && (GetLastError() == NTE_BAD_DATA || - GetLastError() == NTE_BAD_LEN || /* Win7 */ - GetLastError() == NTE_BAD_TYPE || /* W2K */ - GetLastError() == NTE_PERM), /* Win9x, WinMe and NT4 */ - "unexpected error %08x\n", GetLastError()); - /* but importing an 56-bit (7-byte) key does.. */ - key_blob.key_size = 7; - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, 0, &hkey); - ok(ret || - broken(!ret && GetLastError() == NTE_BAD_TYPE) || /* W2K */ - broken(!ret && GetLastError() == NTE_PERM), /* Win9x, WinMe and NT4 */ - "CryptAcquireContext error %08x\n", GetLastError()); - pCryptDestroyKey(hkey); - /* as does importing a 16-byte key with the base provider when - * CRYPT_IPSEC_HMAC_KEY is specified. - */ - key_blob.key_size = sizeof(key); - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, CRYPT_IPSEC_HMAC_KEY, &hkey); - /* CRYPT_IPSEC_HMAC_KEY is not supported on W2K and lower */ - todo_wine - ok(ret || - broken(!ret && GetLastError() == NTE_BAD_FLAGS), - "CryptImportKey error %08x\n", GetLastError()); - pCryptDestroyKey(hkey); - - pCryptReleaseContext(provider, 0); + if (ret) + { + /* Importing a 16-byte key doesn't work with the base provider.. */ + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, 0, &hkey); + ok(!ret && (GetLastError() == NTE_BAD_DATA || + GetLastError() == NTE_BAD_LEN || /* Win7 */ + GetLastError() == NTE_BAD_TYPE || /* W2K */ + GetLastError() == NTE_PERM), /* Win9x, WinMe and NT4 */ + "unexpected error %08x\n", GetLastError()); + /* but importing an 56-bit (7-byte) key does.. */ + key_blob.key_size = 7; + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, 0, &hkey); + ok(ret || + broken(!ret && GetLastError() == NTE_BAD_TYPE) || /* W2K */ + broken(!ret && GetLastError() == NTE_PERM), /* Win9x, WinMe and NT4 */ + "CryptAcquireContext error %08x\n", GetLastError()); + if (ret) + pCryptDestroyKey(hkey); + /* as does importing a 16-byte key with the base provider when + * CRYPT_IPSEC_HMAC_KEY is specified. + */ + key_blob.key_size = sizeof(key); + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, CRYPT_IPSEC_HMAC_KEY, &hkey); + /* CRYPT_IPSEC_HMAC_KEY is not supported on W2K and lower */ + todo_wine + ok(ret || + broken(!ret && GetLastError() == NTE_BAD_FLAGS), + "CryptImportKey error %08x\n", GetLastError()); + if (ret) + pCryptDestroyKey(hkey); + + pCryptReleaseContext(provider, 0); + } key_blob.key_size = sizeof(key); SetLastError(0xdeadbeef); @@ -1027,34 +1035,39 @@ static void test_rc2_keylen(void) PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContext error %08x\n", GetLastError()); - /* Importing a 16-byte key also works with the default provider when - * CRYPT_IPSEC_HMAC_KEY is specified. - */ - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, CRYPT_IPSEC_HMAC_KEY, &hkey); - todo_wine - ok(ret || - broken(!ret && GetLastError() == NTE_BAD_FLAGS), - "CryptImportKey error %08x\n", GetLastError()); - pCryptDestroyKey(hkey); - - /* There is no apparent limit to the size of the input key when - * CRYPT_IPSEC_HMAC_KEY is specified. - */ - key_blob.key_size = sizeof(key_blob.key_data); - SetLastError(0xdeadbeef); - ret = pCryptImportKey(provider, (BYTE*)&key_blob, - sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, - 0, CRYPT_IPSEC_HMAC_KEY, &hkey); - todo_wine - ok(ret || - broken(!ret && GetLastError() == NTE_BAD_FLAGS), - "CryptImportKey error %08x\n", GetLastError()); - pCryptDestroyKey(hkey); - - pCryptReleaseContext(provider, 0); + if (ret) + { + /* Importing a 16-byte key also works with the default provider when + * CRYPT_IPSEC_HMAC_KEY is specified. + */ + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, CRYPT_IPSEC_HMAC_KEY, &hkey); + todo_wine + ok(ret || + broken(!ret && GetLastError() == NTE_BAD_FLAGS), + "CryptImportKey error %08x\n", GetLastError()); + if (ret) + pCryptDestroyKey(hkey); + + /* There is no apparent limit to the size of the input key when + * CRYPT_IPSEC_HMAC_KEY is specified. + */ + key_blob.key_size = sizeof(key_blob.key_data); + SetLastError(0xdeadbeef); + ret = pCryptImportKey(provider, (BYTE*)&key_blob, + sizeof(BLOBHEADER)+sizeof(DWORD)+key_blob.key_size, + 0, CRYPT_IPSEC_HMAC_KEY, &hkey); + todo_wine + ok(ret || + broken(!ret && GetLastError() == NTE_BAD_FLAGS), + "CryptImportKey error %08x\n", GetLastError()); + if (ret) + pCryptDestroyKey(hkey); + + pCryptReleaseContext(provider, 0); + } } START_TEST(crypt)
1
0
0
0
Michael Martin : kernel32/tests: Additional tests for CopyFile/ MoveFile used on mapped files.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 39d8f13785d5b927525ca2dbdb27242ca65ef916 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=39d8f13785d5b927525ca2dbd…
Author: Michael Martin <martinmnet(a)hotmail.com> Date: Sun Nov 1 09:20:13 2009 +0000 kernel32/tests: Additional tests for CopyFile/MoveFile used on mapped files. --- dlls/kernel32/tests/file.c | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index d59315e..0a9152e 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -563,6 +563,7 @@ static void test_CopyFileA(void) char source[MAX_PATH], dest[MAX_PATH]; static const char prefix[] = "pfx"; HANDLE hfile; + HANDLE hmapfile; FILETIME ft1, ft2; char buf[10]; DWORD ret; @@ -628,6 +629,32 @@ static void test_CopyFileA(void) ok( retok && ret == sizeof(prefix), "ReadFile: error %d\n", GetLastError()); ok(!memcmp(prefix, buf, sizeof(prefix)), "buffer contents mismatch\n"); + + /* check error on copying over a mapped file that was opened with FILE_SHARE_READ */ + hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + ret = CopyFileA(source, dest, FALSE); + ok(!ret && GetLastError() == ERROR_SHARING_VIOLATION, + "CopyFileA with mapped dest file: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + + CloseHandle(hmapfile); + CloseHandle(hfile); + + hfile = CreateFileA(dest, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); + + /* check error on copying over a mapped file that was opened with FILE_SHARE_WRITE */ + hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + ret = CopyFileA(source, dest, FALSE); + todo_wine { + ok(!ret && GetLastError() == ERROR_USER_MAPPED_FILE, + "CopyFileA with mapped dest file: expected ERROR_USER_MAPPED_FILE, got %d\n", GetLastError()); + } + + CloseHandle(hmapfile); CloseHandle(hfile); ret = DeleteFileA(source); @@ -1263,7 +1290,10 @@ static void test_MoveFileA(void) char tempdir[MAX_PATH]; char source[MAX_PATH], dest[MAX_PATH]; static const char prefix[] = "pfx"; + HANDLE hfile; + HANDLE hmapfile; DWORD ret; + BOOL retok; ret = GetTempPathA(MAX_PATH, tempdir); ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); @@ -1282,6 +1312,46 @@ static void test_MoveFileA(void) ret = DeleteFileA(dest); ok(ret, "DeleteFileA: error %d\n", GetLastError()); + hfile = CreateFileA(source, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); + + retok = WriteFile(hfile, prefix, sizeof(prefix), &ret, NULL ); + ok( retok && ret == sizeof(prefix), + "WriteFile error %d\n", GetLastError()); + + hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + ret = MoveFileA(source, dest); + todo_wine { + ok(!ret, "MoveFileA: expected failure\n"); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "MoveFileA: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + } + + CloseHandle(hmapfile); + CloseHandle(hfile); + + /* if MoveFile succeeded, move back to dest */ + if (ret) MoveFile(dest, source); + + hfile = CreateFileA(source, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); + + hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + ret = MoveFileA(source, dest); + todo_wine { + ok(!ret, "MoveFileA: expected failure\n"); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "MoveFileA: expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); + } + + CloseHandle(hmapfile); + CloseHandle(hfile); + + /* if MoveFile succeeded, move back to dest */ + if (ret) MoveFile(dest, source); + ret = MoveFileA(source, dest); ok(ret, "MoveFileA: failed, error %d\n", GetLastError());
1
0
0
0
Jörg Höhle : mciwave: Correct MCI return codes.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 59bb360a5d83ba10e263c27e5a51c6e3e908b7ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=59bb360a5d83ba10e263c27e5…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Tue Nov 3 00:32:30 2009 +0100 mciwave: Correct MCI return codes. --- dlls/mciwave/mciwave.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index 18fb5eb..0c17f32 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -791,7 +791,7 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, TRACE("Playing from byte=%u to byte=%u\n", wmw->dwPosition, end); if (end <= wmw->dwPosition) - return TRUE; + return MMSYSERR_NOERROR; #define WAVE_ALIGN_ON_BLOCK(wmw,v) \ @@ -1026,7 +1026,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt if (end <= wmw->dwPosition) { - return TRUE; + return MMSYSERR_NOERROR; } #define WAVE_ALIGN_ON_BLOCK(wmw,v) \ @@ -1471,7 +1471,7 @@ static DWORD WAVE_mciStatus(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_STATUS_PARM lpParms->dwReturn = id; } else { lpParms->dwReturn = 0; - ret = MCIERR_WAVE_INPUTUNSPECIFIED; + ret = MCIERR_WAVE_OUTPUTUNSPECIFIED; } } break;
1
0
0
0
Jörg Höhle : mciwave: waveaudio does not support the shareable flag.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: d3dd250c2e4f6d98f572091f5bc886f184a1f617 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d3dd250c2e4f6d98f572091f5…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Mon Nov 2 23:52:49 2009 +0100 mciwave: waveaudio does not support the shareable flag. --- dlls/mciwave/mciwave.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index be7d3b1..18fb5eb 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -38,7 +38,6 @@ typedef struct { UINT wDevID; HANDLE hWave; int nUseCount; /* Incremented for each shared open */ - BOOL fShareable; /* TRUE if first open was shareable */ HMMIO hFile; /* mmio file handle open as Element */ MCI_WAVE_OPEN_PARMSW openParms; WAVEFORMATEX wfxRef; @@ -476,7 +475,7 @@ static LRESULT WAVE_mciOpen(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_P if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_OPEN_SHAREABLE) - return MCIERR_HARDWARE; + return MCIERR_UNSUPPORTED_FUNCTION; if (wmw->nUseCount > 0) { /* The driver is already opened on this channel
1
0
0
0
Owen Rudge : comctl32: Add support for scrolling during marquee selection.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: e1f3edef3e491095dd73548b711bddf14ee73ef0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1f3edef3e491095dd73548b7…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Nov 2 10:58:26 2009 -0600 comctl32: Add support for scrolling during marquee selection. --- dlls/comctl32/listview.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 118 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ba9bb3b..ae658bd 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -249,6 +249,7 @@ typedef struct tagLISTVIEW_INFO BOOL bRButtonDown; BOOL bDragging; BOOL bMarqueeSelect; /* marquee selection/highlight underway */ + BOOL bScrolling; RECT marqueeRect; /* absolute coordinates of marquee selection */ RECT marqueeDrawRect; /* relative coordinates for drawing marquee */ POINT marqueeOrigin; /* absolute coordinates of marquee click origin */ @@ -434,6 +435,7 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, BOOL); static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST); static INT LISTVIEW_HitTest(const LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL); static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *, BOOL, BOOL); +static BOOL LISTVIEW_Scroll(LISTVIEW_INFO *, INT, INT); /******** Text handling functions *************************************/ @@ -3595,6 +3597,11 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, I return 0; } +#define SCROLL_LEFT 0x1 +#define SCROLL_RIGHT 0x2 +#define SCROLL_UP 0x4 +#define SCROLL_DOWN 0x8 + /*** * DESCRIPTION: * Utility routine to draw and highlight items within a marquee selection rectangle. @@ -3641,6 +3648,21 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, LPPOINT coords_ori /* Cancel out the old marquee rectangle and draw the new one */ LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeDrawRect); + /* Scroll by the appropriate distance if applicable - speed up scrolling as + the cursor is further away */ + + if ((scroll & SCROLL_LEFT) && (coords_orig->x <= 0)) + LISTVIEW_Scroll(infoPtr, coords_orig->x, 0); + + if ((scroll & SCROLL_RIGHT) && (coords_orig->x >= infoPtr->rcList.right)) + LISTVIEW_Scroll(infoPtr, (coords_orig->x - infoPtr->rcList.right), 0); + + if ((scroll & SCROLL_UP) && (coords_orig->y <= 0)) + LISTVIEW_Scroll(infoPtr, 0, coords_orig->y); + + if ((scroll & SCROLL_DOWN) && (coords_orig->y >= infoPtr->rcList.bottom)) + LISTVIEW_Scroll(infoPtr, 0, (coords_orig->y - infoPtr->rcList.bottom)); + /* Invert the items in the old marquee rectangle */ iterator_frameditems_absolute(&i, infoPtr, &infoPtr->marqueeRect); @@ -3694,6 +3716,80 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, LPPOINT coords_ori /*** * DESCRIPTION: + * Called when we are in a marquee selection that involves scrolling the listview (ie, + * the cursor is outside the bounds of the client area). This is a TIMERPROC. + * + * PARAMETER(S): + * [I] hwnd : Handle to the listview + * [I] uMsg : WM_TIMER (ignored) + * [I] idEvent : The timer ID interpreted as a pointer to a LISTVIEW_INFO struct + * [I] dwTimer : The elapsed time (ignored) + * + * RETURN: + * None. + */ +static VOID CALLBACK LISTVIEW_ScrollTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) +{ + LISTVIEW_INFO *infoPtr; + SCROLLINFO scrollInfo; + POINT coords_orig; + POINT coords_offs; + POINT offset; + INT scroll = 0; + + infoPtr = (LISTVIEW_INFO *) idEvent; + + if (!infoPtr) + return; + + /* Get the current cursor position and convert to client coordinates */ + GetCursorPos(&coords_orig); + ScreenToClient(hWnd, &coords_orig); + + /* Ensure coordinates are within client bounds */ + coords_offs.x = max(min(coords_orig.x, infoPtr->rcList.right), 0); + coords_offs.y = max(min(coords_orig.y, infoPtr->rcList.bottom), 0); + + /* Get offset */ + LISTVIEW_GetOrigin(infoPtr, &offset); + + /* Offset coordinates by the appropriate amount */ + coords_offs.x -= offset.x; + coords_offs.y -= offset.y; + + scrollInfo.cbSize = sizeof(SCROLLINFO); + scrollInfo.fMask = SIF_ALL; + + /* Work out in which directions we can scroll */ + if (GetScrollInfo(infoPtr->hwndSelf, SB_VERT, &scrollInfo)) + { + if (scrollInfo.nPos != scrollInfo.nMin) + scroll |= SCROLL_UP; + + if (((scrollInfo.nPage + scrollInfo.nPos) - 1) != scrollInfo.nMax) + scroll |= SCROLL_DOWN; + } + + if (GetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &scrollInfo)) + { + if (scrollInfo.nPos != scrollInfo.nMin) + scroll |= SCROLL_LEFT; + + if (((scrollInfo.nPage + scrollInfo.nPos) - 1) != scrollInfo.nMax) + scroll |= SCROLL_RIGHT; + } + + if (((coords_orig.x <= 0) && (scroll & SCROLL_LEFT)) || + ((coords_orig.y <= 0) && (scroll & SCROLL_UP)) || + ((coords_orig.x >= infoPtr->rcList.right) && (scroll & SCROLL_RIGHT)) || + ((coords_orig.y >= infoPtr->rcList.bottom) && (scroll & SCROLL_DOWN))) + { + LISTVIEW_MarqueeHighlight(infoPtr, &coords_orig, &coords_offs, &offset, scroll); + } +} + +/*** + * DESCRIPTION: * Called whenever WM_MOUSEMOVE is received. * * PARAMETER(S): @@ -3739,6 +3835,24 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN coords_offs.x -= offset.x; coords_offs.y -= offset.y; + /* Enable the timer if we're going outside our bounds, in case the user doesn't + move the mouse again */ + + if ((x <= 0) || (y <= 0) || (x >= infoPtr->rcList.right) || + (y >= infoPtr->rcList.bottom)) + { + if (!infoPtr->bScrolling) + { + infoPtr->bScrolling = TRUE; + SetTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr, 1, LISTVIEW_ScrollTimer); + } + } + else + { + infoPtr->bScrolling = FALSE; + KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr); + } + LISTVIEW_MarqueeHighlight(infoPtr, &coords_orig, &coords_offs, &offset, 0); return 0; } @@ -9464,6 +9578,8 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr) SetRect(&infoPtr->marqueeRect, 0, 0, 0, 0); infoPtr->bMarqueeSelect = FALSE; + infoPtr->bScrolling = FALSE; + KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr); } /* set window focus flag */ @@ -9545,6 +9661,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN infoPtr->ptClickPos = pt; infoPtr->bDragging = FALSE; infoPtr->bMarqueeSelect = FALSE; + infoPtr->bScrolling = FALSE; lvHitTestInfo.pt.x = x; lvHitTestInfo.pt.y = y; @@ -9683,6 +9800,7 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT infoPtr->bDragging = FALSE; infoPtr->bMarqueeSelect = FALSE; + infoPtr->bScrolling = FALSE; KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr); return 0;
1
0
0
0
Owen Rudge : comctl32: Cancel marquee selection if we lose focus in listview.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: c1877a2d5052122ee7770921d028b5b7900deca1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1877a2d5052122ee7770921d…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Nov 2 10:58:00 2009 -0600 comctl32: Cancel marquee selection if we lose focus in listview. --- dlls/comctl32/listview.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 415a863..ba9bb3b 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -9453,7 +9453,19 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr) /* if we have a focus rectangle, get rid of it */ LISTVIEW_ShowFocusRect(infoPtr, FALSE); - + + /* if have a marquee selection, stop it */ + if (infoPtr->bMarqueeSelect) + { + /* Remove the marquee rectangle and release our mouse capture */ + LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeRect); + ReleaseCapture(); + + SetRect(&infoPtr->marqueeRect, 0, 0, 0, 0); + + infoPtr->bMarqueeSelect = FALSE; + } + /* set window focus flag */ infoPtr->bFocus = FALSE;
1
0
0
0
Owen Rudge : comctl32: Move marquee logic into separate function.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 038e36aded6d06c42dee6c08777c519cb97c2014 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=038e36aded6d06c42dee6c087…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Nov 2 10:57:52 2009 -0600 comctl32: Move marquee logic into separate function. --- dlls/comctl32/listview.c | 210 ++++++++++++++++++++++++++++------------------ 1 files changed, 127 insertions(+), 83 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 4bedd89..415a863 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -249,7 +249,9 @@ typedef struct tagLISTVIEW_INFO BOOL bRButtonDown; BOOL bDragging; BOOL bMarqueeSelect; /* marquee selection/highlight underway */ - RECT marqueeRect; + RECT marqueeRect; /* absolute coordinates of marquee selection */ + RECT marqueeDrawRect; /* relative coordinates for drawing marquee */ + POINT marqueeOrigin; /* absolute coordinates of marquee click origin */ POINT ptClickPos; /* point where the user clicked */ BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */ INT nItemHeight; @@ -3595,6 +3597,103 @@ static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, I /*** * DESCRIPTION: + * Utility routine to draw and highlight items within a marquee selection rectangle. + * + * PARAMETER(S): + * [I] infoPtr : valid pointer to the listview structure + * [I] coords_orig : original co-ordinates of the cursor + * [I] coords_offs : offsetted coordinates of the cursor + * [I] offset : offset amount + * [I] scroll : Bitmask of which directions we should scroll, if at all + * + * RETURN: + * None. + */ +static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, LPPOINT coords_orig, LPPOINT coords_offs, LPPOINT offset, INT scroll) +{ + BOOL controlDown = FALSE; + LVITEMW item; + ITERATOR i; + RECT rect; + + if (coords_offs->x > infoPtr->marqueeOrigin.x) + { + rect.left = infoPtr->marqueeOrigin.x; + rect.right = coords_offs->x; + } + else + { + rect.left = coords_offs->x; + rect.right = infoPtr->marqueeOrigin.x; + } + + if (coords_offs->y > infoPtr->marqueeOrigin.y) + { + rect.top = infoPtr->marqueeOrigin.y; + rect.bottom = coords_offs->y; + } + else + { + rect.top = coords_offs->y; + rect.bottom = infoPtr->marqueeOrigin.y; + } + + /* Cancel out the old marquee rectangle and draw the new one */ + LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeDrawRect); + + /* Invert the items in the old marquee rectangle */ + iterator_frameditems_absolute(&i, infoPtr, &infoPtr->marqueeRect); + + while (iterator_next(&i)) + { + if (i.nItem > -1) + { + if (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED) == LVIS_SELECTED) + item.state = 0; + else + item.state = LVIS_SELECTED; + + item.stateMask = LVIS_SELECTED; + + LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + } + } + + iterator_destroy(&i); + + CopyRect(&infoPtr->marqueeRect, &rect); + + CopyRect(&infoPtr->marqueeDrawRect, &rect); + OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y); + + /* Iterate over the items within our marquee rectangle */ + iterator_frameditems_absolute(&i, infoPtr, &infoPtr->marqueeRect); + + if (GetKeyState(VK_CONTROL) & 0x8000) + controlDown = TRUE; + + while (iterator_next(&i)) + { + if (i.nItem > -1) + { + /* If CTRL is pressed, invert. If not, always select the item. */ + if ((controlDown) && (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED))) + item.state = 0; + else + item.state = LVIS_SELECTED; + + item.stateMask = LVIS_SELECTED; + + LISTVIEW_SetItemState(infoPtr, i.nItem, &item); + } + } + + iterator_destroy(&i); + LISTVIEW_InvalidateRect(infoPtr, &rect); +} + +/*** + * DESCRIPTION: * Called whenever WM_MOUSEMOVE is received. * * PARAMETER(S): @@ -3620,93 +3719,27 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN WORD wDragWidth = GetSystemMetrics(SM_CXDRAG); WORD wDragHeight= GetSystemMetrics(SM_CYDRAG); - /* Ensure coordinates are within client bounds */ - if (x < 0) - x = 0; - - if (y < 0) - y = 0; - - if (x > infoPtr->rcList.right) - x = infoPtr->rcList.right; - - if (y > infoPtr->rcList.bottom) - y = infoPtr->rcList.bottom; - if (infoPtr->bMarqueeSelect) { - LVITEMW item; - ITERATOR i; - - if (x > infoPtr->ptClickPos.x) - { - rect.left = infoPtr->ptClickPos.x; - rect.right = x; - } - else - { - rect.left = x; - rect.right = infoPtr->ptClickPos.x; - } - - if (y > infoPtr->ptClickPos.y) - { - rect.top = infoPtr->ptClickPos.y; - rect.bottom = y; - } - else - { - rect.top = y; - rect.bottom = infoPtr->ptClickPos.y; - } - - /* Cancel out the old marquee rectangle and draw the new one */ - LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeRect); - - /* Invert the items in the old marquee rectangle */ - iterator_frameditems(&i, infoPtr, &infoPtr->marqueeRect); - - while (iterator_next(&i)) - { - if (i.nItem > -1) - { - if (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED) == LVIS_SELECTED) - item.state = 0; - else - item.state = LVIS_SELECTED; - - item.stateMask = LVIS_SELECTED; - - LISTVIEW_SetItemState(infoPtr, i.nItem, &item); - } - } - - iterator_destroy(&i); + POINT coords_orig; + POINT coords_offs; + POINT offset; - CopyRect(&infoPtr->marqueeRect, &rect); + coords_orig.x = x; + coords_orig.y = y; - /* Iterate over the items within our marquee rectangle */ - iterator_frameditems(&i, infoPtr, &rect); + /* Get offset */ + LISTVIEW_GetOrigin(infoPtr, &offset); - while (iterator_next(&i)) - { - if (i.nItem > -1) - { - /* If CTRL is pressed, invert. If not, always select the item. */ - if ((fwKeys & MK_CONTROL) && (LISTVIEW_GetItemState(infoPtr, i.nItem, LVIS_SELECTED))) - item.state = 0; - else - item.state = LVIS_SELECTED; + /* Ensure coordinates are within client bounds */ + coords_offs.x = max(min(x, infoPtr->rcList.right), 0); + coords_offs.y = max(min(y, infoPtr->rcList.bottom), 0); - item.stateMask = LVIS_SELECTED; + /* Offset coordinates by the appropriate amount */ + coords_offs.x -= offset.x; + coords_offs.y -= offset.y; - LISTVIEW_SetItemState(infoPtr, i.nItem, &item); - } - } - - iterator_destroy(&i); - - LISTVIEW_InvalidateRect(infoPtr, &rect); + LISTVIEW_MarqueeHighlight(infoPtr, &coords_orig, &coords_offs, &offset, 0); return 0; } @@ -3758,6 +3791,14 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN If return value is non-zero, cancel. */ if (!(infoPtr->dwStyle & LVS_SINGLESEL) && (notify_hdr(infoPtr, LVN_MARQUEEBEGIN, &hdr) == 0)) { + /* Store the absolute coordinates of the click */ + POINT offset; + LISTVIEW_GetOrigin(infoPtr, &offset); + + infoPtr->marqueeOrigin.x = infoPtr->ptClickPos.x - offset.x; + infoPtr->marqueeOrigin.y = infoPtr->ptClickPos.y - offset.y; + + /* Begin selection and capture mouse */ infoPtr->bMarqueeSelect = TRUE; SetCapture(infoPtr->hwndSelf); } @@ -4767,7 +4808,7 @@ enddraw: /* Draw marquee rectangle if appropriate */ if (infoPtr->bMarqueeSelect) - DrawFocusRect(hdc, &infoPtr->marqueeRect); + DrawFocusRect(hdc, &infoPtr->marqueeDrawRect); if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); @@ -9621,14 +9662,17 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT /* Remove the marquee rectangle and release our mouse capture */ if (infoPtr->bMarqueeSelect) { - LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeRect); + LISTVIEW_InvalidateRect(infoPtr, &infoPtr->marqueeDrawRect); ReleaseCapture(); } SetRect(&infoPtr->marqueeRect, 0, 0, 0, 0); + SetRect(&infoPtr->marqueeDrawRect, 0, 0, 0, 0); infoPtr->bDragging = FALSE; infoPtr->bMarqueeSelect = FALSE; + + KillTimer(infoPtr->hwndSelf, (UINT_PTR) infoPtr); return 0; }
1
0
0
0
Owen Rudge : comctl32: Add absolute version of iterator_frameditems.
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 14991b78d8cdac5b46752d6c42c0fb15c882141d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14991b78d8cdac5b46752d6c4…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Nov 2 10:57:41 2009 -0600 comctl32: Add absolute version of iterator_frameditems. --- dlls/comctl32/listview.c | 53 ++++++++++++++++++++++++++++----------------- 1 files changed, 33 insertions(+), 20 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 952c589..4bedd89 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1268,20 +1268,17 @@ static inline BOOL iterator_rangesitems(ITERATOR* i, RANGES ranges) } /*** - * Creates an iterator over the items which intersect lprc. + * Creates an iterator over the items which intersect frame. + * Uses absolute coordinates rather than compensating for the current offset. */ -static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, const RECT *lprc) +static BOOL iterator_frameditems_absolute(ITERATOR* i, const LISTVIEW_INFO* infoPtr, const RECT *frame) { - RECT frame = *lprc, rcItem, rcTemp; - POINT Origin; + RECT rcItem, rcTemp; /* in case we fail, we want to return an empty iterator */ if (!iterator_empty(i)) return FALSE; - LISTVIEW_GetOrigin(infoPtr, &Origin); - - TRACE("(lprc=%s)\n", wine_dbgstr_rect(lprc)); - OffsetRect(&frame, -Origin.x, -Origin.y); + TRACE("(frame=%s)\n", wine_dbgstr_rect(frame)); if (infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON) { @@ -1290,7 +1287,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons if (infoPtr->uView == LV_VIEW_ICON && infoPtr->nFocusedItem != -1) { LISTVIEW_GetItemBox(infoPtr, infoPtr->nFocusedItem, &rcItem); - if (IntersectRect(&rcTemp, &rcItem, lprc)) + if (IntersectRect(&rcTemp, &rcItem, frame)) i->nSpecial = infoPtr->nFocusedItem; } if (!(iterator_rangesitems(i, ranges_create(50)))) return FALSE; @@ -1302,7 +1299,7 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons rcItem.top = (LONG_PTR)DPA_GetPtr(infoPtr->hdpaPosY, nItem); rcItem.right = rcItem.left + infoPtr->nItemWidth; rcItem.bottom = rcItem.top + infoPtr->nItemHeight; - if (IntersectRect(&rcTemp, &rcItem, &frame)) + if (IntersectRect(&rcTemp, &rcItem, frame)) ranges_additem(i->ranges, nItem); } return TRUE; @@ -1311,11 +1308,11 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons { RANGE range; - if (frame.left >= infoPtr->nItemWidth) return TRUE; - if (frame.top >= infoPtr->nItemHeight * infoPtr->nItemCount) return TRUE; + if (frame->left >= infoPtr->nItemWidth) return TRUE; + if (frame->top >= infoPtr->nItemHeight * infoPtr->nItemCount) return TRUE; - range.lower = max(frame.top / infoPtr->nItemHeight, 0); - range.upper = min((frame.bottom - 1) / infoPtr->nItemHeight, infoPtr->nItemCount - 1) + 1; + range.lower = max(frame->top / infoPtr->nItemHeight, 0); + range.upper = min((frame->bottom - 1) / infoPtr->nItemHeight, infoPtr->nItemCount - 1) + 1; if (range.upper <= range.lower) return TRUE; if (!iterator_rangeitems(i, range)) return FALSE; TRACE(" report=%s\n", debugrange(&i->range)); @@ -1323,8 +1320,8 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons else { INT nPerCol = max((infoPtr->rcList.bottom - infoPtr->rcList.top) / infoPtr->nItemHeight, 1); - INT nFirstRow = max(frame.top / infoPtr->nItemHeight, 0); - INT nLastRow = min((frame.bottom - 1) / infoPtr->nItemHeight, nPerCol - 1); + INT nFirstRow = max(frame->top / infoPtr->nItemHeight, 0); + INT nLastRow = min((frame->bottom - 1) / infoPtr->nItemHeight, nPerCol - 1); INT nFirstCol; INT nLastCol; INT lower; @@ -1333,13 +1330,13 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons if (infoPtr->nItemWidth) { - nFirstCol = max(frame.left / infoPtr->nItemWidth, 0); - nLastCol = min((frame.right - 1) / infoPtr->nItemWidth, (infoPtr->nItemCount + nPerCol - 1) / nPerCol); + nFirstCol = max(frame->left / infoPtr->nItemWidth, 0); + nLastCol = min((frame->right - 1) / infoPtr->nItemWidth, (infoPtr->nItemCount + nPerCol - 1) / nPerCol); } else { - nFirstCol = max(frame.left, 0); - nLastCol = min(frame.right - 1, (infoPtr->nItemCount + nPerCol - 1) / nPerCol); + nFirstCol = max(frame->left, 0); + nLastCol = min(frame->right - 1, (infoPtr->nItemCount + nPerCol - 1) / nPerCol); } lower = nFirstCol * nPerCol + nFirstRow; @@ -1365,6 +1362,22 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons } /*** + * Creates an iterator over the items which intersect lprc. + */ +static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, const RECT *lprc) +{ + RECT frame = *lprc; + POINT Origin; + + TRACE("(lprc=%s)\n", wine_dbgstr_rect(lprc)); + + LISTVIEW_GetOrigin(infoPtr, &Origin); + OffsetRect(&frame, -Origin.x, -Origin.y); + + return iterator_frameditems_absolute(i, infoPtr, &frame); +} + +/*** * Creates an iterator over the items which intersect the visible region of hdc. */ static BOOL iterator_visibleitems(ITERATOR *i, const LISTVIEW_INFO *infoPtr, HDC hdc)
1
0
0
0
Henri Verbeet : wined3d: Initialize "context[0]" in IWineD3DDeviceImpl_CreateSwapChain() when not using OpenGL (Valgrind).
by Alexandre Julliard
04 Nov '09
04 Nov '09
Module: wine Branch: master Commit: 8d351a11417d75cc16f77f41b19060317f54fc76 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d351a11417d75cc16f77f41b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Nov 4 10:37:17 2009 +0100 wined3d: Initialize "context[0]" in IWineD3DDeviceImpl_CreateSwapChain() when not using OpenGL (Valgrind). --- dlls/wined3d/device.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e6931ea..a5a6c2e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1211,6 +1211,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface, object->win_handle, object->context[0]->glCtx); } } + else + { + object->context[0] = NULL; + } /********************* * Create the back, front and stencil buffers
1
0
0
0
← Newer
1
...
79
80
81
82
83
84
85
...
91
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
Results per page:
10
25
50
100
200