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
October 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1174 discussions
Start a n
N
ew thread
Krzysztof Nowicki : windowscodecs: Optimise copy_pixels in case the whole bitmap is copied.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: db6731f628c1be0e474860965d109954d8a9e71e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=db6731f628c1be0e474860965…
Author: Krzysztof Nowicki <krissn(a)op.pl> Date: Tue Oct 19 21:51:25 2010 +0200 windowscodecs: Optimise copy_pixels in case the whole bitmap is copied. --- dlls/windowscodecs/main.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 906ea16..6f37f5d 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -77,6 +77,13 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer, if ((dststride * rc->Height) > dstbuffersize) return E_INVALIDARG; + /* if the whole bitmap is copied and the buffer format matches then it's a matter of a single memcpy */ + if (rc->X == 0 && rc->Y == 0 && rc->Width == srcwidth && rc->Height == srcheight && srcstride == dststride) + { + memcpy(dstbuffer, srcbuffer, srcstride * srcheight); + return S_OK; + } + row_offset = rc->X * bpp; if (row_offset % 8 == 0)
1
0
0
0
Juan Lang : crypt32: Implement CertRDNValueToStr for UTF8 strings.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: a1352035d1c23003c8a30fdcec4febb705838b4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a1352035d1c23003c8a30fdce…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 17:32:01 2010 -0700 crypt32: Implement CertRDNValueToStr for UTF8 strings. --- dlls/crypt32/str.c | 2 ++ dlls/crypt32/tests/str.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index d514a5a..e0e238b 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -102,6 +102,7 @@ DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, } break; case CERT_RDN_BMP_STRING: + case CERT_RDN_UTF8_STRING: len = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)pValue->pbData, pValue->cbData / sizeof(WCHAR), NULL, 0, NULL, NULL); if (pValue->cbData && isspaceW(((LPCWSTR)pValue->pbData)[0])) @@ -210,6 +211,7 @@ DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, } break; case CERT_RDN_BMP_STRING: + case CERT_RDN_UTF8_STRING: strLen = len = pValue->cbData / sizeof(WCHAR); if (pValue->cbData && isspace(pValue->pbData[0])) needsQuotes = TRUE; diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index cf3d42e..ff652f3 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -53,6 +53,12 @@ static BYTE bin6[] = { 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74 }; static BYTE bin7[] = { 0x61, 0x72, 0x69, 0x63, 0x40, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x65, 0x61, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6d }; +static BYTE bin8[] = { +0x65,0x00,0x50,0x00,0x4b,0x00,0x49,0x00,0x20,0x00,0x52,0x00,0x6f,0x00,0x6f, +0x00,0x74,0x00,0x20,0x00,0x43,0x00,0x65,0x00,0x72,0x00,0x74,0x00,0x69,0x00, +0x66,0x00,0x69,0x00,0x63,0x00,0x61,0x00,0x74,0x00,0x69,0x00,0x6f,0x00,0x6e, +0x00,0x20,0x00,0x41,0x00,0x75,0x00,0x74,0x00,0x68,0x00,0x6f,0x00,0x72,0x00, +0x69,0x00,0x74,0x00,0x79,0x00 }; static const BYTE cert[] = {0x30,0x82,0x2,0xbb,0x30,0x82,0x2,0x24,0x2,0x9,0x0,0xe3,0x5a,0x10,0xf1,0xfc, @@ -216,6 +222,7 @@ static void test_CertRDNValueToStrA(void) DWORD i, ret; char buffer[2000]; CERT_RDN_VALUE_BLOB blob = { 0, NULL }; + static const char ePKI[] = "ePKI Root Certification Authority"; if (!pCertRDNValueToStrA) return; @@ -239,6 +246,14 @@ static void test_CertRDNValueToStrA(void) ok(!strcmp(buffer, attrs[i].str), "Expected %s, got %s\n", attrs[i].str, buffer); } + blob.pbData = bin8; + blob.cbData = sizeof(bin8); + ret = pCertRDNValueToStrA(CERT_RDN_UTF8_STRING, &blob, buffer, + sizeof(buffer)); + ok(ret == strlen(ePKI) + 1 || broken(ret != strlen(ePKI) + 1), + "Expected length %d, got %d\n", lstrlenA(ePKI), ret); + if (ret == strlen(ePKI) + 1) + ok(!strcmp(buffer, ePKI), "Expected %s, got %s\n", ePKI, buffer); } static void test_CertRDNValueToStrW(void) @@ -254,6 +269,9 @@ static void test_CertRDNValueToStrW(void) static const WCHAR localhostW[] = { 'l','o','c','a','l','h','o','s','t',0 }; static const WCHAR aricW[] = { 'a','r','i','c','@','c','o','d','e','w','e', 'a','v','e','r','s','.','c','o','m',0 }; + static const WCHAR ePKIW[] = { 'e','P','K','I',' ','R','o','o','t',' ', + 'C','e','r','t','i','f','i','c','a','t','i','o','n',' ','A','u','t','h', + 'o','r','i','t','y',0 }; CertRDNAttrEncodingW attrs[] = { { "2.5.4.6", CERT_RDN_PRINTABLE_STRING, { sizeof(bin1), bin1 }, usW }, @@ -269,6 +287,8 @@ static void test_CertRDNValueToStrW(void) { sizeof(bin6), bin6 }, localhostW }, { "1.2.840.113549.1.9.1", CERT_RDN_IA5_STRING, { sizeof(bin7), bin7 }, aricW }, + { "2.5.4.3", CERT_RDN_UTF8_STRING, + { sizeof(bin8), bin8 }, ePKIW }, }; DWORD i, ret; WCHAR buffer[2000]; @@ -301,6 +321,15 @@ static void test_CertRDNValueToStrW(void) ok(!lstrcmpW(buffer, attrs[i].str), "Expected %s, got %s\n", wine_dbgstr_w(attrs[i].str), wine_dbgstr_w(buffer)); } + blob.pbData = bin8; + blob.cbData = sizeof(bin8); + ret = pCertRDNValueToStrW(CERT_RDN_UTF8_STRING, &blob, buffer, + sizeof(buffer)); + ok(ret == lstrlenW(ePKIW) + 1 || broken(ret != lstrlenW(ePKIW) + 1), + "Expected length %d, got %d\n", lstrlenW(ePKIW), ret); + if (ret == lstrlenW(ePKIW) + 1) + ok(!lstrcmpW(buffer, ePKIW), "Expected %s, got %s\n", + wine_dbgstr_w(ePKIW), wine_dbgstr_w(buffer)); } static void test_NameToStrConversionA(PCERT_NAME_BLOB pName, DWORD dwStrType,
1
0
0
0
Juan Lang : crypt32: The newline character must also be quoted.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 8f2821ac77a068c470ab56485ad2709a73c9d202 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f2821ac77a068c470ab56485…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 15:07:59 2010 -0700 crypt32: The newline character must also be quoted. --- dlls/crypt32/str.c | 1 + dlls/crypt32/tests/str.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index e118000..d514a5a 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -41,6 +41,7 @@ static inline BOOL is_quotable_char(char c) case '>': case ';': case '#': + case '\n': return TRUE; default: return FALSE; diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index b9af4cd..cf3d42e 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -363,6 +363,9 @@ static BYTE encodedHashCN[] = { static BYTE encodedSemiCN[] = { 0x30,0x0d,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x03,0x1e,0x02,0x00,0x3b }; +static BYTE encodedNewlineCN[] = { +0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03,0x55,0x04,0x03,0x1e,0x06,0x00,0x61, +0x00,0x0a,0x00,0x62 }; static void test_CertNameToStrA(void) { @@ -457,6 +460,9 @@ static void test_CertNameToStrA(void) blob.pbData = encodedSemiCN; blob.cbData = sizeof(encodedSemiCN); test_NameToStrConversionA(&blob, CERT_X500_NAME_STR, "CN=\";\"", FALSE); + blob.pbData = encodedNewlineCN; + blob.cbData = sizeof(encodedNewlineCN); + test_NameToStrConversionA(&blob, CERT_X500_NAME_STR, "CN=\"a\nb\"", FALSE); } static void test_NameToStrConversionW(PCERT_NAME_BLOB pName, DWORD dwStrType, @@ -499,6 +505,7 @@ static const WCHAR lessThanCN_W[] = { 'C','N','=','"','<','"',0 }; static const WCHAR greaterThanCN_W[] = { 'C','N','=','"','>','"',0 }; static const WCHAR hashCN_W[] = { 'C','N','=','"','#','"',0 }; static const WCHAR semiCN_W[] = { 'C','N','=','"',';','"',0 }; +static const WCHAR newlineCN_W[] = { 'C','N','=','"','a','\n','b','"',0 }; static void test_CertNameToStrW(void) { @@ -594,6 +601,9 @@ static void test_CertNameToStrW(void) blob.pbData = encodedSemiCN; blob.cbData = sizeof(encodedSemiCN); test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, semiCN_W, FALSE); + blob.pbData = encodedNewlineCN; + blob.cbData = sizeof(encodedNewlineCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, newlineCN_W, FALSE); } struct StrToNameA
1
0
0
0
Juan Lang : crypt32: Correct Unicode quoting of BMP strings.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 7833f30721fa400215cdd82fadac34b893acf2c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7833f30721fa400215cdd82fa…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 19:23:50 2010 -0700 crypt32: Correct Unicode quoting of BMP strings. --- dlls/crypt32/str.c | 45 +++++++++++++++++++++++++++++++++++++++------ dlls/crypt32/tests/str.c | 10 +++++----- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index 1bdba5d..e118000 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -73,12 +73,12 @@ DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, if (pValue->cbData && isspace(pValue->pbData[pValue->cbData - 1])) needsQuotes = TRUE; for (i = 0; i < pValue->cbData; i++) - { + { if (is_quotable_char(pValue->pbData[i])) needsQuotes = TRUE; if (pValue->pbData[i] == '"') len += 1; - } + } if (needsQuotes) len += 2; if (!psz || !csz) @@ -158,7 +158,7 @@ DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, LPWSTR psz, DWORD csz) { - DWORD ret = 0, len, i; + DWORD ret = 0, len, i, strLen; BOOL needsQuotes = FALSE; TRACE("(%d, %p, %p, %d)\n", dwValueType, pValue, psz, csz); @@ -175,19 +175,18 @@ DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, case CERT_RDN_GRAPHIC_STRING: case CERT_RDN_VISIBLE_STRING: case CERT_RDN_GENERAL_STRING: - case CERT_RDN_BMP_STRING: len = pValue->cbData; if (pValue->cbData && isspace(pValue->pbData[0])) needsQuotes = TRUE; if (pValue->cbData && isspace(pValue->pbData[pValue->cbData - 1])) needsQuotes = TRUE; for (i = 0; i < pValue->cbData; i++) - { + { if (is_quotable_char(pValue->pbData[i])) needsQuotes = TRUE; if (pValue->pbData[i] == '"') len += 1; - } + } if (needsQuotes) len += 2; if (!psz || !csz) @@ -209,6 +208,40 @@ DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue, ret = ptr - psz; } break; + case CERT_RDN_BMP_STRING: + strLen = len = pValue->cbData / sizeof(WCHAR); + if (pValue->cbData && isspace(pValue->pbData[0])) + needsQuotes = TRUE; + if (pValue->cbData && isspace(pValue->pbData[strLen - 1])) + needsQuotes = TRUE; + for (i = 0; i < strLen; i++) + { + if (is_quotable_char(((LPCWSTR)pValue->pbData)[i])) + needsQuotes = TRUE; + if (((LPCWSTR)pValue->pbData)[i] == '"') + len += 1; + } + if (needsQuotes) + len += 2; + if (!psz || !csz) + ret = len; + else + { + WCHAR *ptr = psz; + + if (needsQuotes) + *ptr++ = '"'; + for (i = 0; i < strLen && ptr - psz < csz; ptr++, i++) + { + *ptr = ((LPCWSTR)pValue->pbData)[i]; + if (((LPCWSTR)pValue->pbData)[i] == '"' && ptr - psz < csz - 1) + *(++ptr) = '"'; + } + if (needsQuotes && ptr - psz < csz) + *ptr++ = '"'; + ret = ptr - psz; + } + break; default: FIXME("string type %d unimplemented\n", dwValueType); } diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index 913599e..b9af4cd 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -570,7 +570,7 @@ static void test_CertNameToStrW(void) blob.pbData = encodedQuotedCN; blob.cbData = sizeof(encodedQuotedCN); test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, quotedCN_W, - TRUE); + FALSE); blob.pbData = encodedMultipleAttrCN; blob.cbData = sizeof(encodedMultipleAttrCN); test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, multipleAttrCN_W, @@ -583,17 +583,17 @@ static void test_CertNameToStrW(void) test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, equalCN_W, FALSE); blob.pbData = encodedLessThanCN; blob.cbData = sizeof(encodedLessThanCN); - test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, lessThanCN_W, TRUE); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, lessThanCN_W, FALSE); blob.pbData = encodedGreaterThanCN; blob.cbData = sizeof(encodedGreaterThanCN); test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, greaterThanCN_W, - TRUE); + FALSE); blob.pbData = encodedHashCN; blob.cbData = sizeof(encodedHashCN); - test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, hashCN_W, TRUE); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, hashCN_W, FALSE); blob.pbData = encodedSemiCN; blob.cbData = sizeof(encodedSemiCN); - test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, semiCN_W, TRUE); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, semiCN_W, FALSE); } struct StrToNameA
1
0
0
0
Juan Lang : crypt32/tests: Show expected values in ok output.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: bf70d35529c37ea3ea57bac7a41c0e05852c1ebd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf70d35529c37ea3ea57bac7a…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 14:21:50 2010 -0700 crypt32/tests: Show expected values in ok output. --- dlls/crypt32/tests/str.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index d2ea3fb..913599e 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -26,11 +26,6 @@ #include "wine/test.h" -/*#define DUMP_STRINGS*/ -#ifdef DUMP_STRINGS -#include "wine/debug.h" -#endif - typedef struct _CertRDNAttrEncoding { LPCSTR pszObjId; DWORD dwValueType; @@ -303,11 +298,8 @@ static void test_CertRDNValueToStrW(void) buffer, sizeof(buffer) / sizeof(buffer[0])); ok(ret == lstrlenW(attrs[i].str) + 1, "Expected length %d, got %d\n", lstrlenW(attrs[i].str) + 1, ret); - ok(!lstrcmpW(buffer, attrs[i].str), "Unexpected value\n"); -#ifdef DUMP_STRINGS - trace("Expected %s, got %s\n", + ok(!lstrcmpW(buffer, attrs[i].str), "Expected %s, got %s\n", wine_dbgstr_w(attrs[i].str), wine_dbgstr_w(buffer)); -#endif } } @@ -489,13 +481,11 @@ static void test_NameToStrConversionW(PCERT_NAME_BLOB pName, DWORD dwStrType, ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", lstrlenW(expected) + 1, i); if (todo) - todo_wine ok(!lstrcmpW(buffer, expected), "Unexpected value\n"); + todo_wine ok(!lstrcmpW(buffer, expected), "Expected %s, got %s\n", + wine_dbgstr_w(expected), wine_dbgstr_w(buffer)); else - ok(!lstrcmpW(buffer, expected), "Unexpected value\n"); -#ifdef DUMP_STRINGS - trace("Expected %s, got %s\n", - wine_dbgstr_w(expected), wine_dbgstr_w(buffer)); -#endif + ok(!lstrcmpW(buffer, expected), "Expected %s, got %s\n", + wine_dbgstr_w(expected), wine_dbgstr_w(buffer)); } static const WCHAR simpleCN_W[] = { 'C','N','=','1',0 };
1
0
0
0
Juan Lang : crypt32/tests: Test more Unicode encoded string to string conversions.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: e21cb8fb9dc622ed9ebe8e9eeedeba66eea029c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e21cb8fb9dc622ed9ebe8e9ee…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 14:13:21 2010 -0700 crypt32/tests: Test more Unicode encoded string to string conversions. --- dlls/crypt32/tests/str.c | 99 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 75 insertions(+), 24 deletions(-) diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index e59b933..d2ea3fb 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -468,28 +468,52 @@ static void test_CertNameToStrA(void) } static void test_NameToStrConversionW(PCERT_NAME_BLOB pName, DWORD dwStrType, - LPCWSTR expected) + LPCWSTR expected, BOOL todo) { WCHAR buffer[2000] = { 0 }; DWORD i; i = pCertNameToStrW(X509_ASN_ENCODING,pName, dwStrType, NULL, 0); - ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", - lstrlenW(expected) + 1, i); + if (todo) + todo_wine ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", + lstrlenW(expected) + 1, i); + else + ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", + lstrlenW(expected) + 1, i); i = pCertNameToStrW(X509_ASN_ENCODING,pName, dwStrType, buffer, sizeof(buffer) / sizeof(buffer[0])); - ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", - lstrlenW(expected) + 1, i); - ok(!lstrcmpW(buffer, expected), "Unexpected value\n"); + if (todo) + todo_wine ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", + lstrlenW(expected) + 1, i); + else + ok(i == lstrlenW(expected) + 1, "Expected %d chars, got %d\n", + lstrlenW(expected) + 1, i); + if (todo) + todo_wine ok(!lstrcmpW(buffer, expected), "Unexpected value\n"); + else + ok(!lstrcmpW(buffer, expected), "Unexpected value\n"); #ifdef DUMP_STRINGS trace("Expected %s, got %s\n", wine_dbgstr_w(expected), wine_dbgstr_w(buffer)); #endif } +static const WCHAR simpleCN_W[] = { 'C','N','=','1',0 }; +static const WCHAR singledQuotedCN_W[] = { 'C','N','=','\'','1','\'',0 }; +static const WCHAR spacedCN_W[] = { 'C','N','=','"',' ','1',' ','"',0 }; +static const WCHAR quotedCN_W[] = { 'C','N','=','"','"','"','1','"','"','"',0 }; +static const WCHAR multipleAttrCN_W[] = { 'C','N','=','"','1','+','2','"',0 }; +static const WCHAR commaCN_W[] = { 'C','N','=','"','a',',','b','"',0 }; +static const WCHAR equalCN_W[] = { 'C','N','=','"','a','=','b','"',0 }; +static const WCHAR lessThanCN_W[] = { 'C','N','=','"','<','"',0 }; +static const WCHAR greaterThanCN_W[] = { 'C','N','=','"','>','"',0 }; +static const WCHAR hashCN_W[] = { 'C','N','=','"','#','"',0 }; +static const WCHAR semiCN_W[] = { 'C','N','=','"',';','"',0 }; + static void test_CertNameToStrW(void) { PCCERT_CONTEXT context; + CERT_NAME_BLOB blob; if (!pCertNameToStrW) { @@ -522,26 +546,64 @@ static void test_CertNameToStrW(void) ret, GetLastError()); test_NameToStrConversionW(&context->pCertInfo->Issuer, - CERT_SIMPLE_NAME_STR, issuerStrW); + CERT_SIMPLE_NAME_STR, issuerStrW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Issuer, CERT_SIMPLE_NAME_STR | CERT_NAME_STR_SEMICOLON_FLAG, - issuerStrSemicolonW); + issuerStrSemicolonW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Issuer, CERT_SIMPLE_NAME_STR | CERT_NAME_STR_CRLF_FLAG, - issuerStrCRLFW); + issuerStrCRLFW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Subject, - CERT_OID_NAME_STR, subjectStrW); + CERT_OID_NAME_STR, subjectStrW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Subject, CERT_OID_NAME_STR | CERT_NAME_STR_SEMICOLON_FLAG, - subjectStrSemicolonW); + subjectStrSemicolonW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Subject, CERT_OID_NAME_STR | CERT_NAME_STR_CRLF_FLAG, - subjectStrCRLFW); + subjectStrCRLFW, FALSE); test_NameToStrConversionW(&context->pCertInfo->Subject, - CERT_X500_NAME_STR | CERT_NAME_STR_SEMICOLON_FLAG | CERT_NAME_STR_REVERSE_FLAG, x500SubjectStrSemicolonReverseW); + CERT_X500_NAME_STR | CERT_NAME_STR_SEMICOLON_FLAG | CERT_NAME_STR_REVERSE_FLAG, + x500SubjectStrSemicolonReverseW, FALSE); CertFreeCertificateContext(context); } + blob.pbData = encodedSimpleCN; + blob.cbData = sizeof(encodedSimpleCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, simpleCN_W, FALSE); + blob.pbData = encodedSingleQuotedCN; + blob.cbData = sizeof(encodedSingleQuotedCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, singledQuotedCN_W, + FALSE); + blob.pbData = encodedSpacedCN; + blob.cbData = sizeof(encodedSpacedCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, spacedCN_W, FALSE); + blob.pbData = encodedQuotedCN; + blob.cbData = sizeof(encodedQuotedCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, quotedCN_W, + TRUE); + blob.pbData = encodedMultipleAttrCN; + blob.cbData = sizeof(encodedMultipleAttrCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, multipleAttrCN_W, + FALSE); + blob.pbData = encodedCommaCN; + blob.cbData = sizeof(encodedCommaCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, commaCN_W, FALSE); + blob.pbData = encodedEqualCN; + blob.cbData = sizeof(encodedEqualCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, equalCN_W, FALSE); + blob.pbData = encodedLessThanCN; + blob.cbData = sizeof(encodedLessThanCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, lessThanCN_W, TRUE); + blob.pbData = encodedGreaterThanCN; + blob.cbData = sizeof(encodedGreaterThanCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, greaterThanCN_W, + TRUE); + blob.pbData = encodedHashCN; + blob.cbData = sizeof(encodedHashCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, hashCN_W, TRUE); + blob.pbData = encodedSemiCN; + blob.cbData = sizeof(encodedSemiCN); + test_NameToStrConversionW(&blob, CERT_X500_NAME_STR, semiCN_W, TRUE); } struct StrToNameA @@ -627,22 +689,11 @@ struct StrToNameW }; static const WCHAR badlyQuotedCN_W[] = { 'C','N','=','"','"','1','"','"',0 }; -static const WCHAR simpleCN_W[] = { 'C','N','=','1',0 }; static const WCHAR simpleCN2_W[] = { 'C','N','=','"','1','"',0 }; static const WCHAR simpleCN3_W[] = { 'C','N',' ','=',' ','"','1','"',0 }; -static const WCHAR singledQuotedCN_W[] = { 'C','N','=','\'','1','\'',0 }; -static const WCHAR spacedCN_W[] = { 'C','N','=','"',' ','1',' ','"',0 }; -static const WCHAR quotedCN_W[] = { 'C','N','=','"','"','"','1','"','"','"',0 }; -static const WCHAR multipleAttrCN_W[] = { 'C','N','=','"','1','+','2','"',0 }; static const WCHAR japaneseCN_W[] = { 'C','N','=',0x226f,0x575b,0 }; static const BYTE encodedJapaneseCN[] = { 0x30,0x0f,0x31,0x0d,0x30,0x0b,0x06, 0x03,0x55,0x04,0x03,0x1e,0x04,0x22,0x6f,0x57,0x5b }; -static const WCHAR commaCN_W[] = { 'C','N','=','"','a',',','b','"',0 }; -static const WCHAR equalCN_W[] = { 'C','N','=','"','a','=','b','"',0 }; -static const WCHAR lessThanCN_W[] = { 'C','N','=','"','<','"',0 }; -static const WCHAR greaterThanCN_W[] = { 'C','N','=','"','>','"',0 }; -static const WCHAR hashCN_W[] = { 'C','N','=','"','#','"',0 }; -static const WCHAR semiCN_W[] = { 'C','N','=','"',';','"',0 }; static const struct StrToNameW namesW[] = { { simpleCN_W, sizeof(encodedSimpleCN), encodedSimpleCN },
1
0
0
0
Juan Lang : crypt32: Remove unneeded comments.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 41416252846843a1295fc7908172589272530c02 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41416252846843a1295fc7908…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Oct 19 12:51:52 2010 -0700 crypt32: Remove unneeded comments. --- dlls/crypt32/str.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index 47130d0..1bdba5d 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -322,7 +322,6 @@ DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, psz ? psz + ret : NULL, psz ? csz - ret - 1 : 0); ret += chars; } - /* FIXME: handle quoting */ chars = CertRDNValueToStrA( rdn->rgRDNAttr[j].dwValueType, &rdn->rgRDNAttr[j].Value, psz ? psz + ret : NULL, @@ -502,7 +501,6 @@ DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indentLevel, psz ? psz + ret : NULL, psz ? csz - ret - 1 : 0); ret += chars; } - /* FIXME: handle quoting */ chars = CertRDNValueToStrW( rdn->rgRDNAttr[j].dwValueType, &rdn->rgRDNAttr[j].Value, psz ? psz + ret : NULL,
1
0
0
0
Alexandre Julliard : kernel32: Fix last error code in GetVolumeInformationW when an explicit subdir is requested .
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 14556047045a08a98442e7e44bffb7cff29e67de URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14556047045a08a98442e7e44…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 20 12:29:45 2010 +0200 kernel32: Fix last error code in GetVolumeInformationW when an explicit subdir is requested. --- dlls/kernel32/tests/volume.c | 2 +- dlls/kernel32/volume.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index c63dd72..482ff16 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -435,7 +435,7 @@ static void test_GetVolumeInformationA(void) SetLastError(0xdeadbeef); ret = pGetVolumeInformationA(windowsdir, vol_name_buf, vol_name_size, &vol_serial_num, &max_comp_len, &fs_flags, fs_name_buf, fs_name_len); - todo_wine ok(!ret && (GetLastError()==ERROR_DIR_NOT_ROOT || + ok(!ret && (GetLastError()==ERROR_DIR_NOT_ROOT || broken(GetLastError()==ERROR_BAD_PATHNAME/* win9x */)), "GetVolumeInformationA did%s fail, root=%s, last error=%u\n", ret ? " not":"", windowsdir, GetLastError()); /* A subdir with trailing \ yields DIR_NOT_ROOT instead of INVALID_NAME */ diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index b65d67b..17e70e5 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -568,7 +568,13 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, p = memchrW( nt_name.Buffer + 4, '\\', (nt_name.Length - 4) / sizeof(WCHAR) ); if (p != nt_name.Buffer + nt_name.Length / sizeof(WCHAR) - 1) { - SetLastError( ERROR_INVALID_NAME ); + /* check if root contains an explicit subdir */ + if (root[0] && root[1] == ':') root += 2; + while (*root == '\\') root++; + if (strchrW( root, '\\' )) + SetLastError( ERROR_DIR_NOT_ROOT ); + else + SetLastError( ERROR_INVALID_NAME ); goto done; }
1
0
0
0
Alexandre Julliard : kernel32: Use the NT name to retrieve label and serial in GetVolumeInformationW.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 357b50600bb11cfda1c7a155d85278a07134ad51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=357b50600bb11cfda1c7a155d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 20 12:26:54 2010 +0200 kernel32: Use the NT name to retrieve label and serial in GetVolumeInformationW. --- dlls/kernel32/volume.c | 79 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 55 insertions(+), 24 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 0a3cc6a..b65d67b 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -209,15 +209,31 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root ) } /* get the label by reading it from a file at the root of the filesystem */ -static void get_filesystem_label( const WCHAR *device, WCHAR *label, DWORD len ) +static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DWORD len ) { + static const WCHAR labelW[] = {'.','w','i','n','d','o','w','s','-','l','a','b','e','l',0}; HANDLE handle; - WCHAR labelW[] = {'A',':','\\','.','w','i','n','d','o','w','s','-','l','a','b','e','l',0}; + UNICODE_STRING name; + IO_STATUS_BLOCK io; + OBJECT_ATTRIBUTES attr; - labelW[0] = device[4]; - handle = CreateFileW( labelW, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, 0, 0 ); - if (handle != INVALID_HANDLE_VALUE) + label[0] = 0; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + name.MaximumLength = device->Length + sizeof(labelW); + name.Length = name.MaximumLength - sizeof(WCHAR); + if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return; + + memcpy( name.Buffer, device->Buffer, device->Length ); + memcpy( name.Buffer + device->Length / sizeof(WCHAR), labelW, sizeof(labelW) ); + if (!NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT )) { char buffer[256], *p; DWORD size; @@ -230,19 +246,34 @@ static void get_filesystem_label( const WCHAR *device, WCHAR *label, DWORD len ) if (!MultiByteToWideChar( CP_UNIXCP, 0, buffer, -1, label, len )) label[len-1] = 0; } - else label[0] = 0; + RtlFreeUnicodeString( &name ); } /* get the serial number by reading it from a file at the root of the filesystem */ -static DWORD get_filesystem_serial( const WCHAR *device ) +static DWORD get_filesystem_serial( const UNICODE_STRING *device ) { + static const WCHAR serialW[] = {'.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0}; HANDLE handle; - WCHAR serialW[] = {'A',':','\\','.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0}; + UNICODE_STRING name; + IO_STATUS_BLOCK io; + OBJECT_ATTRIBUTES attr; + DWORD ret = 0; - serialW[0] = device[4]; - handle = CreateFileW( serialW, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, 0, 0 ); - if (handle != INVALID_HANDLE_VALUE) + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &name; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + name.MaximumLength = device->Length + sizeof(serialW); + name.Length = name.MaximumLength - sizeof(WCHAR); + if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return 0; + + memcpy( name.Buffer, device->Buffer, device->Length ); + memcpy( name.Buffer + device->Length / sizeof(WCHAR), serialW, sizeof(serialW) ); + if (!NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_SYNCHRONOUS_IO_NONALERT )) { char buffer[32]; DWORD size; @@ -250,9 +281,10 @@ static DWORD get_filesystem_serial( const WCHAR *device ) if (!ReadFile( handle, buffer, sizeof(buffer)-1, &size, NULL )) size = 0; CloseHandle( handle ); buffer[size] = 0; - return strtoul( buffer, NULL, 16 ); + ret = strtoul( buffer, NULL, 16 ); } - else return 0; + RtlFreeUnicodeString( &name ); + return ret; } @@ -377,8 +409,8 @@ static enum fs_type VOLUME_ReadCDSuperblock( HANDLE handle, BYTE *buff ) /************************************************************************** * VOLUME_GetSuperblockLabel */ -static void VOLUME_GetSuperblockLabel( const WCHAR *device, enum fs_type type, const BYTE *superblock, - WCHAR *label, DWORD len ) +static void VOLUME_GetSuperblockLabel( const UNICODE_STRING *device, enum fs_type type, + const BYTE *superblock, WCHAR *label, DWORD len ) { const BYTE *label_ptr = NULL; DWORD label_len; @@ -431,7 +463,8 @@ static void VOLUME_GetSuperblockLabel( const WCHAR *device, enum fs_type type, c /************************************************************************** * VOLUME_GetSuperblockSerial */ -static DWORD VOLUME_GetSuperblockSerial( const WCHAR *device, enum fs_type type, const BYTE *superblock ) +static DWORD VOLUME_GetSuperblockSerial( const UNICODE_STRING *device, enum fs_type type, + const BYTE *superblock ) { switch(type) { @@ -515,7 +548,6 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, static const WCHAR cdfsW[] = {'C','D','F','S',0}; static const WCHAR default_rootW[] = {'\\',0}; - WCHAR device[] = {'\\','\\','.','\\','A',':',0}; HANDLE handle; NTSTATUS status; UNICODE_STRING nt_name; @@ -539,7 +571,6 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, SetLastError( ERROR_INVALID_NAME ); goto done; } - device[4] = nt_name.Buffer[4]; /* try to open the device */ @@ -585,8 +616,8 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, TRACE( "%s: found fs type %d\n", debugstr_w(nt_name.Buffer), type ); if (type == FS_ERROR) goto done; - if (label && label_len) VOLUME_GetSuperblockLabel( device, type, superblock, label, label_len ); - if (serial) *serial = VOLUME_GetSuperblockSerial( device, type, superblock ); + if (label && label_len) VOLUME_GetSuperblockLabel( &nt_name, type, superblock, label, label_len ); + if (serial) *serial = VOLUME_GetSuperblockSerial( &nt_name, type, superblock ); goto fill_fs_info; } else TRACE( "cannot open device %s: err %d\n", debugstr_w(nt_name.Buffer), GetLastError() ); @@ -608,8 +639,8 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, } if (info.DeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) type = FS_ISO9660; - if (label && label_len) get_filesystem_label( device, label, label_len ); - if (serial) *serial = get_filesystem_serial( device ); + if (label && label_len) get_filesystem_label( &nt_name, label, label_len ); + if (serial) *serial = get_filesystem_serial( &nt_name ); fill_fs_info: /* now fill in the information that depends on the file system type */
1
0
0
0
Alexandre Julliard : kernel32: Use the NT name to open the root directory in GetVolumeInformationW.
by Alexandre Julliard
20 Oct '10
20 Oct '10
Module: wine Branch: master Commit: 5820f408623458c46e86cec37ff202c0614eee69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5820f408623458c46e86cec37…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Oct 20 12:25:32 2010 +0200 kernel32: Use the NT name to open the root directory in GetVolumeInformationW. --- dlls/kernel32/volume.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index a198add..0a3cc6a 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -521,6 +521,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, UNICODE_STRING nt_name; IO_STATUS_BLOCK io; OBJECT_ATTRIBUTES attr; + FILE_FS_DEVICE_INFORMATION info; WCHAR *p; enum fs_type type = FS_UNKNOWN; BOOL ret = FALSE; @@ -592,22 +593,20 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len, /* we couldn't open the device, fallback to default strategy */ - switch(GetDriveTypeW( root )) + status = NtOpenFile( &handle, 0, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); + if (status != STATUS_SUCCESS) { - case DRIVE_UNKNOWN: - case DRIVE_NO_ROOT_DIR: - SetLastError( ERROR_NOT_READY ); + SetLastError( RtlNtStatusToDosError(status) ); + goto done; + } + status = NtQueryVolumeInformationFile( handle, &io, &info, sizeof(info), FileFsDeviceInformation ); + NtClose( handle ); + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); goto done; - case DRIVE_REMOVABLE: - case DRIVE_FIXED: - case DRIVE_REMOTE: - case DRIVE_RAMDISK: - type = FS_UNKNOWN; - break; - case DRIVE_CDROM: - type = FS_ISO9660; - break; } + if (info.DeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM) type = FS_ISO9660; if (label && label_len) get_filesystem_label( device, label, label_len ); if (serial) *serial = get_filesystem_serial( device );
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
118
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
Results per page:
10
25
50
100
200