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
April 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
898 discussions
Start a n
N
ew thread
Andrew Nguyen : kernel32: Only check the buffer pointer in FormatMessageA if buffer allocation is requested .
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: ce61b254d03d3aa4cfb3e803855d22670bb6d8d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce61b254d03d3aa4cfb3e8038…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Sun Apr 18 09:09:06 2010 -0500 kernel32: Only check the buffer pointer in FormatMessageA if buffer allocation is requested. --- dlls/kernel32/format_msg.c | 2 +- dlls/kernel32/tests/format_msg.c | 83 +++++++++++++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index fbd133b..8c37434 100644 --- a/dlls/kernel32/format_msg.c +++ b/dlls/kernel32/format_msg.c @@ -434,7 +434,7 @@ DWORD WINAPI FormatMessageA( &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; - if (!lpBuffer) + if ((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) && !lpBuffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index f48c0f8..21b6377 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -734,6 +734,32 @@ static void test_message_null_buffer(void) { DWORD ret, error; + /* Without FORMAT_MESSAGE_ALLOCATE_BUFFER, only the specified buffer size is checked. */ + SetLastError(0xdeadbeef); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageA returned %u\n", ret); + ok(error == ERROR_INSUFFICIENT_BUFFER || + error == ERROR_INVALID_PARAMETER, /* win9x */ + "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageA returned %u\n", ret); + ok(error == ERROR_INSUFFICIENT_BUFFER || + error == ERROR_INVALID_PARAMETER, /* win9x */ + "last error %u\n", error); + + if (0) /* crashes on Windows */ + { + SetLastError(0xdeadbeef); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 256, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageA returned %u\n", ret); + trace("last error %u\n", error); + } + SetLastError(0xdeadbeef); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); @@ -743,7 +769,28 @@ static void test_message_null_buffer(void) "last error %u\n", error); SetLastError(0xdeadbeef); - ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageA returned %u\n", ret); + ok(error == ERROR_NOT_ENOUGH_MEMORY || + error == ERROR_INVALID_PARAMETER, /* win9x */ + "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageA returned %u\n", ret); + ok(error == ERROR_NOT_ENOUGH_MEMORY || + error == ERROR_INVALID_PARAMETER, /* win9x */ + "last error %u\n", error); +} + +static void test_message_null_buffer_wide(void) +{ + DWORD ret, error; + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); error = GetLastError(); if (!ret && error == ERROR_CALL_NOT_IMPLEMENTED) { @@ -751,6 +798,39 @@ static void test_message_null_buffer(void) return; } + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageW returned %u\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageW returned %u\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 256, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageW returned %u\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageW returned %u\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL); + error = GetLastError(); + ok(!ret, "FormatMessageW returned %u\n", ret); + ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL); + error = GetLastError(); ok(!ret, "FormatMessageW returned %u\n", ret); ok(error == ERROR_INVALID_PARAMETER, "last error %u\n", error); } @@ -822,5 +902,6 @@ START_TEST(format_msg) test_message_insufficient_buffer(); test_message_insufficient_buffer_wide(); test_message_null_buffer(); + test_message_null_buffer_wide(); test_message_from_hmodule(); }
1
0
0
0
Andrew Nguyen : kernel32: Reject an insufficiently sized buffer in FormatMessageA/W.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: 8b28efaed79c707c72ce9e2f9a7e2877fa485cf7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b28efaed79c707c72ce9e2f9…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Sun Apr 18 09:08:54 2010 -0500 kernel32: Reject an insufficiently sized buffer in FormatMessageA/W. --- dlls/kernel32/format_msg.c | 34 ++++++++++---- dlls/kernel32/tests/format_msg.c | 94 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 9 deletions(-) diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index f579d21..fbd133b 100644 --- a/dlls/kernel32/format_msg.c +++ b/dlls/kernel32/format_msg.c @@ -570,13 +570,20 @@ DWORD WINAPI FormatMessageA( *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced)); memcpy(*(LPSTR*)lpBuffer,target,talloced); } else { - lstrcpynA(lpBuffer,target,nSize); + if (nSize < talloced) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + goto failure; + } + strcpy(lpBuffer, target); } + + ret = talloced - 1; /* null terminator */ +failure: HeapFree(GetProcessHeap(),0,target); HeapFree(GetProcessHeap(),0,from); if (!(dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)) HeapFree( GetProcessHeap(), 0, format_args.args ); - ret = (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer) : strlen(lpBuffer); - TRACE("-- returning %d\n", ret); + TRACE("-- returning %u\n", ret); return ret; } #undef ADD_TO_T @@ -595,6 +602,7 @@ DWORD WINAPI FormatMessageW( __ms_va_list* args ) { struct format_args format_args; + DWORD ret = 0; LPWSTR target,t; DWORD talloced; LPWSTR from; @@ -741,21 +749,29 @@ DWORD WINAPI FormatMessageW( *t='\0'; } talloced = strlenW(target)+1; + TRACE("-- %s\n",debugstr_w(target)); if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { /* nSize is the MINIMUM size */ DWORD len = strlenW(target) + 1; *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,len*sizeof(WCHAR)); strcpyW(*(LPWSTR*)lpBuffer, target); } - else lstrcpynW(lpBuffer, target, nSize); + else + { + if (nSize < talloced) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + goto failure; + } + strcpyW(lpBuffer, target); + } + ret = talloced - 1; /* null terminator */ +failure: HeapFree(GetProcessHeap(),0,target); HeapFree(GetProcessHeap(),0,from); if (!(dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY)) HeapFree( GetProcessHeap(), 0, format_args.args ); - TRACE("ret=%s\n", wine_dbgstr_w((dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - *(LPWSTR*)lpBuffer : lpBuffer)); - return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? - strlenW(*(LPWSTR*)lpBuffer): - strlenW(lpBuffer); + TRACE("-- returning %u\n", ret); + return ret; } #undef ADD_TO_T diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index fba932c..f48c0f8 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -638,6 +638,98 @@ static void test_message_from_string(void) ok(r==2,"failed: r=%d\n",r); } +static void test_message_insufficient_buffer(void) +{ + static const char init_buf[] = {'x', 'x', 'x', 'x', 'x'}; + static const char expected_buf[] = {'x', 'x', 'x', 'x', 'x'}; + DWORD ret; + CHAR out[5]; + + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, 0, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)), + "Expected the buffer to be untouched\n"); + + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, 1, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)), + "Expected the buffer to be untouched\n"); + + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "test", 0, 0, out, sizeof(out)/sizeof(out[0]) - 1, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)), + "Expected the buffer to be untouched\n"); +} + +static void test_message_insufficient_buffer_wide(void) +{ + static const WCHAR test[] = {'t','e','s','t',0}; + static const WCHAR init_buf[] = {'x', 'x', 'x', 'x', 'x'}; + static const WCHAR expected_buf[] = {'x', 'x', 'x', 'x', 'x'}; + static const WCHAR broken_buf[] = {0, 'x', 'x', 'x', 'x'}; + static const WCHAR broken2_buf[] = {'t','e','s',0,'x'}; + + DWORD ret; + WCHAR out[5]; + + SetLastError(0xdeadbeef); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, NULL, 0, 0, NULL, 0, NULL); + if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("FormatMessageW is not implemented\n"); + return; + } + + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, test, 0, 0, out, 0, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)), + "Expected the buffer to be untouched\n"); + + /* Windows Server 2003 and newer report failure but copy a + * truncated string to the buffer for non-zero buffer sizes. */ + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, test, 0, 0, out, 1, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)) || + broken(!memcmp(broken_buf, out, sizeof(broken_buf))), /* W2K3+ */ + "Expected the buffer to be untouched\n"); + + SetLastError(0xdeadbeef); + memcpy(out, init_buf, sizeof(init_buf)); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, test, 0, 0, out, sizeof(out)/sizeof(out[0]) - 1, NULL); + ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected GetLastError() to return ERROR_INSUFFICIENT_BUFFER, got %u\n", + GetLastError()); + ok(!memcmp(expected_buf, out, sizeof(expected_buf)) || + broken(!memcmp(broken2_buf, out, sizeof(broken2_buf))), /* W2K3+ */ + "Expected the buffer to be untouched\n"); +} + static void test_message_null_buffer(void) { DWORD ret, error; @@ -727,6 +819,8 @@ START_TEST(format_msg) { test_message_from_string(); test_message_from_string_wide(); + test_message_insufficient_buffer(); + test_message_insufficient_buffer_wide(); test_message_null_buffer(); test_message_from_hmodule(); }
1
0
0
0
Andrew Nguyen : kernel32: Remove superfluous heap reallocation calls in FormatMessageA/W.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: c0e7931954de1d363267ef58ecb23fd87585f005 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0e7931954de1d363267ef58e…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Sun Apr 18 09:08:42 2010 -0500 kernel32: Remove superfluous heap reallocation calls in FormatMessageA/W. The buffer in question is temporary and will be freed on function return, so resizing and leaving the enlarged space unused is pointless. --- dlls/kernel32/format_msg.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index c312acd..f579d21 100644 --- a/dlls/kernel32/format_msg.c +++ b/dlls/kernel32/format_msg.c @@ -565,9 +565,6 @@ DWORD WINAPI FormatMessageA( *t='\0'; } talloced = strlen(target)+1; - if (nSize && talloced<nSize) { - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize); - } TRACE("-- %s\n",debugstr_a(target)); if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { *((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,max(nSize, talloced)); @@ -744,8 +741,6 @@ DWORD WINAPI FormatMessageW( *t='\0'; } talloced = strlenW(target)+1; - if (nSize && talloced<nSize) - target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize*sizeof(WCHAR)); if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { /* nSize is the MINIMUM size */ DWORD len = strlenW(target) + 1;
1
0
0
0
Andrew Nguyen : kernel32/tests: Remove a superfluous comment in the FormatMessage tests.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: f35ca2a77c07e375c7af5dda92efeca9c27de7fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f35ca2a77c07e375c7af5dda9…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Sun Apr 18 09:08:15 2010 -0500 kernel32/tests: Remove a superfluous comment in the FormatMessage tests. --- dlls/kernel32/tests/format_msg.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index 228f4d0..fba932c 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -24,8 +24,6 @@ #include "winbase.h" #include "winnls.h" -/* #define ok(cond,failstr) if(!(cond)) {printf("line %d : %s\n",__LINE__,failstr);exit(1);} */ - static DWORD __cdecl doit(DWORD flags, LPCVOID src, DWORD msg_id, DWORD lang_id, LPSTR out, DWORD outsize, ... ) {
1
0
0
0
Alistair Leslie-Hughes : msxml3: Register classes.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: 8248040dbee64e69ea614cbf5912d11f8782196e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8248040dbee64e69ea614cbf5…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Apr 19 20:53:51 2010 +1000 msxml3: Register classes. --- dlls/msxml3/regsvr.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 65 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/regsvr.c b/dlls/msxml3/regsvr.c index d9b47dd..415e5af 100644 --- a/dlls/msxml3/regsvr.c +++ b/dlls/msxml3/regsvr.c @@ -515,8 +515,23 @@ static struct regsvr_coclass const coclass_list[] = { "Both", "Microsoft.FreeThreadedXMLDOM.1.0", "1.0" + }, + { &CLSID_FreeThreadedDOMDocument26, + "Free Threaded XML DOM Document 2.6", + NULL, + "msxml3.dll", + "Both", + "Microsoft.FreeThreadedXMLDOM.1.0", + "1.0" + }, + { &CLSID_FreeThreadedDOMDocument30, + "Free Threaded XML DOM Document 3.0", + NULL, + "msxml3.dll", + "Both", + "Microsoft.FreeThreadedDOMDocument.1.0", + "1.0" }, - { &CLSID_XMLHTTPRequest, "XML HTTP Request", NULL, @@ -548,6 +563,14 @@ static struct regsvr_coclass const coclass_list[] = { "Msxml2.XMLSchemaCache", "3.0" }, + { &CLSID_XMLSchemaCache26, + "XML Schema Cache 2.6", + NULL, + "msxml3.dll", + "Both", + "Msxml2.XMLSchemaCache", + "2.6" + }, { &CLSID_XMLSchemaCache30, "XML Schema Cache 3.0", NULL, @@ -588,6 +611,22 @@ static struct regsvr_coclass const coclass_list[] = { "Msxml2.MXXMLWriter", "3.0" }, + { &CLSID_SAXAttributes, + "SAX Attribute", + NULL, + "msxml3.dll", + "Both", + "Msxml2.SAXAttributes", + NULL + }, + { &CLSID_SAXAttributes30, + "SAX Attribute 3.0", + NULL, + "msxml3.dll", + "Both", + "Msxml2.SAXAttributes", + "3.0" + }, { NULL } /* list terminator */ }; @@ -642,6 +681,16 @@ static struct progid const progid_list[] = { &CLSID_DOMFreeThreadedDocument, "Microsoft.FreeThreadedXMLDOM.1.0" }, + { "MSXML.FreeThreadedDOMDocument26", + "Free threaded XML DOM Document 2.6", + &CLSID_FreeThreadedDOMDocument26, + NULL + }, + { "MSXML.FreeThreadedDOMDocument30", + "Free threaded XML DOM Document 3.0", + &CLSID_FreeThreadedDOMDocument30, + NULL + }, { "Microsoft.XMLHTTP", "XML HTTP Request", &CLSID_XMLHTTPRequest, @@ -672,6 +721,11 @@ static struct progid const progid_list[] = { &CLSID_XMLSchemaCache, "Msxml2.XMLSchemaCache.3.0" }, + { "Msxml2.XMLSchemaCache.2.6", + "XML Schema Cache 2.6", + &CLSID_XMLSchemaCache26, + "Msxml2.XMLSchemaCache.2.6" + }, { "Msxml2.XMLSchemaCache.3.0", "XML Schema Cache 3.0", &CLSID_XMLSchemaCache30, @@ -697,7 +751,16 @@ static struct progid const progid_list[] = { &CLSID_MXXMLWriter30, NULL }, - + { "Msxml2.SAXAttributes", + "SAX Attribute", + &CLSID_SAXAttributes, + NULL + }, + { "Msxml2.SAXAttributes.3.0", + "SAX Attribute 3.0", + &CLSID_SAXAttributes30, + NULL + }, { NULL } /* list terminator */ };
1
0
0
0
Alistair Leslie-Hughes : msxml4: Register classes.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: 4164c308b2cf675e0c10182cc1a682ab2bc6d541 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4164c308b2cf675e0c10182cc…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Apr 16 06:07:47 2010 +1000 msxml4: Register classes. --- dlls/msxml4/regsvr.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/msxml2.idl | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 0 deletions(-) diff --git a/dlls/msxml4/regsvr.c b/dlls/msxml4/regsvr.c index b3088f1..e4b1a0d 100644 --- a/dlls/msxml4/regsvr.c +++ b/dlls/msxml4/regsvr.c @@ -353,6 +353,38 @@ static struct regsvr_coclass const coclass_list[] = { "Msxml2.SAXXMLReader", "4.0" }, + { &CLSID_XMLSchemaCache40, + "XML Schema Cache 4.0", + NULL, + "msxml4.dll", + "Both", + "Msxml2.XMLSchemaCache", + "4.0" + }, + { &CLSID_MXXMLWriter40, + "IMXWriter interface 4.0", + NULL, + "msxml4.dll", + "Both", + "Msxml2.MXXMLWriter", + "4.0" + }, + { &CLSID_SAXAttributes40, + "SAX Attribute 4.0", + NULL, + "msxml4.dll", + "Both", + "Msxml2.SAXAttributes", + "4.0" + }, + { &CLSID_FreeThreadedDOMDocument40, + "Free Threaded XML DOM Document 4.0", + NULL, + "msxml4.dll", + "Both", + "Microsoft.FreeThreadedDOMDocument4.0", + "4.0" + }, { NULL } /* list terminator */ }; @@ -370,6 +402,26 @@ static struct progid const progid_list[] = { &CLSID_SAXXMLReader40, NULL }, + { "Msxml2.XMLSchemaCache.4.0", + "XML Schema Cache 4.0", + &CLSID_XMLSchemaCache40, + NULL + }, + { "Msxml2.MXXMLWriter.4.0", + "MXXMLWriter 4.0", + &CLSID_MXXMLWriter40, + NULL + }, + { "Msxml2.SAXAttributes.4.0", + "SAX Attribute 4.0", + &CLSID_SAXAttributes40, + NULL + }, + { "MSXML.FreeThreadedDOMDocument40", + "Free threaded XML DOM Document 4.0", + &CLSID_FreeThreadedDOMDocument40, + NULL + }, { NULL } /* list terminator */ }; diff --git a/include/msxml2.idl b/include/msxml2.idl index 1f28f83..f2841a5 100644 --- a/include/msxml2.idl +++ b/include/msxml2.idl @@ -1280,6 +1280,15 @@ coclass FreeThreadedDOMDocument30 } [ + uuid(88d969c1-f192-11d4-a65f-0040963251e5), +] +coclass FreeThreadedDOMDocument40 +{ + [default] interface IXMLDOMDocument2; + [default, source] dispinterface XMLDOMDocumentEvents; +}; + +[ uuid(373984c9-b845-449b-91e7-45ac83036ade) ] coclass XMLSchemaCache @@ -1304,6 +1313,14 @@ coclass XMLSchemaCache30 } [ + uuid(88d969c2-f192-11d4-a65f-0040963251e5) +] +coclass XMLSchemaCache40 +{ + [default] interface IXMLDOMSchemaCollection2; +}; + +[ uuid(2933BF94-7B36-11d2-B20E-00C04F983E60) ] coclass XSLTemplate @@ -2639,6 +2656,26 @@ coclass MXXMLWriter30 }; [ + uuid(88d969c8-f192-11d4-a65f-0040963251e5), +] +coclass MXXMLWriter40 +{ + [default] interface IMXWriter; + + interface ISAXContentHandler; + interface ISAXDeclHandler; + interface ISAXDTDHandler; + interface ISAXErrorHandler; + interface ISAXLexicalHandler; + + interface IVBSAXContentHandler; + interface IVBSAXDeclHandler; + interface IVBSAXDTDHandler; + interface IVBSAXErrorHandler; + interface IVBSAXLexicalHandler; +}; + +[ uuid(4dd441ad-526d-4a77-9f1b-9841ed802fb0) ] coclass SAXAttributes @@ -2658,5 +2695,15 @@ coclass SAXAttributes30 interface ISAXAttributes; }; +[ + uuid(88d969ca-f192-11d4-a65f-0040963251e5), +] +coclass SAXAttributes40 +{ + [default] interface IMXAttributes; + interface IVBSAXAttributes; + interface ISAXAttributes; +}; + } /* Library MSXML */
1
0
0
0
Nikolay Sivov : shell32: Move IShellIcon definition to idl source.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: b7d611a80f5ab4ea8cc69163547447acd3baa4de URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7d611a80f5ab4ea8cc691635…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 18 18:54:43 2010 +0400 shell32: Move IShellIcon definition to idl source. --- include/shlguid.h | 1 - include/shlobj.h | 27 --------------------------- include/shobjidl.idl | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/include/shlguid.h b/include/shlguid.h index 88d70ce..0055d38 100644 --- a/include/shlguid.h +++ b/include/shlguid.h @@ -38,7 +38,6 @@ DEFINE_OLEGUID(CGID_ShellDocView, 0x000214D1L, 0, 0); DEFINE_OLEGUID(CGID_ShellServiceObject, 0x000214D2L, 0, 0); DEFINE_OLEGUID(CGID_ExplorerBarDoc, 0x000214D3L, 0, 0); -DEFINE_OLEGUID(IID_IShellIcon, 0x000214E5L, 0, 0); DEFINE_OLEGUID(IID_IShellDetails, 0x000214ECL, 0, 0); DEFINE_OLEGUID(IID_IDelayedRelease, 0x000214EDL, 0, 0); DEFINE_OLEGUID(IID_IShellCopyHookA, 0x000214EFL, 0, 0); diff --git a/include/shlobj.h b/include/shlobj.h index a463ca1..df1fc93 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -369,33 +369,6 @@ DECLARE_INTERFACE_(IShellDetails, IUnknown) #define IShellDetails_ColumnClick(p,a) (p)->lpVtbl->ColumnClick(p,a) #endif -/**************************************************************************** - * IShellIcon interface - */ - -#define INTERFACE IShellIcon -DECLARE_INTERFACE_(IShellIcon,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IShellIcon methods ***/ - STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags, LPINT lpIconIndex) PURE; -}; -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IShellIcon_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IShellIcon_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IShellIcon_Release(p) (p)->lpVtbl->Release(p) -/*** IShellIcon methods ***/ -#define IShellIcon_GetIconOf(p,a,b,c) (p)->lpVtbl->GetIconOf(p,a,b,c) -#endif - -typedef IShellIcon *LPSHELLICON; - /* IQueryInfo interface */ #define INTERFACE IQueryInfo DECLARE_INTERFACE_(IQueryInfo,IUnknown) diff --git a/include/shobjidl.idl b/include/shobjidl.idl index a050b39..7c4fb78 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -422,6 +422,21 @@ typedef struct } FOLDERSETTINGS, *PFOLDERSETTINGS, *LPFOLDERSETTINGS; typedef const FOLDERSETTINGS *LPCFOLDERSETTINGS; +/***************************************************************************** + * IShellIcon interface + */ +[ + uuid(000214e5-0000-0000-c000-000000000046), + object, + pointer_default(unique) +] +interface IShellIcon : IUnknown +{ + HRESULT GetIconOf( + [in] PCUITEMID_CHILD pidl, + [in] UINT flags, + [out] int *pIconIndex); +} /***************************************************************************** * IShellView interface
1
0
0
0
Nikolay Sivov : shell32: Fallback to IShellDetails while filling shell view columns if IShellFolder2 is missed .
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: 066063541ddf79422c600144f9e3d9bc6dd67c98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=066063541ddf79422c600144f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 18 18:51:45 2010 +0400 shell32: Fallback to IShellDetails while filling shell view columns if IShellFolder2 is missed. --- dlls/shell32/shlview.c | 39 +++++++++++++++++++++++---------------- include/shlobj.h | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 938ec13..c7d9ee8 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -389,40 +389,47 @@ static BOOL ShellView_CreateList (IShellViewImpl * This) */ static void ShellView_InitList(IShellViewImpl *This) { + IShellDetails *details = NULL; LVCOLUMNW lvColumn; SHELLDETAILS sd; WCHAR nameW[50]; + HRESULT hr; + INT i; TRACE("(%p)\n", This); SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0); + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; lvColumn.pszText = nameW; - if (This->pSF2Parent) + if (!This->pSF2Parent) { - HRESULT hr; - INT i; - - for (i = 0; 1; i++) + hr = IShellFolder_QueryInterface(This->pSFParent, &IID_IShellDetails, (void**)&details); + if (hr != S_OK) { - hr = IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd); - if (FAILED(hr)) break; - - lvColumn.fmt = sd.fmt; - lvColumn.cx = sd.cxChar*8; /* chars->pixel */ - StrRetToStrNW(nameW, sizeof(nameW)/sizeof(WCHAR), &sd.str, NULL); - SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); + WARN("IShellFolder2/IShellDetails not supported\n"); + return; } } - else + + for (i = 0; 1; i++) { - FIXME("no SF2\n"); + if (This->pSFParent) + hr = IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd); + else + hr = IShellDetails_GetDetailsOf(details, NULL, i, &sd); + if (FAILED(hr)) break; + + lvColumn.fmt = sd.fmt; + lvColumn.cx = sd.cxChar*8; /* chars->pixel */ + StrRetToStrNW(nameW, sizeof(nameW)/sizeof(WCHAR), &sd.str, NULL); + SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); } - SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); - SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); + if (details) IShellDetails_Release(details); } /********************************************************** diff --git a/include/shlobj.h b/include/shlobj.h index 9f87a0a..a463ca1 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -346,6 +346,28 @@ typedef struct #define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0) #define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1) +#define INTERFACE IShellDetails +DECLARE_INTERFACE_(IShellDetails, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IShellDetails methods ***/ + STDMETHOD(GetDetailsOf)(THIS_ PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE; + STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IShellDetails_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IShellDetails_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IShellDetails_Release(p) (p)->lpVtbl->Release(p) +/*** IShellDetails methods ***/ +#define IShellDetails_GetDetailsOf(p,a,b,c) (p)->lpVtbl->GetDetailsOf(p,a,b,c) +#define IShellDetails_ColumnClick(p,a) (p)->lpVtbl->ColumnClick(p,a) +#endif /**************************************************************************** * IShellIcon interface
1
0
0
0
Nikolay Sivov : shell32: Load shell folder column names as A/ W strings depending on 9x/NT selector.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: 1b31b377b6f4efa9d707541f3c0903e07993fda2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b31b377b6f4efa9d707541f3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 18 18:48:58 2010 +0400 shell32: Load shell folder column names as A/W strings depending on 9x/NT selector. --- dlls/shell32/shlfolder.c | 16 ++++++++- dlls/shell32/shlview.c | 60 +++++++++++++++++----------------- dlls/shell32/tests/shfldr_special.c | 14 +++++++- 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 99773b3..230d7c6 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -548,8 +548,20 @@ HRESULT SHELL32_GetColumnDetails(const shvheader *data, int column, SHELLDETAILS { details->fmt = data[column].fmt; details->cxChar = data[column].cxChar; - details->str.uType = STRRET_CSTR; - LoadStringA (shell32_hInstance, data[column].colnameid, details->str.u.cStr, MAX_PATH); + + if (SHELL_OsIsUnicode()) + { + details->str.u.pOleStr = CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR)); + if (!details->str.u.pOleStr) return E_OUTOFMEMORY; + + details->str.uType = STRRET_WSTR; + LoadStringW(shell32_hInstance, data[column].colnameid, details->str.u.pOleStr, MAX_PATH); + } + else + { + details->str.uType = STRRET_CSTR; + LoadStringA(shell32_hInstance, data[column].colnameid, details->str.u.cStr, MAX_PATH); + } return S_OK; } diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 653e5f3..938ec13 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -387,42 +387,44 @@ static BOOL ShellView_CreateList (IShellViewImpl * This) * * - adds all needed columns to the shellview */ -static BOOL ShellView_InitList(IShellViewImpl * This) +static void ShellView_InitList(IShellViewImpl *This) { - LVCOLUMNW lvColumn; - SHELLDETAILS sd; - int i; - WCHAR szTemp[50]; + LVCOLUMNW lvColumn; + SHELLDETAILS sd; + WCHAR nameW[50]; - TRACE("%p\n",This); + TRACE("(%p)\n", This); - SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0); + SendMessageW(This->hWndList, LVM_DELETEALLITEMS, 0, 0); - lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; - lvColumn.pszText = szTemp; + lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; + lvColumn.pszText = nameW; + + if (This->pSF2Parent) + { + HRESULT hr; + INT i; + + for (i = 0; 1; i++) + { + hr = IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd); + if (FAILED(hr)) break; - if (This->pSF2Parent) - { - for (i=0; 1; i++) - { - if (FAILED(IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd))) - break; lvColumn.fmt = sd.fmt; lvColumn.cx = sd.cxChar*8; /* chars->pixel */ - StrRetToStrNW( szTemp, 50, &sd.str, NULL); + StrRetToStrNW(nameW, sizeof(nameW)/sizeof(WCHAR), &sd.str, NULL); SendMessageW(This->hWndList, LVM_INSERTCOLUMNW, i, (LPARAM) &lvColumn); - } - } - else - { - FIXME("no SF2\n"); - } - - SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); - SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); + } + } + else + { + FIXME("no SF2\n"); + } - return TRUE; + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ShellSmallIconList); + SendMessageW(This->hWndList, LVM_SETIMAGELIST, LVSIL_NORMAL, (LPARAM)ShellBigIconList); } + /********************************************************** * ShellView_CompareItems() * @@ -688,10 +690,8 @@ static LRESULT ShellView_OnCreate(IShellViewImpl *This) if (ShellView_CreateList(This)) { - if (ShellView_InitList(This)) - { - ShellView_FillList(This); - } + ShellView_InitList(This); + ShellView_FillList(This); } hr = IShellView2_QueryInterface(iface, &IID_IDropTarget, (LPVOID*)&pdt); diff --git a/dlls/shell32/tests/shfldr_special.c b/dlls/shell32/tests/shfldr_special.c index 3320130..7be2bdf 100644 --- a/dlls/shell32/tests/shfldr_special.c +++ b/dlls/shell32/tests/shfldr_special.c @@ -33,6 +33,11 @@ #include "wine/test.h" +static inline BOOL SHELL_OsIsUnicode(void) +{ + return !(GetVersion() & 0x80000000); +} + /* Tests for My Network Places */ static void test_parse_for_entire_network(void) { @@ -129,8 +134,8 @@ static void test_printers_folder(void) SHELLDETAILS details; SHCOLSTATEF state; LPITEMIDLIST pidl1, pidl2; - INT i; HRESULT hr; + INT i; CoInitialize( NULL ); @@ -166,6 +171,9 @@ if (0) ok(hr == S_OK, "got 0x%08x\n", hr); /* all columns are left-aligned */ ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt); + /* can't be on w9x at this point, IShellFolder2 unsupported there, + check present for running Wine with w9x setup */ + if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr); hr = IShellFolder2_GetDefaultColumnState(folder, i, &state); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -176,6 +184,10 @@ if (0) ok(state == (SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT), "got 0x%x\n", state); } + hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(details.str.uType == STRRET_WSTR, "got %d\n", details.str.uType); + /* default pidl */ hr = IShellFolder2_QueryInterface(folder, &IID_IPersistFolder2, (void**)&pf); ok(hr == S_OK, "got 0x%08x\n", hr);
1
0
0
0
Nikolay Sivov : shell32: Add printers CLSID to test, clean up a bit.
by Alexandre Julliard
19 Apr '10
19 Apr '10
Module: wine Branch: master Commit: c51b248b48b528c05ba51f6efb0123cb397b8638 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c51b248b48b528c05ba51f6ef…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 18 18:31:52 2010 +0400 shell32: Add printers CLSID to test, clean up a bit. --- dlls/shell32/tests/shellpath.c | 297 +++++++++++++++++----------------------- 1 files changed, 126 insertions(+), 171 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c51b248b48b528c05ba51…
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
90
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
Results per page:
10
25
50
100
200