ReactOS.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
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
List overview
Download
Ros-diffs
March 2010
----- 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
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[cwittich] 45887: [RICHED32_WINETEST] sync riched32_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:50:02 2010 New Revision: 45887 URL:
http://svn.reactos.org/svn/reactos?rev=45887&view=rev
Log: [RICHED32_WINETEST] sync riched32_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/riched32/editor.c Modified: trunk/rostests/winetests/riched32/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched32/editor…
============================================================================== --- trunk/rostests/winetests/riched32/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched32/editor.c [iso-8859-1] Fri Mar 5 19:50:02 2010 @@ -50,25 +50,30 @@ static void test_WM_SETTEXT(void) { + static const struct { + const char *itemtext; + DWORD lines; + DWORD lines_broken; + } testitems[] = { + { "TestSomeText", 1}, + { "TestSomeText\r", 1}, + { "TestSomeText\rSomeMoreText\r", 2, 1}, /* NT4 and below */ + { "TestSomeText\n\nTestSomeText", 3}, + { "TestSomeText\r\r\nTestSomeText", 2}, + { "TestSomeText\r\r\n\rTestSomeText", 3, 2}, /* NT4 and below */ + { "TestSomeText\r\n\r\r\n\rTestSomeText", 4, 3}, /* NT4 and below */ + { "TestSomeText\r\n" ,2}, + { "TestSomeText\r\nSomeMoreText\r\n", 3}, + { "TestSomeText\r\n\r\nTestSomeText", 3}, + { "TestSomeText TestSomeText" ,1}, + { "TestSomeText \r\nTestSomeText", 2}, + { "TestSomeText\r\n \r\nTestSomeText", 3}, + { "TestSomeText\n", 2}, + { "TestSomeText\r\r\r", 3, 1}, /* NT4 and below */ + { "TestSomeText\r\r\rSomeMoreText", 4, 2} /* NT4 and below */ + }; HWND hwndRichEdit = new_richedit(NULL); - const char * TestItem1 = "TestSomeText"; - const char * TestItem2 = "TestSomeText\r"; - const char * TestItem3 = "TestSomeText\rSomeMoreText\r"; - const char * TestItem4 = "TestSomeText\n\nTestSomeText"; - const char * TestItem5 = "TestSomeText\r\r\nTestSomeText"; - const char * TestItem6 = "TestSomeText\r\r\n\rTestSomeText"; - const char * TestItem7 = "TestSomeText\r\n\r\r\n\rTestSomeText"; - const char * TestItem8 = "TestSomeText\r\n"; - const char * TestItem9 = "TestSomeText\r\nSomeMoreText\r\n"; - const char * TestItem10 = "TestSomeText\r\n\r\nTestSomeText"; - const char * TestItem11 = "TestSomeText TestSomeText"; - const char * TestItem12 = "TestSomeText \r\nTestSomeText"; - const char * TestItem13 = "TestSomeText\r\n \r\nTestSomeText"; - const char * TestItem14 = "TestSomeText\n"; - const char * TestItem15 = "TestSomeText\r\r\r"; - const char * TestItem16 = "TestSomeText\r\r\rSomeMoreText"; - char buf[1024] = {0}; - LRESULT result; + int i; /* This test attempts to show that WM_SETTEXT on a riched32 control does not * attempt to modify the text that is pasted into the control, and should @@ -85,37 +90,26 @@ * where \r at the end of the text is a proper line break. */ -#define TEST_SETTEXT(a, b, nlines) \ - result = SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) a); \ - ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ - result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buf); \ - ok (result == lstrlen(buf), \ - "WM_GETTEXT returned %ld instead of expected %u\n", \ - result, lstrlen(buf)); \ - result = strcmp(b, buf); \ - ok(result == 0, \ - "WM_SETTEXT round trip: strcmp = %ld\n", result); \ - result = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); \ - ok(result == nlines, "EM_GETLINECOUNT returned %ld, expected %d\n", result, nlines); - - TEST_SETTEXT(TestItem1, TestItem1, 1) - TEST_SETTEXT(TestItem2, TestItem2, 1) - TEST_SETTEXT(TestItem3, TestItem3, 2) - TEST_SETTEXT(TestItem4, TestItem4, 3) - TEST_SETTEXT(TestItem5, TestItem5, 2) - TEST_SETTEXT(TestItem6, TestItem6, 3) - TEST_SETTEXT(TestItem7, TestItem7, 4) - TEST_SETTEXT(TestItem8, TestItem8, 2) - TEST_SETTEXT(TestItem9, TestItem9, 3) - TEST_SETTEXT(TestItem10, TestItem10, 3) - TEST_SETTEXT(TestItem11, TestItem11, 1) - TEST_SETTEXT(TestItem12, TestItem12, 2) - TEST_SETTEXT(TestItem13, TestItem13, 3) - TEST_SETTEXT(TestItem14, TestItem14, 2) - TEST_SETTEXT(TestItem15, TestItem15, 3) - TEST_SETTEXT(TestItem16, TestItem16, 4) - -#undef TEST_SETTEXT + for (i = 0; i < sizeof(testitems)/sizeof(testitems[0]); i++) { + + char buf[1024] = {0}; + LRESULT result; + + result = SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) testitems[i].itemtext); + ok (result == 1, "[%d] WM_SETTEXT returned %ld instead of 1\n", i, result); + result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buf); + ok (result == lstrlen(buf), + "[%d] WM_GETTEXT returned %ld instead of expected %u\n", + i, result, lstrlen(buf)); + result = strcmp(testitems[i].itemtext, buf); + ok (result == 0, + "[%d] WM_SETTEXT round trip: strcmp = %ld\n", i, result); + result = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + ok (result == testitems[i].lines || + broken(testitems[i].lines_broken && result == testitems[i].lines_broken), + "[%d] EM_GETLINECOUNT returned %ld, expected %d\n", i, result, testitems[i].lines); + } + DestroyWindow(hwndRichEdit); } @@ -354,11 +348,12 @@ int line; size_t buffer_len; const char *text; + const char *broken_text; } gl[] = { - {0, 10, "foo bar\r\n"}, - {1, 10, "\r"}, - {2, 10, "\r\r\n"}, - {3, 10, "bar\n"}, + {0, 10, "foo bar\r\n", "foo bar\r\n"}, + {1, 10, "\r", "\r\r\r\n"}, + {2, 10, "\r\r\n", "bar\n"}, + {3, 10, "bar\n", "\r\n"}, {4, 10, "\r\n"}, /* Buffer smaller than line length */ @@ -373,19 +368,40 @@ HWND hwndRichEdit = new_richedit(NULL); static const int nBuf = 1024; char dest[1024], origdest[1024]; + LRESULT linecount; const char text[] = "foo bar\r\n" "\r" "\r\r\n" "bar\n"; + BOOL broken_os = FALSE; SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); + linecount = SendMessage(hwndRichEdit, EM_GETLINECOUNT, 0, 0); + if (linecount == 4) + { + broken_os = TRUE; + win_skip("Win9x, WinME and NT4 handle '\\r only' differently\n"); + } memset(origdest, 0xBB, nBuf); for (i = 0; i < sizeof(gl)/sizeof(struct getline_s); i++) { - int nCopied; - int expected_nCopied = min(gl[i].buffer_len, strlen(gl[i].text)); - int expected_bytes_written = min(gl[i].buffer_len, strlen(gl[i].text) + 1); + int nCopied, expected_nCopied, expected_bytes_written; + char gl_text[1024]; + + if (gl[i].line >= linecount) + continue; /* Win9x, WinME and NT4 */ + + if (broken_os && gl[i].broken_text) + /* Win9x, WinME and NT4 */ + strcpy(gl_text, gl[i].broken_text); + else + strcpy(gl_text, gl[i].text); + + expected_nCopied = min(gl[i].buffer_len, strlen(gl_text)); + /* Cater for the fact that Win9x, WinME and NT4 don't append the '\0' */ + expected_bytes_written = min(gl[i].buffer_len, strlen(gl_text) + (broken_os ? 0 : 1)); + memset(dest, 0xBB, nBuf); *(WORD *) dest = gl[i].buffer_len; @@ -399,11 +415,11 @@ ok(!dest[0] && !dest[1] && !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=0\n"); else if (gl[i].buffer_len == 1) - ok(dest[0] == gl[i].text[0] && !dest[1] && + ok(dest[0] == gl_text[0] && !dest[1] && !strncmp(dest+2, origdest+2, nBuf-2), "buffer_len=1\n"); else { - ok(!strncmp(dest, gl[i].text, expected_bytes_written), + ok(!strncmp(dest, gl_text, expected_bytes_written), "%d: expected_bytes_written=%d\n", i, expected_bytes_written); ok(!strncmp(dest + expected_bytes_written, origdest + expected_bytes_written, nBuf - expected_bytes_written), @@ -656,6 +672,7 @@ ft.chrg.cpMin = f->start; ft.chrg.cpMax = f->end; ft.lpstrText = f->needle; + ft.chrgText.cpMax = 0xdeadbeef; findloc = SendMessage(hwnd, EM_FINDTEXTEX, f->flags, (LPARAM) &ft); ok(findloc == f->expected_loc, "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, start at %d\n", @@ -665,7 +682,8 @@ name, id, f->needle, f->start, f->end, f->flags, ft.chrgText.cpMin, f->expected_loc); expected_end_loc = ((f->expected_loc == -1) ? -1 : f->expected_loc + strlen(f->needle)); - ok(ft.chrgText.cpMax == expected_end_loc, + ok(ft.chrgText.cpMax == expected_end_loc || + broken(ft.chrgText.cpMin == -1 && ft.chrgText.cpMax == 0xdeadbeef), /* Win9x, WinME and NT4 */ "EM_FINDTEXTEX(%s,%d) '%s' in range(%d,%d), flags %08x, end at %d, expected %d\n", name, id, f->needle, f->start, f->end, f->flags, ft.chrgText.cpMax, expected_end_loc); } @@ -750,7 +768,9 @@ if (i == 0) { ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); - ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + ok(pl.x == 1 || + broken(pl.x == 0), /* Win9x, WinME and NT4 */ + "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); xpos = pl.x; } else if (i == 1) @@ -811,7 +831,9 @@ result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 0); ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); - ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); + ok(pl.x == 1 || + broken(pl.x == 0), /* Win9x, WinME and NT4 */ + "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); xpos = pl.x; SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINERIGHT, 0); @@ -820,7 +842,9 @@ ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); todo_wine { /* Fails on builtin because horizontal scrollbar is not being shown */ - ok(pl.x < xpos, "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n", pl.x, xpos); + ok(pl.x < xpos || + broken(pl.x == xpos), /* Win9x, WinME and NT4 */ + "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n", pl.x, xpos); } DestroyWindow(hwndRichEdit); } @@ -831,7 +855,7 @@ POINTL point = {0, 60}; /* This point must be below the first line */ const char *text = "Must be long enough to test line wrapping"; DWORD dwCommonStyle = WS_VISIBLE|WS_POPUP|WS_VSCROLL|ES_MULTILINE; - int res, pos, lines; + int res, pos, lines, prevlines, reflines[3]; /* Test the effect of WS_HSCROLL and ES_AUTOHSCROLL styles on wrapping * when specified on window creation and set later. */ @@ -872,11 +896,19 @@ res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); DestroyWindow(hwnd); hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, @@ -886,17 +918,29 @@ res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); /* Test the effect of EM_SETTARGETDEVICE on word wrap. */ res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 1); ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 0); ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res); @@ -904,29 +948,55 @@ ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); DestroyWindow(hwnd); - /* Test to see if wrapping happens with redraw disabled. */ + /* First lets see if the text would wrap normally (needed for reference) */ hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle, - 0, 0, 400, 80, NULL, NULL, hmoduleRichEdit, NULL); + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); ok(IsWindowVisible(hwnd), "Window should be visible.\n"); + res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text); + ok(res, "EM_REPLACESEL failed.\n"); + /* Should have wrapped */ + reflines[0] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(reflines[0] > 1, "Line was expected to wrap (%d lines).\n", reflines[0]); + /* Resize the window to fit the line */ + MoveWindow(hwnd, 0, 0, 600, 80, TRUE); + /* Text should not be wrapped */ + reflines[1] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(reflines[1] == 1, "Line wasn't expected to wrap (%d lines).\n", reflines[1]); + /* Resize the window again to make sure the line wraps again */ + MoveWindow(hwnd, 0, 0, 10, 80, TRUE); + reflines[2] = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(reflines[2] > 1, "Line was expected to wrap (%d lines).\n", reflines[2]); + DestroyWindow(hwnd); + + /* Same test with redraw disabled */ + hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle, + 0, 0, 200, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + ok(IsWindowVisible(hwnd), "Window should be visible.\n"); + /* Redraw is disabled by making the window invisible. */ SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); - /* redraw is disabled by making the window invisible. */ ok(!IsWindowVisible(hwnd), "Window shouldn't be visible.\n"); res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text); ok(res, "EM_REPLACESEL failed.\n"); - MoveWindow(hwnd, 0, 0, 100, 80, TRUE); - SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); - /* Wrapping didn't happen while redraw was disabled. */ + /* Should have wrapped */ + prevlines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(prevlines == reflines[0], + "Line was expected to wrap (%d lines).\n", prevlines); + /* Resize the window to fit the line, no change to the number of lines */ + MoveWindow(hwnd, 0, 0, 600, 80, TRUE); lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); - todo_wine ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); - /* There isn't even a rewrap from resizing the window. */ + todo_wine + ok(lines == prevlines || + broken(lines == reflines[1]), /* Win98, WinME and NT4 */ + "Expected no change in the number of lines\n"); + /* Resize the window again to make sure the line wraps again */ + MoveWindow(hwnd, 0, 0, 10, 80, TRUE); lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); - todo_wine ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); - res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text); - ok(res, "EM_REPLACESEL failed.\n"); - lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); - ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines); - + todo_wine + ok(lines == prevlines || + broken(lines == reflines[2]), /* Win98, WinME and NT4 */ + "Expected no change in the number of lines\n"); DestroyWindow(hwnd); } @@ -946,7 +1016,8 @@ WS_POPUP|WS_VSCROLL|WS_HSCROLL, 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); options = SendMessage(hwnd, EM_GETOPTIONS, 0, 0); - ok(options == ECO_AUTOVSCROLL, + ok(options == ECO_AUTOVSCROLL || + broken(options == 0), /* Win9x, WinME and NT4 */ "Incorrect initial options %x\n", options); DestroyWindow(hwnd); } @@ -961,19 +1032,24 @@ hwnd = CreateWindowEx(0, RICHEDIT_CLASS10A, NULL, WS_POPUP|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL, 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); - ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS10A, (int) GetLastError()); ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0); - ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n"); + ok(ret & ECO_AUTOVSCROLL || + broken(!(ret & ECO_AUTOVSCROLL)), /* Win9x, WinME and NT4 */ + "ECO_AUTOVSCROLL isn't set.\n"); ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n"); ret = GetWindowLong(hwnd, GWL_STYLE); - todo_wine ok(ret & ES_AUTOVSCROLL, "ES_AUTOVSCROLL isn't set.\n"); + todo_wine + ok(ret & ES_AUTOVSCROLL || + broken(!(ret & ES_AUTOVSCROLL)), /* Win9x, WinMe and NT4 */ + "ES_AUTOVSCROLL isn't set.\n"); ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n"); DestroyWindow(hwnd); - hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, + hwnd = CreateWindowEx(0, RICHEDIT_CLASS10A, NULL, WS_POPUP|ES_MULTILINE, 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); - ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError()); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS10A, (int) GetLastError()); ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0); ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n"); ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
14 years, 9 months
1
0
0
0
[cwittich] 45886: [RICHED20_WINETEST] sync riched20_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:49:06 2010 New Revision: 45886 URL:
http://svn.reactos.org/svn/reactos?rev=45886&view=rev
Log: [RICHED20_WINETEST] sync riched20_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/riched20/editor.c trunk/rostests/winetests/riched20/txtsrv.c Modified: trunk/rostests/winetests/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
============================================================================== --- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Fri Mar 5 19:49:06 2010 @@ -33,6 +33,8 @@ #include <time.h> #include <wine/test.h> +#define ID_RICHEDITTESTDBUTTON 0x123 + static CHAR string1[MAX_PATH], string2[MAX_PATH], string3[MAX_PATH]; #define ok_w3(format, szString1, szString2, szString3) \ @@ -291,8 +293,7 @@ /* Setting a format on an arbitrary range should have no effect in search results. This tests correct offset reporting across runs. */ cf2.cbSize = sizeof(CHARFORMAT2); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, - (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2); cf2.dwMask = CFM_ITALIC | cf2.dwMask; cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; SendMessage(hwndRichEdit, EM_SETSEL, 6, 20); @@ -743,7 +744,7 @@ (LPARAM) &cf2); ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); rc = SendMessage(hwndRichEdit, EM_CANUNDO, 0, 0); - todo_wine ok(rc == TRUE, "Should not be able to undo here.\n"); + ok(rc == TRUE, "Should not be able to undo here.\n"); SendMessage(hwndRichEdit, EM_EMPTYUNDOBUFFER, 0, 0); cf2.cbSize = sizeof(CHARFORMAT2); @@ -1238,31 +1239,30 @@ cr.cpMax = 20; SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM) &cr); cf2.cbSize = sizeof(CHARFORMAT2); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, - (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2); cf2.dwMask = CFM_BOLD | cf2.dwMask; cf2.dwEffects = CFE_BOLD ^ cf2.dwEffects; - rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2); ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc); - rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_WORD | SCF_SELECTION, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_WORD | SCF_SELECTION, (LPARAM)&cf2); ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc); - rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM)&cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); /*Get the formatting of those characters*/ - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2); /*Get the formatting of some other characters*/ cf2test.cbSize = sizeof(CHARFORMAT2); cr.cpMin = 21; cr.cpMax = 30; SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM) &cr); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2test); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2test); /*Test that they are the same as plain text allows only one formatting*/ @@ -1284,14 +1284,14 @@ /*Swap back to rich text*/ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) ""); - SendMessage(hwndRichEdit, EM_SETTEXTMODE, (WPARAM) TM_RICHTEXT, 0); + SendMessage(hwndRichEdit, EM_SETTEXTMODE, TM_RICHTEXT, 0); /*Set the default formatting to bold italics*/ - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2); cf2.dwMask |= CFM_ITALIC; cf2.dwEffects ^= CFE_ITALIC; - rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); /*Set the text in the control to "wine", which will be bold and italicized*/ @@ -1308,14 +1308,14 @@ cr.cpMin = 1; cr.cpMax = 3; SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM) &cr); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2); /*Select the second "wine" string and retrieve its formatting*/ cr.cpMin = 5; cr.cpMax = 7; SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM) &cr); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2test); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2test); /*Compare the two formattings. They should be the same.*/ @@ -3282,10 +3282,15 @@ const char * TestItem7 = "TestSomeText\r\n\r\r\n\rTestSomeText"; const char * TestItem7_after = "TestSomeText\r\n \r\nTestSomeText"; + const char rtftextA[] = "{\\rtf sometext}"; + const char urtftextA[] = "{\\urtf sometext}"; + const WCHAR rtftextW[] = {'{','\\','r','t','f',' ','s','o','m','e','t','e','x','t','}',0}; + const WCHAR urtftextW[] = {'{','\\','u','r','t','f',' ','s','o','m','e','t','e','x','t','}',0}; + const WCHAR sometextW[] = {'s','o','m','e','t','e','x','t',0}; + char buf[1024] = {0}; + WCHAR bufW[1024] = {0}; LRESULT result; - EDITSTREAM es; - char * p; /* This test attempts to show that WM_SETTEXT on a riched20 control causes any solitary \r to be converted to \r\n on return. Properly paired @@ -3302,7 +3307,7 @@ result, lstrlen(buf)); \ result = strcmp(b, buf); \ ok(result == 0, \ - "WM_SETTEXT round trip: strcmp = %ld\n", result); + "WM_SETTEXT round trip: strcmp = %ld, text=\"%s\"\n", result, buf); TEST_SETTEXT(TestItem1, TestItem1) TEST_SETTEXT(TestItem2, TestItem2_after) @@ -3313,42 +3318,60 @@ TEST_SETTEXT(TestItem6, TestItem6_after) TEST_SETTEXT(TestItem7, TestItem7_after) - /* The following test demonstrates that WM_SETTEXT supports RTF strings */ + /* The following tests demonstrate that WM_SETTEXT supports RTF strings */ + TEST_SETTEXT(rtftextA, "sometext") /* interpreted as ascii rtf */ + TEST_SETTEXT(urtftextA, "sometext") /* interpreted as ascii rtf */ + TEST_SETTEXT(rtftextW, "{") /* interpreted as ascii text */ + TEST_SETTEXT(urtftextW, "{") /* interpreted as ascii text */ + DestroyWindow(hwndRichEdit); +#undef TEST_SETTEXT + +#define TEST_SETTEXTW(a, b) \ + result = SendMessageW(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) a); \ + ok (result == 1, "WM_SETTEXT returned %ld instead of 1\n", result); \ + result = SendMessageW(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) bufW); \ + ok (result == lstrlenW(bufW), \ + "WM_GETTEXT returned %ld instead of expected %u\n", \ + result, lstrlenW(bufW)); \ + result = lstrcmpW(b, bufW); \ + ok(result == 0, "WM_SETTEXT round trip: strcmp = %ld\n", result); + + if (is_win9x) + { + skip("Cannot perform unicode tests\n"); + return; + } +hwndRichEdit = CreateWindowW(RICHEDIT_CLASS20W, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwndRichEdit != NULL, "class: RichEdit20W, error: %d\n", (int) GetLastError()); + TEST_SETTEXTW(rtftextA, sometextW) /* interpreted as ascii rtf */ + TEST_SETTEXTW(urtftextA, sometextW) /* interpreted as ascii rtf */ + TEST_SETTEXTW(rtftextW, rtftextW) /* interpreted as ascii text */ + TEST_SETTEXTW(urtftextW, urtftextW) /* interpreted as ascii text */ + DestroyWindow(hwndRichEdit); +#undef TEST_SETTEXTW +} + +static void test_EM_STREAMOUT(void) +{ + HWND hwndRichEdit = new_richedit(NULL); + int r; + EDITSTREAM es; + char buf[1024] = {0}; + char * p; + + const char * TestItem1 = "TestSomeText"; + const char * TestItem2 = "TestSomeText\r"; + const char * TestItem3 = "TestSomeText\r\n"; + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) TestItem1); p = buf; es.dwCookie = (DWORD_PTR)&p; es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_RTF), (LPARAM)&es); - trace("EM_STREAMOUT produced:\n%s\n", buf); - TEST_SETTEXT(buf, TestItem1) - -#undef TEST_SETTEXT - DestroyWindow(hwndRichEdit); -} - -static void test_EM_STREAMOUT(void) -{ - HWND hwndRichEdit = new_richedit(NULL); - int r; - EDITSTREAM es; - char buf[1024] = {0}; - char * p; - - const char * TestItem1 = "TestSomeText"; - const char * TestItem2 = "TestSomeText\r"; - const char * TestItem3 = "TestSomeText\r\n"; - - SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) TestItem1); - p = buf; - es.dwCookie = (DWORD_PTR)&p; - es.dwError = 0; - es.pfnCallback = test_WM_SETTEXT_esCallback; - memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_TEXT), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); r = strlen(buf); ok(r == 12, "streamed text length is %d, expecting 12\n", r); ok(strcmp(buf, TestItem1) == 0, @@ -3360,8 +3383,7 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_TEXT), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); r = strlen(buf); /* Here again, \r gets converted to \r\n, like WM_GETTEXT */ ok(r == 14, "streamed text length is %d, expecting 14\n", r); @@ -3373,8 +3395,7 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_TEXT), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); r = strlen(buf); ok(r == 14, "streamed text length is %d, expecting 14\n", r); ok(strcmp(buf, TestItem3) == 0, @@ -3403,8 +3424,7 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessage(hwndRichEdit, EM_STREAMOUT, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMOUT, SF_RTF, (LPARAM)&es); /* scans for \fonttbl, error if not found */ fontTbl = strstr(buf, "\\fonttbl"); @@ -4228,12 +4248,11 @@ /* set char format */ SendMessage(hwndRichEdit, EM_SETMODIFY, FALSE, 0); cf2.cbSize = sizeof(CHARFORMAT2); - SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, - (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2); cf2.dwMask = CFM_ITALIC | cf2.dwMask; cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; - SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); - result = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); + result = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); ok(result == 1, "EM_SETCHARFORMAT returned %ld instead of 1\n", result); result = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok (result != 0, @@ -4256,8 +4275,7 @@ es.dwCookie = (DWORD_PTR)&streamText; es.dwError = 0; es.pfnCallback = test_EM_GETMODIFY_esCallback; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_TEXT), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es); result = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok (result != 0, "EM_GETMODIFY returned zero, instead of non-zero for EM_STREAM\n"); @@ -4996,8 +5014,7 @@ es.dwCookie = (DWORD_PTR)&streamText0; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 12, @@ -5011,8 +5028,7 @@ es.dwCookie = (DWORD_PTR)&streamText0a; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 12, @@ -5026,8 +5042,7 @@ es.dwCookie = (DWORD_PTR)&streamText0b; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 14, @@ -5040,8 +5055,7 @@ es.dwCookie = (DWORD_PTR)&streamText1; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 12, @@ -5053,8 +5067,7 @@ es.dwCookie = (DWORD_PTR)&streamText2; es.dwError = 0; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 0, @@ -5065,8 +5078,7 @@ es.dwCookie = (DWORD_PTR)&streamText3; es.dwError = 0; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_RTF), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == 0, @@ -5078,8 +5090,7 @@ es.dwCookie = (DWORD_PTR)&cookieForStream4; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback2; - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_TEXT), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es); result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); ok (result == length4, @@ -5117,7 +5128,7 @@ SendMessage(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) randomtext); SendMessage(hwndRichEdit, EM_SETSEL,0,0); - SendMessage(hwndRichEdit, EM_STREAMIN, (WPARAM)SF_TEXT, (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); result = strcmp (buffer,"test"); ok (result == 0, @@ -5132,8 +5143,7 @@ SendMessage(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) randomtext); SendMessage(hwndRichEdit, EM_SETSEL,0,0); - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_TEXT|SFF_SELECTION), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT|SFF_SELECTION, (LPARAM)&es); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); result = strcmp (buffer,"testSome text"); ok (result == 0, @@ -5149,8 +5159,7 @@ SendMessage(hwndRichEdit,EM_EMPTYUNDOBUFFER, 0,0); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) randomtext); SendMessage(hwndRichEdit, EM_SETSEL,4,5); - SendMessage(hwndRichEdit, EM_STREAMIN, - (WPARAM)(SF_TEXT|SFF_SELECTION), (LPARAM)&es); + SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT|SFF_SELECTION, (LPARAM)&es); SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); result = strcmp (buffer,"Sometesttext"); ok (result == 0, @@ -5258,13 +5267,13 @@ expect_empty(hwnd, WM_GETTEXT); expect_empty(hwnd, EM_GETTEXTEX); - ret = SendMessageA(hwnd, WM_CHAR, (WPARAM)textW[0], 0); + ret = SendMessageA(hwnd, WM_CHAR, textW[0], 0); ok(!ret, "SendMessageA(WM_CHAR) should return 0, got %d\n", ret); expect_textA(hwnd, WM_GETTEXT, "t"); expect_textA(hwnd, EM_GETTEXTEX, "t"); expect_textW(hwnd, EM_GETTEXTEX, tW); - ret = SendMessageA(hwnd, WM_CHAR, (WPARAM)textA[1], 0); + ret = SendMessageA(hwnd, WM_CHAR, textA[1], 0); ok(!ret, "SendMessageA(WM_CHAR) should return 0, got %d\n", ret); expect_textA(hwnd, WM_GETTEXT, "te"); expect_textA(hwnd, EM_GETTEXTEX, "te"); @@ -5564,7 +5573,7 @@ ok(eventMaskEditHwnd != 0, "Failed to create edit window\n"); eventMask = ENM_CHANGE | ENM_UPDATE; - ret = SendMessage(eventMaskEditHwnd, EM_SETEVENTMASK, 0, (LPARAM) eventMask); + ret = SendMessage(eventMaskEditHwnd, EM_SETEVENTMASK, 0, eventMask); ok(ret == ENM_NONE, "wrong event mask\n"); ret = SendMessage(eventMaskEditHwnd, EM_GETEVENTMASK, 0, 0); ok(ret == eventMask, "failed to set event mask\n"); @@ -5615,6 +5624,7 @@ static int received_WM_NOTIFY = 0; static int modify_at_WM_NOTIFY = 0; +static BOOL filter_on_WM_NOTIFY = FALSE; static HWND hwndRichedit_WM_NOTIFY; static LRESULT WINAPI WM_NOTIFY_ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -5623,6 +5633,7 @@ { received_WM_NOTIFY = 1; modify_at_WM_NOTIFY = SendMessage(hwndRichedit_WM_NOTIFY, EM_GETMODIFY, 0, 0); + if (filter_on_WM_NOTIFY) return TRUE; } return DefWindowProcA(hwnd, message, wParam, lParam); } @@ -5632,6 +5643,7 @@ HWND parent; WNDCLASSA cls; CHARFORMAT2 cf2; + int sel_start, sel_end; /* register class to capture WM_NOTIFY */ cls.style = 0; @@ -5660,8 +5672,7 @@ ME_CommitUndo, which should check whether message should be sent */ received_WM_NOTIFY = 0; cf2.cbSize = sizeof(CHARFORMAT2); - SendMessage(hwndRichedit_WM_NOTIFY, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, - (LPARAM) &cf2); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf2); cf2.dwMask = CFM_ITALIC | cf2.dwMask; cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; SendMessage(hwndRichedit_WM_NOTIFY, EM_SETCHARFORMAT, 0, (LPARAM) &cf2); @@ -5693,6 +5704,29 @@ SendMessage(hwndRichedit_WM_NOTIFY, EM_REPLACESEL, FALSE, (LPARAM)"inserted"); ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, TRUE, 0); + + /* Test filtering key events. */ + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETSEL, 0, 0); + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETEVENTMASK, 0, ENM_KEYEVENTS); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + received_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, WM_KEYDOWN, VK_RIGHT, 0); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == 1 && sel_end == 1, + "selections is incorrectly at (%d,%d)\n", sel_start, sel_end); + filter_on_WM_NOTIFY = TRUE; + received_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, WM_KEYDOWN, VK_RIGHT, 0); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == 1 && sel_end == 1, + "selections is incorrectly at (%d,%d)\n", sel_start, sel_end); + + /* test with owner set to NULL */ + SetWindowLongPtr(hwndRichedit_WM_NOTIFY, GWLP_HWNDPARENT, 0); + SendMessage(hwndRichedit_WM_NOTIFY, WM_KEYDOWN, VK_RIGHT, 0); + SendMessage(hwndRichedit_WM_NOTIFY, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == 1 && sel_end == 1, + "selections is incorrectly at (%d,%d)\n", sel_start, sel_end); DestroyWindow(hwndRichedit_WM_NOTIFY); DestroyWindow(parent); @@ -5781,7 +5815,7 @@ SendMessage(hwnd, EM_EMPTYUNDOBUFFER, 0, 0); result = SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"abcd"); ok(result == TRUE, "Failed to set the text.\n"); - SendMessage(hwnd, EM_SETSEL, (WPARAM)1, (LPARAM)1); + SendMessage(hwnd, EM_SETSEL, 1, 1); SendMessage(hwnd, WM_KEYDOWN, VK_DELETE, 1); SendMessage(hwnd, WM_KEYUP, VK_DELETE, 1); SendMessage(hwnd, WM_KEYDOWN, VK_DELETE, 1); @@ -6540,7 +6574,7 @@ ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); /* Test how much the mouse wheel can zoom in and out. */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)490, (LPARAM)100); + ret = SendMessage(hwnd, EM_SETZOOM, 490, 100); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); hold_key(VK_CONTROL); @@ -6554,7 +6588,7 @@ ok(denominator == 100, "incorrect denominator is %d\n", denominator); ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)491, (LPARAM)100); + ret = SendMessage(hwnd, EM_SETZOOM, 491, 100); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); hold_key(VK_CONTROL); @@ -6568,7 +6602,7 @@ ok(denominator == 100, "incorrect denominator is %d\n", denominator); ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)20, (LPARAM)100); + ret = SendMessage(hwnd, EM_SETZOOM, 20, 100); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); hold_key(VK_CONTROL); @@ -6582,7 +6616,7 @@ ok(denominator == 100, "incorrect denominator is %d\n", denominator); ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)19, (LPARAM)100); + ret = SendMessage(hwnd, EM_SETZOOM, 19, 100); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); hold_key(VK_CONTROL); @@ -6597,7 +6631,7 @@ ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); /* Test how WM_SCROLLWHEEL treats our custom denominator. */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)50, (LPARAM)13); + ret = SendMessage(hwnd, EM_SETZOOM, 50, 13); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); hold_key(VK_CONTROL); @@ -6612,13 +6646,13 @@ ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); /* Test bounds checking on EM_SETZOOM */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)2, (LPARAM)127); + ret = SendMessage(hwnd, EM_SETZOOM, 2, 127); ok(ret == TRUE, "EM_SETZOOM rejected valid values (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)127, (LPARAM)2); + ret = SendMessage(hwnd, EM_SETZOOM, 127, 2); ok(ret == TRUE, "EM_SETZOOM rejected valid values (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)2, (LPARAM)128); + ret = SendMessage(hwnd, EM_SETZOOM, 2, 128); ok(ret == FALSE, "EM_SETZOOM accepted invalid values (%d).\n", ret); ret = SendMessage(hwnd, EM_GETZOOM, (WPARAM)&numerator, (LPARAM)&denominator); @@ -6626,15 +6660,15 @@ ok(denominator == 2, "incorrect denominator is %d\n", denominator); ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)128, (LPARAM)2); + ret = SendMessage(hwnd, EM_SETZOOM, 128, 2); ok(ret == FALSE, "EM_SETZOOM accepted invalid values (%d).\n", ret); /* See if negative numbers are accepted. */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)-100, (LPARAM)-100); + ret = SendMessage(hwnd, EM_SETZOOM, -100, -100); ok(ret == FALSE, "EM_SETZOOM accepted invalid values (%d).\n", ret); /* See if negative numbers are accepted. */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)0, (LPARAM)100); + ret = SendMessage(hwnd, EM_SETZOOM, 0, 100); ok(ret == FALSE, "EM_SETZOOM failed (%d).\n", ret); ret = SendMessage(hwnd, EM_GETZOOM, (WPARAM)&numerator, (LPARAM)&denominator); @@ -6643,10 +6677,334 @@ ok(ret == TRUE, "EM_GETZOOM failed (%d).\n", ret); /* Reset the zoom value */ - ret = SendMessage(hwnd, EM_SETZOOM, (WPARAM)0, (LPARAM)0); + ret = SendMessage(hwnd, EM_SETZOOM, 0, 0); ok(ret == TRUE, "EM_SETZOOM failed (%d).\n", ret); DestroyWindow(hwnd); +} + +struct dialog_mode_messages +{ + int wm_getdefid, wm_close, wm_nextdlgctl; +}; + +static struct dialog_mode_messages dm_messages; + +#define test_dm_messages(wmclose, wmgetdefid, wmnextdlgctl) \ + ok(dm_messages.wm_close == wmclose, "expected %d WM_CLOSE message, " \ + "got %d\n", wmclose, dm_messages.wm_close); \ + ok(dm_messages.wm_getdefid == wmgetdefid, "expected %d WM_GETDIFID message, " \ + "got %d\n", wmgetdefid, dm_messages.wm_getdefid);\ + ok(dm_messages.wm_nextdlgctl == wmnextdlgctl, "expected %d WM_NEXTDLGCTL message, " \ + "got %d\n", wmnextdlgctl, dm_messages.wm_nextdlgctl) + +static LRESULT CALLBACK dialog_mode_wnd_proc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) +{ + switch (iMsg) + { + case DM_GETDEFID: + dm_messages.wm_getdefid++; + return MAKELONG(ID_RICHEDITTESTDBUTTON, DC_HASDEFID); + case WM_NEXTDLGCTL: + dm_messages.wm_nextdlgctl++; + break; + case WM_CLOSE: + dm_messages.wm_close++; + break; + } + + return DefWindowProc(hwnd, iMsg, wParam, lParam); +} + +static void test_dialogmode(void) +{ + HWND hwRichEdit, hwParent, hwButton; + MSG msg= {0}; + int lcount, r; + WNDCLASSA cls; + + cls.style = 0; + cls.lpfnWndProc = dialog_mode_wnd_proc; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = "DialogModeParentClass"; + if(!RegisterClassA(&cls)) assert(0); + + hwParent = CreateWindow("DialogModeParentClass", NULL, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, 200, 120, NULL, NULL, GetModuleHandleA(0), NULL); + + /* Test richedit(ES_MULTILINE) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_MULTILINE, hwParent); + + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, 0); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(3 == lcount, "expected 3, got %d\n", lcount); + + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(3 == lcount, "expected 3, got %d\n", lcount); + + DestroyWindow(hwRichEdit); + + /* Test standalone richedit(ES_MULTILINE) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_MULTILINE, NULL); + + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + DestroyWindow(hwRichEdit); + + /* Check a destination for messages */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_MULTILINE, hwParent); + + SetWindowLong(hwRichEdit, GWL_STYLE, GetWindowLong(hwRichEdit, GWL_STYLE)& ~WS_POPUP); + SetParent( hwRichEdit, NULL); + + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 1, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 1); + + DestroyWindow(hwRichEdit); + + /* Check messages from richedit(ES_MULTILINE) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_MULTILINE, hwParent); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 1, 0); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 1); + + hwButton = CreateWindow("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, + 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL); + ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError()); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 1, 1); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + DestroyWindow(hwButton); + DestroyWindow(hwRichEdit); + + /* Check messages from richedit(ES_MULTILINE|ES_WANTRETURN) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_MULTILINE|ES_WANTRETURN, hwParent); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(2 == lcount, "expected 2, got %d\n", lcount); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8f == r, "expected 0x8f, got 0x%x\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(3 == lcount, "expected 3, got %d\n", lcount); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 1); + + hwButton = CreateWindow("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, + 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL); + ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError()); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + lcount = SendMessage(hwRichEdit, EM_GETLINECOUNT, 0, 0); + ok(4 == lcount, "expected 4, got %d\n", lcount); + + DestroyWindow(hwButton); + DestroyWindow(hwRichEdit); + + /* Check messages from richedit(0) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, 0, hwParent); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8b == r, "expected 0x8b, got 0x%x\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 1, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_ESCAPE, 0x10001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_TAB, 0xf0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 1); + + hwButton = CreateWindow("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, + 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL); + ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError()); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 1, 1); + + DestroyWindow(hwRichEdit); + + /* Check messages from richedit(ES_WANTRETURN) */ + + hwRichEdit = new_window(RICHEDIT_CLASS, ES_WANTRETURN, hwParent); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); + ok(0x8b == r, "expected 0x8b, got 0x%x\n", r); + test_dm_messages(0, 0, 0); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + hwButton = CreateWindow("BUTTON", "OK", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, + 100, 100, 50, 20, hwParent, (HMENU)ID_RICHEDITTESTDBUTTON, GetModuleHandleA(0), NULL); + ok(hwButton!=NULL, "CreateWindow failed with error code %d\n", GetLastError()); + + memset(&dm_messages, 0, sizeof(dm_messages)); + r = SendMessage(hwRichEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); + ok(0 == r, "expected 0, got %d\n", r); + test_dm_messages(0, 0, 0); + + DestroyWindow(hwRichEdit); + DestroyWindow(hwParent); } START_TEST( editor ) @@ -6705,6 +7063,7 @@ test_format_rect(); test_WM_GETDLGCODE(); test_zoom(); + test_dialogmode(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. Modified: trunk/rostests/winetests/riched20/txtsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/txtsrv…
============================================================================== --- trunk/rostests/winetests/riched20/txtsrv.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/txtsrv.c [iso-8859-1] Fri Mar 5 19:49:06 2010 @@ -667,6 +667,7 @@ ok(memcmp(rettext,settext,SysStringByteLen(rettext)) == 0, "String returned differs\n"); + SysFreeString(rettext); IUnknown_Release(txtserv); CoTaskMemFree(dummyTextHost); } @@ -739,6 +740,31 @@ CoTaskMemFree(dummyTextHost); } +static void test_TxDraw(void) +{ + HDC tmphdc = GetDC(NULL); + DWORD dwAspect = DVASPECT_CONTENT; + HDC hicTargetDev = NULL; /* Means "default" device */ + DVTARGETDEVICE *ptd = NULL; + void *pvAspect = NULL; + HRESULT result; + RECTL client = {0,0,100,100}; + + if (!init_texthost()) + return; + + todo_wine { + result = ITextServices_TxDraw(txtserv, dwAspect, 0, pvAspect, ptd, + tmphdc, hicTargetDev, &client, NULL, + NULL, NULL, 0, 0); + ok(result == S_OK, "TxDraw failed\n"); + } + + IUnknown_Release(txtserv); + CoTaskMemFree(dummyTextHost); + +} + START_TEST( txtsrv ) { setup_thiscall_wrappers(); @@ -756,6 +782,7 @@ test_TxGetText(); test_TxSetText(); test_TxGetNaturalSize(); + test_TxDraw(); } if (wrapperCodeMem) VirtualFree(wrapperCodeMem, 0, MEM_RELEASE); }
14 years, 9 months
1
0
0
0
[cwittich] 45885: [URLMON_WINETEST] sync urlmon_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:47:06 2010 New Revision: 45885 URL:
http://svn.reactos.org/svn/reactos?rev=45885&view=rev
Log: [URLMON_WINETEST] sync urlmon_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/urlmon/misc.c trunk/rostests/winetests/urlmon/protocol.c trunk/rostests/winetests/urlmon/sec_mgr.c trunk/rostests/winetests/urlmon/stream.c trunk/rostests/winetests/urlmon/url.c Modified: trunk/rostests/winetests/urlmon/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/misc.c?r…
============================================================================== --- trunk/rostests/winetests/urlmon/misc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/misc.c [iso-8859-1] Fri Mar 5 19:47:06 2010 @@ -270,6 +270,10 @@ static const WCHAR wszAbout[] = {'a','b','o','u','t',0}; static const WCHAR wszEmpty[] = {0}; +static const WCHAR wszWineHQ[] = {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR wszHttpWineHQ[] = {'h','t','t','p',':','/','/','w','w','w','.', + 'w','i','n','e','h','q','.','o','r','g',0}; + struct parse_test { LPCWSTR url; HRESULT secur_hres; @@ -277,15 +281,19 @@ HRESULT path_hres; LPCWSTR path; LPCWSTR schema; + LPCWSTR domain; + HRESULT domain_hres; + LPCWSTR rootdocument; + HRESULT rootdocument_hres; }; static const struct parse_test parse_tests[] = { - {url1, S_OK, url1, E_INVALIDARG, NULL, wszRes}, - {url2, E_FAIL, url2, E_INVALIDARG, NULL, wszEmpty}, - {url3, E_FAIL, url3, S_OK, path3, wszFile}, - {url4, E_FAIL, url4e, S_OK, path4, wszFile}, - {url5, E_FAIL, url5, E_INVALIDARG, NULL, wszHttp}, - {url6, S_OK, url6, E_INVALIDARG, NULL, wszAbout} + {url1, S_OK, url1, E_INVALIDARG, NULL, wszRes, NULL, E_FAIL, NULL, E_FAIL}, + {url2, E_FAIL, url2, E_INVALIDARG, NULL, wszEmpty, NULL, E_FAIL, NULL, E_FAIL}, + {url3, E_FAIL, url3, S_OK, path3, wszFile, wszEmpty, S_OK, NULL, E_FAIL}, + {url4, E_FAIL, url4e, S_OK, path4, wszFile, wszEmpty, S_OK, NULL, E_FAIL}, + {url5, E_FAIL, url5, E_INVALIDARG, NULL, wszHttp, wszWineHQ, S_OK, wszHttpWineHQ, S_OK}, + {url6, S_OK, url6, E_INVALIDARG, NULL, wszAbout, NULL, E_FAIL, NULL, E_FAIL}, }; static void test_CoInternetParseUrl(void) @@ -331,6 +339,23 @@ ok(hres == S_OK, "[%d] schema failed: %08x\n", i, hres); ok(size == lstrlenW(parse_tests[i].schema), "[%d] wrong size\n", i); ok(!lstrcmpW(parse_tests[i].schema, buf), "[%d] wrong schema\n", i); + + if(memcmp(parse_tests[i].url, wszRes, 3*sizeof(WCHAR)) + && memcmp(parse_tests[i].url, wszAbout, 5*sizeof(WCHAR))) { + memset(buf, 0xf0, sizeof(buf)); + hres = CoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf, + sizeof(buf)/sizeof(WCHAR), &size, 0); + ok(hres == parse_tests[i].domain_hres, "[%d] domain failed: %08x\n", i, hres); + if(parse_tests[i].domain) + ok(!lstrcmpW(parse_tests[i].domain, buf), "[%d] wrong domain, received %s\n", i, wine_dbgstr_w(buf)); + } + + memset(buf, 0xf0, sizeof(buf)); + hres = CoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf, + sizeof(buf)/sizeof(WCHAR), &size, 0); + ok(hres == parse_tests[i].rootdocument_hres, "[%d] rootdocument failed: %08x\n", i, hres); + if(parse_tests[i].rootdocument) + ok(!lstrcmpW(parse_tests[i].rootdocument, buf), "[%d] wrong rootdocument, received %s\n", i, wine_dbgstr_w(buf)); } } @@ -755,7 +780,19 @@ PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved) { - CHECK_EXPECT(ParseUrl); + CHECK_EXPECT2(ParseUrl); + + if(ParseAction == PARSE_SECURITY_URL) { + if(pcchResult) + *pcchResult = sizeof(url1)/sizeof(WCHAR); + + if(cchResult<sizeof(url1)/sizeof(WCHAR)) + return S_FALSE; + + memcpy(pwzResult, url1, sizeof(url1)); + return S_OK; + } + return E_NOTIMPL; } @@ -800,7 +837,7 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) { if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) { - CHECK_EXPECT(QI_IInternetProtocolInfo); + CHECK_EXPECT2(QI_IInternetProtocolInfo); ok(iface == expect_cf, "unexpected iface\n"); *ppv = &protocol_info; return qiret; @@ -871,6 +908,7 @@ { IInternetSession *session; WCHAR buf[200]; + LPWSTR sec_url; DWORD size; HRESULT hres; @@ -914,6 +952,34 @@ hres = CoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR), &size, 0); ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); + + CHECK_CALLED(QI_IInternetProtocolInfo); + CHECK_CALLED(ParseUrl); + + SET_EXPECT(QI_IInternetProtocolInfo); + SET_EXPECT(ParseUrl); + + hres = CoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf, + sizeof(buf)/sizeof(WCHAR), &size, 0); + ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); + ok(size == sizeof(url1)/sizeof(WCHAR), "Size = %d\n", size); + if(size == sizeof(url1)/sizeof(WCHAR)) + ok(!memcmp(buf, url1, sizeof(url1)), "Encoded url = %s\n", wine_dbgstr_w(buf)); + + CHECK_CALLED(QI_IInternetProtocolInfo); + CHECK_CALLED(ParseUrl); + + SET_EXPECT(QI_IInternetProtocolInfo); + SET_EXPECT(ParseUrl); + + hres = CoInternetGetSecurityUrl(url8, &sec_url, PSU_SECURITY_URL_ONLY, 0); + ok(hres == S_OK, "CoInternetGetSecurityUrl failed: %08x\n", hres); + if(hres == S_OK) { + ok(lstrlenW(sec_url)>sizeof(wszFile)/sizeof(WCHAR) && + !memcmp(sec_url, wszFile, sizeof(wszFile)-sizeof(WCHAR)), + "Encoded url = %s\n", wine_dbgstr_w(sec_url)); + CoTaskMemFree(sec_url); + } CHECK_CALLED(QI_IInternetProtocolInfo); CHECK_CALLED(ParseUrl); Modified: trunk/rostests/winetests/urlmon/protocol.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/protocol…
============================================================================== --- trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/protocol.c [iso-8859-1] Fri Mar 5 19:47:06 2010 @@ -131,7 +131,7 @@ static HRESULT expect_hrResult; static LPCWSTR file_name, http_url, expect_wsz; static IInternetProtocol *async_protocol = NULL; -static BOOL first_data_notif, http_is_first, http_post_test; +static BOOL first_data_notif, http_is_first, http_post_test, test_redirect; static int state = 0, prot_state, read_report_data; static DWORD bindf, ex_priority , pi; static IInternetProtocol *binding_protocol, *filtered_protocol; @@ -442,19 +442,23 @@ CLEAR_CALLED(ReportProgress_FINDINGRESOURCE); CLEAR_CALLED(ReportProgress_CONNECTING); CLEAR_CALLED(ReportProgress_PROXYDETECTING); - } else todo_wine { - CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); - /* IE7 does call this */ - CLEAR_CALLED(ReportProgress_CONNECTING); - } + }else if(test_redirect) { + CHECK_CALLED(ReportProgress_FINDINGRESOURCE); + }else todo_wine { + CHECK_NOT_CALLED(ReportProgress_FINDINGRESOURCE); + /* IE7 does call this */ + CLEAR_CALLED(ReportProgress_CONNECTING); + } } if(tested_protocol == FTP_TEST) todo_wine CHECK_CALLED(ReportProgress_SENDINGREQUEST); else if (tested_protocol != HTTPS_TEST) CHECK_CALLED(ReportProgress_SENDINGREQUEST); + if(test_redirect) + CHECK_CALLED(ReportProgress_REDIRECTING); if(tested_protocol == HTTP_TEST || tested_protocol == HTTPS_TEST) { SET_EXPECT(OnResponse); - if(tested_protocol == HTTPS_TEST) + if(tested_protocol == HTTPS_TEST || test_redirect) SET_EXPECT(ReportProgress_ACCEPTRANGES); SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); if(bindf & BINDF_NEEDFILE) @@ -478,6 +482,8 @@ CHECK_CALLED(OnResponse); if(tested_protocol == HTTPS_TEST) CHECK_CALLED(ReportProgress_ACCEPTRANGES); + else if(test_redirect) + CLEAR_CALLED(ReportProgress_ACCEPTRANGES); CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); if(bindf & BINDF_NEEDFILE) CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE); @@ -616,7 +622,10 @@ break; case BINDSTATUS_REDIRECTING: CHECK_EXPECT(ReportProgress_REDIRECTING); - ok(szStatusText == NULL, "szStatusText = %s\n", wine_dbgstr_w(szStatusText)); + if(test_redirect) + ok(!strcmp_wa(szStatusText, "
http://test.winehq.org/hello.html
"), "szStatusText = %s\n", wine_dbgstr_w(szStatusText)); + else + ok(szStatusText == NULL, "szStatusText = %s\n", wine_dbgstr_w(szStatusText)); break; case BINDSTATUS_ENCODING: CHECK_EXPECT(ReportProgress_ENCODING); @@ -1346,6 +1355,7 @@ "GetBindString(BINDSTRING_ACCEPT_MIMES) failed: %08x\n", hres); ok(fetched == 1, "fetched = %d, expected 1\n", fetched); ok(!strcmp_ww(acc_mimeW, accept_mimes[0]), "unexpected mimes %s\n", wine_dbgstr_w(accept_mimes[0])); + CoTaskMemFree(accept_mimes[0]); hres = IInternetBindInfo_QueryInterface(pOIBindInfo, &IID_IServiceProvider, (void**)&service_provider); @@ -1952,6 +1962,7 @@ #define TEST_POST 0x10 #define TEST_EMULATEPROT 0x20 #define TEST_SHORT_READ 0x40 +#define TEST_REDIRECT 0x80 static void init_test(int prot, DWORD flags) { @@ -1977,6 +1988,7 @@ emulate_prot = (flags & TEST_EMULATEPROT) != 0; wait_for_switch = TRUE; short_read = (flags & TEST_SHORT_READ) != 0; + test_redirect = (flags & TEST_REDIRECT) != 0; } static void test_priority(IInternetProtocol *protocol) @@ -2429,6 +2441,8 @@ SET_EXPECT(ReportProgress_FINDINGRESOURCE); SET_EXPECT(ReportProgress_CONNECTING); SET_EXPECT(ReportProgress_SENDINGREQUEST); + if(test_redirect) + SET_EXPECT(ReportProgress_REDIRECTING); SET_EXPECT(ReportProgress_PROXYDETECTING); if(prot == HTTP_TEST) SET_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); @@ -2516,6 +2530,9 @@ {'h','t','t','p',':','/','/','c','r','o','s','s','o','v','e','r','.', 'c','o','d','e','w','e','a','v','e','r','s','.','c','o','m','/', 'p','o','s','t','t','e','s','t','.','p','h','p',0}; + static const WCHAR redirect_url[] = + {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/', + 't','e','s','t','r','e','d','i','r','e','c','t',0}; trace("Testing http protocol (not from urlmon)...\n"); bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; @@ -2538,6 +2555,10 @@ trace("Testing http protocol (direct read)...\n"); bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON; test_http_protocol_url(winehq_url, HTTP_TEST, TEST_DIRECT_READ); + + trace("Testing http protocol (redirected)...\n"); + bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA | BINDF_FROMURLMON; + test_http_protocol_url(redirect_url, HTTP_TEST, TEST_REDIRECT); } static void test_https_protocol(void) Modified: trunk/rostests/winetests/urlmon/sec_mgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/sec_mgr.…
============================================================================== --- trunk/rostests/winetests/urlmon/sec_mgr.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/sec_mgr.c [iso-8859-1] Fri Mar 5 19:47:06 2010 @@ -91,6 +91,15 @@ {url7, 3, S_OK, sizeof(secid7), secid7, S_OK} }; +static int strcmp_w(const WCHAR *str1, const WCHAR *str2) +{ + DWORD len1 = lstrlenW(str1); + DWORD len2 = lstrlenW(str2); + + if(len1!=len2) return 1; + return memcmp(str1, str2, len1*sizeof(WCHAR)); +} + static void test_SecurityManager(void) { int i; @@ -605,11 +614,69 @@ ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); } +static void test_InternetSecurityMarshalling(void) +{ + IInternetSecurityManager *secmgr = NULL; + IUnknown *unk; + IStream *stream; + HRESULT hres; + + hres = CoInternetCreateSecurityManager(NULL, &secmgr, 0); + if(FAILED(hres)) + return; + + hres = IInternetSecurityManager_QueryInterface(secmgr, &IID_IUnknown, (void**)&unk); + ok(hres == S_OK, "QueryInterface returned: %08x\n", hres); + + hres = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hres == S_OK, "CreateStreamOnHGlobal returned: %08x\n", hres); + + hres = CoMarshalInterface(stream, &IID_IInternetSecurityManager, unk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hres == S_OK, "CoMarshalInterface returned: %08x\n", hres); + + IStream_Release(stream); + IUnknown_Release(unk); + IInternetSecurityManager_Release(secmgr); +} + +static void test_InternetGetSecurityUrl(void) +{ + const WCHAR url5_out[] = {'h','t','t','p',':','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; + const WCHAR url7_out[] = {'f','t','p',':','w','i','n','e','h','q','.','o','r','g',0}; + + const WCHAR *in[] = {url2, url3, url4, url5, url7, url8, url9, url10}; + const WCHAR *out_default[] = {url2, url3, url4, url5_out, url7_out, url8, url5_out, url10}; + const WCHAR *out_securl[] = {url2, url3, url4, url5, url7, url8, url9, url10}; + + WCHAR *sec; + DWORD i; + HRESULT hres; + + for(i=0; i<sizeof(in)/sizeof(WCHAR*); i++) { + hres = CoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0); + ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres); + if(hres == S_OK) { + ok(!strcmp_w(sec, out_default[i]), "(%d) Got %s, expected %s\n", + i, wine_dbgstr_w(sec), wine_dbgstr_w(out_default[i])); + CoTaskMemFree(sec); + } + + hres = CoInternetGetSecurityUrl(in[i], &sec, PSU_SECURITY_URL_ONLY, 0); + ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres); + if(hres == S_OK) { + ok(!strcmp_w(sec, out_securl[i]), "(%d) Got %s, expected %s\n", + i, wine_dbgstr_w(sec), wine_dbgstr_w(out_securl[i])); + CoTaskMemFree(sec); + } + } +} + START_TEST(sec_mgr) { OleInitialize(NULL); + test_InternetGetSecurityUrl(); test_SecurityManager(); test_polices(); test_CoInternetCreateZoneManager(); @@ -617,6 +684,7 @@ test_GetZoneActionPolicy(); test_GetZoneAt(); test_GetZoneAttributes(); + test_InternetSecurityMarshalling(); OleUninitialize(); } Modified: trunk/rostests/winetests/urlmon/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/stream.c…
============================================================================== --- trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/stream.c [iso-8859-1] Fri Mar 5 19:47:06 2010 @@ -299,8 +299,11 @@ hr = URLOpenBlockingStreamW(NULL, NULL, &pStream, 0, &BindStatusCallback); ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x\n", hr); - hr = URLOpenBlockingStreamW(NULL, INDEX_HTML, NULL, 0, &BindStatusCallback); - ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x\n", hr); + if (0) /* crashes on Win2k */ + { + hr = URLOpenBlockingStreamW(NULL, INDEX_HTML, NULL, 0, &BindStatusCallback); + ok(hr == E_INVALIDARG, "URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x\n", hr); + } SET_EXPECT(GetBindInfo); SET_EXPECT(QueryInterface_IServiceProvider); Modified: trunk/rostests/winetests/urlmon/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/urlmon/url.c?re…
============================================================================== --- trunk/rostests/winetests/urlmon/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/urlmon/url.c [iso-8859-1] Fri Mar 5 19:47:06 2010 @@ -100,6 +100,7 @@ DEFINE_EXPECT(OnStartBinding); DEFINE_EXPECT(OnProgress_FINDINGRESOURCE); DEFINE_EXPECT(OnProgress_CONNECTING); +DEFINE_EXPECT(OnProgress_REDIRECTING); DEFINE_EXPECT(OnProgress_SENDINGREQUEST); DEFINE_EXPECT(OnProgress_MIMETYPEAVAILABLE); DEFINE_EXPECT(OnProgress_BEGINDOWNLOADDATA); @@ -121,6 +122,7 @@ DEFINE_EXPECT(Obj_OnProgress_ENDSYNCOPERATION); DEFINE_EXPECT(Obj_OnProgress_FINDINGRESOURCE); DEFINE_EXPECT(Obj_OnProgress_CONNECTING); +DEFINE_EXPECT(Obj_OnProgress_REDIRECTING); DEFINE_EXPECT(Obj_OnProgress_CACHEFILENAMEAVAILABLE); DEFINE_EXPECT(Start); DEFINE_EXPECT(Read); @@ -181,6 +183,7 @@ static HANDLE complete_event, complete_event2; static HRESULT binding_hres; static BOOL have_IHttpNegotiate2, use_bscex; +static BOOL test_redirect; static LPCWSTR urls[] = { WINE_ABOUT_URL, @@ -380,12 +383,26 @@ SET_EXPECT(OnProgress_SENDINGREQUEST); hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_SENDINGREQUEST, NULL); - ok(hres == S_OK, "ReportProxgress failed: %08x\n", hres); + ok(hres == S_OK, "ReportProgress failed: %08x\n", hres); WaitForSingleObject(complete_event, INFINITE); if(bind_to_object) CHECK_CALLED(Obj_OnProgress_SENDINGREQUEST); else CHECK_CALLED(OnProgress_SENDINGREQUEST); + + if(test_redirect) { + if(bind_to_object) + SET_EXPECT(Obj_OnProgress_REDIRECTING); + else + SET_EXPECT(OnProgress_REDIRECTING); + hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_REDIRECTING, WINE_ABOUT_URL); + ok(hres == S_OK, "ReportProgress(BINDSTATUS_REFIRECTING) failed: %08x\n", hres); + WaitForSingleObject(complete_event, INFINITE); + if(bind_to_object) + CHECK_CALLED(Obj_OnProgress_REDIRECTING); + else + CHECK_CALLED(OnProgress_REDIRECTING); + } test_switch_fail(); @@ -773,7 +790,7 @@ IHttpNegotiate_Release(http_negotiate); ok(hres == S_OK, "OnResponse failed: %08x\n", hres); - if(test_protocol == HTTPS_TEST) { + if(test_protocol == HTTPS_TEST || test_redirect) { hres = IInternetProtocolSink_ReportProgress(protocol_sink, BINDSTATUS_ACCEPTRANGES, NULL); ok(hres == S_OK, "ReportProgress(BINDSTATUS_ACCEPTRANGES) failed: %08x\n", hres); } @@ -1273,6 +1290,16 @@ else CHECK_EXPECT(OnProgress_CONNECTING); if((bindf & BINDF_ASYNCHRONOUS) && emulate_protocol) + SetEvent(complete_event); + break; + case BINDSTATUS_REDIRECTING: + if(iface == &objbsc) + CHECK_EXPECT(Obj_OnProgress_REDIRECTING); + else + CHECK_EXPECT(OnProgress_REDIRECTING); + ok(!lstrcmpW(szStatusText, WINE_ABOUT_URL), "unexpected status text %s\n", + wine_dbgstr_w(szStatusText)); + if(!bind_to_object || iface == &objbsc) SetEvent(complete_event); break; case BINDSTATUS_SENDINGREQUEST: @@ -1700,6 +1727,8 @@ SET_EXPECT(QueryInterface_IBindStatusCallbackEx); SET_EXPECT(GetBindInfo); SET_EXPECT(OnStartBinding); + if(test_redirect) + SET_EXPECT(OnProgress_REDIRECTING); SET_EXPECT(OnProgress_BEGINDOWNLOADDATA); if(test_protocol == FILE_TEST) SET_EXPECT(OnProgress_CACHEFILENAMEAVAILABLE); @@ -1716,6 +1745,8 @@ CLEAR_CALLED(QueryInterface_IBindStatusCallbackEx); /* IE 8 */ CHECK_CALLED(GetBindInfo); CHECK_CALLED(OnStartBinding); + if(test_redirect) + CHECK_CALLED(OnProgress_REDIRECTING); CHECK_CALLED(OnProgress_BEGINDOWNLOADDATA); if(test_protocol == FILE_TEST) CHECK_CALLED(OnProgress_CACHEFILENAMEAVAILABLE); @@ -2184,9 +2215,11 @@ return ret; } -#define BINDTEST_EMULATE 1 -#define BINDTEST_TOOBJECT 2 -#define BINDTEST_FILEDWLAPI 4 +#define BINDTEST_EMULATE 0x0001 +#define BINDTEST_TOOBJECT 0x0002 +#define BINDTEST_FILEDWLAPI 0x0004 +#define BINDTEST_HTTPRESPONSE 0x0008 +#define BINDTEST_REDIRECT 0x0010 static void init_bind_test(int protocol, DWORD flags, DWORD t) { @@ -2201,9 +2234,14 @@ bind_to_object = (flags & BINDTEST_TOOBJECT) != 0; tymed = t; filedwl_api = (flags & BINDTEST_FILEDWLAPI) != 0; -} - -static void test_BindToStorage(int protocol, BOOL emul, DWORD t) + if(flags & BINDTEST_HTTPRESPONSE) + urls[HTTP_TEST] = SHORT_RESPONSE_URL; + else + urls[HTTP_TEST] = WINE_ABOUT_URL; + test_redirect = (flags & BINDTEST_REDIRECT) != 0; +} + +static void test_BindToStorage(int protocol, DWORD flags, DWORD t) { IMoniker *mon; HRESULT hres; @@ -2214,7 +2252,7 @@ IUnknown *unk = (IUnknown*)0x00ff00ff; IBinding *bind; - init_bind_test(protocol, emul ? BINDTEST_EMULATE : 0, t); + init_bind_test(protocol, flags, t); SET_EXPECT(QueryInterface_IServiceProvider); hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx); @@ -2396,7 +2434,7 @@ http_is_first = FALSE; } -static void test_BindToObject(int protocol, BOOL emul) +static void test_BindToObject(int protocol, DWORD flags) { IMoniker *mon; HRESULT hres; @@ -2407,9 +2445,9 @@ IUnknown *unk = (IUnknown*)0x00ff00ff; IBinding *bind; - init_bind_test(protocol, BINDTEST_TOOBJECT | (emul ? BINDTEST_EMULATE : 0), TYMED_ISTREAM); - - if(emul) + init_bind_test(protocol, BINDTEST_TOOBJECT|flags, TYMED_ISTREAM); + + if(emulate_protocol) CoRegisterClassObject(&CLSID_HTMLDocument, (IUnknown *)&mime_cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®id); @@ -2500,14 +2538,14 @@ }else { ok(hres == S_OK, "IMoniker_BindToStorage failed: %08x\n", hres); ok(unk != NULL, "unk == NULL\n"); - if(emul) + if(emulate_protocol) ok(unk == (IUnknown*)&PersistMoniker, "unk != PersistMoniker\n"); } if(unk) IUnknown_Release(unk); while((bindf & BINDF_ASYNCHRONOUS) && - !((!emul || stopped_binding) && stopped_obj_binding) && GetMessage(&msg,NULL,0,0)) { + !((!emulate_protocol || stopped_binding) && stopped_obj_binding) && GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } @@ -2571,7 +2609,7 @@ CHECK_CALLED(Obj_OnStopBinding); } - if(test_protocol != HTTP_TEST || emul || urls[test_protocol] == SHORT_RESPONSE_URL || !(bindf & BINDF_ASYNCHRONOUS)) { + if(test_protocol != HTTP_TEST || emulate_protocol || !(bindf & BINDF_ASYNCHRONOUS)) { ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); }else { @@ -2579,7 +2617,7 @@ IBindCtx_Release(bctx); } - if(emul) + if(emulate_protocol) CoRevokeClassObject(regid); if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST) @@ -2612,6 +2650,7 @@ SET_EXPECT(QueryInterface_IHttpNegotiate2); SET_EXPECT(GetRootSecurityId); SET_EXPECT(QueryInterface_IWindowForBindingUI); + SET_EXPECT(OnProgress_CONNECTING); } if(test_protocol == HTTP_TEST || test_protocol == HTTPS_TEST || test_protocol == FILE_TEST) SET_EXPECT(OnProgress_SENDINGREQUEST); @@ -2655,6 +2694,7 @@ CHECK_CALLED(GetRootSecurityId); } CLEAR_CALLED(QueryInterface_IWindowForBindingUI); + CLEAR_CALLED(OnProgress_CONNECTING); } if(test_protocol == FILE_TEST) CHECK_CALLED(OnProgress_SENDINGREQUEST); @@ -2821,40 +2861,8 @@ IMoniker_Release(mon); } -static void gecko_installer_workaround(BOOL disable) -{ - HKEY hkey; - DWORD res; - - static BOOL has_url = FALSE; - static char url[2048]; - - if(!disable && !has_url) - return; - - res = RegOpenKey(HKEY_CURRENT_USER, "Software\\Wine\\MSHTML", &hkey); - if(res != ERROR_SUCCESS) - return; - - if(disable) { - DWORD type, size = sizeof(url); - - res = RegQueryValueEx(hkey, "GeckoUrl", NULL, &type, (PVOID)url, &size); - if(res == ERROR_SUCCESS && type == REG_SZ) - has_url = TRUE; - - RegDeleteValue(hkey, "GeckoUrl"); - }else { - RegSetValueEx(hkey, "GeckoUrl", 0, REG_SZ, (PVOID)url, lstrlenA(url)+1); - } - - RegCloseKey(hkey); -} - START_TEST(url) { - gecko_installer_workaround(TRUE); - complete_event = CreateEvent(NULL, FALSE, FALSE, NULL); complete_event2 = CreateEvent(NULL, FALSE, FALSE, NULL); thread_id = GetCurrentThreadId(); @@ -2874,7 +2882,7 @@ test_BindToStorage_fail(); trace("synchronous http test (COM not initialised)...\n"); - test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); CoInitialize(NULL); @@ -2882,95 +2890,100 @@ test_StdURLMoniker(); trace("synchronous http test...\n"); - test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); trace("synchronous http test (to object)...\n"); - test_BindToObject(HTTP_TEST, FALSE); + test_BindToObject(HTTP_TEST, 0); trace("synchronous file test...\n"); - test_BindToStorage(FILE_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM); trace("synchronous file test (to object)...\n"); - test_BindToObject(FILE_TEST, FALSE); + test_BindToObject(FILE_TEST, 0); bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA; trace("http test...\n"); - test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, 0, TYMED_ISTREAM); trace("http test (to file)...\n"); - test_BindToStorage(HTTP_TEST, FALSE, TYMED_FILE); + test_BindToStorage(HTTP_TEST, 0, TYMED_FILE); trace("http test (to object)...\n"); - test_BindToObject(HTTP_TEST, FALSE); + test_BindToObject(HTTP_TEST, 0); trace("http test (short response)...\n"); http_is_first = TRUE; - urls[HTTP_TEST] = SHORT_RESPONSE_URL; - test_BindToStorage(HTTP_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_HTTPRESPONSE, TYMED_ISTREAM); trace("http test (short response, to object)...\n"); - test_BindToObject(HTTP_TEST, FALSE); + test_BindToObject(HTTP_TEST, 0); trace("emulated http test...\n"); - test_BindToStorage(HTTP_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("emulated http test (to object)...\n"); - test_BindToObject(HTTP_TEST, TRUE); + test_BindToObject(HTTP_TEST, BINDTEST_EMULATE); + + trace("emulated http test (to object, redirect)...\n"); + test_BindToObject(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT); trace("emulated http test (to file)...\n"); - test_BindToStorage(HTTP_TEST, TRUE, TYMED_FILE); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE, TYMED_FILE); + + trace("emulated http test (redirect)...\n"); + test_BindToStorage(HTTP_TEST, BINDTEST_EMULATE|BINDTEST_REDIRECT, TYMED_ISTREAM); trace("asynchronous https test...\n"); - test_BindToStorage(HTTPS_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, 0, TYMED_ISTREAM); trace("emulated https test...\n"); - test_BindToStorage(HTTPS_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(HTTPS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("about test...\n"); - test_BindToStorage(ABOUT_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(ABOUT_TEST, 0, TYMED_ISTREAM); trace("about test (to file)...\n"); - test_BindToStorage(ABOUT_TEST, FALSE, TYMED_FILE); + test_BindToStorage(ABOUT_TEST, 0, TYMED_FILE); trace("about test (to object)...\n"); - test_BindToObject(ABOUT_TEST, FALSE); + test_BindToObject(ABOUT_TEST, 0); trace("emulated about test...\n"); - test_BindToStorage(ABOUT_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("emulated about test (to file)...\n"); - test_BindToStorage(ABOUT_TEST, TRUE, TYMED_FILE); + test_BindToStorage(ABOUT_TEST, BINDTEST_EMULATE, TYMED_FILE); trace("emulated about test (to object)...\n"); - test_BindToObject(ABOUT_TEST, TRUE); + test_BindToObject(ABOUT_TEST, BINDTEST_EMULATE); trace("file test...\n"); - test_BindToStorage(FILE_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, 0, TYMED_ISTREAM); trace("file test (to file)...\n"); - test_BindToStorage(FILE_TEST, FALSE, TYMED_FILE); + test_BindToStorage(FILE_TEST, 0, TYMED_FILE); trace("file test (to object)...\n"); - test_BindToObject(FILE_TEST, FALSE); + test_BindToObject(FILE_TEST, 0); trace("emulated file test...\n"); - test_BindToStorage(FILE_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("emulated file test (to file)...\n"); - test_BindToStorage(FILE_TEST, TRUE, TYMED_FILE); + test_BindToStorage(FILE_TEST, BINDTEST_EMULATE, TYMED_FILE); trace("emulated file test (to object)...\n"); - test_BindToObject(FILE_TEST, TRUE); + test_BindToObject(FILE_TEST, BINDTEST_EMULATE); trace("emulated its test...\n"); - test_BindToStorage(ITS_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("emulated its test (to file)...\n"); - test_BindToStorage(ITS_TEST, TRUE, TYMED_FILE); + test_BindToStorage(ITS_TEST, BINDTEST_EMULATE, TYMED_FILE); trace("emulated mk test...\n"); - test_BindToStorage(MK_TEST, TRUE, TYMED_ISTREAM); + test_BindToStorage(MK_TEST, BINDTEST_EMULATE, TYMED_ISTREAM); trace("test URLDownloadToFile for file protocol...\n"); test_URLDownloadToFile(FILE_TEST, FALSE); @@ -2984,7 +2997,7 @@ bindf |= BINDF_NOWRITECACHE; trace("ftp test...\n"); - test_BindToStorage(FTP_TEST, FALSE, TYMED_ISTREAM); + test_BindToStorage(FTP_TEST, 0, TYMED_ISTREAM); trace("test failures...\n"); test_BindToStorage_fail(); @@ -2994,6 +3007,4 @@ CloseHandle(complete_event); CloseHandle(complete_event2); CoUninitialize(); - - gecko_installer_workaround(FALSE); -} +}
14 years, 9 months
1
0
0
0
[cwittich] 45884: add dsound_winetest to build
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:45:24 2010 New Revision: 45884 URL:
http://svn.reactos.org/svn/reactos?rev=45884&view=rev
Log: add dsound_winetest to build Modified: trunk/rostests/winetests/directory.rbuild Modified: trunk/rostests/winetests/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/directory.rbuil…
============================================================================== --- trunk/rostests/winetests/directory.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/directory.rbuild [iso-8859-1] Fri Mar 5 19:45:24 2010 @@ -37,6 +37,9 @@ <directory name="dnsapi"> <xi:include href="dnsapi/dnsapi.rbuild" /> </directory> + <directory name="dsound"> + <xi:include href="dsound/dsound.rbuild" /> + </directory> <directory name="fusion"> <xi:include href="fusion/fusion.rbuild" /> </directory>
14 years, 9 months
1
0
0
0
[cwittich] 45883: [DSOUND_WINETEST] sync dsound_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:44:59 2010 New Revision: 45883 URL:
http://svn.reactos.org/svn/reactos?rev=45883&view=rev
Log: [DSOUND_WINETEST] sync dsound_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/dsound/ds3d.c trunk/rostests/winetests/dsound/dsound.c trunk/rostests/winetests/dsound/dsound8.c trunk/rostests/winetests/dsound/propset.c Modified: trunk/rostests/winetests/dsound/ds3d.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dsound/ds3d.c?r…
============================================================================== --- trunk/rostests/winetests/dsound/ds3d.c [iso-8859-1] (original) +++ trunk/rostests/winetests/dsound/ds3d.c [iso-8859-1] Fri Mar 5 19:44:59 2010 @@ -1158,13 +1158,12 @@ "to create a 3D primary buffer: %08x\n",rc); if (rc==DS_OK && primary!=NULL) { LPDIRECTSOUND3DLISTENER listener=NULL; + LPDIRECTSOUNDBUFFER temp_buffer=NULL; rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSound3DListener,(void **)&listener); ok(rc==DS_OK && listener!=NULL,"IDirectSoundBuffer_QueryInterface() " "failed to get a 3D listener: %08x\n",rc); if (rc==DS_OK && listener!=NULL) { - LPDIRECTSOUNDBUFFER temp_buffer=NULL; - /* Checking the COM interface */ rc=IDirectSoundBuffer_QueryInterface(primary, &IID_IDirectSoundBuffer,(LPVOID *)&temp_buffer); @@ -1195,12 +1194,32 @@ winetest_interactive && !(dscaps.dwFlags & DSCAPS_EMULDRIVER),1.0,0, listener,0,0,FALSE,0); + + todo_wine { + temp_buffer = NULL; + rc=IDirectSound3DListener_QueryInterface(listener, + &IID_IKsPropertySet,(LPVOID *)&temp_buffer); + ok(rc==DS_OK && temp_buffer!=NULL, + "IDirectSound3DListener_QueryInterface didn't handle IKsPropertySet: ret = %08x\n", rc); + if(temp_buffer) + IKsPropertySet_Release(temp_buffer); + } } /* Testing the reference counting */ ref=IDirectSound3DListener_Release(listener); ok(ref==0,"IDirectSound3DListener_Release() listener has %d " "references, should have 0\n",ref); + } + + todo_wine { + temp_buffer = NULL; + rc=IDirectSoundBuffer_QueryInterface(primary, + &IID_IKsPropertySet,(LPVOID *)&temp_buffer); + ok(rc==DS_OK && temp_buffer!=NULL, + "IDirectSoundBuffer_QueryInterface didn't handle IKsPropertySet on primary buffer: ret = %08x\n", rc); + if(temp_buffer) + IKsPropertySet_Release(temp_buffer); } /* Testing the reference counting */ Modified: trunk/rostests/winetests/dsound/dsound.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dsound/dsound.c…
============================================================================== --- trunk/rostests/winetests/dsound/dsound.c [iso-8859-1] (original) +++ trunk/rostests/winetests/dsound/dsound.c [iso-8859-1] Fri Mar 5 19:44:59 2010 @@ -55,7 +55,7 @@ IUnknown * unknown; IDirectSound * ds; IDirectSound8 * ds8; - DWORD speaker_config, new_speaker_config; + DWORD speaker_config, new_speaker_config, ref_speaker_config; /* Try to Query for objects */ rc=IDirectSound_QueryInterface(dso,&IID_IUnknown,(LPVOID*)&unknown); @@ -144,11 +144,17 @@ rc=IDirectSound_GetSpeakerConfig(dso,&speaker_config); ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08x\n", rc); + ref_speaker_config = speaker_config; speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); - rc=IDirectSound_SetSpeakerConfig(dso,speaker_config); - ok(rc==DS_OK,"IDirectSound_SetSpeakerConfig() failed: %08x\n", rc); + if (speaker_config == ref_speaker_config) + speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, + DSSPEAKER_GEOMETRY_NARROW); + if(rc==DS_OK) { + rc=IDirectSound_SetSpeakerConfig(dso,speaker_config); + ok(rc==DS_OK,"IDirectSound_SetSpeakerConfig() failed: %08x\n", rc); + } if (rc==DS_OK) { rc=IDirectSound_GetSpeakerConfig(dso,&new_speaker_config); ok(rc==DS_OK,"IDirectSound_GetSpeakerConfig() failed: %08x\n", rc); @@ -156,6 +162,7 @@ trace("IDirectSound_GetSpeakerConfig() failed to set speaker " "config: expected 0x%08x, got 0x%08x\n", speaker_config,new_speaker_config); + IDirectSound_SetSpeakerConfig(dso,ref_speaker_config); } EXIT: Modified: trunk/rostests/winetests/dsound/dsound8.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dsound/dsound8.…
============================================================================== --- trunk/rostests/winetests/dsound/dsound8.c [iso-8859-1] (original) +++ trunk/rostests/winetests/dsound/dsound8.c [iso-8859-1] Fri Mar 5 19:44:59 2010 @@ -54,7 +54,7 @@ IUnknown * unknown; IDirectSound * ds; IDirectSound8 * ds8; - DWORD speaker_config, new_speaker_config; + DWORD speaker_config, new_speaker_config, ref_speaker_config; DWORD certified; /* Try to Query for objects */ @@ -148,11 +148,17 @@ rc=IDirectSound8_GetSpeakerConfig(dso,&speaker_config); ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08x\n", rc); + ref_speaker_config = speaker_config; speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); - rc=IDirectSound8_SetSpeakerConfig(dso,speaker_config); - ok(rc==DS_OK,"IDirectSound8_SetSpeakerConfig() failed: %08x\n", rc); + if (speaker_config == ref_speaker_config) + speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, + DSSPEAKER_GEOMETRY_NARROW); + if(rc==DS_OK) { + rc=IDirectSound8_SetSpeakerConfig(dso,speaker_config); + ok(rc==DS_OK,"IDirectSound8_SetSpeakerConfig() failed: %08x\n", rc); + } if (rc==DS_OK) { rc=IDirectSound8_GetSpeakerConfig(dso,&new_speaker_config); ok(rc==DS_OK,"IDirectSound8_GetSpeakerConfig() failed: %08x\n", rc); @@ -160,6 +166,7 @@ trace("IDirectSound8_GetSpeakerConfig() failed to set speaker " "config: expected 0x%08x, got 0x%08x\n", speaker_config,new_speaker_config); + IDirectSound8_SetSpeakerConfig(dso,ref_speaker_config); } rc=IDirectSound8_VerifyCertification(dso, &certified); Modified: trunk/rostests/winetests/dsound/propset.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dsound/propset.…
============================================================================== --- trunk/rostests/winetests/dsound/propset.c [iso-8859-1] (original) +++ trunk/rostests/winetests/dsound/propset.c [iso-8859-1] Fri Mar 5 19:44:59 2010 @@ -550,6 +550,7 @@ NULL, 0, &data, sizeof(data), &bytes); ok(rc==DS_OK, "Couldn't enumerate: 0x%x\n",rc); } + IKsPropertySet_Release(pps); } static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
14 years, 9 months
1
0
0
0
[cwittich] 45882: [MAPI32_WINETEST] sync mapi32_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:41:30 2010 New Revision: 45882 URL:
http://svn.reactos.org/svn/reactos?rev=45882&view=rev
Log: [MAPI32_WINETEST] sync mapi32_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/mapi32/imalloc.c trunk/rostests/winetests/mapi32/prop.c trunk/rostests/winetests/mapi32/util.c Modified: trunk/rostests/winetests/mapi32/imalloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/imalloc.…
============================================================================== --- trunk/rostests/winetests/mapi32/imalloc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/imalloc.c [iso-8859-1] Fri Mar 5 19:41:30 2010 @@ -45,11 +45,18 @@ pMAPIGetDefaultMalloc = (void*)GetProcAddress(hMapi32, "MAPIGetDefaultMalloc@0"); if (!pMAPIGetDefaultMalloc) + { + win_skip("MAPIGetDefaultMalloc is not available\n"); return; + } lpMalloc = pMAPIGetDefaultMalloc(); + ok(lpMalloc != NULL, "Expected MAPIGetDefaultMalloc to return non-NULL\n"); if (!lpMalloc) + { + skip("MAPIGetDefaultMalloc failed\n"); return; + } lpVoid = NULL; hRet = IMalloc_QueryInterface(lpMalloc, &IID_IUnknown, &lpVoid); Modified: trunk/rostests/winetests/mapi32/prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/prop.c?r…
============================================================================== --- trunk/rostests/winetests/mapi32/prop.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/prop.c [iso-8859-1] Fri Mar 5 19:41:30 2010 @@ -32,6 +32,7 @@ static HMODULE hMapi32 = 0; static SCODE (WINAPI *pScInitMapiUtil)(ULONG); +static void (WINAPI *pDeinitMapiUtil)(void); static SCODE (WINAPI *pPropCopyMore)(LPSPropValue,LPSPropValue,ALLOCATEMORE*,LPVOID); static ULONG (WINAPI *pUlPropSize)(LPSPropValue); static BOOL (WINAPI *pFPropContainsProp)(LPSPropValue,LPSPropValue,ULONG); @@ -53,26 +54,49 @@ FREEBUFFER*,LPVOID,LPPROPDATA*); static SCODE (WINAPI *pMAPIAllocateBuffer)(ULONG, LPVOID); static SCODE (WINAPI *pMAPIAllocateMore)(ULONG, LPVOID, LPVOID); +static SCODE (WINAPI *pMAPIInitialize)(LPVOID); static SCODE (WINAPI *pMAPIFreeBuffer)(LPVOID); +static void (WINAPI *pMAPIUninitialize)(void); static BOOL InitFuncPtrs(void) { hMapi32 = LoadLibraryA("mapi32.dll"); + pPropCopyMore = (void*)GetProcAddress(hMapi32, "PropCopyMore@16"); + pUlPropSize = (void*)GetProcAddress(hMapi32, "UlPropSize@4"); + pFPropContainsProp = (void*)GetProcAddress(hMapi32, "FPropContainsProp@12"); + pFPropCompareProp = (void*)GetProcAddress(hMapi32, "FPropCompareProp@12"); + pLPropCompareProp = (void*)GetProcAddress(hMapi32, "LPropCompareProp@8"); + pPpropFindProp = (void*)GetProcAddress(hMapi32, "PpropFindProp@12"); + pScCountProps = (void*)GetProcAddress(hMapi32, "ScCountProps@12"); + pScCopyProps = (void*)GetProcAddress(hMapi32, "ScCopyProps@16"); + pScRelocProps = (void*)GetProcAddress(hMapi32, "ScRelocProps@20"); + pLpValFindProp = (void*)GetProcAddress(hMapi32, "LpValFindProp@12"); + pFBadRglpszA = (void*)GetProcAddress(hMapi32, "FBadRglpszA@8"); + pFBadRglpszW = (void*)GetProcAddress(hMapi32, "FBadRglpszW@8"); + pFBadRowSet = (void*)GetProcAddress(hMapi32, "FBadRowSet@4"); + pFBadPropTag = (void*)GetProcAddress(hMapi32, "FBadPropTag@4"); + pFBadRow = (void*)GetProcAddress(hMapi32, "FBadRow@4"); + pFBadProp = (void*)GetProcAddress(hMapi32, "FBadProp@4"); + pFBadColumnSet = (void*)GetProcAddress(hMapi32, "FBadColumnSet@4"); + pCreateIProp = (void*)GetProcAddress(hMapi32, "CreateIProp@24"); + pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4"); + pDeinitMapiUtil = (void*)GetProcAddress(hMapi32, "DeinitMapiUtil@0"); pMAPIAllocateBuffer = (void*)GetProcAddress(hMapi32, "MAPIAllocateBuffer"); pMAPIAllocateMore = (void*)GetProcAddress(hMapi32, "MAPIAllocateMore"); pMAPIFreeBuffer = (void*)GetProcAddress(hMapi32, "MAPIFreeBuffer"); - if(pScInitMapiUtil && pMAPIAllocateBuffer && pMAPIAllocateMore && pMAPIFreeBuffer) - return TRUE; - else - return FALSE; -} - + pMAPIInitialize = (void*)GetProcAddress(hMapi32, "MAPIInitialize"); + pMAPIUninitialize = (void*)GetProcAddress(hMapi32, "MAPIUninitialize"); + + return pMAPIAllocateBuffer && pMAPIAllocateMore && pMAPIFreeBuffer && + pScInitMapiUtil && pDeinitMapiUtil; +} + +/* FIXME: Test PT_I2, PT_I4, PT_R4, PT_R8, PT_CURRENCY, PT_APPTIME, PT_SYSTIME, + * PT_ERROR, PT_BOOLEAN, PT_I8, and PT_CLSID. */ static ULONG ptTypes[] = { - PT_I2, PT_I4, PT_R4, PT_R8, PT_CURRENCY, PT_APPTIME, PT_SYSTIME, - PT_ERROR, PT_BOOLEAN, PT_I8, PT_CLSID, PT_STRING8, PT_BINARY, - PT_UNICODE + PT_STRING8, PT_BINARY, PT_UNICODE }; static inline int strcmpW(const WCHAR *str1, const WCHAR *str2) @@ -89,18 +113,27 @@ ULONG i; SCODE scode; - pPropCopyMore = (void*)GetProcAddress(hMapi32, "PropCopyMore@16"); - if (!pPropCopyMore) - return; - - scode = pMAPIAllocateBuffer(sizeof(LPSPropValue), lpDest); + { + win_skip("PropCopyMore is not available\n"); + return; + } + + scode = pMAPIAllocateBuffer(sizeof(SPropValue), &lpDest); + ok(scode == S_OK, "Expected MAPIAllocateBuffer to return S_OK, got 0x%x\n", scode); if (FAILED(scode)) - return; - - scode = pMAPIAllocateMore(sizeof(LPSPropValue), lpDest, lpSrc); + { + skip("MAPIAllocateBuffer failed\n"); + return; + } + + scode = pMAPIAllocateMore(sizeof(SPropValue), lpDest, &lpSrc); + ok(scode == S_OK, "Expected MAPIAllocateMore to return S_OK, got 0x%x\n", scode); if (FAILED(scode)) - return; + { + skip("MAPIAllocateMore failed\n"); + return; + } for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++) { @@ -148,7 +181,8 @@ } /* Since all allocations are linked, freeing lpDest frees everything */ - pMAPIFreeBuffer(lpDest); + scode = pMAPIFreeBuffer(lpDest); + ok(scode == S_OK, "Expected MAPIFreeBuffer to return S_OK, got 0x%x\n", scode); } static void test_UlPropSize(void) @@ -160,10 +194,11 @@ SBinary buffbin[2]; ULONG pt, exp, res; - pUlPropSize = (void*)GetProcAddress(hMapi32, "UlPropSize@4"); - if (!pUlPropSize) - return; + { + win_skip("UlPropSize is not available\n"); + return; + } for (pt = 0; pt < PROP_ID_INVALID; pt++) { @@ -257,10 +292,11 @@ ULONG pt; BOOL bRet; - pFPropContainsProp = (void*)GetProcAddress(hMapi32, "FPropContainsProp@12"); - if (!pFPropContainsProp) - return; + { + win_skip("FPropContainsProp is not available\n"); + return; + } /* Ensure that only PT_STRING8 and PT_BINARY are handled */ for (pt = 0; pt < PROP_ID_INVALID; pt++) @@ -406,10 +442,11 @@ ULONG i, j; BOOL bRet, bExp; - pFPropCompareProp = (void*)GetProcAddress(hMapi32, "FPropCompareProp@12"); - if (!pFPropCompareProp) - return; + { + win_skip("FPropCompareProp is not available\n"); + return; + } lbuffa[1] = '\0'; rbuffa[1] = '\0'; @@ -535,10 +572,11 @@ ULONG i, j; INT iRet, iExp; - pLPropCompareProp = (void*)GetProcAddress(hMapi32, "LPropCompareProp@8"); - if (!pLPropCompareProp) - return; + { + win_skip("LPropCompareProp is not available\n"); + return; + } lbuffa[1] = '\0'; rbuffa[1] = '\0'; @@ -640,10 +678,11 @@ SPropValue pvProp, *pRet; ULONG i; - pPpropFindProp = (void*)GetProcAddress(hMapi32, "PpropFindProp@12"); - if (!pPpropFindProp) - return; + { + win_skip("PpropFindProp is not available\n"); + return; + } for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++) { @@ -679,10 +718,11 @@ ULONG pt, exp, ulRet; int success = 1; - pScCountProps = (void*)GetProcAddress(hMapi32, "ScCountProps@12"); - if (!pScCountProps) - return; + { + win_skip("ScCountProps is not available\n"); + return; + } for (pt = 0; pt < PROP_ID_INVALID && success; pt++) { @@ -814,11 +854,11 @@ ULONG ulCount; SCODE sc; - pScCopyProps = (void*)GetProcAddress(hMapi32, "ScCopyProps@16"); - pScRelocProps = (void*)GetProcAddress(hMapi32, "ScRelocProps@20"); - if (!pScCopyProps || !pScRelocProps) - return; + { + win_skip("SPropValue copy functions are not available\n"); + return; + } pvProp.ulPropTag = PROP_TAG(PT_MV_STRING8, 1u); @@ -877,10 +917,11 @@ SPropValue pvProp, *pRet; ULONG i; - pLpValFindProp = (void*)GetProcAddress(hMapi32, "LpValFindProp@12"); - if (!pLpValFindProp) - return; + { + win_skip("LpValFindProp is not available\n"); + return; + } for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++) { @@ -912,9 +953,11 @@ static CHAR szString[] = "A String"; BOOL bRet; - pFBadRglpszA = (void*)GetProcAddress(hMapi32, "FBadRglpszA@8"); if (!pFBadRglpszA) - return; + { + win_skip("FBadRglpszA is not available\n"); + return; + } bRet = pFBadRglpszA(NULL, 10); ok(bRet == TRUE, "FBadRglpszA(Null): expected TRUE, got FALSE\n"); @@ -937,9 +980,11 @@ static WCHAR szString[] = { 'A',' ','S','t','r','i','n','g','\0' }; BOOL bRet; - pFBadRglpszW = (void*)GetProcAddress(hMapi32, "FBadRglpszW@8"); if (!pFBadRglpszW) - return; + { + win_skip("FBadRglpszW is not available\n"); + return; + } bRet = pFBadRglpszW(NULL, 10); ok(bRet == TRUE, "FBadRglpszW(Null): expected TRUE, got FALSE\n"); @@ -960,9 +1005,11 @@ { ULONG ulRet; - pFBadRowSet = (void*)GetProcAddress(hMapi32, "FBadRowSet@4"); if (!pFBadRowSet) - return; + { + win_skip("FBadRowSet is not available\n"); + return; + } ulRet = pFBadRowSet(NULL); ok(ulRet != 0, "FBadRow(null): Expected non-zero, got 0\n"); @@ -974,9 +1021,11 @@ { ULONG pt, res; - pFBadPropTag = (void*)GetProcAddress(hMapi32, "FBadPropTag@4"); if (!pFBadPropTag) - return; + { + win_skip("FBadPropTag is not available\n"); + return; + } for (pt = 0; pt < PROP_ID_INVALID; pt++) { @@ -1006,9 +1055,11 @@ { ULONG ulRet; - pFBadRow = (void*)GetProcAddress(hMapi32, "FBadRow@4"); if (!pFBadRow) - return; + { + win_skip("FBadRow is not available\n"); + return; + } ulRet = pFBadRow(NULL); ok(ulRet != 0, "FBadRow(null): Expected non-zero, got 0\n"); @@ -1023,9 +1074,11 @@ ULONG pt, res; SPropValue pv; - pFBadProp = (void*)GetProcAddress(hMapi32, "FBadProp@4"); if (!pFBadProp) - return; + { + win_skip("FBadProp is not available\n"); + return; + } for (pt = 0; pt < PROP_ID_INVALID; pt++) { @@ -1097,9 +1150,11 @@ SPropTagArray pta; ULONG pt, res; - pFBadColumnSet = (void*)GetProcAddress(hMapi32, "FBadColumnSet@4"); if (!pFBadColumnSet) - return; + { + win_skip("FBadColumnSet is not available\n"); + return; + } res = pFBadColumnSet(NULL); ok(res != 0, "(null): Expected non-zero, got 0\n"); @@ -1157,10 +1212,11 @@ ULONG access[2], count; SCODE sc; - pCreateIProp = (void*)GetProcAddress(hMapi32, "CreateIProp@24"); - if (!pCreateIProp) - return; + { + win_skip("CreateIProp is not available\n"); + return; + } memset(&tags, 0 , sizeof(tags)); @@ -1390,7 +1446,17 @@ test_PropCopyMore(); test_UlPropSize(); + + /* We call MAPIInitialize here for the benefit of native extended MAPI + * providers which crash in the FPropContainsProp tests when MAPIInitialize + * has not been called. Since MAPIInitialize is irrelevant for FPropContainsProp + * on Wine, we do not care whether MAPIInitialize succeeds. */ + if (pMAPIInitialize) + ret = pMAPIInitialize(NULL); test_FPropContainsProp(); + if (pMAPIUninitialize && ret == S_OK) + pMAPIUninitialize(); + test_FPropCompareProp(); test_LPropCompareProp(); test_PpropFindProp(); @@ -1406,5 +1472,7 @@ test_FBadColumnSet(); test_IProp(); + + pDeinitMapiUtil(); FreeLibrary(hMapi32); } Modified: trunk/rostests/winetests/mapi32/util.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mapi32/util.c?r…
============================================================================== --- trunk/rostests/winetests/mapi32/util.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mapi32/util.c [iso-8859-1] Fri Mar 5 19:41:30 2010 @@ -31,22 +31,45 @@ static HMODULE hMapi32 = 0; static SCODE (WINAPI *pScInitMapiUtil)(ULONG); +static void (WINAPI *pDeinitMapiUtil)(void); static void (WINAPI *pSwapPword)(PUSHORT,ULONG); static void (WINAPI *pSwapPlong)(PULONG,ULONG); static void (WINAPI *pHexFromBin)(LPBYTE,int,LPWSTR); -static void (WINAPI *pFBinFromHex)(LPWSTR,LPBYTE); +static BOOL (WINAPI *pFBinFromHex)(LPWSTR,LPBYTE); static UINT (WINAPI *pUFromSz)(LPCSTR); static ULONG (WINAPI *pUlFromSzHex)(LPCSTR); static ULONG (WINAPI *pCbOfEncoded)(LPCSTR); static BOOL (WINAPI *pIsBadBoundedStringPtr)(LPCSTR,ULONG); +static SCODE (WINAPI *pMAPIInitialize)(LPVOID); +static void (WINAPI *pMAPIUninitialize)(void); + +static void init_function_pointers(void) +{ + hMapi32 = LoadLibraryA("mapi32.dll"); + + pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4"); + pDeinitMapiUtil = (void*)GetProcAddress(hMapi32, "DeinitMapiUtil@0"); + pSwapPword = (void*)GetProcAddress(hMapi32, "SwapPword@8"); + pSwapPlong = (void*)GetProcAddress(hMapi32, "SwapPlong@8"); + pHexFromBin = (void*)GetProcAddress(hMapi32, "HexFromBin@12"); + pFBinFromHex = (void*)GetProcAddress(hMapi32, "FBinFromHex@8"); + pUFromSz = (void*)GetProcAddress(hMapi32, "UFromSz@4"); + pUlFromSzHex = (void*)GetProcAddress(hMapi32, "UlFromSzHex@4"); + pCbOfEncoded = (void*)GetProcAddress(hMapi32, "CbOfEncoded@4"); + pIsBadBoundedStringPtr = (void*)GetProcAddress(hMapi32, "IsBadBoundedStringPtr@8"); + pMAPIInitialize = (void*)GetProcAddress(hMapi32, "MAPIInitialize"); + pMAPIUninitialize = (void*)GetProcAddress(hMapi32, "MAPIUninitialize"); +} static void test_SwapPword(void) { USHORT shorts[3]; - pSwapPword = (void*)GetProcAddress(hMapi32, "SwapPword@8"); if (!pSwapPword) - return; + { + win_skip("SwapPword is not available\n"); + return; + } shorts[0] = 0xff01; shorts[1] = 0x10ff; @@ -61,9 +84,11 @@ { ULONG longs[3]; - pSwapPlong = (void*)GetProcAddress(hMapi32, "SwapPlong@8"); if (!pSwapPlong) - return; + { + win_skip("SwapPlong is not available\n"); + return; + } longs[0] = 0xffff0001; longs[1] = 0x1000ffff; @@ -89,10 +114,11 @@ BOOL bOk; int i; - pHexFromBin = (void*)GetProcAddress(hMapi32, "HexFromBin@12"); - pFBinFromHex = (void*)GetProcAddress(hMapi32, "FBinFromHex@8"); if (!pHexFromBin || !pFBinFromHex) - return; + { + win_skip("Hexadecimal conversion functions are not available\n"); + return; + } for (i = 0; i < 255; i++) data[i] = i; @@ -112,9 +138,11 @@ static void test_UFromSz(void) { - pUFromSz = (void*)GetProcAddress(hMapi32, "UFromSz@4"); if (!pUFromSz) - return; + { + win_skip("UFromSz is not available\n"); + return; + } ok(pUFromSz("105679") == 105679u, "UFromSz: expected 105679, got %d\n", pUFromSz("105679")); @@ -125,9 +153,11 @@ static void test_UlFromSzHex(void) { - pUlFromSzHex = (void*)GetProcAddress(hMapi32, "UlFromSzHex@4"); if (!pUlFromSzHex) - return; + { + win_skip("UlFromSzHex is not available\n"); + return; + } ok(pUlFromSzHex("fF") == 0xffu, "UlFromSzHex: expected 0xff, got 0x%x\n", pUlFromSzHex("fF")); @@ -141,9 +171,11 @@ char buff[129]; unsigned int i; - pCbOfEncoded = (void*)GetProcAddress(hMapi32, "CbOfEncoded@4"); if (!pCbOfEncoded) - return; + { + win_skip("CbOfEncoded is not available\n"); + return; + } for (i = 0; i < sizeof(buff) - 1; i++) { @@ -160,9 +192,11 @@ static void test_IsBadBoundedStringPtr(void) { - pIsBadBoundedStringPtr = (void*)GetProcAddress(hMapi32, "IsBadBoundedStringPtr@8"); if (!pIsBadBoundedStringPtr) - return; + { + win_skip("IsBadBoundedStringPtr is not available\n"); + return; + } ok(pIsBadBoundedStringPtr(NULL, 0) == TRUE, "IsBadBoundedStringPtr: expected TRUE\n"); ok(pIsBadBoundedStringPtr("TEST", 4) == TRUE, "IsBadBoundedStringPtr: expected TRUE\n"); @@ -179,13 +213,11 @@ return; } - hMapi32 = LoadLibraryA("mapi32.dll"); - - pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4"); - - if (!pScInitMapiUtil) - { - win_skip("ScInitMapiUtil is not available\n"); + init_function_pointers(); + + if (!pScInitMapiUtil || !pDeinitMapiUtil) + { + win_skip("MAPI utility initialization functions are not available\n"); FreeLibrary(hMapi32); return; } @@ -207,11 +239,22 @@ test_SwapPword(); test_SwapPlong(); + + /* We call MAPIInitialize here for the benefit of native extended MAPI + * providers which crash in the HexFromBin tests when MAPIInitialize has + * not been called. Since MAPIInitialize is irrelevant for HexFromBin on + * Wine, we do not care whether MAPIInitialize succeeds. */ + if (pMAPIInitialize) + ret = pMAPIInitialize(NULL); test_HexFromBin(); + if (pMAPIUninitialize && ret == S_OK) + pMAPIUninitialize(); + test_UFromSz(); test_UlFromSzHex(); test_CbOfEncoded(); test_IsBadBoundedStringPtr(); + pDeinitMapiUtil(); FreeLibrary(hMapi32); }
14 years, 9 months
1
0
0
0
[cwittich] 45881: [MAPI32] sync mapi32 to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:40:20 2010 New Revision: 45881 URL:
http://svn.reactos.org/svn/reactos?rev=45881&view=rev
Log: [MAPI32] sync mapi32 to wine 1.1.39 Added: trunk/reactos/dll/win32/mapi32/De.rc (with props) trunk/reactos/dll/win32/mapi32/En.rc (with props) trunk/reactos/dll/win32/mapi32/Es.rc (with props) trunk/reactos/dll/win32/mapi32/Fr.rc (with props) trunk/reactos/dll/win32/mapi32/Lt.rc (with props) trunk/reactos/dll/win32/mapi32/Ru.rc (with props) trunk/reactos/dll/win32/mapi32/res.h (with props) Modified: trunk/reactos/dll/win32/mapi32/mapi32.rbuild trunk/reactos/dll/win32/mapi32/mapi32.spec trunk/reactos/dll/win32/mapi32/mapi32_main.c trunk/reactos/dll/win32/mapi32/prop.c trunk/reactos/dll/win32/mapi32/sendmail.c trunk/reactos/dll/win32/mapi32/util.c trunk/reactos/dll/win32/mapi32/util.h trunk/reactos/dll/win32/mapi32/version.rc trunk/reactos/include/psdk/mapi.h Added: trunk/reactos/dll/win32/mapi32/De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/De.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/De.rc (added) +++ trunk/reactos/dll/win32/mapi32/De.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,30 @@ +/* +* MAPI32 German resources +* +* Copyright 2009 André Hentschel +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "Das senden der E-Mails scheiterte, da Sie keinen MAPI E-Mail Programm installiert haben." + IDS_SEND_MAIL, "E-Mail senden" +} Propchange: trunk/reactos/dll/win32/mapi32/De.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mapi32/En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/En.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/En.rc (added) +++ trunk/reactos/dll/win32/mapi32/En.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,30 @@ +/* +* MAPI32 English resources +* +* Copyright 2009 Owen Rudge for CodeWeavers +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "Mail sending failed as you do not have a MAPI mail client installed." + IDS_SEND_MAIL, "Send Mail" +} Propchange: trunk/reactos/dll/win32/mapi32/En.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mapi32/Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/Es.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/Es.rc (added) +++ trunk/reactos/dll/win32/mapi32/Es.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,33 @@ +/* +* MAPI32 Spanish resources +* +* Copyright 2010 José Manuel Ferrer Ortiz +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "El envÃo de correo ha fallado debido a que no tiene instalado un cliente de correo MAPI." + IDS_SEND_MAIL, "Enviar correo" +} Propchange: trunk/reactos/dll/win32/mapi32/Es.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mapi32/Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/Fr.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/Fr.rc (added) +++ trunk/reactos/dll/win32/mapi32/Fr.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,33 @@ +/* +* MAPI32 French resources +* +* Copyright 2009 Frédéric Delanoy +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "L'envoi de courriel a échoué car aucun client mail MAPI n'est installé." + IDS_SEND_MAIL, "Envoyer un courriel" +} Propchange: trunk/reactos/dll/win32/mapi32/Fr.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mapi32/Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/Lt.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/Lt.rc (added) +++ trunk/reactos/dll/win32/mapi32/Lt.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,33 @@ +/* +* MAPI32 Lithuanian resources +* + * Copyright 2009 Aurimas Fišeras <aurimas(a)gmail.com> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "Nepavyko išsiųsti laiškų, nes neturite įdiegto MAPI pašto kliento." + IDS_SEND_MAIL, "Laiškų siuntimas" +} Propchange: trunk/reactos/dll/win32/mapi32/Lt.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/mapi32/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/Ru.rc?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/Ru.rc (added) +++ trunk/reactos/dll/win32/mapi32/Ru.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,33 @@ +/* +* MAPI32 Russian resources +* +* Copyright 2009 Vladimir Pankratov +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include "res.h" + +/* UTF-8 */ +#pragma code_page(65001) + +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_NO_MAPI_CLIENT, "Ðевозможно оÑпÑавиÑÑ Ð¿Ð¾ÑÑÑ: не ÑÑÑановлен поÑÑовÑй ÐºÐ»Ð¸ÐµÐ½Ñ MAPI." + IDS_SEND_MAIL, "ÐÑпÑавка поÑÑÑ" +} Propchange: trunk/reactos/dll/win32/mapi32/Ru.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/mapi32/mapi32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/mapi32.rb…
============================================================================== --- trunk/reactos/dll/win32/mapi32/mapi32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/mapi32.rbuild [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -15,6 +15,7 @@ <library>wine</library> <library>shlwapi</library> <library>shell32</library> + <library>user32</library> <library>advapi32</library> <library>uuid</library> <library>ntdll</library> Modified: trunk/reactos/dll/win32/mapi32/mapi32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/mapi32.sp…
============================================================================== --- trunk/reactos/dll/win32/mapi32/mapi32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/mapi32.spec [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -145,17 +145,17 @@ 205 stub FDecodeID@12 206 stub CchOfEncoding@4 207 stdcall CbOfEncoded@4(ptr) CbOfEncoded -208 stdcall MAPISendDocuments(ptr ptr ptr ptr long) -209 stdcall MAPILogon(long ptr ptr long long ptr) -210 stdcall MAPILogoff(long long long long) -211 stdcall MAPISendMail(long long ptr long long) -212 stdcall MAPISaveMail(ptr ptr ptr long long ptr) -213 stdcall MAPIReadMail(ptr ptr ptr long long ptr) -214 stdcall MAPIFindNext(ptr ptr ptr ptr long long ptr) -215 stdcall MAPIDeleteMail(ptr ptr ptr long long) -217 stdcall MAPIAddress(ptr ptr ptr long ptr long long ptr long ptr ptr) +208 stdcall MAPISendDocuments(ptr str str str long) +209 stdcall MAPILogon(ptr str str long long ptr) +210 stdcall MAPILogoff(ptr ptr long long) +211 stdcall MAPISendMail(ptr ptr ptr long long) +212 stdcall MAPISaveMail(ptr ptr ptr long long str) +213 stdcall MAPIReadMail(ptr ptr str long long ptr) +214 stdcall MAPIFindNext(ptr ptr str str long long ptr) +215 stdcall MAPIDeleteMail(ptr ptr str long long) +217 stdcall MAPIAddress(ptr ptr str long str long ptr long long ptr ptr) 218 stdcall MAPIDetails(ptr ptr ptr long long) -219 stdcall MAPIResolveName(ptr ptr ptr long long ptr) +219 stdcall MAPIResolveName(ptr ptr str long long ptr) 220 stub BMAPISendMail 221 stub BMAPISaveMail 222 stub BMAPIReadMail Modified: trunk/reactos/dll/win32/mapi32/mapi32_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/mapi32_ma…
============================================================================== --- trunk/reactos/dll/win32/mapi32/mapi32_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/mapi32_main.c [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mapi); LONG MAPI_ObjectCount = 0; +HINSTANCE hInstMAPI32; /*********************************************************************** * DllMain (MAPI32.init) @@ -45,6 +46,7 @@ switch (fdwReason) { case DLL_PROCESS_ATTACH: + hInstMAPI32 = hinstDLL; DisableThreadLibraryCalls(hinstDLL); load_mapi_providers(); break; Modified: trunk/reactos/dll/win32/mapi32/prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/prop.c?re…
============================================================================== --- trunk/reactos/dll/win32/mapi32/prop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/prop.c [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1835,7 +1835,7 @@ else { /* Add new value */ - if (!(item = IMAPIPROP_AddValue(This, &lpProps[i]))) + if (!IMAPIPROP_AddValue(This, &lpProps[i])) hRet = MAPI_E_NOT_ENOUGH_MEMORY; } } Added: trunk/reactos/dll/win32/mapi32/res.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/res.h?rev…
============================================================================== --- trunk/reactos/dll/win32/mapi32/res.h (added) +++ trunk/reactos/dll/win32/mapi32/res.h [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1,0 +1,26 @@ +/* +* MAPI32 resources +* +* Copyright 2009 Owen Rudge for CodeWeavers +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +* +*/ + +#include <windef.h> + +/* Strings */ +#define IDS_NO_MAPI_CLIENT 1 +#define IDS_SEND_MAIL 2 Propchange: trunk/reactos/dll/win32/mapi32/res.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/mapi32/sendmail.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/sendmail.…
============================================================================== --- trunk/reactos/dll/win32/mapi32/sendmail.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/sendmail.c [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -30,6 +30,7 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" +#include "winuser.h" #include "objbase.h" #include "objidl.h" #include "mapi.h" @@ -41,6 +42,7 @@ #include "shlwapi.h" #include "wine/debug.h" #include "util.h" +#include "res.h" WINE_DEFAULT_DEBUG_CHANNEL(mapi); @@ -383,27 +385,11 @@ * Success: SUCCESS_SUCCESS * Failure: MAPI_E_FAILURE * - * NOTES - * The fallback procedure is a temporary hack. */ ULONG WINAPI MAPISendMail( LHANDLE session, ULONG_PTR uiparam, lpMapiMessage message, FLAGS flags, ULONG reserved ) { - ULONG ret = MAPI_E_FAILURE; - unsigned int i, to_count = 0, cc_count = 0, bcc_count = 0; - unsigned int to_size = 0, cc_size = 0, bcc_size = 0, subj_size, body_size; - - char *to = NULL, *cc = NULL, *bcc = NULL; - const char *address, *subject, *body; - static const char format[] = - "mailto:\"%s\"?subject=\"%s\"&cc=\"%s\"&bcc=\"%s\"&body=\"%s\""; - char *mailto = NULL, *escape = NULL; - char empty_string[] = ""; - HRESULT res; - DWORD size; - - TRACE( "(0x%08x 0x%08lx %p 0x%08x 0x%08x)\n", session, uiparam, - message, flags, reserved ); + WCHAR msg_title[READ_BUF_SIZE], error_msg[READ_BUF_SIZE]; /* Check to see if we have a Simple MAPI provider loaded */ if (mapiFunctions.MAPISendMail) @@ -413,133 +399,13 @@ if (MAPIInitialize(NULL) == S_OK) return sendmail_extended_mapi(session, uiparam, message, flags, reserved); - /* Fall back on our own implementation */ - if (!message) return MAPI_E_FAILURE; - - for (i = 0; i < message->nRecipCount; i++) - { - if (!message->lpRecips) - { - WARN("No recipients found\n"); - return MAPI_E_FAILURE; - } - - address = message->lpRecips[i].lpszAddress; - if (address) - { - switch (message->lpRecips[i].ulRecipClass) - { - case MAPI_ORIG: - TRACE( "From: %s\n", debugstr_a(address) ); - break; - case MAPI_TO: - TRACE( "To: %s\n", debugstr_a(address) ); - to_size += lstrlenA( address ) + 1; - break; - case MAPI_CC: - TRACE( "Cc: %s\n", debugstr_a(address) ); - cc_size += lstrlenA( address ) + 1; - break; - case MAPI_BCC: - TRACE( "Bcc: %s\n", debugstr_a(address) ); - bcc_size += lstrlenA( address ) + 1; - break; - default: - TRACE( "Unknown recipient class: %d\n", - message->lpRecips[i].ulRecipClass ); - } - } - else - FIXME("Name resolution and entry identifiers not supported\n"); - } - if (message->nFileCount) FIXME("Ignoring attachments\n"); - - subject = message->lpszSubject ? message->lpszSubject : ""; - body = message->lpszNoteText ? message->lpszNoteText : ""; - - TRACE( "Subject: %s\n", debugstr_a(subject) ); - TRACE( "Body: %s\n", debugstr_a(body) ); - - subj_size = lstrlenA( subject ); - body_size = lstrlenA( body ); - - ret = MAPI_E_INSUFFICIENT_MEMORY; - if (to_size) - { - to = HeapAlloc( GetProcessHeap(), 0, to_size ); - if (!to) goto exit; - to[0] = 0; - } - if (cc_size) - { - cc = HeapAlloc( GetProcessHeap(), 0, cc_size ); - if (!cc) goto exit; - cc[0] = 0; - } - if (bcc_size) - { - bcc = HeapAlloc( GetProcessHeap(), 0, bcc_size ); - if (!bcc) goto exit; - bcc[0] = 0; - } - - if (message->lpOriginator) - TRACE( "From: %s\n", debugstr_a(message->lpOriginator->lpszAddress) ); - - for (i = 0; i < message->nRecipCount; i++) - { - address = message->lpRecips[i].lpszAddress; - if (address) - { - switch (message->lpRecips[i].ulRecipClass) - { - case MAPI_TO: - if (to_count) lstrcatA( to, "," ); - lstrcatA( to, address ); - to_count++; - break; - case MAPI_CC: - if (cc_count) lstrcatA( cc, "," ); - lstrcatA( cc, address ); - cc_count++; - break; - case MAPI_BCC: - if (bcc_count) lstrcatA( bcc, "," ); - lstrcatA( bcc, address ); - bcc_count++; - break; - } - } - } - ret = MAPI_E_FAILURE; - size = sizeof(format) + to_size + cc_size + bcc_size + subj_size + body_size; - - mailto = HeapAlloc( GetProcessHeap(), 0, size ); - if (!mailto) goto exit; - - sprintf( mailto, format, to ? to : "", subject, cc ? cc : "", bcc ? bcc : "", body ); - - size = 1; - res = UrlEscapeA( mailto, empty_string, &size, URL_ESCAPE_SPACES_ONLY ); - if (res != E_POINTER) goto exit; - - escape = HeapAlloc( GetProcessHeap(), 0, size ); - if (!escape) goto exit; - - res = UrlEscapeA( mailto, escape, &size, URL_ESCAPE_SPACES_ONLY ); - if (res != S_OK) goto exit; - - if ((UINT_PTR)ShellExecuteA( NULL, "open", escape, NULL, NULL, 0 ) > 32) - ret = SUCCESS_SUCCESS; - -exit: - HeapFree( GetProcessHeap(), 0, to ); - HeapFree( GetProcessHeap(), 0, cc ); - HeapFree( GetProcessHeap(), 0, bcc ); - HeapFree( GetProcessHeap(), 0, mailto ); - HeapFree( GetProcessHeap(), 0, escape ); - - return ret; + /* Display an error message since we apparently have no mail clients */ + LoadStringW(hInstMAPI32, IDS_NO_MAPI_CLIENT, error_msg, sizeof(error_msg) / sizeof(WCHAR)); + LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, sizeof(msg_title) / sizeof(WCHAR)); + + MessageBoxW((HWND) uiparam, error_msg, msg_title, MB_ICONEXCLAMATION); + + return MAPI_E_NOT_SUPPORTED; } ULONG WINAPI MAPISendDocuments(ULONG_PTR uiparam, LPSTR delim, LPSTR paths, Modified: trunk/reactos/dll/win32/mapi32/util.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/util.c?re…
============================================================================== --- trunk/reactos/dll/win32/mapi32/util.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/util.c [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -1037,7 +1037,7 @@ TRACE("appName: %s\n", debugstr_w(appName)); appKey = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(regkey_mail) + - lstrlenW(regkey_backslash) + lstrlenW(appName))); + lstrlenW(regkey_backslash) + lstrlenW(appName) + 1)); if (!appKey) goto cleanUp; Modified: trunk/reactos/dll/win32/mapi32/util.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/util.h?re…
============================================================================== --- trunk/reactos/dll/win32/mapi32/util.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/util.h [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -61,5 +61,6 @@ } MAPI_FUNCTIONS; extern MAPI_FUNCTIONS mapiFunctions; +extern HINSTANCE hInstMAPI32; #endif Modified: trunk/reactos/dll/win32/mapi32/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/version.r…
============================================================================== --- trunk/reactos/dll/win32/mapi32/version.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/version.rc [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -24,3 +24,10 @@ #define WINE_PRODUCTVERSION_STR "1.0.0.0" #include "wine/wine_common_ver.rc" + +#include "De.rc" +#include "En.rc" +#include "Es.rc" +#include "Fr.rc" +#include "Lt.rc" +#include "Ru.rc" Modified: trunk/reactos/include/psdk/mapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/mapi.h?rev=45…
============================================================================== --- trunk/reactos/include/psdk/mapi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/mapi.h [iso-8859-1] Fri Mar 5 19:40:20 2010 @@ -27,7 +27,7 @@ #ifndef __LHANDLE #define __LHANDLE -typedef ULONG LHANDLE, *LPLHANDLE; +typedef ULONG_PTR LHANDLE, *LPLHANDLE; #endif #define lhSessionNull ((LHANDLE)0)
14 years, 9 months
1
0
0
0
[cwittich] 45880: [INETMIB1] sync inetmib1 to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:34:19 2010 New Revision: 45880 URL:
http://svn.reactos.org/svn/reactos?rev=45880&view=rev
Log: [INETMIB1] sync inetmib1 to wine 1.1.39 Modified: trunk/reactos/dll/win32/inetmib1/main.c Modified: trunk/reactos/dll/win32/inetmib1/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetmib1/main.c?…
============================================================================== --- trunk/reactos/dll/win32/inetmib1/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetmib1/main.c [iso-8859-1] Fri Mar 5 19:34:19 2010 @@ -32,10 +32,11 @@ /** * Utility functions */ -static void copyInt(AsnAny *value, void *src) +static DWORD copyInt(AsnAny *value, void *src) { value->asnType = ASN_INTEGER; value->asnValue.number = *(DWORD *)src; + return SNMP_ERRORSTATUS_NOERROR; } static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str) @@ -45,18 +46,11 @@ strValue.asnType = type; strValue.asnValue.string.stream = str; strValue.asnValue.string.length = len; - strValue.asnValue.string.dynamic = TRUE; + strValue.asnValue.string.dynamic = FALSE; SnmpUtilAsnAnyCpy(value, &strValue); } -static void copyLengthPrecededString(AsnAny *value, void *src) -{ - DWORD len = *(DWORD *)src; - - setStringValue(value, ASN_OCTETSTRING, len, (BYTE *)src + sizeof(DWORD)); -} - -typedef void (*copyValueFunc)(AsnAny *value, void *src); +typedef DWORD (*copyValueFunc)(AsnAny *value, void *src); struct structToAsnValue { @@ -75,13 +69,13 @@ return SNMP_ERRORSTATUS_NOSUCHNAME; if (!map[id].copy) return SNMP_ERRORSTATUS_NOSUCHNAME; - map[id].copy(&pVarBind->value, (BYTE *)record + map[id].offset); + return map[id].copy(&pVarBind->value, (BYTE *)record + map[id].offset); +} + +static DWORD copyIpAddr(AsnAny *value, void *src) +{ + setStringValue(value, ASN_IPADDRESS, sizeof(DWORD), src); return SNMP_ERRORSTATUS_NOERROR; -} - -static void copyIpAddr(AsnAny *value, void *src) -{ - setStringValue(value, ASN_IPADDRESS, sizeof(DWORD), src); } static UINT mib2[] = { 1,3,6,1,2,1 }; @@ -168,7 +162,7 @@ return ret; } -static void copyOperStatus(AsnAny *value, void *src) +static DWORD copyOperStatus(AsnAny *value, void *src) { value->asnType = ASN_INTEGER; /* The IPHlpApi definition of operational status differs from the MIB2 one, @@ -186,6 +180,7 @@ default: value->asnValue.number = MIB_IF_ADMIN_STATUS_DOWN; }; + return SNMP_ERRORSTATUS_NOERROR; } /* Given an OID and a base OID that it must begin with, finds the item and @@ -393,7 +388,7 @@ * an infinite loop. */ for (++index; index <= table->numEntries && compare(key, - &table->entries[tableEntrySize * index]) == 0; ++index) + &table->entries[tableEntrySize * (index - 1)]) == 0; ++index) ; } HeapFree(GetProcessHeap(), 0, key); @@ -550,13 +545,46 @@ return ret; } +static DWORD copyIfRowDescr(AsnAny *value, void *src) +{ + PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src - + FIELD_OFFSET(MIB_IFROW, dwDescrLen)); + DWORD ret; + + if (row->dwDescrLen) + { + setStringValue(value, ASN_OCTETSTRING, row->dwDescrLen, row->bDescr); + ret = SNMP_ERRORSTATUS_NOERROR; + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + return ret; +} + +static DWORD copyIfRowPhysAddr(AsnAny *value, void *src) +{ + PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src - + FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen)); + DWORD ret; + + if (row->dwPhysAddrLen) + { + setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen, + row->bPhysAddr); + ret = SNMP_ERRORSTATUS_NOERROR; + } + else + ret = SNMP_ERRORSTATUS_NOSUCHNAME; + return ret; +} + static struct structToAsnValue mib2IfEntryMap[] = { { FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt }, - { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IFROW, dwDescrLen), copyIfRowDescr }, { FIELD_OFFSET(MIB_IFROW, dwType), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwMtu), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt }, - { FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen), copyIfRowPhysAddr }, { FIELD_OFFSET(MIB_IFROW, dwAdminStatus), copyInt }, { FIELD_OFFSET(MIB_IFROW, dwOperStatus), copyOperStatus }, { FIELD_OFFSET(MIB_IFROW, dwLastChange), copyInt }, @@ -883,9 +911,18 @@ static UINT mib2IpNet[] = { 1,3,6,1,2,1,4,22,1 }; static PMIB_IPNETTABLE ipNetTable; +static DWORD copyIpNetPhysAddr(AsnAny *value, void *src) +{ + PMIB_IPNETROW row = (PMIB_IPNETROW)((BYTE *)src - FIELD_OFFSET(MIB_IPNETROW, + dwPhysAddrLen)); + + setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen, row->bPhysAddr); + return SNMP_ERRORSTATUS_NOERROR; +} + static struct structToAsnValue mib2IpNetMap[] = { { FIELD_OFFSET(MIB_IPNETROW, dwIndex), copyInt }, - { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyLengthPrecededString }, + { FIELD_OFFSET(MIB_IPNETROW, dwPhysAddrLen), copyIpNetPhysAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwAddr), copyIpAddr }, { FIELD_OFFSET(MIB_IPNETROW, dwType), copyInt }, };
14 years, 9 months
1
0
0
0
[cwittich] 45879: [INETCOMM] sync inetcomm to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:32:19 2010 New Revision: 45879 URL:
http://svn.reactos.org/svn/reactos?rev=45879&view=rev
Log: [INETCOMM] sync inetcomm to wine 1.1.39 Modified: trunk/reactos/dll/win32/inetcomm/inetcomm_main.c Modified: trunk/reactos/dll/win32/inetcomm/inetcomm_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/inetcomm_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/inetcomm_main.c [iso-8859-1] Fri Mar 5 19:32:19 2010 @@ -197,6 +197,5 @@ */ HRESULT WINAPI DllCanUnloadNow(void) { - FIXME("\n"); return S_FALSE; }
14 years, 9 months
1
0
0
0
[cwittich] 45878: [FUSION] sync fusion to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Mar 5 19:30:07 2010 New Revision: 45878 URL:
http://svn.reactos.org/svn/reactos?rev=45878&view=rev
Log: [FUSION] sync fusion to wine 1.1.39 Modified: trunk/reactos/dll/win32/fusion/asmname.c trunk/reactos/dll/win32/fusion/fusion_main.c Modified: trunk/reactos/dll/win32/fusion/asmname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fusion/asmname.c…
============================================================================== --- trunk/reactos/dll/win32/fusion/asmname.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fusion/asmname.c [iso-8859-1] Fri Mar 5 19:30:07 2010 @@ -471,6 +471,11 @@ done: HeapFree(GetProcessHeap(), 0, save); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, name->displayname); + HeapFree(GetProcessHeap(), 0, name->name); + } return hr; } Modified: trunk/reactos/dll/win32/fusion/fusion_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fusion/fusion_ma…
============================================================================== --- trunk/reactos/dll/win32/fusion/fusion_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fusion/fusion_main.c [iso-8859-1] Fri Mar 5 19:30:07 2010 @@ -34,6 +34,8 @@ switch (fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); break;
14 years, 9 months
1
0
0
0
← Newer
1
...
72
73
74
75
76
77
78
...
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