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
August 2009
----- 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
21 participants
654 discussions
Start a n
N
ew thread
[gschneider] 42856: - Handle failed memory allocation in CreateDIBitmap, check initialize option before allocating and copying
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Aug 22 18:56:28 2009 New Revision: 42856 URL:
http://svn.reactos.org/svn/reactos?rev=42856&view=rev
Log: - Handle failed memory allocation in CreateDIBitmap, check initialize option before allocating and copying Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bi…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] Sat Aug 22 18:56:28 2009 @@ -501,11 +501,18 @@ hBmp = GetStockObject(DEFAULT_BITMAP); else { - if ( Bits ) + if ( Bits && Init == CBM_INIT ) { pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize); - if ( pvSafeBits ) + if (pvSafeBits == NULL) + { + hBmp = NULL; + goto Exit; + } + else + { RtlCopyMemory( pvSafeBits, Bits, cjBmpScanSize); + } } hBmp = NtGdiCreateDIBitmapInternal(hDC, @@ -520,7 +527,7 @@ 0, 0); - if ( Bits ) + if ( Bits && Init == CBM_INIT ) RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits); } Exit:
15 years, 4 months
1
0
0
0
[cwittich] 42855: sync shell32 winetest with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 18:56:26 2009 New Revision: 42855 URL:
http://svn.reactos.org/svn/reactos?rev=42855&view=rev
Log: sync shell32 winetest with wine 1.1.28 Modified: trunk/rostests/winetests/shell32/shlfolder.c Modified: trunk/rostests/winetests/shell32/shlfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfold…
============================================================================== --- trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] Sat Aug 22 18:56:26 2009 @@ -79,15 +79,6 @@ hr = SHGetMalloc(&ppM); ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr); -} - -static const char *wine_dbgstr_w(LPCWSTR str) -{ - static char buf[512]; - if (!str) - return "(null)"; - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); - return buf; } static void test_ParseDisplayName(void)
15 years, 4 months
1
0
0
0
[cwittich] 42854: sync ntdsapi winetest with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 18:50:50 2009 New Revision: 42854 URL:
http://svn.reactos.org/svn/reactos?rev=42854&view=rev
Log: sync ntdsapi winetest with wine 1.1.28 Modified: trunk/rostests/winetests/ntdsapi/ntdsapi.c Modified: trunk/rostests/winetests/ntdsapi/ntdsapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdsapi/ntdsapi…
============================================================================== --- trunk/rostests/winetests/ntdsapi/ntdsapi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdsapi/ntdsapi.c [iso-8859-1] Sat Aug 22 18:50:50 2009 @@ -27,15 +27,6 @@ #include "ntdsapi.h" #include "wine/test.h" - -static const char *wine_dbgstr_w(LPCWSTR str) -{ - static char buf[512]; - if (!str) - return "(null)"; - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); - return buf; -} static void test_DsMakeSpn(void) {
15 years, 4 months
1
0
0
0
[cwittich] 42853: sync kernel32_winetest with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 18:42:11 2009 New Revision: 42853 URL:
http://svn.reactos.org/svn/reactos?rev=42853&view=rev
Log: sync kernel32_winetest with wine 1.1.28 Modified: trunk/rostests/winetests/kernel32/codepage.c trunk/rostests/winetests/kernel32/drive.c trunk/rostests/winetests/kernel32/format_msg.c trunk/rostests/winetests/kernel32/process.c trunk/rostests/winetests/kernel32/profile.c trunk/rostests/winetests/kernel32/thread.c trunk/rostests/winetests/kernel32/virtual.c trunk/rostests/winetests/kernel32/volume.c Modified: trunk/rostests/winetests/kernel32/codepage.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/codepa…
============================================================================== --- trunk/rostests/winetests/kernel32/codepage.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/codepage.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -320,7 +320,7 @@ SetLastError(0xdeadbeef); ret = WideCharToMultiByte(950, 0, dbwcs, -1, mbs, sizeof(mbs), NULL, bUsedDefaultChar); ok(ret == 5, "ret is %d\n", ret); - ok(!strcmp(mbs, "µH©Ò"), "mbs is %s\n", mbs); + ok(!strcmp(mbs, "\xb5H\xa9\xd2"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); @@ -334,7 +334,7 @@ SetLastError(0xdeadbeef); ret = WideCharToMultiByte(950, 0, dbwcs, 1, mbs, sizeof(mbs), NULL, bUsedDefaultChar); ok(ret == 2, "ret is %d\n", ret); - ok(!strcmp(mbs, "µH"), "mbs is %s\n", mbs); + ok(!strcmp(mbs, "\xb5H"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == FALSE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u\n", GetLastError()); Modified: trunk/rostests/winetests/kernel32/drive.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/drive.…
============================================================================== --- trunk/rostests/winetests/kernel32/drive.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/drive.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -125,6 +125,7 @@ GetLastError() == ERROR_INVALID_DRIVE || GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_REQUEST_ABORTED || + GetLastError() == ERROR_NETNAME_DELETED || GetLastError() == ERROR_UNRECOGNIZED_VOLUME, "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%d\n", drive, ret, GetLastError()); @@ -144,6 +145,7 @@ GetLastError() == ERROR_INVALID_FUNCTION || GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_REQUEST_ABORTED || + GetLastError() == ERROR_NETNAME_DELETED || GetLastError() == ERROR_UNRECOGNIZED_VOLUME, "GetDiskFreeSpaceExA( %s ) failed. GetLastError=%d\n", drive, GetLastError()); ok( bytes_per_sector == 0 || /* empty cd rom drive */ Modified: trunk/rostests/winetests/kernel32/format_msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/format…
============================================================================== --- trunk/rostests/winetests/kernel32/format_msg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/format_msg.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -50,13 +50,6 @@ lang_id, out, outsize, &list); va_end(list); return r; -} - -static char buf[1024]; -static const char *debugstr_w(const WCHAR *str) -{ - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); - return buf; } static void test_message_from_string_wide(void) @@ -127,180 +120,180 @@ /* the basics */ r = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, test, 0, 0, out, sizeof(out)/sizeof(WCHAR), NULL); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4, "failed: r=%d\n", r); /* using the format feature */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_1s, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* no format */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_1, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* two pieces */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_12, 0, 0, out, sizeof(out)/sizeof(WCHAR), te, st); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* three pieces */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123, 0, 0, out, sizeof(out)/sizeof(WCHAR), t, s, e); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* s doesn't seem to work in format strings */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_s, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(&fmt_s[1], out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(&fmt_s[1], out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==3, "failed: r=%d\n", r); /* nor ls */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_ls, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(&fmt_ls[1], out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(&fmt_ls[1], out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4, "failed: r=%d\n", r); /* nor S */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_S, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(&fmt_S[1], out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(&fmt_S[1], out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==3, "failed: r=%d\n", r); /* nor ws */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_ws, 0, 0, out, sizeof(out)/sizeof(WCHAR), test); - ok(!lstrcmpW(&fmt_ws[1], out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(&fmt_ws[1], out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4, "failed: r=%d\n", r); /* as characters */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123c, 0, 0, out, sizeof(out)/sizeof(WCHAR), 't', 'e', 's'); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* lc is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123lc, 0, 0, out, sizeof(out)/sizeof(WCHAR), 't', 'e', 's'); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* wc is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123wc, 0, 0, out, sizeof(out)/sizeof(WCHAR), 't', 'e', 's'); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* C is unicode */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123C, 0, 0, out, sizeof(out)/sizeof(WCHAR), 't', 'e', 's'); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* some numbers */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_123d, 0, 0, out, sizeof(out)/sizeof(WCHAR), 1, 2, 3); - ok(!lstrcmpW(s_123d, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_123d, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==3,"failed: r=%d\n", r); /* a single digit with some spacing */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_14d, 0, 0, out, sizeof(out)/sizeof(WCHAR), 1); - ok(!lstrcmpW(s_14d, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_14d, out), "failed out=%s\n", wine_dbgstr_w(out)); /* a single digit, left justified */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_1_4d, 0, 0, out, sizeof(out)/sizeof(CHAR), 1); - ok(!lstrcmpW(s_1_4d, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_1_4d, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* two digit decimal number */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_14d, 0, 0, out, sizeof(out)/sizeof(WCHAR), 11); - ok(!lstrcmpW(s_14d2, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_14d2, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* a hex number */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_14x, 0, 0, out, sizeof(out)/sizeof(WCHAR), 11); - ok(!lstrcmpW(s_14x, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_14x, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* a hex number, upper case */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_14X, 0, 0, out, sizeof(out)/sizeof(WCHAR), 11); - ok(!lstrcmpW(s_14X, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_14X, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* a hex number, upper case, left justified */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_1_4X, 0, 0, out, sizeof(out)/sizeof(WCHAR), 11); - ok(!lstrcmpW(s_1_4X, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_1_4X, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* a long hex number, upper case */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_14X, 0, 0, out, sizeof(out)/sizeof(WCHAR), 0x1ab); - ok(!lstrcmpW(s_1AB, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_1AB, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* two percent... */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_2pct, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_2pct, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_2pct, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* periods are special cases */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_2dot1d, 0, 0, out, sizeof(out)/sizeof(WCHAR), 0x1ab); - ok(!lstrcmpW(s_2dot147, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_2dot147, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==8,"failed: r=%d\n", r); /* %0 ends the line */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_t0t, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(test, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(test, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* %! prints an exclamation */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_yah, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_yah, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_yah, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* %space */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_space, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_space, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_space, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_hi_lf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_hi_crlf, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_hi_crlf, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_hi_crlf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_hi_crlf, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_hi_crlf, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* carriage return */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_cr, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_crlf, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_crlf, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==2,"failed: r=%d\n", r); /* double carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING, fmt_crcrlf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_crlfcrlf, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_crlfcrlf, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==4,"failed: r=%d\n", r); /* change of pace... test the low byte of dwflags */ @@ -308,25 +301,25 @@ /* line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, fmt_hi_lf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_hi_sp, out) || !lstrcmpW(s_hi_crlf, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_hi_sp, out) || !lstrcmpW(s_hi_crlf, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==3 || r==4,"failed: r=%d\n", r); /* carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, fmt_hi_crlf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_hi_sp, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_hi_sp, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==3,"failed: r=%d\n", r); /* carriage return */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, fmt_cr, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_sp, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_sp, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==1,"failed: r=%d\n", r); /* double carriage return line feed */ r = doitW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, fmt_crcrlf, 0, 0, out, sizeof(out)/sizeof(WCHAR)); - ok(!lstrcmpW(s_2sp, out), "failed out=[%s]\n", debugstr_w(out)); + ok(!lstrcmpW(s_2sp, out), "failed out=%s\n", wine_dbgstr_w(out)); ok(r==2,"failed: r=%d\n", r); } Modified: trunk/rostests/winetests/kernel32/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/proces…
============================================================================== --- trunk/rostests/winetests/kernel32/process.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/process.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -55,23 +55,6 @@ ok(lstrcmpiW((expected), value) == 0, "Expected " #actual " to be L\"%s\" (" #expected ") is L\"%s\"\n", \ wine_dbgstr_w(expected), wine_dbgstr_w(value)); \ } while (0) - -/* A simpler version of wine_dbgstr_w. Note that the returned buffer will be - * invalid after 16 calls to this funciton. */ -static const char *wine_dbgstr_w(LPCWSTR wstr) -{ - static char *buffers[16]; - static int curr_buffer = 0; - - int size; - - curr_buffer = (curr_buffer + 1) % 16; - HeapFree(GetProcessHeap(), 0, buffers[curr_buffer]); - size = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); - buffers[curr_buffer] = HeapAlloc(GetProcessHeap(), 0, size); - size = WideCharToMultiByte(CP_ACP, 0, wstr, -1, buffers[curr_buffer], size, NULL, NULL); - return buffers[curr_buffer]; -} static HINSTANCE hkernel32; static LPVOID (WINAPI *pVirtualAllocEx)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD); @@ -1243,6 +1226,7 @@ static void test_DebuggingFlag(void) { char buffer[MAX_PATH]; + void *processbase = NULL; PROCESS_INFORMATION info; STARTUPINFOA startup, us; DEBUG_EVENT de; @@ -1263,7 +1247,15 @@ { ok(WaitForDebugEvent(&de, INFINITE), "reading debug event\n"); ContinueDebugEvent(de.dwProcessId, de.dwThreadId, DBG_CONTINUE); + if (!dbg) + { + ok(de.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, + "first event: %d\n", de.dwDebugEventCode); + processbase = de.u.CreateProcessInfo.lpBaseOfImage; + } if (de.dwDebugEventCode != EXCEPTION_DEBUG_EVENT) dbg++; + ok(de.dwDebugEventCode != LOAD_DLL_DEBUG_EVENT || + de.u.LoadDll.lpBaseOfDll != processbase, "got LOAD_DLL for main module\n"); } while (de.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT); ok(dbg, "I have seen a debug event\n"); Modified: trunk/rostests/winetests/kernel32/profile.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/profil…
============================================================================== --- trunk/rostests/winetests/kernel32/profile.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/profile.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -92,14 +92,23 @@ static void test_profile_string(void) { + static WCHAR emptyW[] = { 0 }; + static WCHAR keyW[] = { 'k','e','y',0 }; + static WCHAR sW[] = { 's',0 }; + static WCHAR TESTFILE2W[] = {'.','\\','t','e','s','t','w','i','n','e','2','.','i','n','i',0}; + static WCHAR valsectionW[] = {'v','a','l','_','e','_','s','e','c','t','i','o','n',0 }; + static WCHAR valnokeyW[] = {'v','a','l','_','n','o','_','k','e','y',0}; HANDLE h; int ret; DWORD count; char buf[100]; + WCHAR bufW[100]; char *p; /* test that lines without an '=' will not be enumerated */ /* in the case below, name2 is a key while name3 is not. */ char content[]="[s]\r\nname1=val1\r\nname2=\r\nname3\r\nname4=val4\r\n"; + char content2[]="\r\nkey=val_no_section\r\n[]\r\nkey=val_e_section\r\n" + "[s]\r\n=val_no_key\r\n[t]\r\n"; DeleteFileA( TESTFILE2); h = CreateFileA( TESTFILE2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); @@ -125,6 +134,27 @@ p[-1] = ','; ok( ret == 24 && !strcmp( buf, "name1,name2,name4,name5"), "wrong keys returned(%d): %s\n", ret, buf); + + h = CreateFileA( TESTFILE2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + ok( h != INVALID_HANDLE_VALUE, " cannot create %s\n", TESTFILE2); + if( h == INVALID_HANDLE_VALUE) return; + WriteFile( h, content2, sizeof(content2), &count, NULL); + CloseHandle( h); + + /* works only in unicode, ascii crashes */ + ret=GetPrivateProfileStringW(emptyW, keyW, emptyW, bufW, + sizeof(bufW)/sizeof(bufW[0]), TESTFILE2W); + todo_wine + ok(!lstrcmpW(valsectionW,bufW), "expected %s, got %s\n", + wine_dbgstr_w(valsectionW), wine_dbgstr_w(bufW) ); + + /* works only in unicode, ascii crashes */ + ret=GetPrivateProfileStringW(sW, emptyW, emptyW, bufW, + sizeof(bufW)/sizeof(bufW[0]), TESTFILE2W); + todo_wine + ok(!lstrcmpW(valnokeyW,bufW), "expected %s, got %s\n", + wine_dbgstr_w(valnokeyW), wine_dbgstr_w(bufW) ); DeleteFileA( TESTFILE2); } Modified: trunk/rostests/winetests/kernel32/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/thread…
============================================================================== --- trunk/rostests/winetests/kernel32/thread.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/thread.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -812,22 +812,24 @@ "SetThreadAffinityMask passed for an illegal processor\n"); /* NOTE: This only works on WinNT/2000/XP) */ if (pSetThreadIdealProcessor) { - todo_wine { - SetLastError(0); - error=pSetThreadIdealProcessor(curthread,0); - if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) { - ok(error!=-1, "SetThreadIdealProcessor failed\n"); - } + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,0); + if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("SetThreadIdealProcessor is not implemented\n"); + return; } - if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) { - error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); - ok(error==-1, - "SetThreadIdealProcessor succeeded with an illegal processor #\n"); - todo_wine { - error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS); - ok(error==0, "SetThreadIdealProcessor returned an incorrect value\n"); - } - } + ok(error!=-1, "SetThreadIdealProcessor failed\n"); + + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); + ok(error==-1, + "SetThreadIdealProcessor succeeded with an illegal processor #\n"); + ok(GetLastError()==ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS); + ok(error==0, "SetThreadIdealProcessor returned an incorrect value\n"); } } Modified: trunk/rostests/winetests/kernel32/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/virtua…
============================================================================== --- trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/virtual.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -284,6 +284,40 @@ ok(old_prot == PAGE_READONLY, "wrong old protection: got %04x instead of PAGE_READONLY\n", old_prot); + ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), + "VirtualQuery failed\n"); + ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); + memset( addr1, 0x55, 20 ); + ok( *(DWORD *)addr1 == 0x55555555, "wrong data %x\n", *(DWORD *)addr1 ); + + addr2 = VirtualAlloc( addr1, 0x1000, MEM_RESET, PAGE_NOACCESS ); + ok( addr2 == addr1 || broken( !addr2 && GetLastError() == ERROR_INVALID_PARAMETER), /* win9x */ + "VirtualAlloc failed err %u\n", GetLastError() ); + ok( *(DWORD *)addr1 == 0x55555555 || *(DWORD *)addr1 == 0, "wrong data %x\n", *(DWORD *)addr1 ); + if (addr2) + { + ok(VirtualQuery(addr1, &info, sizeof(info)) == sizeof(info), + "VirtualQuery failed\n"); + ok(info.RegionSize == 0x1000, "%lx != 0x1000\n", info.RegionSize); + ok(info.State == MEM_COMMIT, "%x != MEM_COMMIT\n", info.State); + ok(info.Protect == PAGE_READWRITE, "%x != PAGE_READWRITE\n", info.Protect); + + addr2 = VirtualAlloc( (char *)addr1 + 0x1000, 0x1000, MEM_RESET, PAGE_NOACCESS ); + ok( (char *)addr2 == (char *)addr1 + 0x1000, "VirtualAlloc failed\n" ); + + ok(VirtualQuery(addr2, &info, sizeof(info)) == sizeof(info), + "VirtualQuery failed\n"); + ok(info.RegionSize == 0xf000, "%lx != 0xf000\n", info.RegionSize); + ok(info.State == MEM_RESERVE, "%x != MEM_RESERVE\n", info.State); + ok(info.Protect == 0, "%x != 0\n", info.Protect); + + addr2 = VirtualAlloc( (char *)addr1 + 0xf000, 0x2000, MEM_RESET, PAGE_NOACCESS ); + ok( !addr2, "VirtualAlloc failed\n" ); + ok( GetLastError() == ERROR_INVALID_ADDRESS, "wrong error %u\n", GetLastError() ); + } + /* invalid protection values */ SetLastError(0xdeadbeef); addr2 = VirtualAlloc(NULL, 0x1000, MEM_RESERVE, 0); @@ -329,7 +363,7 @@ static const char testfile[] = "testfile.xxx"; const char *name; HANDLE file, mapping, map2; - void *ptr, *ptr2; + void *ptr, *ptr2, *addr; MEMORY_BASIC_INFORMATION info; BOOL ret; @@ -699,6 +733,10 @@ "Protect should have been 0 instead of 0x%x\n", info.Protect); ok(info.Type == MEM_MAPPED, "Type should have been MEM_MAPPED instead of 0x%x\n", info.Type); } + + addr = VirtualAlloc( ptr, MAPPING_SIZE, MEM_RESET, PAGE_READONLY ); + ok( addr == ptr || broken(!addr && GetLastError() == ERROR_INVALID_PARAMETER), /* win9x */ + "VirtualAlloc failed with error %u\n", GetLastError() ); ret = VirtualFree( ptr, 0x10000, MEM_DECOMMIT ); ok( !ret || broken(ret) /* win9x */, "VirtualFree succeeded\n" ); Modified: trunk/rostests/winetests/kernel32/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/kernel32/volume…
============================================================================== --- trunk/rostests/winetests/kernel32/volume.c [iso-8859-1] (original) +++ trunk/rostests/winetests/kernel32/volume.c [iso-8859-1] Sat Aug 22 18:42:11 2009 @@ -160,7 +160,7 @@ "GetVolumeNameForVolumeMountPointA failed on %s, last=%d\n", temp_path, GetLastError()); - /* Try on a non-existent dos drive */ + /* Try on a nonexistent dos drive */ path[2] = 0; for (;path[0] <= 'z'; path[0]++) { ret = QueryDosDeviceA( path, volume, len); @@ -174,7 +174,7 @@ "GetVolumeNameForVolumeMountPointA failed on %s, last=%d\n", path, GetLastError()); - /* Try without trailing \ and on a non-existent dos drive */ + /* Try without trailing \ and on a nonexistent dos drive */ path[2] = 0; ret = pGetVolumeNameForVolumeMountPointA(path, volume, len); ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME, @@ -299,6 +299,7 @@ DWORD vol_name_size=MAX_PATH+1, vol_serial_num=-1, max_comp_len=0, fs_flags=0, fs_name_len=MAX_PATH+1; char vol_name_buf[MAX_PATH+1], fs_name_buf[MAX_PATH+1]; char windowsdir[MAX_PATH+10]; + char currentdir[MAX_PATH+1]; if (!pGetVolumeInformationA) { win_skip("GetVolumeInformationA not found\n"); @@ -321,12 +322,40 @@ ret = pGetVolumeNameForVolumeMountPointA(Root_Dir1, volume, MAX_PATH); ok(ret == TRUE, "GetVolumeNameForVolumeMountPointA failed\n"); + result = GetCurrentDirectory(MAX_PATH, currentdir); + ok(result, "GetCurrentDirectory: error %d\n", GetLastError()); + /* **** now start the tests **** */ /* check for error on no trailing \ */ + if (result > 3) + { + ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL, + NULL, NULL, fs_name_buf, fs_name_len); + ok(!ret && GetLastError() == ERROR_INVALID_NAME, + "GetVolumeInformationA w/o '\\' did not fail, last error %u\n", GetLastError()); + } + else + skip("Running on a root directory\n"); + + /* check for error on no trailing \ when current dir is root dir */ + ret = SetCurrentDirectory(Root_Dir1); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); + ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL, + NULL, NULL, fs_name_buf, fs_name_len); + todo_wine + ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError()); + + /* check for error on no trailing \ when current dir is windows dir */ + ret = SetCurrentDirectory(windowsdir); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); ok(!ret && GetLastError() == ERROR_INVALID_NAME, - "GetVolumeInformationA w/o '\\' did not fail, last error %u\n", GetLastError()); + "GetVolumeInformationA did not fail, last error %u\n", GetLastError()); + + /* reset current directory */ + ret = SetCurrentDirectory(currentdir); + ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); /* try null root directory to return "root of the current directory" */ ret = pGetVolumeInformationA(NULL, vol_name_buf, vol_name_size, NULL,
15 years, 4 months
1
0
0
0
[gschneider] 42852: Polish translation for rapps, translation fixes for mmsys and syssetup by Olaf Siejka
by gschneider@svn.reactos.org
Author: gschneider Date: Sat Aug 22 18:42:01 2009 New Revision: 42852 URL:
http://svn.reactos.org/svn/reactos?rev=42852&view=rev
Log: Polish translation for rapps, translation fixes for mmsys and syssetup by Olaf Siejka Added: trunk/reactos/base/applications/rapps/lang/pl-PL.rc (with props) Modified: trunk/reactos/base/applications/paint/lang/pl-PL.rc trunk/reactos/base/applications/rapps/rsrc.rc trunk/reactos/dll/cpl/mmsys/lang/pl-PL.rc trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc Modified: trunk/reactos/base/applications/paint/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/paint/la…
============================================================================== --- trunk/reactos/base/applications/paint/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/paint/lang/pl-PL.rc [iso-8859-1] Sat Aug 22 18:42:01 2009 @@ -1,5 +1,8 @@ /* * translated by Caemyr - Olaf Siejka (May,2009) + * Use ReactOS forum PM or IRC to contact me + *
http://www.reactos.org
+ * IRC:
irc.freenode.net
#reactos-pl; */ Added: trunk/reactos/base/applications/rapps/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/pl-PL.rc (added) +++ trunk/reactos/base/applications/rapps/lang/pl-PL.rc [iso-8859-1] Sat Aug 22 18:42:01 2009 @@ -1,0 +1,169 @@ +// * translated by Caemyr - Olaf Siejka (Aug, 2009) + +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT + +IDR_MAINMENU MENU +BEGIN + POPUP "&Plik" + BEGIN + MENUITEM "&Ustawienia", ID_SETTINGS, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Wyjcie", ID_EXIT + END + POPUP "&Programy" + BEGIN + MENUITEM "&Instaluj", ID_INSTALL + MENUITEM "&Odinstaluj",ID_UNINSTALL + MENUITEM "&Modyfikuj", ID_MODIFY + MENUITEM SEPARATOR + MENUITEM "O&dwie¿", ID_REFRESH + END + POPUP "Pomoc" + BEGIN + MENUITEM "Pomoc", ID_HELP, GRAYED + MENUITEM "O programie", ID_ABOUT + END +END + +IDR_LINKMENU MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Otwórz link w przegl¹darce", ID_OPEN_LINK + MENUITEM "&Skopiuj link do przegl¹darki", ID_COPY_LINK + END +END + +IDR_APPLICATIONMENU MENU +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Instaluj", ID_INSTALL + MENUITEM "&odinstaluj", ID_UNINSTALL + MENUITEM "&Modyfikuj", ID_MODIFY + MENUITEM SEPARATOR + MENUITEM "&Odwie¿", ID_REFRESH + END +END + +IDD_SETTINGS_DIALOG DIALOGEX DISCARDABLE 0, 0, 386, 231 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Ustawienia" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "OK", IDOK, 255, 212, 60, 14 + PUSHBUTTON "Anuluj", IDCANCEL, 320, 212, 60, 14 +END + +IDD_INSTALL_DIALOG DIALOGEX DISCARDABLE 0, 0, 386, 231 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ci¹gnij i zainstaluj" +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "OK", IDOK, 255, 212, 60, 14 + PUSHBUTTON "Anuluj", IDCANCEL, 320, 212, 60, 14 +END + +IDD_DOWNLOAD_DIALOG DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76 +STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE +CAPTION "ci¹gnij..." +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 + LTEXT "", IDC_DOWNLOAD_STATUS, 10, 30, 200, 10, SS_CENTER + PUSHBUTTON "Anuluj", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP +END + +IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66 +STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME +CAPTION "O programie" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "ReactOS Applications Manager\nCopyright (C) 2009\nby Dmitry Chapyshev (dmitry(a)reactos.org)", IDC_STATIC, 48, 7, 130, 39 + PUSHBUTTON "Close", IDOK, 133, 46, 50, 14 + ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30 +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TOOLTIP_INSTALL "Instaluj" + IDS_TOOLTIP_UNINSTALL "Odinstaluj" + IDS_TOOLTIP_MODIFY "Modyfikuj" + IDS_TOOLTIP_SETTINGS "Ustawienia" + IDS_TOOLTIP_REFRESH "Odwie¿" + IDS_TOOLTIP_EXIT "Wyjcie" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_NAME "Nazwa" + IDS_APP_INST_VERSION "Wersja" + IDS_APP_DESCRIPTION "Opis" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_INFO_VERSION "\nWersja: " + IDS_INFO_DESCRIPTION "\nOpis: " + IDS_INFO_PUBLISHER "\nAutor: " + IDS_INFO_HELPLINK "\nLink do pomocy: " + IDS_INFO_HELPPHONE "\nInfolinia: " + IDS_INFO_README "\nPrzeczytaj.to: " + IDS_INFO_REGOWNER "\nW³aciciel: " + IDS_INFO_PRODUCTID "\nProductID: " + IDS_INFO_CONTACT "\nKontakt: " + IDS_INFO_UPDATEINFO "\nAktualizacje: " + IDS_INFO_INFOABOUT "\nInformacje: " + IDS_INFO_COMMENTS "\nKomentarze: " + IDS_INFO_INSTLOCATION "\nScie¿ka instalacji: " + IDS_INFO_INSTALLSRC "\nród³o instalacji: " + IDS_INFO_UNINSTALLSTR "\nKomenda deinstalacji: " + IDS_INFO_MODIFYPATH "\nModify Path: " + IDS_INFO_INSTALLDATE "\nData instalacji: " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_AINFO_VERSION "\nWersja: " + IDS_AINFO_DESCRIPTION "\nOpis: " + IDS_AINFO_SIZE "\nRozmiar: " + IDS_AINFO_URLSITE "\nStrona: " + IDS_AINFO_LICENCE "\nLicencja: " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CAT_AUDIO "Dwiêk" + IDS_CAT_DEVEL "Programowanie" + IDS_CAT_DRIVERS "Sterowniki" + IDS_CAT_EDU "Edukacja" + IDS_CAT_ENGINEER "In¿ynieria" + IDS_CAT_FINANCE "Finanse" + IDS_CAT_GAMES "Gry i rozrywka" + IDS_CAT_GRAPHICS "Grafika" + IDS_CAT_INTERNET "Internet i Sieci" + IDS_CAT_LIBS "Biblioteki" + IDS_CAT_OFFICE "Biurowe" + IDS_CAT_OTHER "Inne" + IDS_CAT_SCIENCE "Nauka" + IDS_CAT_TOOLS "Narzêdzia" + IDS_CAT_VIDEO "Wideo" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPTITLE "Mened¿er aplikacji ReactOS" + IDS_SEARCH_TEXT "Szukaj..." + IDS_INSTALL "Instaluj" + IDS_UNINSTALL "Odinstaluj" + IDS_MODIFY "Modyfikuj" + IDS_APPS_COUNT "Licznik aplikacji: %d" + IDS_WELCOME_TITLE "Witamy w Mened¿erze aplikacji ReactOS!\n\n" + IDS_WELCOME_TEXT "Z listy po lewej wybierz kategoriê, a nastêpnie aplikacjê by j¹ zainstalowaæ lub odinstalowaæ.\nStrona projektu ReactOS: " + IDS_WELCOME_URL "
http://www.reactos.org
" + IDS_INSTALLED "Zainstalowane" + IDS_AVAILABLEFORINST "Dostêpne" + IDS_UPDATES "Uaktualnienia" + IDS_APPLICATIONS "Aplikacje" + IDS_DOWNLOAD_FOLDER "ci¹gniête" +END Propchange: trunk/reactos/base/applications/rapps/lang/pl-PL.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/rapps/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/rs…
============================================================================== --- trunk/reactos/base/applications/rapps/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rsrc.rc [iso-8859-1] Sat Aug 22 18:42:01 2009 @@ -1,5 +1,6 @@ #include "lang/en-US.rc" #include "lang/de-DE.rc" #include "lang/no-NO.rc" +#include "lang/pl-PL.rc" #include "lang/ru-RU.rc" #include "lang/uk-UA.rc" Modified: trunk/reactos/dll/cpl/mmsys/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/lang/pl-PL.r…
============================================================================== --- trunk/reactos/dll/cpl/mmsys/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/mmsys/lang/pl-PL.rc [iso-8859-1] Sat Aug 22 18:42:01 2009 @@ -244,7 +244,7 @@ IDS_CPLNAME "Dwiêk i urz¹dzenia audio" IDS_CPLDESCRIPTION "Zmieñ schemat dwiêkowy dla tego komputera lub skonfiguruj ustawienia g³oników i urz¹dzeñ nagrywaj¹cych." IDS_NO_SOUND "(Brak)" - IDS_NO_DEVICES "No Devices" + IDS_NO_DEVICES "Brak urz¹dzeñ" 5825 "B³¹d programu" 5826 "Zamknij program" @@ -275,5 +275,5 @@ 5851 "Menu Start" 5852 "Wylogowanie z ReactOS" 5853 "Logowanie do ReactOS" - 5854 "ReactOS Explorer" -END + 5854 "Eksplorator ReactOS" +END Modified: trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/pl…
============================================================================== --- trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc [iso-8859-1] Sat Aug 22 18:42:01 2009 @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * translated by Caemyr - * updated by Caemyr - Olaf Siejka (Jan, 2008) + * updated by Caemyr - Olaf Siejka (Jan, 2008), (Aug, 2009) * Use ReactOS forum PM or IRC to contact me *
http://www.reactos.org
* IRC:
irc.freenode.net
#reactos-pl; @@ -271,7 +271,7 @@ BEGIN IDS_SHORT_CMD "Wiersz poleceñ.lnk" IDS_SHORT_EXPLORER "Eksplorator ReactOS.lnk" - IDS_SHORT_DOWNLOADER "ReactOS Applications Manager.lnk" + IDS_SHORT_DOWNLOADER "Mened¿er aplikacji ReactOS.lnk" IDS_SHORT_SERVICE "Mened¿er us³ug.lnk" IDS_SHORT_DEVICE "Mened¿er urz¹dzeñ.lnk" IDS_SHORT_MPLAY32 "Odtwarzacz multimedialny.lnk"
15 years, 4 months
1
0
0
0
[cwittich] 42851: sync wrc to wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 17:35:17 2009 New Revision: 42851 URL:
http://svn.reactos.org/svn/reactos?rev=42851&view=rev
Log: sync wrc to wine 1.1.28 Modified: trunk/reactos/tools/wrc/genres.c trunk/reactos/tools/wrc/lex.yy.c trunk/reactos/tools/wrc/parser.l trunk/reactos/tools/wrc/utils.c trunk/reactos/tools/wrc/utils.h trunk/reactos/tools/wrc/wrc.c trunk/reactos/tools/wrc/wrc.h Modified: trunk/reactos/tools/wrc/genres.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/genres.c?rev=428…
============================================================================== --- trunk/reactos/tools/wrc/genres.c [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/genres.c [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -317,6 +317,9 @@ if (!check_unicode_conversion( str, newstr, codepage )) error( "String %s does not convert identically to Unicode and back in codepage %d. " "Try using a Unicode string instead\n", str->str.cstr, codepage ); + if (check_valid_utf8( str, codepage )) + warning( "string \"%s\" seems to be UTF-8 but codepage %u is in use.\n", + str->str.cstr, codepage ); } if (!isterm) put_word(res, newstr->size); for(cnt = 0; cnt < newstr->size; cnt++) Modified: trunk/reactos/tools/wrc/lex.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/lex.yy.c?rev=428…
============================================================================== --- trunk/reactos/tools/wrc/lex.yy.c [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/lex.yy.c [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -2672,6 +2672,9 @@ if (!check_unicode_conversion( str, str_w, current_codepage )) parser_error("String %s does not convert identically to Unicode and back in codepage %d. " "Try using a Unicode string instead", str->str.cstr, current_codepage ); + if (check_valid_utf8( str, current_codepage )) + parser_warning( "string \"%s\" seems to be UTF-8 but codepage %u is in use.", + str->str.cstr, current_codepage ); free_string( str ); return str_w; } Modified: trunk/reactos/tools/wrc/parser.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/parser.l?rev=428…
============================================================================== --- trunk/reactos/tools/wrc/parser.l [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/parser.l [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -637,6 +637,9 @@ if (!check_unicode_conversion( str, str_w, current_codepage )) parser_error("String %s does not convert identically to Unicode and back in codepage %d. " "Try using a Unicode string instead", str->str.cstr, current_codepage ); + if (check_valid_utf8( str, current_codepage )) + parser_warning( "string \"%s\" seems to be UTF-8 but codepage %u is in use.", + str->str.cstr, current_codepage ); free_string( str ); return str_w; } Modified: trunk/reactos/tools/wrc/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/utils.c?rev=4285…
============================================================================== --- trunk/reactos/tools/wrc/utils.c [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/utils.c [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -311,6 +311,29 @@ free( str ); } +/* check if the string is valid utf8 despite a different codepage being in use */ +int check_valid_utf8( const string_t *str, int codepage ) +{ + unsigned int i; + + if (!check_utf8) return 0; + if (!codepage) return 0; + if (!wine_cp_get_table( codepage )) return 0; + + for (i = 0; i < str->size; i++) + { + if ((unsigned char)str->str.cstr[i] >= 0xf5) goto done; + if ((unsigned char)str->str.cstr[i] >= 0xc2) break; + if ((unsigned char)str->str.cstr[i] >= 0x80) goto done; + } + if (i == str->size) return 0; /* no 8-bit chars at all */ + + if (wine_utf8_mbstowcs( MB_ERR_INVALID_CHARS, str->str.cstr, str->size, NULL, 0 ) >= 0) return 1; + +done: + check_utf8 = 0; /* at least one 8-bit non-utf8 string found, stop checking */ + return 0; +} int check_unicode_conversion( const string_t *str_a, const string_t *str_w, int codepage ) { Modified: trunk/reactos/tools/wrc/utils.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/utils.h?rev=4285…
============================================================================== --- trunk/reactos/tools/wrc/utils.h [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/utils.h [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -45,6 +45,7 @@ int compare_name_id(const name_id_t *n1, const name_id_t *n2); string_t *convert_string(const string_t *str, enum str_e type, int codepage); void free_string( string_t *str ); +int check_valid_utf8( const string_t *str, int codepage ); int check_unicode_conversion( const string_t *str_a, const string_t *str_w, int codepage ); int get_language_codepage( unsigned short lang, unsigned short sublang ); Modified: trunk/reactos/tools/wrc/wrc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/wrc.c?rev=42851&…
============================================================================== --- trunk/reactos/tools/wrc/wrc.c [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/wrc.c [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -155,6 +155,8 @@ */ int no_preprocess = 0; +int check_utf8 = 1; /* whether to check for valid utf8 */ + static int verify_translations_mode; char *output_name = NULL; /* The name given by the -o option */ @@ -292,6 +294,7 @@ /* Reset the language */ currentlanguage = dup_language( defaultlanguage ); + check_utf8 = 1; /* Go from .rc to .res */ chat("Starting parse\n"); @@ -514,14 +517,11 @@ } if (load_file( input_name, output_name )) exit(1); } - /* stdin special case. NULL means "stdin" for wpp. */ - if (nb_files == 0) { + if (nb_files == 0) + { if(!output_name && !preprocess_only) - { - output_name = dup_basename("stdin", ".rc"); - strcat(output_name, ".res"); - } + output_name = strdup("wrc.tab.res"); if (load_file( NULL, output_name )) exit(1); } Modified: trunk/reactos/tools/wrc/wrc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/wrc.h?rev=42851&…
============================================================================== --- trunk/reactos/tools/wrc/wrc.h [iso-8859-1] (original) +++ trunk/reactos/tools/wrc/wrc.h [iso-8859-1] Sat Aug 22 17:35:17 2009 @@ -43,6 +43,7 @@ extern int byteorder; extern int preprocess_only; extern int no_preprocess; +extern int check_utf8; extern char *output_name; extern char *input_name;
15 years, 4 months
1
0
0
0
[cwittich] 42850: sync jscript winetest with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 17:26:35 2009 New Revision: 42850 URL:
http://svn.reactos.org/svn/reactos?rev=42850&view=rev
Log: sync jscript winetest with wine 1.1.28 Modified: trunk/rostests/winetests/jscript/api.js trunk/rostests/winetests/jscript/regexp.js trunk/rostests/winetests/jscript/run.c Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
============================================================================== --- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Sat Aug 22 17:26:35 2009 @@ -76,6 +76,14 @@ ok(tmp.f() === "[object RegExp]", "tmp.f() = " + tmp.f()); (tmp = new String).f = Object.prototype.toString; ok(tmp.f() === "[object String]", "tmp.f() = " + tmp.f()); + +var obj = new Object(); +obj.toString = function (x) { + ok(arguments.length === 0, "arguments.length = " + arguments.length); + return "test"; +}; +ok((tmp = obj.toLocaleString()) === "test", "obj.toLocaleString() = " + tmp); +ok((tmp = obj.toLocaleString(1)) === "test", "obj.toLocaleString(1) = " + tmp); ok("".length === 0, "\"\".length = " + "".length); ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length); @@ -1345,4 +1353,203 @@ exception_test(function() {eval("if(")}, "SyntaxError", -2146827286); exception_test(function() {eval("'unterminated")}, "SyntaxError", -2146827273); +function testObjectInherit(obj, ts, tls, vo) { + ok(obj.hasOwnProperty === Object.prototype.hasOwnProperty, + "obj.hasOwnProperty !== Object.prototype.hasOwnProprty"); + ok(obj.isPrototypeOf === Object.prototype.isPrototypeOf, + "obj.isPrototypeOf !== Object.prototype.isPrototypeOf"); + ok(obj.propertyIsEnumerable === Object.prototype.propertyIsEnumerable, + "obj.propertyIsEnumerable !== Object.prototype.propertyIsEnumerable"); + + if(ts) + ok(obj.toString === Object.prototype.toString, + "obj.toString !== Object.prototype.toString"); + else + ok(obj.toString != Object.prototype.toString, + "obj.toString == Object.prototype.toString"); + + if(tls) + ok(obj.toLocaleString === Object.prototype.toLocaleString, + "obj.toLocaleString !== Object.prototype.toLocaleString"); + else + ok(obj.toLocaleString != Object.prototype.toLocaleString, + "obj.toLocaleString == Object.prototype.toLocaleString"); + + if(vo) + ok(obj.valueOf === Object.prototype.valueOf, + "obj.valueOf !== Object.prototype.valueOf"); + else + ok(obj.valueOf != Object.prototype.valueOf, + "obj.valueOf == Object.prototype.valueOf"); + + ok(obj._test === "test", "obj.test = " + obj._test); +} + +Object.prototype._test = "test"; +testObjectInherit(new String("test"), false, true, false); +testObjectInherit(/test/g, false, true, true); +testObjectInherit(new Number(1), false, false, false); +testObjectInherit(new Date(), false, false, false); +testObjectInherit(new Boolean(true), false, true, false); +testObjectInherit(new Array(), false, false, true); +testObjectInherit(new Error(), false, true, true); +testObjectInherit(testObjectInherit, false, true, true); +testObjectInherit(Math, true, true, true); + +function testFunctions(obj, arr) { + var l; + + for(var i=0; i<arr.length; i++) { + l = obj[arr[i][0]].length; + ok(l === arr[i][1], arr[i][0] + ".length = " + l); + } +} + +testFunctions(Boolean.prototype, [ + ["valueOf", 0], + ["toString", 0] + ]); + +testFunctions(Number.prototype, [ + ["valueOf", 0], + ["toString", 1], + ["toExponential", 1], + ["toLocaleString", 0], + ["toPrecision", 1] + ]); + +testFunctions(String.prototype, [ + ["valueOf", 0], + ["toString", 0], + ["anchor", 1], + ["big", 0], + ["blink", 0], + ["bold", 0], + ["charAt", 1], + ["charCodeAt", 1], + ["concat", 1], + ["fixed", 0], + ["fontcolor", 1], + ["fontsize", 1], + ["indexOf", 2], + ["italics", 0], + ["lastIndexOf", 2], + ["link", 1], + ["localeCompare", 1], + ["match", 1], + ["replace", 1], + ["search", 0], + ["slice", 0], + ["small", 0], + ["split", 2], + ["strike", 0], + ["sub", 0], + ["substr", 2], + ["substring", 2], + ["sup", 0], + ["toLocaleLowerCase", 0], + ["toLocaleUpperCase", 0], + ["toLowerCase", 0], + ["toUpperCase", 0] + ]); + +testFunctions(RegExp.prototype, [ + ["toString", 0], + ["exec", 1], + ["test", 1] + ]); + +testFunctions(Date.prototype, [ + ["getDate", 0], + ["getDay", 0], + ["getFullYear", 0], + ["getHours", 0], + ["getMilliseconds", 0], + ["getMinutes", 0], + ["getMonth", 0], + ["getSeconds", 0], + ["getTime", 0], + ["getTimezoneOffset", 0], + ["getUTCDate", 0], + ["getUTCDay", 0], + ["getUTCFullYear", 0], + ["getUTCHours", 0], + ["getUTCMilliseconds", 0], + ["getUTCMinutes", 0], + ["getUTCMonth", 0], + ["getUTCSeconds", 0], + ["setDate", 1], + ["setFullYear", 3], + ["setHours", 4], + ["setMilliseconds", 1], + ["setMinutes", 3], + ["setMonth", 2], + ["setSeconds", 2], + ["setTime", 1], + ["setUTCDate", 1], + ["setUTCFullYear", 3], + ["setUTCHours", 4], + ["setUTCMilliseconds", 1], + ["setUTCMinutes", 3], + ["setUTCMonth", 2], + ["setUTCSeconds", 2], + ["toDateString", 0], + ["toLocaleDateString", 0], + ["toLocaleString", 0], + ["toLocaleTimeString", 0], + ["toString", 0], + ["toTimeString", 0], + ["toUTCString", 0], + ["valueOf", 0] + ]); + +testFunctions(Array.prototype, [ + ["concat", 1], + ["join", 1], + ["push", 1], + ["pop", 0], + ["reverse", 0], + ["shift", 0], + ["slice", 2], + ["sort", 1], + ["splice", 2], + ["toLocaleString", 0], + ["toString", 0], + ["unshift", 1] + ]); + +testFunctions(Error.prototype, [ + ["toString", 0] + ]); + +testFunctions(Math, [ + ["abs", 1], + ["acos", 1], + ["asin", 1], + ["atan", 1], + ["atan2", 2], + ["ceil", 1], + ["cos", 1], + ["exp", 1], + ["floor", 1], + ["log", 1], + ["max", 2], + ["min", 2], + ["pow", 2], + ["random", 0], + ["round", 1], + ["sin", 1], + ["sqrt", 1], + ["tan", 1] + ]); + +testFunctions(Object.prototype, [ + ["hasOwnProperty", 1], + ["isPrototypeOf", 1], + ["propertyIsEnumerable", 1], + ["toLocaleString", 0], + ["toString", 0], + ["valueOf", 0] + ]); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/regexp.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/regexp.…
============================================================================== --- trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] Sat Aug 22 17:26:35 2009 @@ -158,6 +158,39 @@ r = "[test1] [test2]".replace(/\[([^\[]+)\]/g, replaceFunc2); ok(r === "r0 r1", "r = '" + r + "' expected 'r0 r1'"); +r = "$1,$2".replace(/(\$(\d))/g, "$$1-$1$2"); +ok(r === "$1-$11,$1-$22", "r = '" + r + "' expected '$1-$11,$1-$22'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$&"); +ok(r === "abc &1 123", "r = '" + r + "' expected 'abc &1 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$'"); +ok(r === "abc 123 123", "r = '" + r + "' expected 'abc 123 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$`"); +ok(r === "abc abc 123", "r = '" + r + "' expected 'abc abc 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$3"); +ok(r === "abc $3 123", "r = '" + r + "' expected 'abc $3 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$"); +ok(r === "abc $ 123", "r = '" + r + "' expected 'abc $ 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$a"); +ok(r === "abc $a 123", "r = '" + r + "' expected 'abc $a 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$11"); +ok(r === "abc &11 123", "r = '" + r + "' expected 'abc &11 123'"); + +r = "abc &1 123".replace(/(\&(\d))/g, "$0"); +ok(r === "abc $0 123", "r = '" + r + "' expected 'abc $0 123'"); + +r = "1 2 3".replace("2", "$&"); +ok(r === "1 $& 3", "r = '" + r + "' expected '1 $& 3'"); + +r = "1 2 3".replace("2", "$'"); +ok(r === "1 $' 3", "r = '" + r + "' expected '1 $' 3'"); + r = "1,,2,3".split(/,+/g); ok(r.length === 3, "r.length = " + r.length); ok(r[0] === "1", "r[0] = " + r[0]); @@ -175,4 +208,12 @@ ok(r[0] === "1", "r[0] = " + r[0]); ok(r[1] === "2", "r[1] = " + r[1]); +var re; + +re = /abc[^d]/g; +ok(re.source === "abc[^d]", "re.source = '" + re.source + "', expected 'abc[^d]'"); + +re = /a\bc[^d]/g; +ok(re.source === "a\\bc[^d]", "re.source = '" + re.source + "', expected 'a\\bc[^d]'"); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/run.c?r…
============================================================================== --- trunk/rostests/winetests/jscript/run.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/run.c [iso-8859-1] Sat Aug 22 17:26:35 2009 @@ -63,6 +63,7 @@ DEFINE_EXPECT(global_propput_i); DEFINE_EXPECT(global_success_d); DEFINE_EXPECT(global_success_i); +DEFINE_EXPECT(global_notexists_d); DEFINE_EXPECT(testobj_delete); DEFINE_EXPECT(GetItemInfo_testVal); @@ -83,17 +84,6 @@ static BOOL strict_dispid_check; static const char *test_name = "(null)"; -static const char *debugstr_w(LPCWSTR str) -{ - static char buf[1024]; - - if(!str) - return "(null)"; - - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); - return buf; -} - static BSTR a2bstr(const char *str) { BSTR ret; @@ -168,7 +158,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) { - ok(0, "unexpected call %s %x\n", debugstr_w(bstrName), grfdex); + ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); return E_NOTIMPL; } @@ -219,7 +209,7 @@ { CHECK_EXPECT(testobj_delete); - ok(!strcmp_wa(bstrName, "deleteTest"), "unexpected name %s\n", debugstr_w(bstrName)); + ok(!strcmp_wa(bstrName, "deleteTest"), "unexpected name %s\n", wine_dbgstr_w(bstrName)); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); return S_OK; } @@ -288,9 +278,14 @@ *pid = DISPID_GLOBAL_NULL_BSTR; return S_OK; } + if(!strcmp_wa(bstrName, "notExists")) { + CHECK_EXPECT(global_notexists_d); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + return DISP_E_UNKNOWNNAME; + } if(strict_dispid_check) - ok(0, "unexpected call %s\n", debugstr_w(bstrName)); + ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName)); return DISP_E_UNKNOWNNAME; } @@ -313,7 +308,7 @@ ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg)); - ok(V_BOOL(pdp->rgvarg+1), "%s: %s\n", test_name, debugstr_w(V_BSTR(pdp->rgvarg))); + ok(V_BOOL(pdp->rgvarg+1), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg))); return S_OK; @@ -329,7 +324,7 @@ ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); if(V_VT(pdp->rgvarg) == VT_BSTR) - trace("%s: %s\n", test_name, debugstr_w(V_BSTR(pdp->rgvarg))); + trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg))); return S_OK; @@ -507,7 +502,7 @@ if(!strcmp_wa(pstrName, test_valA)) CHECK_EXPECT(GetItemInfo_testVal); else if(strcmp_wa(pstrName, testA)) - ok(0, "unexpected pstrName %s\n", debugstr_w(pstrName)); + ok(0, "unexpected pstrName %s\n", wine_dbgstr_w(pstrName)); *ppiunkItem = (IUnknown*)&Global; return S_OK; @@ -835,6 +830,18 @@ parse_script_a("ok(typeof(test) === 'object', \"typeof(test) != 'object'\");"); + parse_script_a("function reportSuccess() {}; reportSuccess();"); + + SET_EXPECT(global_propget_d); + parse_script_a("var testPropGet"); + CHECK_CALLED(global_propget_d); + + SET_EXPECT(global_notexists_d); + parse_script_a("var notExists; notExists = 1;"); + CHECK_CALLED(global_notexists_d); + + parse_script_a("function f() { var testPropGet; }"); + run_from_res("lang.js"); run_from_res("api.js"); run_from_res("regexp.js");
15 years, 4 months
1
0
0
0
[cwittich] 42849: sync jscript with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 17:25:26 2009 New Revision: 42849 URL:
http://svn.reactos.org/svn/reactos?rev=42849&view=rev
Log: sync jscript with wine 1.1.28 Modified: trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/date.c trunk/reactos/dll/win32/jscript/dispex.c trunk/reactos/dll/win32/jscript/engine.c trunk/reactos/dll/win32/jscript/error.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/jscript_Nl.rc trunk/reactos/dll/win32/jscript/math.c trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/object.c trunk/reactos/dll/win32/jscript/regexp.c trunk/reactos/dll/win32/jscript/string.c Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -43,10 +43,6 @@ static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR unshiftW[] = {'u','n','s','h','i','f','t',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR default_separatorW[] = {',',0}; @@ -743,27 +739,6 @@ return E_NOTIMPL; } -static HRESULT Array_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Array_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Array_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Array_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -809,22 +784,19 @@ } static const builtin_prop_t Array_props[] = { - {concatW, Array_concat, PROPF_METHOD}, - {hasOwnPropertyW, Array_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Array_isPrototypeOf, PROPF_METHOD}, - {joinW, Array_join, PROPF_METHOD}, + {concatW, Array_concat, PROPF_METHOD|1}, + {joinW, Array_join, PROPF_METHOD|1}, {lengthW, Array_length, 0}, {popW, Array_pop, PROPF_METHOD}, - {propertyIsEnumerableW, Array_propertyIsEnumerable, PROPF_METHOD}, - {pushW, Array_push, PROPF_METHOD}, + {pushW, Array_push, PROPF_METHOD|1}, {reverseW, Array_reverse, PROPF_METHOD}, {shiftW, Array_shift, PROPF_METHOD}, - {sliceW, Array_slice, PROPF_METHOD}, - {sortW, Array_sort, PROPF_METHOD}, - {spliceW, Array_splice, PROPF_METHOD}, + {sliceW, Array_slice, PROPF_METHOD|2}, + {sortW, Array_sort, PROPF_METHOD|1}, + {spliceW, Array_splice, PROPF_METHOD|2}, {toLocaleStringW, Array_toLocaleString, PROPF_METHOD}, {toStringW, Array_toString, PROPF_METHOD}, - {unshiftW, Array_unshift, PROPF_METHOD}, + {unshiftW, Array_unshift, PROPF_METHOD|1}, }; static const builtin_info_t Array_info = { @@ -888,7 +860,7 @@ return S_OK; } -static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **ret) +static HRESULT alloc_array(script_ctx_t *ctx, DispatchEx *object_prototype, ArrayInstance **ret) { ArrayInstance *array; HRESULT hres; @@ -897,8 +869,8 @@ if(!array) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->array_constr); + if(object_prototype) + hres = init_dispex(&array->dispex, ctx, &Array_info, object_prototype); else hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->object_constr); @@ -911,12 +883,12 @@ return S_OK; } -HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_array_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { ArrayInstance *array; HRESULT hres; - hres = alloc_array(ctx, FALSE, &array); + hres = alloc_array(ctx, object_prototype, &array); if(FAILED(hres)) return hres; @@ -931,7 +903,7 @@ ArrayInstance *array; HRESULT hres; - hres = alloc_array(ctx, TRUE, &array); + hres = alloc_array(ctx, NULL, &array); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -30,12 +30,7 @@ } BoolInstance; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; /* ECMA-262 3rd Edition 15.6.4.2 */ static HRESULT Bool_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -66,13 +61,6 @@ return S_OK; } -static HRESULT Bool_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - TRACE("\n"); - return Bool_toString(dispex, lcid, flags, dp, retv, ei, sp); -} - /* ECMA-262 3rd Edition 15.6.4.3 */ static HRESULT Bool_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) @@ -90,27 +78,6 @@ } return S_OK; -} - -static HRESULT Bool_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Bool_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Bool_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; } static HRESULT Bool_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -131,10 +98,6 @@ } static const builtin_prop_t Bool_props[] = { - {hasOwnPropertyW, Bool_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Bool_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Bool_propertyIsEnumerable, PROPF_METHOD}, - {toLocaleStringW, Bool_toLocaleString, PROPF_METHOD}, {toStringW, Bool_toString, PROPF_METHOD}, {valueOfW, Bool_valueOf, PROPF_METHOD} }; @@ -188,7 +151,7 @@ return S_OK; } -static HRESULT alloc_bool(script_ctx_t *ctx, BOOL use_constr, BoolInstance **ret) +static HRESULT alloc_bool(script_ctx_t *ctx, DispatchEx *object_prototype, BoolInstance **ret) { BoolInstance *bool; HRESULT hres; @@ -197,10 +160,10 @@ if(!bool) return E_OUTOFMEMORY; - if(use_constr) + if(object_prototype) + hres = init_dispex(&bool->dispex, ctx, &Bool_info, object_prototype); + else hres = init_dispex_from_constr(&bool->dispex, ctx, &Bool_info, ctx->bool_constr); - else - hres = init_dispex(&bool->dispex, ctx, &Bool_info, NULL); if(FAILED(hres)) { heap_free(bool); @@ -211,12 +174,12 @@ return S_OK; } -HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { BoolInstance *bool; HRESULT hres; - hres = alloc_bool(ctx, FALSE, &bool); + hres = alloc_bool(ctx, object_prototype, &bool); if(FAILED(hres)) return hres; @@ -231,7 +194,7 @@ BoolInstance *bool; HRESULT hres; - hres = alloc_bool(ctx, TRUE, &bool); + hres = alloc_bool(ctx, NULL, &bool); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/date.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/date.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/date.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #include <limits.h> #include <math.h> @@ -44,7 +47,6 @@ static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; @@ -649,27 +651,6 @@ return S_OK; } -static HRESULT Date_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Date_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Date_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Date_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { @@ -2073,24 +2054,21 @@ {getUTCMonthW, Date_getUTCMonth, PROPF_METHOD}, {getUTCSecondsW, Date_getUTCSeconds, PROPF_METHOD}, {getYearW, Date_getYear, PROPF_METHOD}, - {hasOwnPropertyW, Date_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Date_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Date_propertyIsEnumerable, PROPF_METHOD}, - {setDateW, Date_setDate, PROPF_METHOD}, - {setFullYearW, Date_setFullYear, PROPF_METHOD}, - {setHoursW, Date_setHours, PROPF_METHOD}, - {setMillisecondsW, Date_setMilliseconds, PROPF_METHOD}, - {setMinutesW, Date_setMinutes, PROPF_METHOD}, - {setMonthW, Date_setMonth, PROPF_METHOD}, - {setSecondsW, Date_setSeconds, PROPF_METHOD}, - {setTimeW, Date_setTime, PROPF_METHOD}, - {setUTCDateW, Date_setUTCDate, PROPF_METHOD}, - {setUTCFullYearW, Date_setUTCFullYear, PROPF_METHOD}, - {setUTCHoursW, Date_setUTCHours, PROPF_METHOD}, - {setUTCMillisecondsW, Date_setUTCMilliseconds, PROPF_METHOD}, - {setUTCMinutesW, Date_setUTCMinutes, PROPF_METHOD}, - {setUTCMonthW, Date_setUTCMonth, PROPF_METHOD}, - {setUTCSecondsW, Date_setUTCSeconds, PROPF_METHOD}, + {setDateW, Date_setDate, PROPF_METHOD|1}, + {setFullYearW, Date_setFullYear, PROPF_METHOD|3}, + {setHoursW, Date_setHours, PROPF_METHOD|4}, + {setMillisecondsW, Date_setMilliseconds, PROPF_METHOD|1}, + {setMinutesW, Date_setMinutes, PROPF_METHOD|3}, + {setMonthW, Date_setMonth, PROPF_METHOD|2}, + {setSecondsW, Date_setSeconds, PROPF_METHOD|2}, + {setTimeW, Date_setTime, PROPF_METHOD|1}, + {setUTCDateW, Date_setUTCDate, PROPF_METHOD|1}, + {setUTCFullYearW, Date_setUTCFullYear, PROPF_METHOD|3}, + {setUTCHoursW, Date_setUTCHours, PROPF_METHOD|4}, + {setUTCMillisecondsW, Date_setUTCMilliseconds, PROPF_METHOD|1}, + {setUTCMinutesW, Date_setUTCMinutes, PROPF_METHOD|3}, + {setUTCMonthW, Date_setUTCMonth, PROPF_METHOD|2}, + {setUTCSecondsW, Date_setUTCSeconds, PROPF_METHOD|2}, {toDateStringW, Date_toDateString, PROPF_METHOD}, {toLocaleDateStringW, Date_toLocaleDateString, PROPF_METHOD}, {toLocaleStringW, Date_toLocaleString, PROPF_METHOD}, @@ -2110,7 +2088,7 @@ NULL }; -static HRESULT create_date(script_ctx_t *ctx, BOOL use_constr, DOUBLE time, DispatchEx **ret) +static HRESULT create_date(script_ctx_t *ctx, DispatchEx *object_prototype, DOUBLE time, DispatchEx **ret) { DateInstance *date; HRESULT hres; @@ -2122,10 +2100,10 @@ if(!date) return E_OUTOFMEMORY; - if(use_constr) + if(object_prototype) + hres = init_dispex(&date->dispex, ctx, &Date_info, object_prototype); + else hres = init_dispex_from_constr(&date->dispex, ctx, &Date_info, ctx->date_constr); - else - hres = init_dispex(&date->dispex, ctx, &Date_info, NULL); if(FAILED(hres)) { heap_free(date); return hres; @@ -2537,7 +2515,7 @@ lltime = ((LONGLONG)time.dwHighDateTime<<32) + time.dwLowDateTime; - hres = create_date(dispex->ctx, TRUE, lltime/10000-TIME_EPOCH, &date); + hres = create_date(dispex->ctx, NULL, lltime/10000-TIME_EPOCH, &date); if(FAILED(hres)) return hres; break; @@ -2560,7 +2538,7 @@ if(FAILED(hres)) return hres; - hres = create_date(dispex->ctx, TRUE, time_clip(num_val(&num)), &date); + hres = create_date(dispex->ctx, NULL, time_clip(num_val(&num)), &date); if(FAILED(hres)) return hres; break; @@ -2573,7 +2551,7 @@ DateConstr_UTC(dispex, lcid, flags, dp, &ret_date, ei, sp); - hres = create_date(dispex->ctx, TRUE, num_val(&ret_date), &date); + hres = create_date(dispex->ctx, NULL, num_val(&ret_date), &date); if(FAILED(hres)) return hres; @@ -2620,12 +2598,12 @@ NULL }; -HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_date_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { DispatchEx *date; HRESULT hres; - hres = create_date(ctx, FALSE, 0.0, &date); + hres = create_date(ctx, object_prototype, 0.0, &date); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/dispex.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/dispex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/dispex.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -844,6 +844,23 @@ return invoke_prop_func(disp, disp, prop, lcid, flags, dp, retv, ei, caller); } +HRESULT jsdisp_call_name(DispatchEx *disp, const WCHAR *name, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, + jsexcept_t *ei, IServiceProvider *caller) +{ + dispex_prop_t *prop; + HRESULT hres; + + hres = find_prop_name_prot(disp, name, TRUE, &prop); + if(FAILED(hres)) + return hres; + + memset(ei, 0, sizeof(*ei)); + if(retv) + V_VT(retv) = VT_EMPTY; + + return invoke_prop_func(disp, disp, prop, lcid, flags, dp, retv, ei, caller); +} + HRESULT disp_call(IDispatch *disp, DISPID id, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller) { Modified: trunk/reactos/dll/win32/jscript/engine.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/engine.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/engine.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -356,6 +356,26 @@ return S_OK; } +static BOOL lookup_global_members(script_ctx_t *ctx, BSTR identifier, exprval_t *ret) +{ + named_item_t *item; + DISPID id; + HRESULT hres; + + for(item = ctx->named_items; item; item = item->next) { + if(item->flags & SCRIPTITEM_GLOBALMEMBERS) { + hres = disp_get_id(item->disp, identifier, 0, &id); + if(SUCCEEDED(hres)) { + if(ret) + exprval_set_idref(ret, item->disp, id); + return TRUE; + } + } + } + + return FALSE; +} + HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *source, jsexcept_t *ei, VARIANT *retv) { script_ctx_t *script = parser->script; @@ -387,8 +407,15 @@ for(var = source->variables; var; var = var->next) { DISPID id = 0; - - hres = jsdisp_get_id(ctx->var_disp, var->identifier, fdexNameEnsure, &id); + BSTR name; + + name = SysAllocString(var->identifier); + if(!name) + return E_OUTOFMEMORY; + + if(!lookup_global_members(parser->script, name, NULL)) + hres = jsdisp_get_id(ctx->var_disp, var->identifier, fdexNameEnsure, &id); + SysFreeString(name); if(FAILED(hres)) return hres; } @@ -493,24 +520,14 @@ } } - for(item = ctx->parser->script->named_items; item; item = item->next) { - if(item->flags & SCRIPTITEM_GLOBALMEMBERS) { - hres = disp_get_id(item->disp, identifier, 0, &id); - if(SUCCEEDED(hres)) - break; - } - } - - if(item) { - exprval_set_idref(ret, item->disp, id); - return S_OK; - } - hres = jsdisp_get_id(ctx->parser->script->script_disp, identifier, 0, &id); if(SUCCEEDED(hres)) { exprval_set_idref(ret, (IDispatch*)_IDispatchEx_(ctx->parser->script->script_disp), id); return S_OK; } + + if(lookup_global_members(ctx->parser->script, identifier, ret)) + return S_OK; if(flags & EXPR_NEWREF) { hres = jsdisp_get_id(ctx->var_disp, identifier, fdexNameEnsure, &id); Modified: trunk/reactos/dll/win32/jscript/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/error.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/error.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/error.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -38,10 +38,6 @@ static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0}; static const WCHAR numberW[] = {'n','u','m','b','e','r',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static HRESULT Error_number(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) @@ -116,28 +112,6 @@ return S_OK; } -static HRESULT Error_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Error_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - - -static HRESULT Error_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, - DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Error_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -166,11 +140,8 @@ static const builtin_prop_t Error_props[] = { {descriptionW, Error_description, 0}, - {hasOwnPropertyW, Error_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Error_isPrototypeOf, PROPF_METHOD}, {messageW, Error_message, 0}, {numberW, Error_number, 0}, - {propertyIsEnumerableW, Error_propertyIsEnumerable, PROPF_METHOD}, {toStringW, Error_toString, PROPF_METHOD} }; @@ -185,11 +156,8 @@ static const builtin_prop_t ErrorInst_props[] = { {descriptionW, Error_description, 0}, - {hasOwnPropertyW, Error_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Error_isPrototypeOf, PROPF_METHOD}, {messageW, Error_message, 0}, {numberW, Error_number, 0}, - {propertyIsEnumerableW, Error_propertyIsEnumerable, PROPF_METHOD} }; static const builtin_info_t ErrorInst_info = { @@ -201,21 +169,21 @@ NULL }; -static HRESULT alloc_error(script_ctx_t *ctx, BOOL error_prototype, +static HRESULT alloc_error(script_ctx_t *ctx, DispatchEx *prototype, DispatchEx *constr, ErrorInstance **ret) { ErrorInstance *err; - DispatchEx *inherit; HRESULT hres; err = heap_alloc_zero(sizeof(ErrorInstance)); if(!err) return E_OUTOFMEMORY; - inherit = error_prototype ? ctx->object_constr : ctx->error_constr; - hres = init_dispex_from_constr(&err->dispex, ctx, - error_prototype ? &Error_info : &ErrorInst_info, - constr ? constr : inherit); + if(prototype) + hres = init_dispex(&err->dispex, ctx, &Error_info, prototype); + else + hres = init_dispex_from_constr(&err->dispex, ctx, &ErrorInst_info, + constr ? constr : ctx->error_constr); if(FAILED(hres)) { heap_free(err); return hres; @@ -231,7 +199,7 @@ ErrorInstance *err; HRESULT hres; - hres = alloc_error(ctx, FALSE, constr, &err); + hres = alloc_error(ctx, NULL, constr, &err); if(FAILED(hres)) return hres; @@ -366,7 +334,7 @@ dispex->ctx->uri_error_constr); } -HRESULT init_error_constr(script_ctx_t *ctx) +HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype) { static const WCHAR nameW[] = {'n','a','m','e',0}; static const WCHAR ErrorW[] = {'E','r','r','o','r',0}; @@ -392,7 +360,7 @@ HRESULT hres; for(i=0; i<7; i++) { - hres = alloc_error(ctx, i==0, NULL, &err); + hres = alloc_error(ctx, i==0 ? object_prototype : NULL, NULL, &err); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
============================================================================== --- trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -40,12 +40,8 @@ static const WCHAR lengthW[] = {'l','e','n','g','t','h',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; static const WCHAR applyW[] = {'a','p','p','l','y',0}; static const WCHAR callW[] = {'c','a','l','l',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static IDispatch *get_this(DISPPARAMS *dp) { @@ -290,42 +286,14 @@ return S_OK; } -static HRESULT Function_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, +static HRESULT Function_apply(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Function_apply(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Function_call(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Function_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Function_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Function_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); @@ -394,11 +362,7 @@ static const builtin_prop_t Function_props[] = { {applyW, Function_apply, PROPF_METHOD}, {callW, Function_call, PROPF_METHOD}, - {hasOwnPropertyW, Function_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Function_isPrototypeOf, PROPF_METHOD}, {lengthW, Function_length, 0}, - {propertyIsEnumerableW, Function_propertyIsEnumerable, PROPF_METHOD}, - {toLocaleStringW, Function_toLocaleString, PROPF_METHOD}, {toStringW, Function_toString, PROPF_METHOD} }; Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -754,31 +754,31 @@ if(FAILED(hres)) return hres; - hres = create_array_constr(ctx, &ctx->array_constr); - if(FAILED(hres)) - return hres; - - hres = create_bool_constr(ctx, &ctx->bool_constr); - if(FAILED(hres)) - return hres; - - hres = create_date_constr(ctx, &ctx->date_constr); - if(FAILED(hres)) - return hres; - - hres = init_error_constr(ctx); - if(FAILED(hres)) - return hres; - - hres = create_number_constr(ctx, &ctx->number_constr); - if(FAILED(hres)) - return hres; - - hres = create_regexp_constr(ctx, &ctx->regexp_constr); - if(FAILED(hres)) - return hres; - - hres = create_string_constr(ctx, &ctx->string_constr); + hres = create_array_constr(ctx, object_prototype, &ctx->array_constr); + if(FAILED(hres)) + return hres; + + hres = create_bool_constr(ctx, object_prototype, &ctx->bool_constr); + if(FAILED(hres)) + return hres; + + hres = create_date_constr(ctx, object_prototype, &ctx->date_constr); + if(FAILED(hres)) + return hres; + + hres = init_error_constr(ctx, object_prototype); + if(FAILED(hres)) + return hres; + + hres = create_number_constr(ctx, object_prototype, &ctx->number_constr); + if(FAILED(hres)) + return hres; + + hres = create_regexp_constr(ctx, object_prototype, &ctx->regexp_constr); + if(FAILED(hres)) + return hres; + + hres = create_string_constr(ctx, object_prototype, &ctx->string_constr); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
============================================================================== --- trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -131,6 +131,7 @@ HRESULT disp_call(IDispatch*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_call_value(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_call(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); +HRESULT jsdisp_call_name(DispatchEx*,const WCHAR*,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT disp_propget(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT disp_propput(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget(DispatchEx*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); @@ -225,14 +226,14 @@ HRESULT init_function_constr(script_ctx_t*,DispatchEx*); HRESULT create_object_prototype(script_ctx_t*,DispatchEx**); -HRESULT create_array_constr(script_ctx_t*,DispatchEx**); -HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); -HRESULT create_date_constr(script_ctx_t*,DispatchEx**); -HRESULT init_error_constr(script_ctx_t*); -HRESULT create_number_constr(script_ctx_t*,DispatchEx**); +HRESULT create_array_constr(script_ctx_t*,DispatchEx*,DispatchEx**); +HRESULT create_bool_constr(script_ctx_t*,DispatchEx*,DispatchEx**); +HRESULT create_date_constr(script_ctx_t*,DispatchEx*,DispatchEx**); +HRESULT init_error_constr(script_ctx_t*,DispatchEx*); +HRESULT create_number_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); -HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**); -HRESULT create_string_constr(script_ctx_t*,DispatchEx**); +HRESULT create_regexp_constr(script_ctx_t*,DispatchEx*,DispatchEx**); +HRESULT create_string_constr(script_ctx_t*,DispatchEx*,DispatchEx**); typedef struct { const WCHAR *str; Modified: trunk/reactos/dll/win32/jscript/jscript_Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
============================================================================== --- trunk/reactos/dll/win32/jscript/jscript_Nl.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jscript_Nl.rc [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -30,6 +30,7 @@ IDS_SEMICOLON "';' verwacht" IDS_LBRACKET "'(' verwacht" IDS_RBRACKET "')' verwacht" + IDS_UNTERMINATED_STR "Onafgesloten tekenreeksconstante" IDS_NOT_FUNC "Functie verwacht" IDS_NOT_DATE "'[object]' is geen datum object" IDS_NOT_NUM "Getal verwacht" Modified: trunk/reactos/dll/win32/jscript/math.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/math.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/math.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/math.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -571,24 +571,24 @@ {PIW, Math_PI, 0}, {SQRT1_2W, Math_SQRT1_2, 0}, {SQRT2W, Math_SQRT2, 0}, - {absW, Math_abs, PROPF_METHOD}, - {acosW, Math_acos, PROPF_METHOD}, - {asinW, Math_asin, PROPF_METHOD}, - {atanW, Math_atan, PROPF_METHOD}, - {atan2W, Math_atan2, PROPF_METHOD}, - {ceilW, Math_ceil, PROPF_METHOD}, - {cosW, Math_cos, PROPF_METHOD}, - {expW, Math_exp, PROPF_METHOD}, - {floorW, Math_floor, PROPF_METHOD}, - {logW, Math_log, PROPF_METHOD}, - {maxW, Math_max, PROPF_METHOD}, - {minW, Math_min, PROPF_METHOD}, - {powW, Math_pow, PROPF_METHOD}, + {absW, Math_abs, PROPF_METHOD|1}, + {acosW, Math_acos, PROPF_METHOD|1}, + {asinW, Math_asin, PROPF_METHOD|1}, + {atanW, Math_atan, PROPF_METHOD|1}, + {atan2W, Math_atan2, PROPF_METHOD|2}, + {ceilW, Math_ceil, PROPF_METHOD|1}, + {cosW, Math_cos, PROPF_METHOD|1}, + {expW, Math_exp, PROPF_METHOD|1}, + {floorW, Math_floor, PROPF_METHOD|1}, + {logW, Math_log, PROPF_METHOD|1}, + {maxW, Math_max, PROPF_METHOD|2}, + {minW, Math_min, PROPF_METHOD|2}, + {powW, Math_pow, PROPF_METHOD|2}, {randomW, Math_random, PROPF_METHOD}, - {roundW, Math_round, PROPF_METHOD}, - {sinW, Math_sin, PROPF_METHOD}, - {sqrtW, Math_sqrt, PROPF_METHOD}, - {tanW, Math_tan, PROPF_METHOD} + {roundW, Math_round, PROPF_METHOD|1}, + {sinW, Math_sin, PROPF_METHOD|1}, + {sqrtW, Math_sqrt, PROPF_METHOD|1}, + {tanW, Math_tan, PROPF_METHOD|1} }; static const builtin_info_t Math_info = { @@ -602,5 +602,19 @@ HRESULT create_math(script_ctx_t *ctx, DispatchEx **ret) { - return create_dispex(ctx, &Math_info, NULL, ret); -} + DispatchEx *math; + HRESULT hres; + + math = heap_alloc_zero(sizeof(DispatchEx)); + if(!math) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(math, ctx, &Math_info, ctx->object_constr); + if(FAILED(hres)) { + heap_free(math); + return hres; + } + + *ret = math; + return S_OK; +} Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #include <math.h> #include "jscript.h" @@ -36,10 +39,6 @@ static const WCHAR toExponentialW[] = {'t','o','E','x','p','o','n','e','n','t','i','a','l',0}; static const WCHAR toPrecisionW[] = {'t','o','P','r','e','c','i','s','i','o','n',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; #define NUMBER_TOSTRING_BUF_SIZE 64 /* ECMA-262 3rd Edition 15.7.4.2 */ @@ -214,27 +213,6 @@ return S_OK; } -static HRESULT Number_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Number_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Number_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Number_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -256,14 +234,11 @@ } static const builtin_prop_t Number_props[] = { - {hasOwnPropertyW, Number_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Number_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Number_propertyIsEnumerable, PROPF_METHOD}, - {toExponentialW, Number_toExponential, PROPF_METHOD}, + {toExponentialW, Number_toExponential, PROPF_METHOD|1}, {toFixedW, Number_toFixed, PROPF_METHOD}, {toLocaleStringW, Number_toLocaleString, PROPF_METHOD}, - {toPrecisionW, Number_toPrecision, PROPF_METHOD}, - {toStringW, Number_toString, PROPF_METHOD}, + {toPrecisionW, Number_toPrecision, PROPF_METHOD|1}, + {toStringW, Number_toString, PROPF_METHOD|1}, {valueOfW, Number_valueOf, PROPF_METHOD} }; @@ -330,7 +305,7 @@ return S_OK; } -static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance **ret) +static HRESULT alloc_number(script_ctx_t *ctx, DispatchEx *object_prototype, NumberInstance **ret) { NumberInstance *number; HRESULT hres; @@ -339,10 +314,10 @@ if(!number) return E_OUTOFMEMORY; - if(use_constr) + if(object_prototype) + hres = init_dispex(&number->dispex, ctx, &Number_info, object_prototype); + else hres = init_dispex_from_constr(&number->dispex, ctx, &Number_info, ctx->number_constr); - else - hres = init_dispex(&number->dispex, ctx, &Number_info, NULL); if(FAILED(hres)) return hres; @@ -350,12 +325,12 @@ return S_OK; } -HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { NumberInstance *number; HRESULT hres; - hres = alloc_number(ctx, FALSE, &number); + hres = alloc_number(ctx, object_prototype, &number); if(FAILED(hres)) return hres; @@ -371,7 +346,7 @@ NumberInstance *number; HRESULT hres; - hres = alloc_number(ctx, TRUE, &number); + hres = alloc_number(ctx, NULL, &number); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/object.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -74,8 +74,11 @@ static HRESULT Object_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - TRACE("\n"); - return Object_toString(dispex, lcid, flags, dp, retv, ei, sp); + DISPPARAMS params = {NULL, NULL, 0, 0}; + + TRACE("\n"); + + return jsdisp_call_name(dispex, toStringW, lcid, DISPATCH_METHOD, ¶ms, retv, ei, sp); } static HRESULT Object_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -142,9 +145,9 @@ } static const builtin_prop_t Object_props[] = { - {hasOwnPropertyW, Object_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Object_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Object_propertyIsEnumerable, PROPF_METHOD}, + {hasOwnPropertyW, Object_hasOwnProperty, PROPF_METHOD|1}, + {isPrototypeOfW, Object_isPrototypeOf, PROPF_METHOD|1}, + {propertyIsEnumerableW, Object_propertyIsEnumerable, PROPF_METHOD|1}, {toLocaleStringW, Object_toLocaleString, PROPF_METHOD}, {toStringW, Object_toString, PROPF_METHOD}, {valueOfW, Object_valueOf, PROPF_METHOD} Modified: trunk/reactos/dll/win32/jscript/regexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/regexp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/regexp.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -90,11 +90,6 @@ static const WCHAR multilineW[] = {'m','u','l','t','i','l','i','n','e',0}; static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR execW[] = {'e','x','e','c',0}; static const WCHAR testW[] = {'t','e','s','t',0}; @@ -3432,67 +3427,55 @@ static HRESULT RegExp_source(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { + TRACE("\n"); + + switch(flags) { + case DISPATCH_PROPERTYGET: { + RegExpInstance *This = (RegExpInstance*)dispex; + + V_VT(retv) = VT_BSTR; + V_BSTR(retv) = SysAllocString(This->str); + if(!V_BSTR(retv)) + return E_OUTOFMEMORY; + break; + } + default: + FIXME("Unimplemnted flags %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +static HRESULT RegExp_global(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) +{ FIXME("\n"); return E_NOTIMPL; } -static HRESULT RegExp_global(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, +static HRESULT RegExp_ignoreCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT RegExp_ignoreCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, +static HRESULT RegExp_multiline(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT RegExp_multiline(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, +static HRESULT RegExp_lastIndex(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT RegExp_lastIndex(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { FIXME("\n"); @@ -3540,17 +3523,13 @@ } static const builtin_prop_t RegExp_props[] = { - {execW, RegExp_exec, PROPF_METHOD}, + {execW, RegExp_exec, PROPF_METHOD|1}, {globalW, RegExp_global, 0}, - {hasOwnPropertyW, RegExp_hasOwnProperty, PROPF_METHOD}, {ignoreCaseW, RegExp_ignoreCase, 0}, - {isPrototypeOfW, RegExp_isPrototypeOf, PROPF_METHOD}, {lastIndexW, RegExp_lastIndex, 0}, {multilineW, RegExp_multiline, 0}, - {propertyIsEnumerableW, RegExp_propertyIsEnumerable, PROPF_METHOD}, {sourceW, RegExp_source, 0}, - {testW, RegExp_test, PROPF_METHOD}, - {toLocaleStringW, RegExp_toLocaleString, PROPF_METHOD}, + {testW, RegExp_test, PROPF_METHOD|1}, {toStringW, RegExp_toString, PROPF_METHOD} }; @@ -3563,7 +3542,7 @@ NULL }; -static HRESULT alloc_regexp(script_ctx_t *ctx, BOOL use_constr, RegExpInstance **ret) +static HRESULT alloc_regexp(script_ctx_t *ctx, DispatchEx *object_prototype, RegExpInstance **ret) { RegExpInstance *regexp; HRESULT hres; @@ -3572,10 +3551,10 @@ if(!regexp) return E_OUTOFMEMORY; - if(use_constr) + if(object_prototype) + hres = init_dispex(®exp->dispex, ctx, &RegExp_info, object_prototype); + else hres = init_dispex_from_constr(®exp->dispex, ctx, &RegExp_info, ctx->regexp_constr); - else - hres = init_dispex(®exp->dispex, ctx, &RegExp_info, NULL); if(FAILED(hres)) { heap_free(regexp); @@ -3593,7 +3572,7 @@ TRACE("%s %x\n", debugstr_w(exp), flags); - hres = alloc_regexp(ctx, TRUE, ®exp); + hres = alloc_regexp(ctx, NULL, ®exp); if(FAILED(hres)) return hres; @@ -3694,12 +3673,12 @@ return S_OK; } -HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { RegExpInstance *regexp; HRESULT hres; - hres = alloc_regexp(ctx, FALSE, ®exp); + hres = alloc_regexp(ctx, object_prototype, ®exp); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] Sat Aug 22 17:25:26 2009 @@ -62,10 +62,6 @@ static const WCHAR toLocaleLowerCaseW[] = {'t','o','L','o','c','a','l','e','L','o','w','e','r','C','a','s','e',0}; static const WCHAR toLocaleUpperCaseW[] = {'t','o','L','o','c','a','l','e','U','p','p','e','r','C','a','s','e',0}; static const WCHAR localeCompareW[] = {'l','o','c','a','l','e','C','o','m','p','a','r','e',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR fromCharCodeW[] = {'f','r','o','m','C','h','a','r','C','o','d','e',0}; static HRESULT String_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -802,7 +798,7 @@ DWORD parens_cnt = 0, parens_size=0, rep_len=0, length; BSTR rep_str = NULL, match_str = NULL, ret_str, val_str = NULL; DispatchEx *rep_func = NULL, *regexp = NULL; - match_result_t *parens = NULL, match; + match_result_t *parens = NULL, match, **parens_ptr = &parens; strbuf_t ret = {NULL,0,0}; BOOL gcheck = FALSE; VARIANT *arg_var; @@ -884,12 +880,9 @@ if(FAILED(hres)) break; - if(strchrW(rep_str, '$')) { - FIXME("unsupported $ in replace string\n"); - hres = E_NOTIMPL; - } - rep_len = SysStringLen(rep_str); + if(!strchrW(rep_str, '$')) + parens_ptr = NULL; } } @@ -900,7 +893,7 @@ while(1) { if(regexp) { - hres = regexp_match_next(regexp, gcheck, str, length, &cp, rep_func ? &parens : NULL, + hres = regexp_match_next(regexp, gcheck, str, length, &cp, parens_ptr, &parens_size, &parens_cnt, &match); gcheck = TRUE; @@ -932,6 +925,64 @@ hres = strbuf_append(&ret, cstr, SysStringLen(cstr)); SysFreeString(cstr); + if(FAILED(hres)) + break; + }else if(rep_str && regexp) { + const WCHAR *ptr = rep_str, *ptr2; + + while((ptr2 = strchrW(ptr, '$'))) { + hres = strbuf_append(&ret, ptr, ptr2-ptr); + if(FAILED(hres)) + break; + + switch(ptr2[1]) { + case '$': + hres = strbuf_append(&ret, ptr2, 1); + ptr = ptr2+2; + break; + case '&': + hres = strbuf_append(&ret, match.str, match.len); + ptr = ptr2+2; + break; + case '`': + hres = strbuf_append(&ret, str, match.str-str); + ptr = ptr2+2; + break; + case '\'': + hres = strbuf_append(&ret, ecp, (str+length)-ecp); + ptr = ptr2+2; + break; + default: { + DWORD idx; + + if(!isdigitW(ptr2[1])) { + hres = strbuf_append(&ret, ptr2, 1); + ptr = ptr2+1; + break; + } + + idx = ptr2[1] - '0'; + if(isdigitW(ptr[3]) && idx*10 + (ptr[2]-'0') <= parens_cnt) { + idx = idx*10 + (ptr[2]-'0'); + ptr = ptr2+3; + }else if(idx && idx <= parens_cnt) { + ptr = ptr2+2; + }else { + hres = strbuf_append(&ret, ptr2, 1); + ptr = ptr2+1; + break; + } + + hres = strbuf_append(&ret, parens[idx-1].str, parens[idx-1].len); + } + } + + if(FAILED(hres)) + break; + } + + if(SUCCEEDED(hres)) + hres = strbuf_append(&ret, ptr, (rep_str+rep_len)-ptr); if(FAILED(hres)) break; }else if(rep_str) { @@ -1456,27 +1507,6 @@ return E_NOTIMPL; } -static HRESULT String_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT String_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT String_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT String_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -1513,35 +1543,32 @@ } static const builtin_prop_t String_props[] = { - {anchorW, String_anchor, PROPF_METHOD}, + {anchorW, String_anchor, PROPF_METHOD|1}, {bigW, String_big, PROPF_METHOD}, {blinkW, String_blink, PROPF_METHOD}, {boldW, String_bold, PROPF_METHOD}, - {charAtW, String_charAt, PROPF_METHOD}, - {charCodeAtW, String_charCodeAt, PROPF_METHOD}, - {concatW, String_concat, PROPF_METHOD}, + {charAtW, String_charAt, PROPF_METHOD|1}, + {charCodeAtW, String_charCodeAt, PROPF_METHOD|1}, + {concatW, String_concat, PROPF_METHOD|1}, {fixedW, String_fixed, PROPF_METHOD}, - {fontcolorW, String_fontcolor, PROPF_METHOD}, - {fontsizeW, String_fontsize, PROPF_METHOD}, - {hasOwnPropertyW, String_hasOwnProperty, PROPF_METHOD}, - {indexOfW, String_indexOf, PROPF_METHOD}, - {isPrototypeOfW, String_isPrototypeOf, PROPF_METHOD}, + {fontcolorW, String_fontcolor, PROPF_METHOD|1}, + {fontsizeW, String_fontsize, PROPF_METHOD|1}, + {indexOfW, String_indexOf, PROPF_METHOD|2}, {italicsW, String_italics, PROPF_METHOD}, - {lastIndexOfW, String_lastIndexOf, PROPF_METHOD}, + {lastIndexOfW, String_lastIndexOf, PROPF_METHOD|2}, {lengthW, String_length, 0}, - {linkW, String_link, PROPF_METHOD}, - {localeCompareW, String_localeCompare, PROPF_METHOD}, - {matchW, String_match, PROPF_METHOD}, - {propertyIsEnumerableW, String_propertyIsEnumerable, PROPF_METHOD}, - {replaceW, String_replace, PROPF_METHOD}, + {linkW, String_link, PROPF_METHOD|1}, + {localeCompareW, String_localeCompare, PROPF_METHOD|1}, + {matchW, String_match, PROPF_METHOD|1}, + {replaceW, String_replace, PROPF_METHOD|1}, {searchW, String_search, PROPF_METHOD}, {sliceW, String_slice, PROPF_METHOD}, {smallW, String_small, PROPF_METHOD}, - {splitW, String_split, PROPF_METHOD}, + {splitW, String_split, PROPF_METHOD|2}, {strikeW, String_strike, PROPF_METHOD}, {subW, String_sub, PROPF_METHOD}, - {substrW, String_substr, PROPF_METHOD}, - {substringW, String_substring, PROPF_METHOD}, + {substrW, String_substr, PROPF_METHOD|2}, + {substringW, String_substring, PROPF_METHOD|2}, {supW, String_sup, PROPF_METHOD}, {toLocaleLowerCaseW, String_toLocaleLowerCase, PROPF_METHOD}, {toLocaleUpperCaseW, String_toLocaleUpperCase, PROPF_METHOD}, @@ -1648,7 +1675,7 @@ return S_OK; } -static HRESULT string_alloc(script_ctx_t *ctx, BOOL use_constr, StringInstance **ret) +static HRESULT string_alloc(script_ctx_t *ctx, DispatchEx *object_prototype, StringInstance **ret) { StringInstance *string; HRESULT hres; @@ -1657,10 +1684,10 @@ if(!string) return E_OUTOFMEMORY; - if(use_constr) + if(object_prototype) + hres = init_dispex(&string->dispex, ctx, &String_info, object_prototype); + else hres = init_dispex_from_constr(&string->dispex, ctx, &String_info, ctx->string_constr); - else - hres = init_dispex(&string->dispex, ctx, &String_info, NULL); if(FAILED(hres)) { heap_free(string); return hres; @@ -1683,12 +1710,12 @@ NULL }; -HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { StringInstance *string; HRESULT hres; - hres = string_alloc(ctx, FALSE, &string); + hres = string_alloc(ctx, object_prototype, &string); if(FAILED(hres)) return hres; @@ -1703,7 +1730,7 @@ StringInstance *string; HRESULT hres; - hres = string_alloc(ctx, TRUE, &string); + hres = string_alloc(ctx, NULL, &string); if(FAILED(hres)) return hres;
15 years, 4 months
1
0
0
0
[cwittich] 42848: sync msxml3 winetest with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 17:18:26 2009 New Revision: 42848 URL:
http://svn.reactos.org/svn/reactos?rev=42848&view=rev
Log: sync msxml3 winetest with wine 1.1.28 Modified: trunk/rostests/winetests/msxml3/domdoc.c trunk/rostests/winetests/msxml3/saxreader.c Modified: trunk/rostests/winetests/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
============================================================================== --- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Sat Aug 22 17:18:26 2009 @@ -150,6 +150,37 @@ "<?xml version=\"1.0\" encoding=\"utf-8\"?>" "<string>Wine</string>"; +static const CHAR szBasicTransformSSXMLPart1[] = +"<?xml version=\"1.0\"?>" +"<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"
http://www.w3.org/1999/XSL/Transform\
" >" +"<xsl:output method=\"html\"/>\n" +"<xsl:template match=\"/\">" +"<HTML><BODY><TABLE>" +" <xsl:apply-templates select='document(\""; + +static const CHAR szBasicTransformSSXMLPart2[] = +"\")/bottle/wine'>" +" <xsl:sort select=\"cost\"/><xsl:sort select=\"name\"/>" +" </xsl:apply-templates>" +"</TABLE></BODY></HTML>" +"</xsl:template>" +"<xsl:template match=\"bottle\">" +" <TR><xsl:apply-templates select=\"name\" /><xsl:apply-templates select=\"cost\" /></TR>" +"</xsl:template>" +"<xsl:template match=\"name\">" +" <TD><xsl:apply-templates /></TD>" +"</xsl:template>" +"<xsl:template match=\"cost\">" +" <TD><xsl:apply-templates /></TD>" +"</xsl:template>" +"</xsl:stylesheet>"; + +static const CHAR szBasicTransformXML[] = +"<?xml version=\"1.0\"?><bottle><wine><name>Wine</name><cost>$25.00</cost></wine></bottle>"; + +static const CHAR szBasicTransformOutput[] = +"<HTML><BODY><TABLE><TD>Wine</TD><TD>$25.00</TD></TABLE></BODY></HTML>"; + static const WCHAR szNonExistentFile[] = { 'c', ':', '\\', 'N', 'o', 'n', 'e', 'x', 'i', 's', 't', 'e', 'n', 't', '.', 'x', 'm', 'l', 0 }; @@ -514,7 +545,11 @@ ok( r == S_OK, "should be a document element\n"); if( element ) { + IObjectIdentity *ident; BSTR tag = NULL; + + r = IXMLDOMElement_QueryInterface( element, &IID_IObjectIdentity, (LPVOID*)&ident ); + ok( r == E_NOINTERFACE, "ret %08x\n", r); /* check if the tag is correct */ r = IXMLDOMElement_get_tagName( element, &tag ); @@ -3945,6 +3980,98 @@ IXMLDOMDocument2_Release(doc); + free_bstrs(); +} + +static void test_TransformWithLoadingLocalFile(void) +{ + IXMLDOMDocument2 *doc = NULL; + IXMLDOMDocument2 *xsl = NULL; + IXMLDOMNode *pNode; + VARIANT_BOOL bSucc; + HRESULT hr; + HANDLE file; + DWORD dwWritten; + char lpPathBuffer[MAX_PATH]; + int i; + + /* Create a Temp File. */ + GetTempPathA(MAX_PATH, lpPathBuffer); + strcat(lpPathBuffer, "customers.xml" ); + + file = CreateFile(lpPathBuffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ); + ok(file != INVALID_HANDLE_VALUE, "Could not create file: %u\n", GetLastError()); + if(file == INVALID_HANDLE_VALUE) + return; + + WriteFile(file, szBasicTransformXML, strlen(szBasicTransformXML), &dwWritten, NULL); + CloseHandle(file); + + /* Correct path to not include a escape character. */ + for(i=0; i < strlen(lpPathBuffer); i++) + { + if(lpPathBuffer[i] == '\\') + lpPathBuffer[i] = '/'; + } + + hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (LPVOID*)&doc ); + if( hr != S_OK ) + return; + + hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (LPVOID*)&xsl ); + if( hr != S_OK ) + { + IXMLDOMDocument2_Release(doc); + return; + } + + hr = IXMLDOMDocument2_loadXML(doc, _bstr_(szTypeValueXML), &bSucc); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(bSucc == VARIANT_TRUE, "Expected VARIANT_TRUE got VARIANT_FALSE\n"); + if(bSucc == VARIANT_TRUE) + { + BSTR sXSL; + BSTR sPart1 = _bstr_(szBasicTransformSSXMLPart1); + BSTR sPart2 = _bstr_(szBasicTransformSSXMLPart2); + BSTR sFileName = _bstr_(lpPathBuffer); + int nLegnth = lstrlenW(sPart1) + lstrlenW(sPart2) + lstrlenW(sFileName) + 1; + + sXSL = SysAllocStringLen(NULL, nLegnth); + lstrcpyW(sXSL, sPart1); + lstrcatW(sXSL, sFileName); + lstrcatW(sXSL, sPart2); + + hr = IXMLDOMDocument2_loadXML(xsl, sXSL, &bSucc); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(bSucc == VARIANT_TRUE, "Expected VARIANT_TRUE got VARIANT_FALSE\n"); + if(bSucc == VARIANT_TRUE) + { + BSTR sResult; + + hr = IXMLDOMDocument_QueryInterface(xsl, &IID_IXMLDOMNode, (LPVOID*)&pNode ); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + /* This will load the temp file via the XSL */ + hr = IXMLDOMDocument2_transformNode(doc, pNode, &sResult); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + ok( compareIgnoreReturns( sResult, _bstr_(szBasicTransformOutput)), "Stylesheet output not correct\n"); + SysFreeString(sResult); + } + + IXMLDOMNode_Release(pNode); + } + } + + SysFreeString(sXSL); + } + + IXMLDOMDocument2_Release(doc); + IXMLDOMDocument2_Release(xsl); + + DeleteFile(lpPathBuffer); free_bstrs(); } @@ -3977,6 +4104,7 @@ test_Namespaces(); test_FormattingXML(); test_NodeTypeValue(); + test_TransformWithLoadingLocalFile(); CoUninitialize(); } Modified: trunk/rostests/winetests/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
============================================================================== --- trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] Sat Aug 22 17:18:26 2009 @@ -117,13 +117,6 @@ static content_handler_test *expectCall; static ISAXLocator *locator; -static const char *debugstr_wn(const WCHAR *szStr, int len) -{ - static char buf[1024]; - WideCharToMultiByte(CP_ACP, 0, szStr, len, buf, sizeof(buf), NULL, NULL); - return buf; -} - static void test_saxstr(unsigned line, const WCHAR *szStr, int nStr, const char *szTest) { WCHAR buf[1024]; @@ -142,7 +135,7 @@ MultiByteToWideChar(CP_ACP, 0, szTest, -1, buf, sizeof(buf)/sizeof(WCHAR)); ok_(__FILE__,line) (!memcmp(szStr, buf, len*sizeof(WCHAR)), "unexpected szStr %s, expected %s\n", - debugstr_wn(szStr, nStr), szTest); + wine_dbgstr_wn(szStr, nStr), szTest); } static BOOL test_expect_call(CH id)
15 years, 4 months
1
0
0
0
[cwittich] 42847: sync test.h with wine 1.1.28
by cwittich@svn.reactos.org
Author: cwittich Date: Sat Aug 22 17:18:03 2009 New Revision: 42847 URL:
http://svn.reactos.org/svn/reactos?rev=42847&view=rev
Log: sync test.h with wine 1.1.28 Modified: trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Sat Aug 22 17:18:03 2009 @@ -61,6 +61,9 @@ extern void winetest_end_todo( const char* platform ); extern int winetest_get_mainargs( char*** pargv ); extern void winetest_wait_child_process( HANDLE process ); + +extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); +static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } #ifdef STANDALONE #define START_TEST(name) \ @@ -196,6 +199,8 @@ int current_line; /* line of current check */ int todo_level; /* current todo nesting level */ int todo_do_loop; + char *str_pos; /* position in debug buffer */ + char strings[2000]; /* buffer for debug strings */ } tls_data; static DWORD tls_index; @@ -208,11 +213,31 @@ data=TlsGetValue(tls_index); if (!data) { - data=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(tls_data)); + data=HeapAlloc(GetProcessHeap(), 0, sizeof(tls_data)); + data->todo_level = 0; + data->str_pos = data->strings; TlsSetValue(tls_index,data); } SetLastError(last_error); return data; +} + +/* allocate some tmp space for a string */ +static char *get_temp_buffer( size_t n ) +{ + tls_data *data = get_tls_data(); + char *res = data->str_pos; + + if (res + n >= &data->strings[sizeof(data->strings)]) res = data->strings; + data->str_pos = res + n; + return res; +} + +/* release extra space that we requested in gimme1() */ +static void release_temp_buffer( char *ptr, size_t size ) +{ + tls_data *data = get_tls_data(); + data->str_pos = ptr + size; } static void exit_process( int code ) @@ -407,6 +432,62 @@ } } +const char *wine_dbgstr_wn( const WCHAR *str, int n ) +{ + char *dst, *res; + size_t size; + + if (!((ULONG_PTR)str >> 16)) + { + if (!str) return "(null)"; + res = get_temp_buffer( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); + return res; + } + if (n == -1) + { + const WCHAR *end = str; + while (*end) end++; + n = end - str; + } + if (n < 0) n = 0; + size = 12 + min( 300, n * 5 ); + dst = res = get_temp_buffer( size ); + *dst++ = 'L'; + *dst++ = '"'; + while (n-- > 0 && dst <= res + size - 10) + { + WCHAR c = *str++; + switch (c) + { + case '\n': *dst++ = '\\'; *dst++ = 'n'; break; + case '\r': *dst++ = '\\'; *dst++ = 'r'; break; + case '\t': *dst++ = '\\'; *dst++ = 't'; break; + case '"': *dst++ = '\\'; *dst++ = '"'; break; + case '\\': *dst++ = '\\'; *dst++ = '\\'; break; + default: + if (c >= ' ' && c <= 126) + *dst++ = c; + else + { + *dst++ = '\\'; + sprintf(dst,"%04x",c); + dst+=4; + } + } + } + *dst++ = '"'; + if (n > 0) + { + *dst++ = '.'; + *dst++ = '.'; + *dst++ = '.'; + } + *dst++ = 0; + release_temp_buffer( res, dst - res ); + return res; +} + /* Find a test by name */ static const struct test *find_test( const char *name ) {
15 years, 4 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
66
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
Results per page:
10
25
50
100
200