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
June 2017
----- 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
20 participants
526 discussions
Start a n
N
ew thread
[akhaldi] 74841: [RICHED20] Sync with Wine Staging 2.9. CORE-13362 d4b1938 riched20: Only write out non-default pattern colours. 5f3772a riched20: Don't compare the colours if the old and new state...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:36:44 2017 New Revision: 74841 URL:
http://svn.reactos.org/svn/reactos?rev=74841&view=rev
Log: [RICHED20] Sync with Wine Staging 2.9. CORE-13362 d4b1938 riched20: Only write out non-default pattern colours. 5f3772a riched20: Don't compare the colours if the old and new states are both auto. 6bcf4d6 riched20: Add linefeeds after the colortbl and generator groups. 8b79854 riched20: Remove a hack that should be longer be needed. 3d291dd riched20: Write the char format for the end-of-paragraph marker. Modified: trunk/reactos/dll/win32/riched20/writer.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/riched20/writer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/writer.…
============================================================================== --- trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] Sat Jun 3 22:36:44 2017 @@ -377,14 +377,6 @@ if (!ME_StreamOutPrint(pStream, "}\r\n")) return FALSE; - /* It seems like Open Office ignores \deff0 tag at RTF-header. - As result it can't correctly parse text before first \fN tag, - so we can put \f0 immediately after font table. This forces - parser to use the same font, that \deff0 specifies. - It makes OOffice happy */ - if (!ME_StreamOutPrint(pStream, "\\f0")) - return FALSE; - /* Output the color table */ if (!ME_StreamOutPrint(pStream, "{\\colortbl;")) return FALSE; /* first entry is auto-color */ for (i = 1; i < pStream->nColorTblLen; i++) @@ -393,7 +385,7 @@ (pStream->colortbl[i] >> 8) & 0xFF, (pStream->colortbl[i] >> 16) & 0xFF)) return FALSE; } - if (!ME_StreamOutPrint(pStream, "}")) return FALSE; + if (!ME_StreamOutPrint(pStream, "}\r\n")) return FALSE; return TRUE; } @@ -726,8 +718,10 @@ sprintf(props + strlen(props), "\\shading%d", fmt->wShadingWeight); if (fmt->wShadingStyle & 0xF) strcat(props, style[fmt->wShadingStyle & 0xF]); - sprintf(props + strlen(props), "\\cfpat%d\\cbpat%d", - (fmt->wShadingStyle >> 4) & 0xF, (fmt->wShadingStyle >> 8) & 0xF); + if ((fmt->wShadingStyle >> 4) & 0xf) + sprintf(props + strlen(props), "\\cfpat%d", (fmt->wShadingStyle >> 4) & 0xf); + if ((fmt->wShadingStyle >> 8) & 0xf) + sprintf(props + strlen(props), "\\cbpat%d", (fmt->wShadingStyle >> 8) & 0xf); } if (*props) strcat(props, " "); @@ -772,14 +766,14 @@ } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOBACKCOLOR || - old_fmt->crBackColor != fmt->crBackColor) + (!(fmt->dwEffects & CFE_AUTOBACKCOLOR) && old_fmt->crBackColor != fmt->crBackColor)) { if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crBackColor, &i ); sprintf(props + strlen(props), "\\cb%u", i); } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR || - old_fmt->crTextColor != fmt->crTextColor) + (!(fmt->dwEffects & CFE_AUTOCOLOR) && old_fmt->crTextColor != fmt->crTextColor)) { if (fmt->dwEffects & CFE_AUTOCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crTextColor, &i ); @@ -1020,7 +1014,7 @@ /* TODO: stylesheet table */ - if (!ME_StreamOutPrint(pStream, "{\\*\\generator Wine Riched20 2.0;}")) + if (!ME_StreamOutPrint(pStream, "{\\*\\generator Wine Riched20 2.0;}\r\n")) return FALSE; /* TODO: information group */ @@ -1069,6 +1063,9 @@ } nChars--; } else if (cursor.pRun->member.run.nFlags & MERF_ENDPARA) { + if (!ME_StreamOutRTFCharProps(pStream, &cursor.pRun->member.run.style->fmt)) + return FALSE; + if (cursor.pPara->member.para.fmt.dwMask & PFM_TABLE && cursor.pPara->member.para.fmt.wEffects & PFE_TABLE && !(cursor.pPara->member.para.nFlags & (MEPF_ROWSTART|MEPF_ROWEND|MEPF_CELL))) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:36:44 2017 @@ -158,7 +158,7 @@ reactos/dll/win32/query # Synced to WineStaging-1.9.11 reactos/dll/win32/rasapi32 # Synced to WineStaging-1.9.11 reactos/dll/win32/resutils # Synced to WineStaging-1.9.11 -reactos/dll/win32/riched20 # Synced to WineStaging-2.2 +reactos/dll/win32/riched20 # Synced to WineStaging-2.9 reactos/dll/win32/riched32 # Synced to WineStaging-1.9.11 reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.2 reactos/dll/win32/rsabase # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74840: [REGEDIT_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:36:19 2017 New Revision: 74840 URL:
http://svn.reactos.org/svn/reactos?rev=74840&view=rev
Log: [REGEDIT_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/regedit/regedit.c Modified: trunk/rostests/winetests/regedit/regedit.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/regedit/regedit…
============================================================================== --- trunk/rostests/winetests/regedit/regedit.c [iso-8859-1] (original) +++ trunk/rostests/winetests/regedit/regedit.c [iso-8859-1] Sat Jun 3 22:36:19 2017 @@ -167,8 +167,8 @@ static void test_basic_import(void) { - HKEY hkey; - DWORD dword = 0x17; + HKEY hkey, subkey; + DWORD dword = 0x17, type, size; char exp_binary[] = {0xAA,0xBB,0xCC,0x11}; WCHAR wide_test[] = {0xFEFF,'W','i','n','d','o','w','s',' ','R','e','g', 'i','s','t','r','y',' ','E','d','i','t','o','r',' ','V','e','r','s', @@ -188,6 +188,8 @@ 'l','u','e','"','\r',0}; WCHAR wide_exp[] = {0x3041,'V','a','l','u','e',0}; LONG lr; + char buffer[8]; + BYTE hex[8]; lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, @@ -235,6 +237,11 @@ "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"With=Equals\"=\"asdf\"\n"); verify_reg(hkey, "With=Equals", REG_SZ, "asdf", 5, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Empty string\"=\"\"\n\n"); + verify_reg(hkey, "Empty string", REG_SZ, "", 1, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -251,8 +258,8 @@ "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Wine1\"=dword:00000782\n\n" "\"Wine2\"=\"Test Value\"\n" - "\"Wine3\"=hex(7):4c,69,6e,65,20,\ - 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n" + "\"Wine3\"=hex(7):4c,69,6e,65,20,\\\n" + " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n" "#comment\n" "@=\"Test\"\n" ";comment\n\n" @@ -265,16 +272,217 @@ dword = 0x12345678; verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword), 0); + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine5\"=\"No newline\""); + verify_reg(hkey, "Wine5", REG_SZ, "No newline", 11, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine6\"=dword:00000050\n\n" + "\"Wine7\"=\"No newline\""); + dword = 0x50; + verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg(hkey, "Wine7", REG_SZ, "No newline", 11, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine8a\"=dword:1\n" + "\"Wine8b\"=dword:4444\n\n"); + dword = 0x1; + verify_reg(hkey, "Wine8a", REG_DWORD, &dword, sizeof(dword), 0); + dword = 0x4444; + verify_reg(hkey, "Wine8b", REG_DWORD, &dword, sizeof(dword), 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine9a\"=hex(2):4c,69,6e,65,00\n" + "\"Wine9b\"=\"Value 1\"\n" + "\"Wine9c\"=hex(2):4c,69,6e,65\\\n" + "\"Wine9d\"=\"Value 2\"\n" + "\"Wine9e\"=hex(2):4c,69,6e,65,\\\n" + "\"Wine9f\"=\"Value 3\"\n" + "\"Wine9g\"=\"Value 4\"\n\n"); + verify_reg(hkey, "Wine9a", REG_EXPAND_SZ, "Line", 5, 0); + verify_reg(hkey, "Wine9b", REG_SZ, "Value 1", 8, 0); + verify_reg_nonexist(hkey, "Wine9c"); + todo_wine verify_reg(hkey, "Wine9d", REG_SZ, "Value 2", 8, 0); + verify_reg_nonexist(hkey, "Wine9e"); + verify_reg_nonexist(hkey, "Wine9f"); + verify_reg(hkey, "Wine9g", REG_SZ, "Value 4", 8, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"double\\\"quote\"=\"valid \\\"or\\\" not\"\n" + "\"single'quote\"=dword:00000008\n\n"); + verify_reg(hkey, "double\"quote", REG_SZ, "valid \"or\" not", 15, 0); + dword = 0x00000008; + verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0); + + /* Test hex data concatenation for REG_NONE, REG_EXPAND_SZ and REG_BINARY */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine10a\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n" + "\"Wine10b\"=hex(0):56,00,61,00,6c,00,\\\n" + " 75,00,65,00,00,00\n" + "\"Wine10c\"=hex(0):56,00,61,00,\\;comment\n" + " 6c,00,75,00,\\\n" + " 65,00,00,00\n" + "\"Wine10d\"=hex(0):56,00,61,00,\\;comment\n" + " 6c,00,75,00,\n" + " 65,00,00,00\n" + "\"Wine10e\"=hex(0):56,00,61,00,\\;comment\n" + " 6c,00,75,00,;comment\n" + " 65,00,00,00\n"); + verify_reg(hkey, "Wine10a", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0); + verify_reg(hkey, "Wine10b", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0); + todo_wine verify_reg(hkey, "Wine10c", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0); + todo_wine verify_reg(hkey, "Wine10d", REG_NONE, "V\0a\0l\0u", 8, 0); + todo_wine verify_reg(hkey, "Wine10e", REG_NONE, "V\0a\0l\0u", 8, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine11a\"=hex(2):25,50,41,54,48,25,00\n" + "\"Wine11b\"=hex(2):25,50,41,\\\n" + " 54,48,25,00\n" + "\"Wine11c\"=hex(2):25,50,41,\\;comment\n" + " 54,48,\\\n" + " 25,00\n" + "\"Wine11d\"=hex(2):25,50,41,\\;comment\n" + " 54,48,\n" + " 25,00\n" + "\"Wine11e\"=hex(2):25,50,41,\\;comment\n" + " 54,48,;comment\n" + " 25,00\n"); + verify_reg(hkey, "Wine11a", REG_EXPAND_SZ, "%PATH%", 7, 0); + verify_reg(hkey, "Wine11b", REG_EXPAND_SZ, "%PATH%", 7, 0); + todo_wine verify_reg(hkey, "Wine11c", REG_EXPAND_SZ, "%PATH%", 7, 0); + /* Wine11d */ + size = sizeof(buffer); + lr = RegQueryValueExA(hkey, "Wine11d", NULL, &type, (BYTE *)&buffer, &size); + todo_wine ok(lr == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", lr); + todo_wine ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ); + todo_wine ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size); + todo_wine ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n"); + /* Wine11e */ + size = sizeof(buffer); + memset(buffer, '-', size); + lr = RegQueryValueExA(hkey, "Wine11e", NULL, &type, (BYTE *)&buffer, &size); + todo_wine ok(lr == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", lr); + todo_wine ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ); + todo_wine ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size); + todo_wine ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine12a\"=hex:11,22,33,44,55,66,77,88\n" + "\"Wine12b\"=hex:11,22,33,44,\\\n" + " 55,66,77,88\n" + "\"Wine12c\"=hex:11,22,33,44,\\;comment\n" + " 55,66,\\\n" + " 77,88\n" + "\"Wine12d\"=hex:11,22,33,44,\\;comment\n" + " 55,66,\n" + " 77,88\n" + "\"Wine12e\"=hex:11,22,33,44,\\;comment\n" + " 55,66,;comment\n" + " 77,88\n"); + hex[0] = 0x11; hex[1] = 0x22; hex[2] = 0x33; hex[3] = 0x44; + hex[4] = 0x55; hex[5] = 0x66; hex[6] = 0x77; hex[7] = 0x88; + verify_reg(hkey, "Wine12a", REG_BINARY, hex, sizeof(hex), 0); + verify_reg(hkey, "Wine12b", REG_BINARY, hex, sizeof(hex), 0); + todo_wine verify_reg(hkey, "Wine12c", REG_BINARY, hex, sizeof(hex), 0); + todo_wine verify_reg(hkey, "Wine12d", REG_BINARY, hex, 6, 0); + todo_wine verify_reg(hkey, "Wine12e", REG_BINARY, hex, 6, 0); + + /* Test import with subkeys */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey\"1]\n" + "\"Wine\\\\31\"=\"Test value\"\n\n"); + lr = RegOpenKeyExA(hkey, "Subkey\"1", 0, KEY_READ, &subkey); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0); + lr = RegCloseKey(subkey); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1"); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n" + "\"123/\\\"4;'5\"=\"Random value name\"\n\n"); + lr = RegOpenKeyExA(hkey, "Subkey/2", 0, KEY_READ, &subkey); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0); + lr = RegCloseKey(subkey); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2"); + ok(lr == ERROR_SUCCESS, "got %d, expected 0\n", lr); + RegCloseKey(hkey); lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); } +static void test_basic_import_31(void) +{ + HKEY hkey; + LONG lr; + + lr = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); + ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, + "RegDeleteKeyA failed: %d\n", lr); + + /* Test simple value */ + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n"); + lr = RegOpenKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, KEY_READ, &hkey); + ok(lr == ERROR_SUCCESS, "RegOpenKeyExA failed: %d\n", lr); + verify_reg(hkey, "", REG_SZ, "Value0", 7, 0); + + /* Test proper handling of spaces and equals signs */ + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " =Value1\r\n"); + verify_reg(hkey, "", REG_SZ, "Value1", 7, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2\r\n"); + verify_reg(hkey, "", REG_SZ, " Value2", 8, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value3 \r\n"); + verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " Value4\r\n"); + verify_reg(hkey, "", REG_SZ, "Value4", 7, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " Value5\r\n"); + verify_reg(hkey, "", REG_SZ, "Value5", 7, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE "\r\n"); + verify_reg(hkey, "", REG_SZ, "", 1, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " \r\n"); + verify_reg(hkey, "", REG_SZ, "", 1, 0); + + exec_import_str("REGEDIT\r\n" + "HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline"); + verify_reg(hkey, "", REG_SZ, "No newline", 11, 0); + + RegCloseKey(hkey); + + lr = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); + ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); +} + static void test_invalid_import(void) { LONG lr; - HKEY hkey; + HKEY hkey, subkey; lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); @@ -317,10 +525,589 @@ verify_reg_nonexist(hkey, "MixedQuotes"); verify_reg_nonexist(hkey, "MixedQuotes=Asdffdsa"); + /* Test import with non-standard registry file headers */ + exec_import_str("REGEDIT3\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test1\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test1"); + + exec_import_str("regedit4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test2\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test2"); + + exec_import_str("Regedit4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test3\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test3"); + + exec_import_str("REGEDIT 4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test4\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test4"); + + exec_import_str("REGEDIT4FOO\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test5\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test5"); + + exec_import_str("REGEDIT4 FOO\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test6\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test6"); + + exec_import_str("REGEDIT5\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test7\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test7"); + + exec_import_str("Windows Registry Editor Version 4.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test8\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test8"); + + exec_import_str("Windows Registry Editor Version 5\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test9\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test9"); + + exec_import_str("WINDOWS REGISTRY EDITOR VERSION 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test10\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test10"); + + exec_import_str("Windows Registry Editor version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test11\"=\"Value\"\n"); + verify_reg_nonexist(hkey, "Test11"); + + /* Test multi-line import with incorrect comma placement */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line1\"=hex(7):4c,69,6e,65,20\\\n" + ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Multi-Line1"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line2\"=hex(7):4c,69,6e,65,20\\\n" + " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Multi-Line2"); + + exec_import_str("Windows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line3\"=hex(7):4c,69,6e,65,20\\\n" + ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Multi-Line3"); + + exec_import_str("Windows Registry Editor Version 5.00\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line4\"=hex(7):4c,69,6e,65,20\\\n" + " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Multi-Line4"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test12a\"=dword:\n" + "\"Test12b\"=dword:hello\n" + "\"Test12c\"=dword:123456789\n" + "\"Test12d\"=dword:012345678\n" + "\"Test12e\"=dword:000000001\n\n"); + verify_reg_nonexist(hkey, "Test12a"); + verify_reg_nonexist(hkey, "Test12b"); + verify_reg_nonexist(hkey, "Test12c"); + verify_reg_nonexist(hkey, "Test12d"); + verify_reg_nonexist(hkey, "Test12e"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test13a\"=dword:12345678abc\n" + "\"Test13b\"=dword:12345678 abc\n\n"); + verify_reg_nonexist(hkey, "Test13a"); + verify_reg_nonexist(hkey, "Test13b"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test14a\"=dword:0x123\n" + "\"Test14b\"=dword:123 456\n" + "\"Test14c\"=dword:1234 5678\n\n"); + verify_reg_nonexist(hkey, "Test14a"); + verify_reg_nonexist(hkey, "Test14b"); + verify_reg_nonexist(hkey, "Test14c"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test15a\"=\"foo\"bar\"\n" + "\"Test15b\"=\"foo\"\"bar\"\n\n"); + verify_reg_nonexist(hkey, "Test15a"); + verify_reg_nonexist(hkey, "Test15b"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test16a\"=\n" + "\"Test16b\"=\\\"\n" + "\"Test16c\"=\\\"Value\\\"\n" + "\"Test16d\"=\\\"Value\"\n\n"); + verify_reg_nonexist(hkey, "Test16a"); + verify_reg_nonexist(hkey, "Test16b"); + verify_reg_nonexist(hkey, "Test16c"); + verify_reg_nonexist(hkey, "Test16d"); + + /* Test key name and value name concatenation */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\\\n" + "Subkey1]\n"); + lr = RegOpenKeyExA(hkey, "Subkey1", 0, KEY_READ, &subkey); + ok(lr == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", lr); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "\n" + "\\Subkey2]\n"); + lr = RegOpenKeyExA(hkey, "Subkey2", 0, KEY_READ, &subkey); + ok(lr == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", lr); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test\\\n" + "17a\"=\"Value 1\"\n" + "\"Test17b\"=\"Value 2\"\n" + "\"Test\n" + "\\17c\"=\"Value 3\"\n\n"); + todo_wine verify_reg_nonexist(hkey, "Test17a"); + verify_reg(hkey, "Test17b", REG_SZ, "Value 2", 8, 0); + verify_reg_nonexist(hkey, "Test17c"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test18a\"=dword:1234\\\n" + "5678\n" + "\"Test18b\"=\"Test \\\n" + "Value\"\n\n"); + todo_wine verify_reg_nonexist(hkey, "Test18a"); + todo_wine verify_reg_nonexist(hkey, "Test18b"); + + /* Test hex data concatenation for REG_NONE, REG_EXPAND_SZ and REG_BINARY */ + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test19a\"=hex(0):56,00,61,00,6c,00\\\n" + ",75,00,65,00,00,00\n" + "\"Test19b\"=hex(0):56,00,61,00,6c,00\\\n" + " ,75,00,65,00,00,00\n" + "\"Test19c\"=hex(0):56,00,61,00,6c,00\\\n" + " 75,00,65,00,00,00\n" + "\"Test19d\"=hex(0):56,00,61,00,6c,00,7\\\n" + "5,00,65,00,00,00\n" + "\"Test19e\"=hex(0):56,00,61,00,6c,00,7\\\n" + " 5,00,65,00,00,00\n" + "\"Test19f\"=hex(0):56,00,61,00,\\;comment\n" + " 6c,00,75,00,\\#comment\n" + " 65,00,00,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Test19a"); + todo_wine verify_reg_nonexist(hkey, "Test19b"); + todo_wine verify_reg_nonexist(hkey, "Test19c"); + todo_wine verify_reg_nonexist(hkey, "Test19d"); + todo_wine verify_reg_nonexist(hkey, "Test19e"); + verify_reg_nonexist(hkey, "Test19f"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test20a\"=hex(2):25,50,41\\\n" + ",54,48,25,00\n" + "\"Test20b\"=hex(2):25,50,41\\\n" + " ,54,48,25,00\n" + "\"Test20c\"=hex(2):25,50,41\\\n" + " 54,48,25,00\n" + "\"Test20d\"=hex(2):25,50,4\\\n" + "1,54,48,25,00\n" + "\"Test20e\"=hex(2):25,50,4\\\n" + " 1,54,48,25,00\n" + "\"Test20f\"=hex(2):25,50,41,\\;comment\n" + " 54,48,\\#comment\n" + " 25,00\n\n"); + todo_wine verify_reg_nonexist(hkey, "Test20a"); + todo_wine verify_reg_nonexist(hkey, "Test20b"); + verify_reg_nonexist(hkey, "Test20c"); + todo_wine verify_reg_nonexist(hkey, "Test20d"); + todo_wine verify_reg_nonexist(hkey, "Test20e"); + verify_reg_nonexist(hkey, "Test20f"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Test21a\"=hex:11,22,33,44\\\n" + ",55,66,77,88\n" + "\"Test21b\"=hex:11,22,33,44\\\n" + " ,55,66,77,88\n" + "\"Test21c\"=hex:11,22,33,44\\\n" + " 55,66,77,88\n" + "\"Test21d\"=hex:11,22,33,4\\\n" + "4,55,66,77,88\n" + "\"Test21e\"=hex:11,22,33,4\\\n" + " 4,55,66,77,88\n" + "\"Test21f\"=hex:11,22,33,\\;comment\n" + " 44,55,66,\\#comment\n" + " 77,88\n\n"); + todo_wine verify_reg_nonexist(hkey, "Test21a"); + todo_wine verify_reg_nonexist(hkey, "Test21b"); + verify_reg_nonexist(hkey, "Test21c"); + todo_wine verify_reg_nonexist(hkey, "Test21d"); + todo_wine verify_reg_nonexist(hkey, "Test21e"); + verify_reg_nonexist(hkey, "Test21f"); + RegCloseKey(hkey); lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); +} + +static void test_invalid_import_31(void) +{ + HKEY hkey; + LONG lr; + + lr = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_READ, NULL, &hkey, NULL); + ok(lr == ERROR_SUCCESS, "RegCreateKeyExA failed: %d\n", lr); + + /* Test character validity at the start of the line */ + exec_import_str("REGEDIT\r\n" + " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1a\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1b\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + "\tHKEY_CLASSES_ROOT\\" KEY_BASE " = Value1c\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + ";HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2a\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + "#HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2b\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + /* Test case sensitivity */ + exec_import_str("REGEDIT\r\n" + "hkey_classes_root\\" KEY_BASE " = Value3a\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + "hKEY_CLASSES_ROOT\\" KEY_BASE " = Value3b\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + exec_import_str("REGEDIT\r\n" + "Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n"); + todo_wine verify_reg_nonexist(hkey, ""); + + RegCloseKey(hkey); + + lr = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE); + ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); +} + +static void test_comments(void) +{ + LONG lr; + HKEY hkey; + DWORD dword; + + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(lr == ERROR_SUCCESS || lr == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", lr); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "#comment\\\n" + "\"Wine1\"=\"Line 1\"\n" + ";comment\\\n" + "\"Wine2\"=\"Line 2\"\n\n"); + lr = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + ok(lr == ERROR_SUCCESS, "RegOpenKeyExA failed: %d\n", lr); + todo_wine verify_reg(hkey, "Wine1", REG_SZ, "Line 1", 7, 0); + todo_wine verify_reg(hkey, "Wine2", REG_SZ, "Line 2", 7, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine3\"=\"Value 1\"#comment\n" + "\"Wine4\"=\"Value 2\";comment\n" + "\"Wine5\"=dword:01020304 #comment\n" + "\"Wine6\"=dword:02040608 ;comment\n\n"); + verify_reg_nonexist(hkey, "Wine3"); + verify_reg(hkey, "Wine4", REG_SZ, "Value 2", 8, 0); + verify_reg_nonexist(hkey, "Wine5"); + dword = 0x2040608; + verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine7\"=hex(7):4c,69,6e,65,20,\\\n" + " #comment\n" + " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n" + "\"Wine8\"=\"A valid line\"\n" + "\"Wine9\"=hex(7):4c,69,6e,65,20,\\\n" + " ;comment\n" + " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n" + "\"Wine10\"=\"Another valid line\"\n\n"); + verify_reg_nonexist(hkey, "Wine7"); + verify_reg(hkey, "Wine8", REG_SZ, "A valid line", 13, 0); + todo_wine verify_reg(hkey, "Wine9", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + verify_reg(hkey, "Wine10", REG_SZ, "Another valid line", 19, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "#\"Comment1\"=\"Value 1\"\n" + ";\"Comment2\"=\"Value 2\"\n" + " #\"Comment3\"=\"Value 3\"\n" + " ;\"Comment4\"=\"Value 4\"\n" + "\"Wine11\"=\"Value 6\"#\"Comment5\"=\"Value 5\"\n" + "\"Wine12\"=\"Value 7\";\"Comment6\"=\"Value 6\"\n\n"); + verify_reg_nonexist(hkey, "Comment1"); + verify_reg_nonexist(hkey, "Comment2"); + verify_reg_nonexist(hkey, "Comment3"); + verify_reg_nonexist(hkey, "Comment4"); + verify_reg_nonexist(hkey, "Wine11"); + verify_reg_nonexist(hkey, "Comment5"); + verify_reg(hkey, "Wine12", REG_SZ, "Value 7", 8, 0); + verify_reg_nonexist(hkey, "Comment6"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine13\"=#\"Value 8\"\n" + "\"Wine14\"=;\"Value 9\"\n" + "\"Wine15\"=\"#comment1\"\n" + "\"Wine16\"=\";comment2\"\n" + "\"Wine17\"=\"Value#comment3\"\n" + "\"Wine18\"=\"Value;comment4\"\n" + "\"Wine19\"=\"Value #comment5\"\n" + "\"Wine20\"=\"Value ;comment6\"\n" + "\"Wine21\"=#dword:00000001\n" + "\"Wine22\"=;dword:00000002\n" + "\"Wine23\"=dword:00000003#comment\n" + "\"Wine24\"=dword:00000004;comment\n\n"); + verify_reg_nonexist(hkey, "Wine13"); + verify_reg_nonexist(hkey, "Wine14"); + verify_reg(hkey, "Wine15", REG_SZ, "#comment1", 10, 0); + verify_reg(hkey, "Wine16", REG_SZ, ";comment2", 10, 0); + verify_reg(hkey, "Wine17", REG_SZ, "Value#comment3", 15, 0); + verify_reg(hkey, "Wine18", REG_SZ, "Value;comment4", 15, 0); + verify_reg(hkey, "Wine19", REG_SZ, "Value #comment5", 16, 0); + verify_reg(hkey, "Wine20", REG_SZ, "Value ;comment6", 16, 0); + verify_reg_nonexist(hkey, "Wine21"); + verify_reg_nonexist(hkey, "Wine22"); + verify_reg_nonexist(hkey, "Wine23"); + dword = 0x00000004; + verify_reg(hkey, "Wine24", REG_DWORD, &dword, sizeof(dword), 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine25a\"=dword:1234;5678\n" + "\"Wine25b\"=dword:1234 ;5678\n" + "\"Wine25c\"=dword:1234#5678\n" + "\"Wine25d\"=dword:1234 #5678\n\n"); + dword = 0x1234; + verify_reg(hkey, "Wine25a", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg(hkey, "Wine25b", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg_nonexist(hkey, "Wine25c"); + verify_reg_nonexist(hkey, "Wine25d"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine26a\"=\"Value1\" ;comment\n" + "\"Wine26b\"=\"Value2\"\t\t;comment\n" + "\"Wine26c\"=\"Value3\" #comment\n" + "\"Wine26d\"=\"Value4\"\t\t#comment\n\n"); + verify_reg(hkey, "Wine26a", REG_SZ, "Value1", 7, 0); + verify_reg(hkey, "Wine26b", REG_SZ, "Value2", 7, 0); + verify_reg_nonexist(hkey, "Wine26c"); + verify_reg_nonexist(hkey, "Wine26d"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line1\"=hex(7):4c,69,6e,65,20,\\\n" + " 63,6f,6e,\\;comment\n" + " 63,61,74,\\;comment\n" + " 65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg(hkey, "Multi-Line1", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line2\"=hex(7):4c,69,6e,65,20,\\\n" + " 63,6f,6e,\\;comment\n" + " 63,61,74,;comment\n" + " 65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg(hkey, "Multi-Line2", REG_MULTI_SZ, "Line concat", 12, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line3\"=hex(7):4c,69,6e,\\;comment\n" + " 65,20,\\;comment\n" + " 63,6f,6e,\\;comment\n" + " 63,61,74,\\;comment\n" + " 65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg(hkey, "Multi-Line3", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line4\"=hex(7):4c,69,6e,\\;#comment\n" + " 65,20,\\;#comment\n" + " 63,6f,6e,\\;#comment\n" + " 63,61,74,\\;#comment\n" + " 65,6e,61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg(hkey, "Multi-Line4", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line5\"=hex(7):4c,69,6e,\\;comment\n" + " 65,20,\\;comment\n" + " 63,6f,6e,\\;comment\n" + " 63,61,74,\\#comment\n" + " 65,6e,61,74,69,6f,6e,00,00\n\n"); + verify_reg_nonexist(hkey, "Multi-Line5"); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Multi-Line6\"=hex(7):4c,69,6e,65,20,\\\n" + " 63,6f,6e,\\;comment\n" + " 63,61,74,\\\n\n" + " 65,6e,\\;comment\n\n" + " 61,74,69,6f,6e,00,00\n\n"); + todo_wine verify_reg(hkey, "Multi-Line6", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + + RegCloseKey(hkey); + + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: %d\n", lr); +} + +static void test_import_with_whitespace(void) +{ + HKEY hkey; + LONG lr; + DWORD dword; + + exec_import_str(" REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"); + + lr = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + ok(lr == ERROR_SUCCESS, "RegOpenKeyExA failed: got %d, expected 0\n", lr); + + exec_import_str(" REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine1a\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine1a", REG_SZ, "Value", 6, 0); + + exec_import_str("\tREGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine1b\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine1b", REG_SZ, "Value", 6, 0); + + exec_import_str(" \t REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine1c\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine1c", REG_SZ, "Value", 6, 0); + + exec_import_str("REGEDIT4\n\n" + " [HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine2a\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine2a", REG_SZ, "Value", 6, 0); + + exec_import_str("REGEDIT4\n\n" + "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine2b\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine2b", REG_SZ, "Value", 6, 0); + + exec_import_str("REGEDIT4\n\n" + " \t [HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine2c\"=\"Value\"\n\n"); + verify_reg(hkey, "Wine2c", REG_SZ, "Value", 6, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + " \"Wine3a\"=\"Two leading spaces\"\n\n"); + verify_reg(hkey, "Wine3a", REG_SZ, "Two leading spaces", 19, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\t\"Wine3b\"=\"One leading tab\"\n\n"); + verify_reg(hkey, "Wine3b", REG_SZ, "One leading tab", 16, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + " \t \"Wine3c\"=\"Space, tab, space\"\n\n"); + verify_reg(hkey, "Wine3c", REG_SZ, "Space, tab, space", 18, 0); + + exec_import_str(" REGEDIT4\n\n" + "\t\t\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\t \"Wine4a\"=\"Tab and four spaces\"\n" + " \"Wine4b\"=dword:00112233\n" + "\t \t \t \t \t \t \"Wine4c\"=hex(7):4c,69,6e,65,20,\\\n" + " 63,6f,6e,\\;comment\n" + "\t\t\t\t63,61,74,\\;comment\n" + " \t65,6e,61,74,69,6f,6e,00,00\n\n"); + verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0); + dword = 0x112233; + verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0); + todo_wine verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0); + + exec_import_str(" REGEDIT4\n\n" + "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + " \"Wine5a\"=\"Leading spaces\"\n" + "\t\t\"Wine5b\"\t\t=\"Leading tabs\"\n" + "\t \"Wine5c\"=\t \"Tabs and spaces\"\n" + " \"Wine5d\" \t = \t \"More whitespace\"\n\n"); + verify_reg(hkey, "Wine5a", REG_SZ, "Leading spaces", 15, 0); + verify_reg(hkey, "Wine5b", REG_SZ, "Leading tabs", 13, 0); + verify_reg(hkey, "Wine5c", REG_SZ, "Tabs and spaces", 16, 0); + verify_reg(hkey, "Wine5d", REG_SZ, "More whitespace", 16, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\" Wine6a\"=\"Leading spaces\"\n" + "\"\t\tWine6b\"=\"Leading tabs\"\n" + " \" Wine6c \" = \" Spaces everywhere \" \n\n"); + verify_reg(hkey, " Wine6a", REG_SZ, "Leading spaces", 15, 0); + verify_reg(hkey, "\t\tWine6b", REG_SZ, "Leading tabs", 13, 0); + verify_reg(hkey, " Wine6c ", REG_SZ, " Spaces everywhere ", 22, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine7a\"=\" Four spaces in the data\"\n" + "\"Wine7b\"=\"\t\tTwo tabs in the data\"\n\n"); + verify_reg(hkey, "Wine7a", REG_SZ, " Four spaces in the data", 28, 0); + verify_reg(hkey, "Wine7b", REG_SZ, "\t\tTwo tabs in the data", 23, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine8a\"=\"Trailing spaces\" \n" + "\"Wine8b\"=\"Trailing tabs and spaces\"\t \t\n\n"); + verify_reg(hkey, "Wine8a", REG_SZ, "Trailing spaces", 16, 0); + verify_reg(hkey, "Wine8b", REG_SZ, "Trailing tabs and spaces", 25, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\"Wine9a\"=dword: 00000008\n" + "\"Wine9b\"=dword:\t\t00000008\n\n"); + dword = 0x00000008; + verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "@ = \"Test Value\"\n\n"); + verify_reg(hkey, "", REG_SZ, "Test Value", 11, 0); + + exec_import_str("REGEDIT4\n\n" + "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" + "\t@\t=\tdword:\t00000008\t\n\n"); + verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), 0); + + lr = RegCloseKey(hkey); + ok(lr == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", lr); + + lr = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(lr == ERROR_SUCCESS, "RegDeleteKeyA failed: got %d, expected 0\n", lr); } START_TEST(regedit) @@ -337,5 +1124,9 @@ supports_wchar = exec_import_wstr(wchar_test); test_basic_import(); + test_basic_import_31(); test_invalid_import(); + test_invalid_import_31(); + test_comments(); + test_import_with_whitespace(); }
7 years, 6 months
1
0
0
0
[akhaldi] 74839: [QUARTZ_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:36:05 2017 New Revision: 74839 URL:
http://svn.reactos.org/svn/reactos?rev=74839&view=rev
Log: [QUARTZ_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/quartz/filtergraph.c Modified: trunk/rostests/winetests/quartz/filtergraph.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/quartz/filtergr…
============================================================================== --- trunk/rostests/winetests/quartz/filtergraph.c [iso-8859-1] (original) +++ trunk/rostests/winetests/quartz/filtergraph.c [iso-8859-1] Sat Jun 3 22:36:05 2017 @@ -374,6 +374,80 @@ h = CreateFileW(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); ok(h != INVALID_HANDLE_VALUE, "CreateFile failed: err=%d\n", GetLastError()); CloseHandle(h); +} + +static DWORD WINAPI call_RenderFile_multithread(LPVOID lParam) +{ + IFilterGraph2 *filter_graph = lParam; + HRESULT hr; + WCHAR mp3file[] = {'t','e','s','t','.','m','p','3',0}; + HANDLE handle; + + handle = CreateFileW(mp3file, 0, 0, NULL, CREATE_ALWAYS, 0, NULL); + if (handle == INVALID_HANDLE_VALUE) + { + skip("Could not read test file %s, skipping test\n", wine_dbgstr_w(mp3file)); + return 1; + } + CloseHandle(handle); + + hr = IFilterGraph2_RenderFile(filter_graph, mp3file, NULL); + todo_wine ok(hr == VFW_E_CANNOT_RENDER || /* xp or older */ + hr == VFW_E_NO_TRANSPORT, /* win7 or newer */ + "Expected 0x%08x or 0x%08x, returned 0x%08x\n", VFW_E_CANNOT_RENDER, VFW_E_NO_TRANSPORT, hr); + + DeleteFileW(mp3file); + return 0; +} + +static void test_render_with_multithread(void) +{ + HRESULT hr; + HMODULE hmod; + static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID rclsid, REFIID riid, void **out); + IClassFactory *classfactory = NULL; + static IGraphBuilder *graph_builder; + static IFilterGraph2 *filter_graph; + HANDLE thread; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hmod = LoadLibraryA("quartz.dll"); + if (!hmod) + { + skip("Fail to load quartz.dll.\n"); + return; + } + + pDllGetClassObject = (void*)GetProcAddress(hmod, "DllGetClassObject"); + if (!pDllGetClassObject) + { + skip("Fail to get DllGetClassObject.\n"); + return; + } + + hr = pDllGetClassObject(&CLSID_FilterGraph, &IID_IClassFactory, (void **)&classfactory); + ok(hr == S_OK, "DllGetClassObject failed 0x%08x\n", hr); + if (FAILED(hr)) + { + skip("Can't create IClassFactory 0x%08x.\n", hr); + return; + } + + hr = IClassFactory_CreateInstance(classfactory, NULL, &IID_IUnknown, (LPVOID*)&graph_builder); + ok(hr == S_OK, "IClassFactory_CreateInstance failed 0x%08x\n", hr); + + hr = IGraphBuilder_QueryInterface(graph_builder, &IID_IFilterGraph2, (void**)&filter_graph); + ok(hr == S_OK, "IGraphBuilder_QueryInterface failed 0x%08x\n", hr); + + thread = CreateThread(NULL, 0, call_RenderFile_multithread, filter_graph, 0, NULL); + + WaitForSingleObject(thread, 1000); + IFilterGraph2_Release(filter_graph); + IGraphBuilder_Release(graph_builder); + IClassFactory_Release(classfactory); + CoUninitialize(); + return; } static void test_graph_builder(void) @@ -2235,4 +2309,5 @@ test_render_filter_priority(); test_aggregate_filter_graph(); CoUninitialize(); -} + test_render_with_multithread(); +}
7 years, 6 months
1
0
0
0
[akhaldi] 74838: [PSAPI_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:35:45 2017 New Revision: 74838 URL:
http://svn.reactos.org/svn/reactos?rev=74838&view=rev
Log: [PSAPI_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/psapi/psapi_main.c Modified: trunk/rostests/winetests/psapi/psapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/psapi/psapi_mai…
============================================================================== --- trunk/rostests/winetests/psapi/psapi_main.c [iso-8859-1] (original) +++ trunk/rostests/winetests/psapi/psapi_main.c [iso-8859-1] Sat Jun 3 22:35:45 2017 @@ -300,9 +300,7 @@ SetLastError(0xdeadbeef); ret = pGetProcessMemoryInfo(hpSR, &pmc, sizeof(pmc)); -todo_wine ok(!ret, "GetProcessMemoryInfo should fail\n"); -todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "expected error=ERROR_ACCESS_DENIED but got %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -329,14 +327,7 @@ ret_len = 0xdeadbeef; status = pNtQueryVirtualMemory(process, addr, MemorySectionName, buf, buf_len, &ret_len); -todo_wine ok(!status, "NtQueryVirtualMemory error %x\n", status); - /* FIXME: remove once Wine is fixed */ - if (status) - { - HeapFree(GetProcessHeap(), 0, buf); - return FALSE; - } section_name = (MEMORY_SECTION_NAME *)buf; ok(ret_len == section_name->SectionFileName.MaximumLength + sizeof(*section_name), "got %lu, %u\n", @@ -362,31 +353,30 @@ char temp_path[MAX_PATH], file_name[MAX_PATH], map_name[MAX_PATH], device_name[MAX_PATH], drive[3]; WCHAR map_nameW[MAX_PATH], nt_map_name[MAX_PATH]; HANDLE hfile, hmap; + HANDLE current_process; + + DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), + GetCurrentProcess(), ¤t_process, 0, 0, DUPLICATE_SAME_ACCESS ); SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(NULL, hMod, szMapPath, sizeof(szMapPath)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "expected error=ERROR_INVALID_HANDLE but got %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(hpSR, hMod, szMapPath, sizeof(szMapPath)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "expected error=ERROR_ACCESS_DENIED but got %d\n", GetLastError()); SetLastError( 0xdeadbeef ); ret = pGetMappedFileNameA(hpQI, hMod, szMapPath, sizeof(szMapPath)); -todo_wine ok( ret || broken(GetLastError() == ERROR_UNEXP_NET_ERR), /* win2k */ "GetMappedFileNameA failed with error %u\n", GetLastError() ); if (ret) { ok(ret == strlen(szMapPath), "szMapPath=\"%s\" ret=%d\n", szMapPath, ret); - todo_wine ok(szMapPath[0] == '\\', "szMapPath=\"%s\"\n", szMapPath); szMapBaseName = strrchr(szMapPath, '\\'); /* That's close enough for us */ - todo_wine ok(szMapBaseName && *szMapBaseName, "szMapPath=\"%s\"\n", szMapPath); if (szMapBaseName) { @@ -424,36 +414,30 @@ SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base, map_name, 0); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_INSUFFICIENT_BUFFER, "wrong error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base, 0, sizeof(map_name)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base, map_name, 1); -todo_wine ok(ret == 1, "GetMappedFileName error %d\n", GetLastError()); ok(!map_name[0] || broken(map_name[0] == device_name[0]) /* before win2k */, "expected 0, got %c\n", map_name[0]); SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base, map_name, sizeof(map_name)); -todo_wine { ok(ret, "GetMappedFileName error %d\n", GetLastError()); ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); -} SetLastError(0xdeadbeef); ret = pGetMappedFileNameW(GetCurrentProcess(), base, map_nameW, sizeof(map_nameW)/sizeof(map_nameW[0])); -todo_wine { ok(ret, "GetMappedFileNameW error %d\n", GetLastError()); ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); -} + if (nt_get_mapped_file_name(GetCurrentProcess(), base, nt_map_name, sizeof(nt_map_name)/sizeof(nt_map_name[0]))) { ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name); @@ -462,17 +446,26 @@ } SetLastError(0xdeadbeef); + ret = pGetMappedFileNameW(current_process, base, map_nameW, sizeof(map_nameW)/sizeof(map_nameW[0])); + ok(ret, "GetMappedFileNameW error %d\n", GetLastError()); + ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); + + if (nt_get_mapped_file_name(current_process, base, nt_map_name, sizeof(nt_map_name)/sizeof(nt_map_name[0]))) + { + ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name); + WideCharToMultiByte(CP_ACP, 0, map_nameW, -1, map_name, MAX_PATH, NULL, NULL); + ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); + } + + SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base + 0x2000, map_name, sizeof(map_name)); -todo_wine { ok(ret, "GetMappedFileName error %d\n", GetLastError()); ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); -} SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base + 0x4000, map_name, sizeof(map_name)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_UNEXP_NET_ERR, "expected ERROR_UNEXP_NET_ERR, got %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -484,7 +477,6 @@ SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(0, base, map_name, sizeof(map_name)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); UnmapViewOfFile(base); @@ -503,9 +495,9 @@ SetLastError(0xdeadbeef); ret = pGetMappedFileNameA(GetCurrentProcess(), base, map_name, sizeof(map_name)); ok(!ret, "GetMappedFileName should fail\n"); -todo_wine ok(GetLastError() == ERROR_FILE_INVALID, "expected ERROR_FILE_INVALID, got %d\n", GetLastError()); + CloseHandle(current_process); UnmapViewOfFile(base); CloseHandle(hmap); } @@ -552,8 +544,8 @@ if(ret && ret1) { /* Windows returns 2*strlen-1 */ - todo_wine ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%d\n", szImgPath, ret); - todo_wine ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); + ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%d\n", szImgPath, ret); + ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); } SetLastError(0xdeadbeef);
7 years, 6 months
1
0
0
0
[akhaldi] 74837: [PROPSYS_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:35:33 2017 New Revision: 74837 URL:
http://svn.reactos.org/svn/reactos?rev=74837&view=rev
Log: [PROPSYS_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/propsys/propsys.c Modified: trunk/rostests/winetests/propsys/propsys.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/propsys…
============================================================================== --- trunk/rostests/winetests/propsys/propsys.c [iso-8859-1] (original) +++ trunk/rostests/winetests/propsys/propsys.c [iso-8859-1] Sat Jun 3 22:35:33 2017 @@ -742,10 +742,10 @@ ok(res == 0, "res=%i\n", res); res = PropVariantCompareEx(&i2_2, &str_2, 0, 0); - todo_wine ok(res == 0, "res=%i\n", res); + ok(res == 0, "res=%i\n", res); res = PropVariantCompareEx(&i2_2, &str_02, 0, 0); - todo_wine ok(res == 0, "res=%i\n", res); + ok(res == 0, "res=%i\n", res); res = PropVariantCompareEx(&str_2, &i2_2, 0, 0); todo_wine ok(res == 0, "res=%i\n", res);
7 years, 6 months
1
0
0
0
[akhaldi] 74836: [PROPSYS] Sync with Wine Staging 2.9. CORE-13362 090b4f2 propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx. (v2) 99758d9 propsys: Add support for VT_LPSTR to ...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:35:14 2017 New Revision: 74836 URL:
http://svn.reactos.org/svn/reactos?rev=74836&view=rev
Log: [PROPSYS] Sync with Wine Staging 2.9. CORE-13362 090b4f2 propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx. (v2) 99758d9 propsys: Add support for VT_LPSTR to PropVariantChangeType. (v2) 43fa646 propsys: Make VT_FILETIME handling by PropVariantChangeType more implicit. 55b3752 propsys: Add support for VT_BSTR to PropVariantChangeType. fc00aec propsys: Add support for VT_LPWSTR and VT_BSTR to PropVariantToStringAlloc. aa841b3 propsys: Add support for VT_I1 and VT_UI1 to PropVariantChangeType. 8e273c8 propsys: Fix PSGetPropertyDescriptionListFromString spec file entry. 6df21d4 propsys: Use snprintf in PROPVAR_ConvertFILETIME. Modified: trunk/reactos/dll/win32/propsys/propsys.spec trunk/reactos/dll/win32/propsys/propvar.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/propsys/propsys.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propsys.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propsys.spec [iso-8859-1] Sat Jun 3 22:35:14 2017 @@ -82,7 +82,7 @@ @ stub PSGetNamedPropertyFromPropertyStorage @ stdcall PSGetPropertyDescription(ptr ptr ptr) @ stub PSGetPropertyDescriptionByName -@ stdcall PSGetPropertyDescriptionListFromString(ptr ptr ptr) +@ stdcall PSGetPropertyDescriptionListFromString(wstr ptr ptr) @ stub PSGetPropertyFromPropertyStorage @ stub PSGetPropertyKeyFromName @ stdcall PSGetPropertySystem(ptr ptr) Modified: trunk/reactos/dll/win32/propsys/propvar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propvar.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] Sat Jun 3 22:35:14 2017 @@ -25,12 +25,11 @@ #include <oleauto.h> #include <propvarutil.h> -static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest, - REFPROPVARIANT propvarSrc, VARTYPE vt) +static HRESULT PROPVAR_ConvertFILETIME(const FILETIME *ft, PROPVARIANT *ppropvarDest, VARTYPE vt) { SYSTEMTIME time; - FileTimeToSystemTime(&propvarSrc->u.filetime, &time); + FileTimeToSystemTime(ft, &time); switch (vt) { @@ -39,13 +38,15 @@ static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d"; ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0, - lstrlenA(format) + 1); + sizeof(format)); if (!ppropvarDest->u.pszVal) return E_OUTOFMEMORY; - sprintf(ppropvarDest->u.pszVal, format, time.wYear, time.wMonth, - time.wDay, time.wHour, time.wMinute, - time.wSecond, time.wMilliseconds); + snprintf( ppropvarDest->u.pszVal, sizeof(format), + format, + time.wYear, time.wMonth, time.wDay, + time.wHour, time.wMinute, time.wSecond, + time.wMilliseconds ); return S_OK; } @@ -99,6 +100,15 @@ case VT_EMPTY: src_signed = FALSE; *res = 0; + break; + case VT_LPSTR: + *res = _strtoi64(pv->u.pszVal, NULL, 0); + src_signed = *res < 0; + break; + case VT_LPWSTR: + case VT_BSTR: + *res = strtolW(pv->u.pwszVal, NULL, 0); + src_signed = *res < 0; break; default: FIXME("unhandled vt %d\n", pv->vt); @@ -211,6 +221,7 @@ res = CoTaskMemAlloc(1*sizeof(WCHAR)); res[0] = '\0'; break; + case VT_LPSTR: if(propvarIn->u.pszVal) { @@ -224,6 +235,18 @@ MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, res, len); } break; + + case VT_LPWSTR: + case VT_BSTR: + if (propvarIn->u.pwszVal) + { + DWORD size = (strlenW(propvarIn->u.pwszVal) + 1) * sizeof(WCHAR); + res = CoTaskMemAlloc(size); + if(!res) return E_OUTOFMEMORY; + memcpy(res, propvarIn->u.pwszVal, size); + } + break; + default: FIXME("Unsupported conversion (%d)\n", propvarIn->vt); hr = E_FAIL; @@ -246,11 +269,40 @@ FIXME("(%p, %p, %d, %d, %d): semi-stub!\n", ppropvarDest, propvarSrc, propvarSrc->vt, flags, vt); - if(vt == propvarSrc->vt) + if (vt == propvarSrc->vt) return PropVariantCopy(ppropvarDest, propvarSrc); + if (propvarSrc->vt == VT_FILETIME) + return PROPVAR_ConvertFILETIME(&propvarSrc->u.filetime, ppropvarDest, vt); + switch (vt) { + case VT_I1: + { + LONGLONG res; + + hr = PROPVAR_ConvertNumber(propvarSrc, 8, TRUE, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_I1; + ppropvarDest->u.cVal = (char)res; + } + return hr; + } + + case VT_UI1: + { + LONGLONG res; + + hr = PROPVAR_ConvertNumber(propvarSrc, 8, FALSE, &res); + if (SUCCEEDED(hr)) + { + ppropvarDest->vt = VT_UI1; + ppropvarDest->u.bVal = (UCHAR)res; + } + return hr; + } + case VT_I2: { SHORT res; @@ -317,7 +369,9 @@ } return hr; } + case VT_LPWSTR: + case VT_BSTR: { WCHAR *res; hr = PropVariantToStringAlloc(propvarSrc, &res); @@ -328,17 +382,36 @@ } return hr; } - } - - switch (propvarSrc->vt) - { - case VT_FILETIME: - return PROPVAR_ConvertFILETIME(ppropvarDest, propvarSrc, vt); - default: - FIXME("Unhandled source type: %d\n", propvarSrc->vt); - } - - return E_FAIL; + + case VT_LPSTR: + { + WCHAR *resW; + hr = PropVariantToStringAlloc(propvarSrc, &resW); + if (SUCCEEDED(hr)) + { + char *res; + DWORD len; + + len = WideCharToMultiByte(CP_ACP, 0, resW, -1, NULL, 0, NULL, NULL); + res = CoTaskMemAlloc(len); + if (res) + { + WideCharToMultiByte(CP_ACP, 0, resW, -1, res, len, NULL, NULL); + ppropvarDest->vt = VT_LPSTR; + ppropvarDest->u.pszVal = res; + } + else + hr = E_OUTOFMEMORY; + + CoTaskMemFree(resW); + } + return hr; + } + + default: + FIXME("Unhandled dest type: %d\n", vt); + return E_FAIL; + } } static void PROPVAR_GUIDToWSTR(REFGUID guid, WCHAR *str) @@ -623,8 +696,19 @@ CMP_INT_VALUE(uhVal.QuadPart); break; case VT_BSTR: - /* FIXME: Use string flags. */ - res = lstrcmpW(propvar1->u.bstrVal, propvar2->u.bstrVal); + case VT_LPWSTR: + /* FIXME: Use other string flags. */ + if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC)) + res = lstrcmpiW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal); + else + res = lstrcmpW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal); + break; + case VT_LPSTR: + /* FIXME: Use other string flags. */ + if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC)) + res = lstrcmpiA(propvar1->u.pszVal, propvar2_converted->u.pszVal); + else + res = lstrcmpA(propvar1->u.pszVal, propvar2_converted->u.pszVal); break; default: FIXME("vartype %d not handled\n", propvar1->vt); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:35:14 2017 @@ -151,7 +151,7 @@ reactos/dll/win32/pidgen # Synced to WineStaging-1.9.11 reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to WineStaging-1.9.11 -reactos/dll/win32/propsys # Synced to WineStaging-1.9.16 +reactos/dll/win32/propsys # Synced to WineStaging-2.9 reactos/dll/win32/pstorec # Synced to WineStaging-2.2 reactos/dll/win32/qmgr # Synced to WineStaging-1.9.23 reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74835: [PDH] Sync with Wine Staging 2.9. CORE-13362 88c4d33 pdh: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:35:01 2017 New Revision: 74835 URL:
http://svn.reactos.org/svn/reactos?rev=74835&view=rev
Log: [PDH] Sync with Wine Staging 2.9. CORE-13362 88c4d33 pdh: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. Modified: trunk/reactos/dll/win32/pdh/pdh_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/pdh/pdh_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/pdh/pdh_main.c?r…
============================================================================== --- trunk/reactos/dll/win32/pdh/pdh_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/pdh/pdh_main.c [iso-8859-1] Sat Jun 3 22:35:01 2017 @@ -49,19 +49,19 @@ }; static CRITICAL_SECTION pdh_handle_cs = { &pdh_handle_cs_debug, -1, 0, 0, 0, 0 }; -static inline void *heap_alloc( SIZE_T size ) -{ - return HeapAlloc( GetProcessHeap(), 0, size ); -} - -static inline void *heap_alloc_zero( SIZE_T size ) -{ - return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); -} - -static inline void heap_free( LPVOID mem ) -{ - HeapFree( GetProcessHeap(), 0, mem ); +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) +{ + return HeapAlloc(GetProcessHeap(), 0, size); +} + +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); } static inline WCHAR *pdh_strdup( const WCHAR *src ) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:35:01 2017 @@ -147,7 +147,7 @@ reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olesvr32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olethk32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/pdh # Synced to WineStaging-1.9.11 +reactos/dll/win32/pdh # Synced to WineStaging-2.9 reactos/dll/win32/pidgen # Synced to WineStaging-1.9.11 reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74834: [OPENGL32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:34:42 2017 New Revision: 74834 URL:
http://svn.reactos.org/svn/reactos?rev=74834&view=rev
Log: [OPENGL32_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/opengl32/opengl.c Modified: trunk/rostests/winetests/opengl32/opengl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/opengl32/opengl…
============================================================================== --- trunk/rostests/winetests/opengl32/opengl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/opengl32/opengl.c [iso-8859-1] Sat Jun 3 22:34:42 2017 @@ -713,6 +713,9 @@ glGetIntegerv( GL_VIEWPORT, viewport ); ok( viewport[0] == 0 && viewport[1] == 0 && viewport[2] == 12 && viewport[3] == 12, "wrong viewport %d,%d,%d,%d\n", viewport[0], viewport[1], viewport[2], viewport[3] ); + + wglDeleteContext(hglrc2); + wglDeleteContext(hglrc); } } @@ -927,12 +930,13 @@ { HGLRC gl3Ctx; DWORD error; + SetLastError(0xdeadbeef); gl3Ctx = pwglCreateContextAttribsARB((HDC)0xdeadbeef, 0, 0); ok(gl3Ctx == 0, "pwglCreateContextAttribsARB using an invalid HDC passed\n"); error = GetLastError(); - todo_wine ok(error == ERROR_DC_NOT_FOUND || - broken(error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_DATA)), /* Nvidia Vista + Win7 */ - "Expected ERROR_DC_NOT_FOUND, got error=%x\n", error); + ok(error == ERROR_DC_NOT_FOUND || + broken(error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_DATA)), /* Nvidia Vista + Win7 */ + "Expected ERROR_DC_NOT_FOUND, got error=%x\n", error); wglDeleteContext(gl3Ctx); } @@ -940,12 +944,13 @@ { HGLRC gl3Ctx; DWORD error; + SetLastError(0xdeadbeef); gl3Ctx = pwglCreateContextAttribsARB(hdc, (HGLRC)0xdeadbeef, 0); ok(gl3Ctx == 0, "pwglCreateContextAttribsARB using an invalid shareList passed\n"); error = GetLastError(); /* The Nvidia implementation seems to return hresults instead of win32 error codes */ - todo_wine ok(error == ERROR_INVALID_OPERATION || - error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION), "Expected ERROR_INVALID_OPERATION, got error=%x\n", error); + ok(error == ERROR_INVALID_OPERATION || + error == NVIDIA_HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION), "Expected ERROR_INVALID_OPERATION, got error=%x\n", error); wglDeleteContext(gl3Ctx); }
7 years, 6 months
1
0
0
0
[akhaldi] 74833: [OLEDLG] Sync with Wine Staging 2.9. CORE-13362 0028360 oledlg: Use W-functions to access window property.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:34:33 2017 New Revision: 74833 URL:
http://svn.reactos.org/svn/reactos?rev=74833&view=rev
Log: [OLEDLG] Sync with Wine Staging 2.9. CORE-13362 0028360 oledlg: Use W-functions to access window property. Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oledlg/insobjdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/insobjdlg…
============================================================================== --- trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/insobjdlg.c [iso-8859-1] Sat Jun 3 22:34:33 2017 @@ -60,7 +60,8 @@ typedef HRESULT (*DLLREGISTER) (void); extern HINSTANCE OLEDLG_hInstance; -static const char OleUIInsertObjectInfoStr[] = "OleUIInsertObjectInfoStr"; +static const WCHAR OleUIInsertObjectInfoStr[] = {'O','l','e','U','I','I','n','s','e','r','t','O','b','j','e','c','t', + 'I','n','f','o','S','t','r',0}; /*********************************************************************** * OleUIInsertObjectA (OLEDLG.3) @@ -112,7 +113,7 @@ */ INT_PTR CALLBACK UIInsertObjectDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - InsertObjectDlgInfo* pdlgInfo = GetPropA(hwnd,OleUIInsertObjectInfoStr); + InsertObjectDlgInfo* pdlgInfo = GetPropW(hwnd, OleUIInsertObjectInfoStr); switch(uMsg) { @@ -122,7 +123,7 @@ pdlgInfo->hwndSelf = hwnd; - SetPropA(hwnd, OleUIInsertObjectInfoStr, pdlgInfo); + SetPropW(hwnd, OleUIInsertObjectInfoStr, pdlgInfo); UIINSERTOBJECTDLG_InitDialog(pdlgInfo); @@ -135,7 +136,7 @@ case WM_DESTROY: if (pdlgInfo) UIINSERTOBJECTDLG_FreeObjectTypes(pdlgInfo); - RemovePropA(hwnd, OleUIInsertObjectInfoStr); + RemovePropW(hwnd, OleUIInsertObjectInfoStr); return FALSE; default : @@ -151,9 +152,9 @@ */ static LRESULT UIINSOBJDLG_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) { + InsertObjectDlgInfo* pdlgInfo = GetPropW(hwnd, OleUIInsertObjectInfoStr); WORD wNotifyCode = HIWORD(wParam); WORD wID = LOWORD(wParam); - InsertObjectDlgInfo* pdlgInfo = GetPropA(hwnd,OleUIInsertObjectInfoStr); switch(wID) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:34:33 2017 @@ -143,7 +143,7 @@ reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-2.9 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/oledlg # Synced to WineStaging-1.9.23 +reactos/dll/win32/oledlg # Synced to WineStaging-2.9 reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olesvr32 # Synced to WineStaging-1.9.11 reactos/dll/win32/olethk32 # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74832: [OLEAUT32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:34:23 2017 New Revision: 74832 URL:
http://svn.reactos.org/svn/reactos?rev=74832&view=rev
Log: [OLEAUT32_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/oleaut32/olepicture.c trunk/rostests/winetests/oleaut32/varformat.c trunk/rostests/winetests/oleaut32/vartest.c trunk/rostests/winetests/oleaut32/vartype.c Modified: trunk/rostests/winetests/oleaut32/olepicture.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olepic…
============================================================================== --- trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] Sat Jun 3 22:34:23 2017 @@ -102,12 +102,21 @@ 0xe7,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; -/* 1x1 pixel bmp */ +/* 1bpp BI_RGB 1x1 pixel bmp */ static const unsigned char bmpimage[66] = { 0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00, 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00, 0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00, 0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00, +0x00,0x00 +}; + +/* 8bpp BI_RLE8 1x1 pixel bmp */ +static const unsigned char bmpimage_rle8[] = { +0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00, +0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x01,0x00, +0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00, +0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x01, 0x00,0x00 }; @@ -1465,6 +1474,7 @@ test_pic(gifimage, sizeof(gifimage)); test_pic(jpgimage, sizeof(jpgimage)); test_pic(bmpimage, sizeof(bmpimage)); + test_pic(bmpimage_rle8, sizeof(bmpimage_rle8)); test_pic(gif4pixel, sizeof(gif4pixel)); /* FIXME: No PNG support in Windows... */ if (0) test_pic(pngimage, sizeof(pngimage)); Modified: trunk/rostests/winetests/oleaut32/varformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/varfor…
============================================================================== --- trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] Sat Jun 3 22:34:23 2017 @@ -644,6 +644,42 @@ SysFreeString(bstr); } +static void test_GetAltMonthNames(void) +{ + LPOLESTR *str, *str2; + HRESULT hr; + + str = (void *)0xdeadbeef; + hr = GetAltMonthNames(0, &str); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str == NULL, "Got %p\n", str); + + str = (void *)0xdeadbeef; + hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), &str); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str == NULL, "Got %p\n", str); + + str = NULL; + hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str != NULL, "Got %p\n", str); + + str2 = NULL; + hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str2); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str2 == str, "Got %p\n", str2); + + str = NULL; + hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SORT_DEFAULT), &str); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str != NULL, "Got %p\n", str); + + str = NULL; + hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SORT_DEFAULT), &str); + ok(hr == S_OK, "Unexpected return value %08x\n", hr); + ok(str != NULL, "Got %p\n", str); +} + START_TEST(varformat) { hOleaut32 = GetModuleHandleA("oleaut32.dll"); @@ -654,4 +690,5 @@ test_VarFormat(); test_VarWeekdayName(); test_VarFormatFromTokens(); + test_GetAltMonthNames(); } Modified: trunk/rostests/winetests/oleaut32/vartest.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartes…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Sat Jun 3 22:34:23 2017 @@ -100,6 +100,150 @@ #define R4_MIN FLT_MIN #define R8_MAX DBL_MAX #define R8_MIN DBL_MIN + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0) + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(dispatch_invoke); + +typedef struct +{ + IDispatch IDispatch_iface; + VARTYPE vt; + HRESULT result; +} DummyDispatch; + +static inline DummyDispatch *impl_from_IDispatch(IDispatch *iface) +{ + return CONTAINING_RECORD(iface, DummyDispatch, IDispatch_iface); +} + +static ULONG WINAPI DummyDispatch_AddRef(IDispatch *iface) +{ + return 2; +} + +static ULONG WINAPI DummyDispatch_Release(IDispatch *iface) +{ + return 1; +} + +static HRESULT WINAPI DummyDispatch_QueryInterface(IDispatch *iface, + REFIID riid, + void** ppvObject) +{ + *ppvObject = NULL; + + if (IsEqualIID(riid, &IID_IDispatch) || + IsEqualIID(riid, &IID_IUnknown)) + { + *ppvObject = iface; + IDispatch_AddRef(iface); + } + + return *ppvObject ? S_OK : E_NOINTERFACE; +} + +static HRESULT WINAPI DummyDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) +{ + ok(0, "Unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDispatch_GetTypeInfo(IDispatch *iface, UINT tinfo, LCID lcid, ITypeInfo **ti) +{ + ok(0, "Unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *names, + UINT cnames, LCID lcid, DISPID *dispid) +{ + ok(0, "Unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DummyDispatch_Invoke(IDispatch *iface, + DISPID dispid, REFIID riid, + LCID lcid, WORD wFlags, + DISPPARAMS *params, + VARIANT *res, + EXCEPINFO *ei, + UINT *arg_err) +{ + DummyDispatch *This = impl_from_IDispatch(iface); + + CHECK_EXPECT(dispatch_invoke); + + ok(dispid == DISPID_VALUE, "got dispid %d\n", dispid); + ok(IsEqualIID(riid, &IID_NULL), "go riid %s\n", wine_dbgstr_guid(riid)); + ok(wFlags == DISPATCH_PROPERTYGET, "Flags wrong\n"); + + ok(params->rgvarg == NULL, "got %p\n", params->rgvarg); + ok(params->rgdispidNamedArgs == NULL, "got %p\n", params->rgdispidNamedArgs); + ok(params->cArgs == 0, "got %d\n", params->cArgs); + ok(params->cNamedArgs == 0, "got %d\n", params->cNamedArgs); + + ok(res != NULL, "got %p\n", res); + ok(V_VT(res) == VT_EMPTY, "got %d\n", V_VT(res)); + ok(ei == NULL, "got %p\n", ei); + ok(arg_err == NULL, "got %p\n", arg_err); + + if (FAILED(This->result)) + return This->result; + + V_VT(res) = This->vt; + if (This->vt == VT_UI1) + V_UI1(res) = 34; + else if (This->vt == VT_NULL) + { + V_VT(res) = VT_NULL; + V_BSTR(res) = NULL; + } + else + memset(res, 0, sizeof(*res)); + + return S_OK; +} + +static const IDispatchVtbl DummyDispatch_VTable = +{ + DummyDispatch_QueryInterface, + DummyDispatch_AddRef, + DummyDispatch_Release, + DummyDispatch_GetTypeInfoCount, + DummyDispatch_GetTypeInfo, + DummyDispatch_GetIDsOfNames, + DummyDispatch_Invoke +}; + +static void init_test_dispatch(VARTYPE vt, DummyDispatch *dispatch) +{ + dispatch->IDispatch_iface.lpVtbl = &DummyDispatch_VTable; + dispatch->vt = vt; + dispatch->result = S_OK; +} typedef struct IRecordInfoImpl { @@ -5611,6 +5755,7 @@ HRESULT hres; HRESULT expected_error_num; int cmp; + DummyDispatch dispatch; CHECKPTR(VarCat); @@ -5944,6 +6089,67 @@ VariantClear(&right); VariantClear(&result); VariantClear(&expected); + + /* Dispatch conversion */ + init_test_dispatch(VT_NULL, &dispatch); + V_VT(&left) = VT_DISPATCH; + V_DISPATCH(&left) = &dispatch.IDispatch_iface; + + SET_EXPECT(dispatch_invoke); + hres = VarCat(&left, &right, &result); + todo_wine ok(hres == S_OK, "got 0x%08x\n", hres); + ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result)); + ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result))); + CHECK_CALLED(dispatch_invoke); + + VariantClear(&left); + VariantClear(&right); + VariantClear(&result); + + init_test_dispatch(VT_NULL, &dispatch); + V_VT(&right) = VT_DISPATCH; + V_DISPATCH(&right) = &dispatch.IDispatch_iface; + + SET_EXPECT(dispatch_invoke); + hres = VarCat(&left, &right, &result); + todo_wine ok(hres == S_OK, "got 0x%08x\n", hres); + ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result)); + ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result))); + CHECK_CALLED(dispatch_invoke); + + VariantClear(&left); + VariantClear(&right); + VariantClear(&result); + + init_test_dispatch(VT_UI1, &dispatch); + V_VT(&right) = VT_DISPATCH; + V_DISPATCH(&right) = &dispatch.IDispatch_iface; + + V_VT(&left) = VT_BSTR; + V_BSTR(&left) = SysAllocString(sz12); + SET_EXPECT(dispatch_invoke); + hres = pVarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08x\n", hres); + CHECK_CALLED(dispatch_invoke); + ok(!strcmp_wa(V_BSTR(&result), "1234"), "got %s\n", wine_dbgstr_w(V_BSTR(&result))); + + VariantClear(&left); + VariantClear(&right); + VariantClear(&result); + + init_test_dispatch(VT_NULL, &dispatch); + dispatch.result = E_OUTOFMEMORY; + V_VT(&right) = VT_DISPATCH; + V_DISPATCH(&right) = &dispatch.IDispatch_iface; + + SET_EXPECT(dispatch_invoke); + hres = VarCat(&left, &right, &result); + todo_wine ok(hres == E_OUTOFMEMORY, "got 0x%08x\n", hres); + CHECK_CALLED(dispatch_invoke); + + VariantClear(&left); + VariantClear(&right); + VariantClear(&result); /* Test boolean conversion */ V_VT(&left) = VT_BOOL; Modified: trunk/rostests/winetests/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartyp…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] Sat Jun 3 22:34:23 2017 @@ -3415,6 +3415,8 @@ SYSTEMTIME st; OLECHAR buff[128]; size_t i; + OLECHAR with_ideographic_spaceW[] = { '6','/','3','0','/','2','0','1','1',0x3000, + '1',':','2','0',':','3','4',0 }; lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); @@ -3538,6 +3540,11 @@ DFS("6/30/2011 01:20:34 PM"); EXPECT_DBL(40724.55594907407); /* Native fails "1999 January 3, 9AM". I consider that a bug in native */ + /* test a data with ideographic space */ + out = 0.0; + hres = pVarDateFromStr(with_ideographic_spaceW, lcid, LOCALE_NOUSEROVERRIDE, &out); + EXPECT_DBL(40724.05594907407); + /* test a non-english data string */ DFS("02.01.1970"); EXPECT_MISMATCH; DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH;
7 years, 6 months
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
53
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
Results per page:
10
25
50
100
200