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
May 2012
----- 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
12 participants
227 discussions
Start a n
N
ew thread
[spetreolle] 56641: [SETUPAPI] Sync SetupCreateDiskSpaceListW with Wine head. Fixes remaining setupapi:diskspace test failures.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sat May 19 18:29:56 2012 New Revision: 56641 URL:
http://svn.reactos.org/svn/reactos?rev=56641&view=rev
Log: [SETUPAPI] Sync SetupCreateDiskSpaceListW with Wine head. Fixes remaining setupapi:diskspace test failures. Modified: trunk/reactos/dll/win32/setupapi/diskspace.c Modified: trunk/reactos/dll/win32/setupapi/diskspace.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/diskspa…
============================================================================== --- trunk/reactos/dll/win32/setupapi/diskspace.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/diskspace.c [iso-8859-1] Sat May 19 18:29:56 2012 @@ -35,7 +35,7 @@ /*********************************************************************** - * SetupCreateDiskSpaceListW (SETUPAPI.@) + * SetupCreateDiskSpaceListW (SETUPAPI.@) */ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT Flags) { @@ -43,6 +43,14 @@ DWORD rc; WCHAR *ptr; LPDISKSPACELIST list=NULL; + + TRACE("(%p, %u, 0x%08x)\n", Reserved1, Reserved2, Flags); + + if (Reserved1 || Reserved2 || Flags & ~SPDSL_IGNORE_DISK) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } rc = GetLogicalDriveStringsW(255,drives); @@ -73,7 +81,7 @@ } ptr += lstrlenW(ptr) + 1; } - return (HANDLE)list; + return list; }
12 years, 7 months
1
0
0
0
[akhaldi] 56640: [UXTHEME_WINETEST] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 15:14:49 2012 New Revision: 56640 URL:
http://svn.reactos.org/svn/reactos?rev=56640&view=rev
Log: [UXTHEME_WINETEST] * Sync to Wine 1.5.4. Modified: trunk/rostests/winetests/uxtheme/system.c Modified: trunk/rostests/winetests/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/uxtheme/system.…
============================================================================== --- trunk/rostests/winetests/uxtheme/system.c [iso-8859-1] (original) +++ trunk/rostests/winetests/uxtheme/system.c [iso-8859-1] Sat May 19 15:14:49 2012 @@ -33,17 +33,12 @@ static BOOL (WINAPI * pIsThemeActive)(VOID); static BOOL (WINAPI * pIsThemePartDefined)(HTHEME, int, int); static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR); +static HTHEME (WINAPI * pOpenThemeDataEx)(HWND, LPCWSTR, DWORD); static HRESULT (WINAPI * pSetWindowTheme)(HWND, LPCWSTR, LPCWSTR); static HMODULE hUxtheme = 0; -#define UXTHEME_GET_PROC(func) \ - p ## func = (void*)GetProcAddress(hUxtheme, #func); \ - if(!p ## func) { \ - trace("GetProcAddress(%s) failed\n", #func); \ - FreeLibrary(hUxtheme); \ - return FALSE; \ - } +#define UXTHEME_GET_PROC(func) p ## func = (void*)GetProcAddress(hUxtheme, #func); static BOOL InitFunctionPtrs(void) { @@ -61,6 +56,7 @@ UXTHEME_GET_PROC(IsThemeActive) UXTHEME_GET_PROC(IsThemePartDefined) UXTHEME_GET_PROC(OpenThemeData) + UXTHEME_GET_PROC(OpenThemeDataEx) UXTHEME_GET_PROC(SetWindowTheme) } /* The following functions should be available, if not return FALSE. The Vista functions will @@ -71,7 +67,10 @@ !pGetWindowTheme || !pIsAppThemed || !pIsThemeActive || !pIsThemePartDefined || !pOpenThemeData || !pSetWindowTheme) + { + FreeLibrary(hUxtheme); return FALSE; + } return TRUE; } @@ -193,8 +192,7 @@ SetLastError(0xdeadbeef); hTheme = pOpenThemeData(NULL, NULL); ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); - todo_wine - ok( GetLastError() == E_POINTER, + ok( GetLastError() == E_POINTER, "Expected GLE() to be E_POINTER, got 0x%08x\n", GetLastError()); @@ -233,8 +231,7 @@ SetLastError(0xdeadbeef); hTheme = pOpenThemeData(hWnd, NULL); ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); - todo_wine - ok( GetLastError() == E_POINTER, + ok( GetLastError() == E_POINTER, "Expected GLE() to be E_POINTER, got 0x%08x\n", GetLastError()); @@ -336,6 +333,151 @@ hWnd, GetLastError()); } +static void test_OpenThemeDataEx(void) +{ + HTHEME hTheme; + HWND hWnd; + BOOL bThemeActive; + BOOL bDestroyed; + + WCHAR szInvalidClassList[] = {'D','E','A','D','B','E','E','F', 0 }; + WCHAR szButtonClassList[] = {'B','u','t','t','o','n', 0 }; + WCHAR szButtonClassList2[] = {'b','U','t','T','o','N', 0 }; + WCHAR szClassList[] = {'B','u','t','t','o','n',';','L','i','s','t','B','o','x', 0 }; + + if (!pOpenThemeDataEx) + { + win_skip("OpenThemeDataEx not available\n"); + return; + } + + bThemeActive = pIsThemeActive(); + + /* All NULL */ + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(NULL, NULL, 0); + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + ok( GetLastError() == E_POINTER, + "Expected GLE() to be E_POINTER, got 0x%08x\n", + GetLastError()); + + /* A NULL hWnd and an invalid classlist without flags */ + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(NULL, szInvalidClassList, 0); + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + todo_wine + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, + "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(NULL, szClassList, 0); + if (bThemeActive) + { + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + } + else + { + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + todo_wine + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, + "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n", + GetLastError()); + } + + /* Only do the bare minimum to get a valid hdc */ + hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL); + if (!hWnd) return; + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, NULL, 0); + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + ok( GetLastError() == E_POINTER, + "Expected GLE() to be E_POINTER, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szInvalidClassList, 0); + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + todo_wine + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, + "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n", + GetLastError()); + + if (!bThemeActive) + { + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList, 0); + ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme); + todo_wine + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, + "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n", + GetLastError()); + skip("No active theme, skipping rest of OpenThemeDataEx tests\n"); + return; + } + + /* Only do the next checks if we have an active theme */ + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList, 0); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList, OTD_FORCE_RECT_SIZING); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList, OTD_NONCLIENT); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList, 0x3); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + /* Test with bUtToN instead of Button */ + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szButtonClassList2, 0); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = pOpenThemeDataEx(hWnd, szClassList, 0); + ok( hTheme != NULL, "got NULL, expected a HTHEME handle\n"); + todo_wine + ok( GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got 0x%08x\n", + GetLastError()); + + bDestroyed = DestroyWindow(hWnd); + if (!bDestroyed) + trace("Window %p couldn't be destroyed : 0x%08x\n", + hWnd, GetLastError()); +} + static void test_GetCurrentThemeName(void) { BOOL bThemeActive; @@ -361,23 +503,20 @@ SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, 0, NULL, 0, NULL, 0); if (bThemeActive) - ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); - else - ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); - - /* When the number of characters given is too small (not 0, see above), GetCurrentThemeName returns 0x8007007a. - * The only definition I found was in strsafe.h: - * - * #define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // 0x7A = 122L = ERROR_INSUFFICIENT_BUFFER - */ + ok( hRes == S_OK || broken(hRes == E_FAIL /* WinXP SP1 */), "Expected S_OK, got 0x%08x\n", hRes); + else + ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); + ok( GetLastError() == 0xdeadbeef, + "Expected 0xdeadbeef, got 0x%08x\n", + GetLastError()); + SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, 2, NULL, 0, NULL, 0); if (bThemeActive) todo_wine - ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); + ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) || + broken(hRes == E_FAIL /* WinXP SP1 */), + "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); ok( GetLastError() == 0xdeadbeef, @@ -391,7 +530,9 @@ currentSize, sizeof(currentSize) / sizeof(WCHAR)); if (bThemeActive) todo_wine - ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); + ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) || + broken(hRes == E_FAIL /* WinXP SP1 */), + "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); ok( GetLastError() == 0xdeadbeef, @@ -498,6 +639,10 @@ trace("Starting test_OpenThemeData()\n"); test_OpenThemeData(); + /* OpenThemeDataEx */ + trace("Starting test_OpenThemeDataEx()\n"); + test_OpenThemeDataEx(); + /* GetCurrentThemeName */ trace("Starting test_GetCurrentThemeName()\n"); test_GetCurrentThemeName();
12 years, 7 months
1
0
0
0
[akhaldi] 56639: [PSDK] * Add some missing definitions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 15:14:41 2012 New Revision: 56639 URL:
http://svn.reactos.org/svn/reactos?rev=56639&view=rev
Log: [PSDK] * Add some missing definitions. Modified: trunk/reactos/include/psdk/uxtheme.h Modified: trunk/reactos/include/psdk/uxtheme.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/uxtheme.h?rev…
============================================================================== --- trunk/reactos/include/psdk/uxtheme.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/uxtheme.h [iso-8859-1] Sat May 19 15:14:41 2012 @@ -32,6 +32,10 @@ #define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM) #define HTTB_SIZINGTEMPLATE 0x0100 #define HTTB_SYSTEMSIZINGMARGINS 0x0200 + +#define OTD_FORCE_RECT_SIZING 0x0001 +#define OTD_NONCLIENT 0x0002 +#define OTD_VALIDBITS (OTD_FORCE_RECT_SIZING | OTD_NONCLIENT) typedef HANDLE HPAINTBUFFER; typedef HANDLE HTHEME;
12 years, 7 months
1
0
0
0
[akhaldi] 56638: [USP10_WINETEST] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 15:08:29 2012 New Revision: 56638 URL:
http://svn.reactos.org/svn/reactos?rev=56638&view=rev
Log: [USP10_WINETEST] * Sync to Wine 1.5.4. Modified: trunk/rostests/winetests/usp10/usp10.c Modified: trunk/rostests/winetests/usp10/usp10.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/usp10/usp10.c?r…
============================================================================== --- trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] (original) +++ trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] Sat May 19 15:08:29 2012 @@ -2798,6 +2798,19 @@ hr = ScriptItemize(test, 3, 4, NULL, NULL, items, NULL); ok(!hr, "ScriptItemize should return S_OK not %08x\n", hr); + /* + * This Test crashes pre Vista. + + hr = ScriptBreak(test, 1, &items[0].a, NULL); + ok(hr == E_INVALIDARG, "ScriptBreak should return E_INVALIDARG not %08x\n", hr); + */ + + hr = ScriptBreak(test, 0, &items[0].a, &la); + ok(hr == E_FAIL || broken(hr == S_OK), "ScriptBreak should return E_FAIL not %08x\n", hr); + + hr = ScriptBreak(test, -1, &items[0].a, &la); + ok(hr == E_INVALIDARG || broken(hr == S_OK), "ScriptBreak should return E_INVALIDARG not %08x\n", hr); + memset(&la, 0, sizeof(la)); hr = ScriptBreak(test, 1, &items[0].a, &la); ok(!hr, "ScriptBreak should return S_OK not %08x\n", hr);
12 years, 7 months
1
0
0
0
[akhaldi] 56637: [USP10] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 15:08:23 2012 New Revision: 56637 URL:
http://svn.reactos.org/svn/reactos?rev=56637&view=rev
Log: [USP10] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/usp10/usp10.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/usp10/usp10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/usp10.c?re…
============================================================================== --- trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] Sat May 19 15:08:23 2012 @@ -492,7 +492,7 @@ {{Script_Myanmar, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {0x55, 0, 1, 1, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 1, 0, 0, 0, 0}, MS_MAKE_TAG('m','y','m','r'), - {0}}, + {'M','y','a','n','m','a','r',' ','T','e','x','t',0}}, {{Script_Myanmar_Numeric, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, {0x55, 1, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, MS_MAKE_TAG('m','y','m','r'), @@ -2665,7 +2665,8 @@ { TRACE("(%s, %d, %p, %p)\n", debugstr_wn(chars, count), count, sa, la); - if (!la) return S_FALSE; + if (count < 0 || !la) return E_INVALIDARG; + if (count == 0) return E_FAIL; BREAK_line(chars, count, sa, la); 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 May 19 15:08:23 2012 @@ -168,7 +168,7 @@ reactos/dll/win32/updspapi # Synced to Wine-1.3.37 reactos/dll/win32/url # Synced to Wine-1.5.4 reactos/dll/win32/urlmon # Autosync -reactos/dll/win32/usp10 # Synced to Wine-1.4 +reactos/dll/win32/usp10 # Synced to Wine-1.5.4 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/version # Autosync reactos/dll/win32/wer # Autosync
12 years, 7 months
1
0
0
0
[akhaldi] 56636: [URL] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 15:01:23 2012 New Revision: 56636 URL:
http://svn.reactos.org/svn/reactos?rev=56636&view=rev
Log: [URL] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/url/CMakeLists.txt trunk/reactos/dll/win32/url/url.spec trunk/reactos/dll/win32/url/url_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/url/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/url/CMakeLists.t…
============================================================================== --- trunk/reactos/dll/win32/url/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/url/CMakeLists.txt [iso-8859-1] Sat May 19 15:01:23 2012 @@ -10,11 +10,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/url.def) add_library(url SHARED ${SOURCE}) - set_module_type(url win32dll) - target_link_libraries(url wine) - add_importlibs(url shell32 shlwapi msvcrt kernel32 ntdll) - add_cd_file(TARGET url DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/url/url.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/url/url.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/url/url.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/url/url.spec [iso-8859-1] Sat May 19 15:01:23 2012 @@ -1,7 +1,5 @@ @ stdcall AddMIMEFileTypesPS(ptr ptr) @ stub AutodialHookCallback -@ stub -private DllCanUnloadNow -@ stub -private DllGetClassObject @ stub DummyEntryPoint @ stub DummyEntryPointA @ stdcall FileProtocolHandler(long ptr str long) FileProtocolHandlerA @@ -13,8 +11,8 @@ @ stub MailToProtocolHandlerA @ stub NewsProtocolHandler @ stub NewsProtocolHandlerA -@ stub OpenURL -@ stub OpenURLA +@ stdcall OpenURL(long long str long) OpenURLA +@ stdcall OpenURLA(long long str long) @ stdcall TelnetProtocolHandler(long str) TelnetProtocolHandlerA @ stdcall TelnetProtocolHandlerA(long str) @ stub TranslateURLA Modified: trunk/reactos/dll/win32/url/url_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/url/url_main.c?r…
============================================================================== --- trunk/reactos/dll/win32/url/url_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/url/url_main.c [iso-8859-1] Sat May 19 15:01:23 2012 @@ -106,6 +106,15 @@ } /*********************************************************************** + * OpenURLA (URL.@) + * + */ +void WINAPI OpenURLA(HWND hwnd, HINSTANCE inst, LPCSTR cmdline, INT show) +{ + FIXME("(%p, %p, %s, %d): stub!\n", hwnd, inst, debugstr_a(cmdline), show); +} + +/*********************************************************************** * TelnetProtocolHandlerA (URL.@) * */ 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 May 19 15:01:23 2012 @@ -166,7 +166,7 @@ reactos/dll/win32/traffic # Synced to Wine-1.5.4 reactos/dll/win32/twain_32 # Out of sync reactos/dll/win32/updspapi # Synced to Wine-1.3.37 -reactos/dll/win32/url # Autosync +reactos/dll/win32/url # Synced to Wine-1.5.4 reactos/dll/win32/urlmon # Autosync reactos/dll/win32/usp10 # Synced to Wine-1.4 reactos/dll/win32/uxtheme # Forked
12 years, 7 months
1
0
0
0
[akhaldi] 56635: [TRAFFIC] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 14:57:24 2012 New Revision: 56635 URL:
http://svn.reactos.org/svn/reactos?rev=56635&view=rev
Log: [TRAFFIC] * Sync to Wine 1.5.4. Modified: trunk/reactos/dll/win32/traffic/traffic.spec trunk/reactos/dll/win32/traffic/traffic_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/traffic/traffic.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/traffic/traffic.…
============================================================================== --- trunk/reactos/dll/win32/traffic/traffic.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/traffic/traffic.spec [iso-8859-1] Sat May 19 14:57:24 2012 @@ -4,7 +4,7 @@ @ stub TcCloseInterface @ stub TcDeleteFilter @ stub TcDeleteFlow -@ stub TcDeregisterClient +@ stdcall TcDeregisterClient(ptr) @ stub TcEnumerateFlows @ stub TcEnumerateInterfaces @ stub TcGetFlowNameA Modified: trunk/reactos/dll/win32/traffic/traffic_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/traffic/traffic_…
============================================================================== --- trunk/reactos/dll/win32/traffic/traffic_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/traffic/traffic_main.c [iso-8859-1] Sat May 19 14:57:24 2012 @@ -54,3 +54,12 @@ if(buffer) *buffer = INVALID_HANDLE_VALUE; return ERROR_CALL_NOT_IMPLEMENTED; } + +/***************************************************************************** + * TcDeregisterClient [TRAFFIC.@] + */ +ULONG WINAPI TcDeregisterClient(HANDLE ClientHandle) +{ + FIXME("%p: stub\n", ClientHandle); + return ERROR_CALL_NOT_IMPLEMENTED; +} 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 May 19 14:57:24 2012 @@ -163,7 +163,7 @@ reactos/dll/win32/sti # Synced to Wine-1.5.4 reactos/dll/win32/sxs # Synced to Wine-1.5.4 reactos/dll/win32/tapi32 # Autosync -reactos/dll/win32/traffic # Autosync +reactos/dll/win32/traffic # Synced to Wine-1.5.4 reactos/dll/win32/twain_32 # Out of sync reactos/dll/win32/updspapi # Synced to Wine-1.3.37 reactos/dll/win32/url # Autosync
12 years, 7 months
1
0
0
0
[akhaldi] 56634: [SXS_WINETEST] * Import from Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 14:53:01 2012 New Revision: 56634 URL:
http://svn.reactos.org/svn/reactos?rev=56634&view=rev
Log: [SXS_WINETEST] * Import from Wine 1.5.4. Added: trunk/rostests/winetests/sxs/ (with props) trunk/rostests/winetests/sxs/CMakeLists.txt (with props) trunk/rostests/winetests/sxs/cache.c (with props) trunk/rostests/winetests/sxs/name.c (with props) trunk/rostests/winetests/sxs/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Sat May 19 14:53:01 2012 @@ -86,6 +86,7 @@ add_subdirectory(snmpapi) add_subdirectory(spoolss) add_subdirectory(sti) +add_subdirectory(sxs) add_subdirectory(twain_32) if(NOT MSVC) add_subdirectory(urlmon) # FIXME: msvc build. Propchange: trunk/rostests/winetests/sxs/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sat May 19 14:53:01 2012 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/sxs/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/sxs/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/winetests/sxs/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/rostests/winetests/sxs/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sxs/CMakeLists.…
============================================================================== --- trunk/rostests/winetests/sxs/CMakeLists.txt (added) +++ trunk/rostests/winetests/sxs/CMakeLists.txt [iso-8859-1] Sat May 19 14:53:01 2012 @@ -1,0 +1,14 @@ + +add_definitions( + -D__ROS_LONG64__ + -D_DLL -D__USE_CRTIMP) + +add_executable(sxs_winetest + cache.c + name.c + testlist.c) + +target_link_libraries(sxs_winetest wine uuid) +set_module_type(sxs_winetest win32cui) +add_importlibs(sxs_winetest sxs msvcrt kernel32 ntdll) +add_cd_file(TARGET sxs_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/sxs/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/sxs/cache.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sxs/cache.c?rev…
============================================================================== --- trunk/rostests/winetests/sxs/cache.c (added) +++ trunk/rostests/winetests/sxs/cache.c [iso-8859-1] Sat May 19 14:53:01 2012 @@ -1,0 +1,211 @@ +/* + * Copyright 2012 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> + +#define COBJMACROS + +#include <windows.h> +#include <winsxs.h> + +#include "wine/test.h" + +static void test_QueryAssemblyInfo( void ) +{ + static const WCHAR emptyW[] = {0}; + static const WCHAR wine1W[] = {'w','i','n','e',0}; + static const WCHAR wine2W[] = + {'w','i','n','e',',', + 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0}; + static const WCHAR wine3W[] = + {'w','i','n','e',',', + 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',0}; + static const WCHAR wine4W[] = + {'w','i','n','e',',', + 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',0}; + static const WCHAR wine5W[] = + {'w','i','n','e',',', + 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','\"',0}; + static const WCHAR comctl1W[] = + {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.', + 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',', + 'v','e','r','s','i','o','n','=','\"','6','.','0','.','2','6','0','0','.','2','9','8','2','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0}; + static const WCHAR comctl2W[] = + {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.', + 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',', + 'v','e','r','s','i','o','n','=','\"','6','.','0','.','3','7','9','0','.','4','7','7','0','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0}; + static const WCHAR comctl3W[] = + {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.', + 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',', + 'v','e','r','s','i','o','n','=','\"','6','.','0','.','8','2','5','0','.','0','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0}; + static const WCHAR comctl4W[] = + {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.', + 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',', + 'v','e','r','s','i','o','n','=','\"','6','.','0','.','7','6','0','1','.','1','7','5','1','4','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0}; + HRESULT hr; + ASSEMBLY_INFO info; + IAssemblyCache *cache = NULL; + WCHAR path[MAX_PATH]; + char comctl_path1[MAX_PATH], comctl_path2[MAX_PATH], comctl_path3[MAX_PATH], comctl_path4[MAX_PATH]; + const WCHAR *comctlW; + + hr = CreateAssemblyCache( &cache, 0 ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( cache != NULL, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, emptyW, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine1W, NULL ); + ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) || + broken(hr == E_INVALIDARG) /* winxp */, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine2W, NULL ); + ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) || + broken(hr == 0x80070490) /* winxp */, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine3W, NULL ); + ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) || + broken(hr == 0x80070490) /* winxp */, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine4W, NULL ); + todo_wine ok( hr == 0x80070490, "got %08x\n", hr ); + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, NULL ); + todo_wine ok( hr == 0x80070490, "got %08x\n", hr ); + + GetWindowsDirectoryA( comctl_path1, MAX_PATH ); + lstrcatA( comctl_path1, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef" ); + GetWindowsDirectoryA( comctl_path2, MAX_PATH ); + lstrcatA( comctl_path2, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.3790.4770_x-ww_05fdf087" ); + GetWindowsDirectoryA( comctl_path3, MAX_PATH ); + lstrcatA( comctl_path3, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.8250.0_none_c119e7cca62b92bd" ); + GetWindowsDirectoryA( comctl_path4, MAX_PATH ); + lstrcatA( comctl_path4, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2" ); + if (GetFileAttributesA( comctl_path1 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl1W; + else if (GetFileAttributesA( comctl_path2 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl2W; + else if (GetFileAttributesA( comctl_path3 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl3W; + else if (GetFileAttributesA( comctl_path4 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl4W; + else + { + skip( "no assembly to test with\n" ); + IAssemblyCache_Release( cache ); + return; + } + + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, &info ); + todo_wine ok( hr == 0x80070490, "got %08x\n", hr ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf ); + ok( !info.cchBuf, "got %u\n", info.cchBuf ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + info.pszCurrentAssemblyPathBuf = path; + info.cchBuf = sizeof(path)/sizeof(path[0]); + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.cchBuf == sizeof(path)/sizeof(path[0]), "got %u\n", info.cchBuf ); + ok( path[0], "empty path\n" ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + info.pszCurrentAssemblyPathBuf = path; + hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info ); + ok( hr == HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ), "got %08x\n", hr ); + ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.cchBuf, "got %u\n", info.cchBuf ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + hr = IAssemblyCache_QueryAssemblyInfo( cache, 1, comctlW, &info ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf ); + ok( !info.cchBuf, "got %u\n", info.cchBuf ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf ); + ok( !info.cchBuf, "got %u\n", info.cchBuf ); + + memset( &info, 0, sizeof(info) ); + info.cbAssemblyInfo = sizeof(info); + info.pszCurrentAssemblyPathBuf = path; + info.cchBuf = sizeof(path)/sizeof(path[0]); + path[0] = 0; + hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags ); + ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart ); + ok( info.cchBuf == sizeof(path)/sizeof(path[0]), "got %u\n", info.cchBuf ); + ok( !path[0], "got %s\n", wine_dbgstr_w(path) ); + + IAssemblyCache_Release( cache ); +} + +START_TEST(cache) +{ + test_QueryAssemblyInfo(); +} Propchange: trunk/rostests/winetests/sxs/cache.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/sxs/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sxs/name.c?rev=…
============================================================================== --- trunk/rostests/winetests/sxs/name.c (added) +++ trunk/rostests/winetests/sxs/name.c [iso-8859-1] Sat May 19 14:53:01 2012 @@ -1,0 +1,228 @@ +/* + * Copyright 2012 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> + +#define COBJMACROS + +#include <windows.h> +#include <winsxs.h> +#include <corerror.h> + +#include "wine/test.h" + +static const WCHAR wine1W[] = + {'w','i','n','e',0}; +static const WCHAR wine2W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n','=','\"','0','1','.','2','.','3','.','4','\"',',', + 't','y','p','e','=','\"','w','i','n','3','2','\"',',', + 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=', + '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=', + '\"','1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','\"',0}; +static const WCHAR wine3W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0}; +static const WCHAR wine4W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','2','.','3','.','4',0}; +static const WCHAR wine5W[] = + {'w','i','n','e',',',' ','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0}; +static const WCHAR wine6W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n',' ','=','\"','1','.','2','.','3','.','4','\"',0}; +static const WCHAR wine7W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n','=',' ','\"','1','.','2','.','3','.','4','\"',0}; +static const WCHAR wine8W[] = + {'w','i','n','e',' ',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0}; +static const WCHAR wine9W[] = + {'w','i','n','e',',','v','e','r','s','i','o','n',0}; +static const WCHAR wine10W[] = + {'w','i','n','e',',','t','y','p','e','=','\"','\"',0}; +static const WCHAR wine11W[] = + {'w','i','n','e',',','t','y','p','e','=','\"','w','i','n','3','2',0}; + +static void test_CreateAssemblyNameObject( void ) +{ + static const WCHAR emptyW[] = {0}; + IAssemblyName *name; + HRESULT hr; + + hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = NULL; + hr = CreateAssemblyNameObject( &name, wine1W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == S_OK, "expected S_OK got %08x\n", hr ); + ok( name != NULL, "expected non-NULL name\n" ); + IAssemblyName_Release( name ); + + hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine1W, CANOF_SET_DEFAULT_VALUES, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + hr = CreateAssemblyNameObject( NULL, wine1W, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine1W, 0, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + + hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, NULL, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, emptyW, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine1W, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = NULL; + hr = CreateAssemblyNameObject( &name, wine3W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == S_OK, "expected S_OK got %08x\n", hr ); + ok( name != NULL, "expected non-NULL name\n" ); + IAssemblyName_Release( name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine4W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine5W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME ), + "expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine6W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME ), + "expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine7W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = NULL; + hr = CreateAssemblyNameObject( &name, wine8W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == S_OK, "expected S_OK got %08x\n", hr ); + ok( name != NULL, "expected non-NULL name\n" ); + IAssemblyName_Release( name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine9W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); + + name = NULL; + hr = CreateAssemblyNameObject( &name, wine10W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == S_OK, "expected S_OK got %08x\n", hr ); + ok( name != NULL, "expected non-NULL name\n" ); + IAssemblyName_Release( name ); + + name = (IAssemblyName *)0xdeadbeef; + hr = CreateAssemblyNameObject( &name, wine11W, CANOF_PARSE_DISPLAY_NAME, NULL ); + ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr ); + ok( !name, "expected NULL got %p\n", name ); +} + +START_TEST(name) +{ + test_CreateAssemblyNameObject(); +} Propchange: trunk/rostests/winetests/sxs/name.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/sxs/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sxs/testlist.c?…
============================================================================== --- trunk/rostests/winetests/sxs/testlist.c (added) +++ trunk/rostests/winetests/sxs/testlist.c [iso-8859-1] Sat May 19 14:53:01 2012 @@ -1,0 +1,15 @@ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + +extern void func_cache(void); +extern void func_name(void); + +const struct test winetest_testlist[] = +{ + { "cache", func_cache }, + { "name", func_name }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/sxs/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
12 years, 7 months
1
0
0
0
[akhaldi] 56633: [SXS] * Sync to Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 14:52:48 2012 New Revision: 56633 URL:
http://svn.reactos.org/svn/reactos?rev=56633&view=rev
Log: [SXS] * Sync to Wine 1.5.4. Added: trunk/reactos/dll/win32/sxs/name.c (with props) trunk/reactos/dll/win32/sxs/sxs_private.h (with props) Modified: trunk/reactos/dll/win32/sxs/CMakeLists.txt trunk/reactos/dll/win32/sxs/cache.c trunk/reactos/dll/win32/sxs/sxs.spec trunk/reactos/include/psdk/winsxs.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/sxs/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/CMakeLists.t…
============================================================================== --- trunk/reactos/dll/win32/sxs/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sxs/CMakeLists.txt [iso-8859-1] Sat May 19 14:52:48 2012 @@ -2,10 +2,11 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) add_definitions(-D__WINESRC__) -spec2def(sxs.dll sxs.spec) +spec2def(sxs.dll sxs.spec ADD_IMPORTLIB) list(APPEND SOURCE cache.c + name.c sxs.c ${CMAKE_CURRENT_BINARY_DIR}/sxs_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/sxs.def) Modified: trunk/reactos/dll/win32/sxs/cache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/cache.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/sxs/cache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sxs/cache.c [iso-8859-1] Sat May 19 14:52:48 2012 @@ -32,21 +32,22 @@ #include "wine/debug.h" #include "wine/list.h" #include "wine/unicode.h" +#include "sxs_private.h" WINE_DEFAULT_DEBUG_CHANNEL(sxs); -static inline WCHAR *strdupW( const WCHAR *s ) -{ - WCHAR *t; - if (!s) return NULL; - if ((t = HeapAlloc( GetProcessHeap(), 0, (strlenW( s ) + 1) * sizeof(WCHAR) ))) strcpyW( t, s ); - return t; -} +static const WCHAR cache_mutex_nameW[] = + {'_','_','W','I','N','E','_','S','X','S','_','C','A','C','H','E','_','M','U','T','E','X','_','_',0}; + +static const WCHAR win32W[] = {'w','i','n','3','2',0}; +static const WCHAR win32_policyW[] = {'w','i','n','3','2','-','p','o','l','i','c','y',0}; +static const WCHAR backslashW[] = {'\\',0}; struct cache { IAssemblyCache IAssemblyCache_iface; LONG refs; + HANDLE lock; }; static inline struct cache *impl_from_IAssemblyCache(IAssemblyCache *iface) @@ -90,30 +91,185 @@ if (!refs) { TRACE("destroying %p\n", cache); + CloseHandle( cache->lock ); HeapFree( GetProcessHeap(), 0, cache ); } return refs; } -static HRESULT WINAPI cache_UninstallAssembly( - IAssemblyCache *iface, - DWORD flags, - LPCWSTR name, - LPCFUSION_INSTALL_REFERENCE ref, - ULONG *disp ) -{ - FIXME("%p, 0x%08x, %s, %p, %p\n", iface, flags, debugstr_w(name), ref, disp); - return E_NOTIMPL; -} +static unsigned int build_sxs_path( WCHAR *path ) +{ + static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\',0}; + unsigned int len = GetWindowsDirectoryW( path, MAX_PATH ); + + memcpy( path + len, winsxsW, sizeof(winsxsW) ); + return len + sizeof(winsxsW) / sizeof(winsxsW[0]) - 1; +} + +static WCHAR *build_assembly_name( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + const WCHAR *version, unsigned int *len ) +{ + static const WCHAR fmtW[] = + {'%','s','_','%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0}; + unsigned int buflen = sizeof(fmtW) / sizeof(fmtW[0]); + WCHAR *ret, *p; + + buflen += strlenW( arch ); + buflen += strlenW( name ); + buflen += strlenW( token ); + buflen += strlenW( version ); + if (!(ret = HeapAlloc( GetProcessHeap(), 0, buflen * sizeof(WCHAR) ))) return NULL; + *len = sprintfW( ret, fmtW, arch, name, token, version ); + for (p = ret; *p; p++) *p = tolowerW( *p ); + return ret; +} + +static WCHAR *build_manifest_path( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + const WCHAR *version ) +{ + static const WCHAR fmtW[] = + {'%','s','m','a','n','i','f','e','s','t','s','\\','%','s','.','m','a','n','i','f','e','s','t',0}; + WCHAR *path = NULL, *ret, sxsdir[MAX_PATH]; + unsigned int len; + + if (!(path = build_assembly_name( arch, name, token, version, &len ))) return NULL; + len += sizeof(fmtW) / sizeof(fmtW[0]); + len += build_sxs_path( sxsdir ); + if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) + { + HeapFree( GetProcessHeap(), 0, path ); + return NULL; + } + sprintfW( ret, fmtW, sxsdir, path ); + HeapFree( GetProcessHeap(), 0, path ); + return ret; +} + +static WCHAR *build_policy_name( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + unsigned int *len ) +{ + static const WCHAR fmtW[] = + {'%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0}; + unsigned int buflen = sizeof(fmtW) / sizeof(fmtW[0]); + WCHAR *ret, *p; + + buflen += strlenW( arch ); + buflen += strlenW( name ); + buflen += strlenW( token ); + if (!(ret = HeapAlloc( GetProcessHeap(), 0, buflen * sizeof(WCHAR) ))) return NULL; + *len = sprintfW( ret, fmtW, arch, name, token ); + for (p = ret; *p; p++) *p = tolowerW( *p ); + return ret; +} + +static WCHAR *build_policy_path( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + const WCHAR *version ) +{ + static const WCHAR fmtW[] = + {'%','s','p','o','l','i','c','i','e','s','\\','%','s','\\','%','s','.','p','o','l','i','c','y',0}; + WCHAR *path = NULL, *ret, sxsdir[MAX_PATH]; + unsigned int len; + + if (!(path = build_policy_name( arch, name, token, &len ))) return NULL; + len += sizeof(fmtW) / sizeof(fmtW[0]); + len += build_sxs_path( sxsdir ); + len += strlenW( version ); + if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) + { + HeapFree( GetProcessHeap(), 0, path ); + return NULL; + } + sprintfW( ret, fmtW, sxsdir, path, version ); + HeapFree( GetProcessHeap(), 0, path ); + return ret; +} + +static void cache_lock( struct cache *cache ) +{ + WaitForSingleObject( cache->lock, INFINITE ); +} + +static void cache_unlock( struct cache *cache ) +{ + ReleaseMutex( cache->lock ); +} + +#define ASSEMBLYINFO_FLAG_INSTALLED 1 static HRESULT WINAPI cache_QueryAssemblyInfo( IAssemblyCache *iface, DWORD flags, - LPCWSTR name, + LPCWSTR assembly_name, ASSEMBLY_INFO *info ) { - FIXME("%p, 0x%08x, %s, %p\n", iface, flags, debugstr_w(name), info); - return E_NOTIMPL; + struct cache *cache = impl_from_IAssemblyCache( iface ); + IAssemblyName *name_obj; + const WCHAR *arch, *name, *token, *type, *version; + WCHAR *p, *path = NULL; + unsigned int len; + HRESULT hr; + + TRACE("%p, 0x%08x, %s, %p\n", iface, flags, debugstr_w(assembly_name), info); + + if (flags || (info && info->cbAssemblyInfo != sizeof(*info))) + return E_INVALIDARG; + + hr = CreateAssemblyNameObject( &name_obj, assembly_name, CANOF_PARSE_DISPLAY_NAME, 0 ); + if (FAILED( hr )) + return hr; + + arch = get_name_attribute( name_obj, NAME_ATTR_ID_ARCH ); + name = get_name_attribute( name_obj, NAME_ATTR_ID_NAME ); + token = get_name_attribute( name_obj, NAME_ATTR_ID_TOKEN ); + type = get_name_attribute( name_obj, NAME_ATTR_ID_TYPE ); + version = get_name_attribute( name_obj, NAME_ATTR_ID_VERSION ); + if (!arch || !name || !token || !type || !version) + { + IAssemblyName_Release( name_obj ); + return HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ); + } + if (!info) + { + IAssemblyName_Release( name_obj ); + return S_OK; + } + cache_lock( cache ); + + if (!strcmpW( type, win32W )) path = build_manifest_path( arch, name, token, version ); + else if (!strcmpW( type, win32_policyW )) path = build_policy_path( arch, name, token, version ); + else + { + hr = HRESULT_FROM_WIN32( ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE ); + goto done; + } + if (!path) + { + hr = E_OUTOFMEMORY; + goto done; + } + hr = S_OK; + if (GetFileAttributesW( path ) != INVALID_FILE_ATTRIBUTES) /* FIXME: better check */ + { + info->dwAssemblyFlags = ASSEMBLYINFO_FLAG_INSTALLED; + TRACE("assembly is installed\n"); + } + if ((p = strrchrW( path, '\\' ))) *p = 0; + len = strlenW( path ) + 1; + if (info->pszCurrentAssemblyPathBuf) + { + if (info->cchBuf < len) + { + info->cchBuf = len; + hr = HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ); + } + else strcpyW( info->pszCurrentAssemblyPathBuf, path ); + } + +done: + HeapFree( GetProcessHeap(), 0, path ); + IAssemblyName_Release( name_obj ); + cache_unlock( cache ); + return hr; } static HRESULT WINAPI cache_CreateAssemblyCacheItem( @@ -274,8 +430,6 @@ static const WCHAR versionW[] = {'v','e','r','s','i','o','n',0}; static const WCHAR architectureW[] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0}; static const WCHAR tokenW[] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0}; - static const WCHAR win32W[] = {'w','i','n','3','2',0}; - static const WCHAR policyW[] = {'w','i','n','3','2','-','p','o','l','i','c','y',0}; IXMLDOMNodeList *list = NULL; IXMLDOMNode *node = NULL; IXMLDOMNamedNodeMap *attrs = NULL; @@ -319,7 +473,7 @@ a->arch = get_attribute_value( attrs, architectureW ); a->token = get_attribute_value( attrs, tokenW ); - if (!a->type || (strcmpW( a->type, win32W ) && strcmpW( a->type, policyW )) || + if (!a->type || (strcmpW( a->type, win32W ) && strcmpW( a->type, win32_policyW )) || !a->name || !a->version || !a->arch || !a->token) { WARN("invalid win32 assembly\n"); @@ -337,97 +491,56 @@ return hr; } -static WCHAR *build_sxs_path( void ) -{ - static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\',0}; - WCHAR sxsdir[MAX_PATH]; - - GetWindowsDirectoryW( sxsdir, MAX_PATH ); - strcatW( sxsdir, winsxsW ); - return strdupW( sxsdir ); -} - -static WCHAR *build_assembly_name( struct assembly *assembly ) -{ - static const WCHAR fmtW[] = - {'%','s','_','%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0}; - WCHAR *ret, *p; - int len; - - len = strlenW( fmtW ); - len += strlenW( assembly->arch ); - len += strlenW( assembly->name ); - len += strlenW( assembly->token ); - len += strlenW( assembly->version ); - - if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, assembly->arch, assembly->name, assembly->token, assembly->version ); - for (p = ret; *p; p++) *p = tolowerW( *p ); - return ret; -} - -static WCHAR *build_policy_name( struct assembly *assembly ) -{ - static const WCHAR fmtW[] = - {'%','s','_','%','s','_','%','s','_','n','o','n','e','_','d','e','a','d','b','e','e','f',0}; - WCHAR *ret, *p; - int len; - - len = strlenW( fmtW ); - len += strlenW( assembly->arch ); - len += strlenW( assembly->name ); - len += strlenW( assembly->token ); - - if (!(ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, assembly->arch, assembly->name, assembly->token ); - for (p = ret; *p; p++) *p = tolowerW( *p ); - return ret; -} - -static HRESULT install_policy( const WCHAR *manifest, struct assembly *assembly ) +static WCHAR *build_policy_filename( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + const WCHAR *version ) { static const WCHAR policiesW[] = {'p','o','l','i','c','i','e','s','\\',0}; static const WCHAR suffixW[] = {'.','p','o','l','i','c','y',0}; - static const WCHAR backslashW[] = {'\\',0}; - WCHAR *sxsdir, *name, *dst; - HRESULT hr = E_OUTOFMEMORY; + WCHAR sxsdir[MAX_PATH], *ret, *fullname; + unsigned int len; + + if (!(fullname = build_policy_name( arch, name, token, &len ))) return NULL; + len += build_sxs_path( sxsdir ); + len += sizeof(policiesW) / sizeof(policiesW[0]) - 1; + len += strlenW( version ); + len += sizeof(suffixW) / sizeof(suffixW[0]) - 1; + if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) + { + HeapFree( GetProcessHeap(), 0, fullname ); + return NULL; + } + strcpyW( ret, sxsdir ); + strcatW( ret, policiesW ); + CreateDirectoryW( ret, NULL ); + strcatW( ret, name ); + CreateDirectoryW( ret, NULL ); + strcatW( ret, backslashW ); + strcatW( ret, version ); + strcatW( ret, suffixW ); + + HeapFree( GetProcessHeap(), 0, fullname ); + return ret; +} + +static HRESULT install_policy( const WCHAR *manifest, struct assembly *assembly ) +{ + WCHAR *dst; BOOL ret; - int len; /* FIXME: handle catalog file */ - if (!(sxsdir = build_sxs_path())) return E_OUTOFMEMORY; - if (!(name = build_policy_name( assembly ))) goto done; - - len = strlenW( sxsdir ); - len += strlenW( policiesW ); - len += strlenW( name ) + 1; - len += strlenW( assembly->version ); - len += strlenW( suffixW ); - - if (!(dst = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) goto done; - strcpyW( dst, sxsdir ); - strcatW( dst, policiesW ); - CreateDirectoryW( dst, NULL ); - strcatW( dst, name ); - CreateDirectoryW( dst, NULL ); - strcatW( dst, backslashW ); - strcatW( dst, assembly->version ); - strcatW( dst, suffixW ); + dst = build_policy_filename( assembly->arch, assembly->name, assembly->token, assembly->version ); + if (!dst) return E_OUTOFMEMORY; ret = CopyFileW( manifest, dst, FALSE ); HeapFree( GetProcessHeap(), 0, dst ); if (!ret) { - hr = HRESULT_FROM_WIN32( GetLastError() ); + HRESULT hr = HRESULT_FROM_WIN32( GetLastError() ); WARN("failed to copy policy manifest file 0x%08x\n", hr); - } - hr = S_OK; - -done: - HeapFree( GetProcessHeap(), 0, sxsdir ); - HeapFree( GetProcessHeap(), 0, name ); - return hr; + return hr; + } + return S_OK; } static WCHAR *build_source_filename( const WCHAR *manifest, struct file *file ) @@ -449,29 +562,64 @@ return src; } -static HRESULT install_assembly( const WCHAR *manifest, struct assembly *assembly ) +static WCHAR *build_manifest_filename( const WCHAR *arch, const WCHAR *name, const WCHAR *token, + const WCHAR *version ) { static const WCHAR manifestsW[] = {'m','a','n','i','f','e','s','t','s','\\',0}; static const WCHAR suffixW[] = {'.','m','a','n','i','f','e','s','t',0}; - static const WCHAR backslashW[] = {'\\',0}; - WCHAR *sxsdir, *p, *name, *dst, *src; + WCHAR sxsdir[MAX_PATH], *ret, *fullname; + unsigned int len; + + if (!(fullname = build_assembly_name( arch, name, token, version, &len ))) return NULL; + len += build_sxs_path( sxsdir ); + len += sizeof(manifestsW) / sizeof(manifestsW[0]) - 1; + len += sizeof(suffixW) / sizeof(suffixW[0]) - 1; + if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) + { + HeapFree( GetProcessHeap(), 0, fullname ); + return NULL; + } + strcpyW( ret, sxsdir ); + strcatW( ret, manifestsW ); + strcatW( ret, fullname ); + strcatW( ret, suffixW ); + + HeapFree( GetProcessHeap(), 0, fullname ); + return ret; +} + +static HRESULT load_manifest( IXMLDOMDocument *doc, const WCHAR *filename ) +{ + HRESULT hr; + VARIANT var; + VARIANT_BOOL b; + BSTR str; + + str = SysAllocString( filename ); + VariantInit( &var ); + V_VT( &var ) = VT_BSTR; + V_BSTR( &var ) = str; + hr = IXMLDOMDocument_load( doc, var, &b ); + SysFreeString( str ); + if (hr != S_OK) return hr; + if (!b) + { + WARN("failed to load manifest\n"); + return S_FALSE; + } + return S_OK; +} + +static HRESULT install_assembly( const WCHAR *manifest, struct assembly *assembly ) +{ + WCHAR sxsdir[MAX_PATH], *p, *name, *dst, *src; + unsigned int len, len_name, len_sxsdir = build_sxs_path( sxsdir ); struct file *file; HRESULT hr = E_OUTOFMEMORY; BOOL ret; - int len; - - if (!(sxsdir = build_sxs_path())) return E_OUTOFMEMORY; - if (!(name = build_assembly_name( assembly ))) goto done; - - len = strlenW( sxsdir ); - len += strlenW( manifestsW ); - len += strlenW( name ); - len += strlenW( suffixW ); - if (!(dst = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) goto done; - strcpyW( dst, sxsdir ); - strcatW( dst, manifestsW ); - strcatW( dst, name ); - strcatW( dst, suffixW ); + + dst = build_manifest_filename( assembly->arch, assembly->name, assembly->token, assembly->version ); + if (!dst) return E_OUTOFMEMORY; ret = CopyFileW( manifest, dst, FALSE ); HeapFree( GetProcessHeap(), 0, dst ); @@ -479,22 +627,22 @@ { hr = HRESULT_FROM_WIN32( GetLastError() ); WARN("failed to copy manifest file 0x%08x\n", hr); - goto done; - } + return hr; + } + + name = build_assembly_name( assembly->arch, assembly->name, assembly->token, assembly->version, + &len_name ); + if (!name) return E_OUTOFMEMORY; /* FIXME: this should be a transaction */ LIST_FOR_EACH_ENTRY( file, &assembly->files, struct file, entry ) { - if (!(src = build_source_filename( manifest, file ))) - { - hr = E_OUTOFMEMORY; - goto done; - } - len = strlenW( sxsdir ) + strlenW( name ) + strlenW( file->name ); + if (!(src = build_source_filename( manifest, file ))) goto done; + + len = len_sxsdir + len_name + strlenW( file->name ); if (!(dst = HeapAlloc( GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR) ))) { HeapFree( GetProcessHeap(), 0, src ); - hr = E_OUTOFMEMORY; goto done; } strcpyW( dst, sxsdir ); @@ -518,7 +666,6 @@ hr = S_OK; done: - HeapFree( GetProcessHeap(), 0, sxsdir ); HeapFree( GetProcessHeap(), 0, name ); return hr; } @@ -529,43 +676,26 @@ LPCWSTR path, LPCFUSION_INSTALL_REFERENCE ref ) { - static const WCHAR policyW[] = {'w','i','n','3','2','-','p','o','l','i','c','y',0}; + struct cache *cache = impl_from_IAssemblyCache( iface ); HRESULT hr, init; IXMLDOMDocument *doc = NULL; struct assembly *assembly = NULL; - BSTR str; - VARIANT var; - VARIANT_BOOL b; TRACE("%p, 0x%08x, %s, %p\n", iface, flags, debugstr_w(path), ref); + cache_lock( cache ); init = CoInitialize( NULL ); hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void **)&doc ); if (hr != S_OK) goto done; - str = SysAllocString( path ); - VariantInit( &var ); - V_VT( &var ) = VT_BSTR; - V_BSTR( &var ) = str; - hr = IXMLDOMDocument_load( doc, var, &b ); - SysFreeString( str ); - if (hr != S_OK) goto done; - if (!b) - { - WARN("failed to load manifest\n"); - hr = S_FALSE; - goto done; - } - - hr = parse_assembly( doc, &assembly ); - if (hr != S_OK) - goto done; + if ((hr = load_manifest( doc, path )) != S_OK) goto done; + if ((hr = parse_assembly( doc, &assembly )) != S_OK) goto done; /* FIXME: verify name attributes */ - if (!strcmpW( assembly->type, policyW )) + if (!strcmpW( assembly->type, win32_policyW )) hr = install_policy( path, assembly ); else hr = install_assembly( path, assembly ); @@ -573,10 +703,115 @@ done: free_assembly( assembly ); if (doc) IXMLDOMDocument_Release( doc ); - - if (SUCCEEDED(init)) - CoUninitialize(); - + if (SUCCEEDED(init)) CoUninitialize(); + cache_unlock( cache ); + return hr; +} + +static HRESULT uninstall_assembly( struct assembly *assembly ) +{ + WCHAR sxsdir[MAX_PATH], *name, *dirname, *filename; + unsigned int len, len_name, len_sxsdir = build_sxs_path( sxsdir ); + HRESULT hr = E_OUTOFMEMORY; + struct file *file; + + name = build_assembly_name( assembly->arch, assembly->name, assembly->token, assembly->version, + &len_name ); + if (!name) return E_OUTOFMEMORY; + if (!(dirname = HeapAlloc( GetProcessHeap(), 0, (len_sxsdir + len_name + 1) * sizeof(WCHAR) ))) + goto done; + strcpyW( dirname, sxsdir ); + strcpyW( dirname + len_sxsdir, name ); + + LIST_FOR_EACH_ENTRY( file, &assembly->files, struct file, entry ) + { + len = len_sxsdir + len_name + 1 + strlenW( file->name ); + if (!(filename = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) goto done; + strcpyW( filename, dirname ); + strcatW( filename, backslashW ); + strcatW( filename, file->name ); + + if (!DeleteFileW( filename )) WARN( "failed to delete file %u\n", GetLastError() ); + HeapFree( GetProcessHeap(), 0, filename ); + } + RemoveDirectoryW( dirname ); + hr = S_OK; + +done: + HeapFree( GetProcessHeap(), 0, dirname ); + HeapFree( GetProcessHeap(), 0, name ); + return hr; +} + +static HRESULT WINAPI cache_UninstallAssembly( + IAssemblyCache *iface, + DWORD flags, + LPCWSTR assembly_name, + LPCFUSION_INSTALL_REFERENCE ref, + ULONG *disp ) +{ + struct cache *cache = impl_from_IAssemblyCache( iface ); + HRESULT hr, init; + IXMLDOMDocument *doc = NULL; + struct assembly *assembly = NULL; + IAssemblyName *name_obj = NULL; + const WCHAR *arch, *name, *token, *type, *version; + WCHAR *p, *path = NULL; + + TRACE("%p, 0x%08x, %s, %p, %p\n", iface, flags, debugstr_w(assembly_name), ref, disp); + + if (ref) + { + FIXME("application reference not supported\n"); + return E_NOTIMPL; + } + cache_lock( cache ); + init = CoInitialize( NULL ); + + hr = CreateAssemblyNameObject( &name_obj, assembly_name, CANOF_PARSE_DISPLAY_NAME, NULL ); + if (FAILED( hr )) + goto done; + + arch = get_name_attribute( name_obj, NAME_ATTR_ID_ARCH ); + name = get_name_attribute( name_obj, NAME_ATTR_ID_NAME ); + token = get_name_attribute( name_obj, NAME_ATTR_ID_TOKEN ); + type = get_name_attribute( name_obj, NAME_ATTR_ID_TYPE ); + version = get_name_attribute( name_obj, NAME_ATTR_ID_VERSION ); + if (!arch || !name || !token || !type || !version) + { + hr = E_INVALIDARG; + goto done; + } + if (!strcmpW( type, win32W )) path = build_manifest_filename( arch, name, token, version ); + else if (!strcmpW( type, win32_policyW )) path = build_policy_filename( arch, name, token, version ); + else + { + hr = E_INVALIDARG; + goto done; + } + + hr = CoCreateInstance( &CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void **)&doc ); + if (hr != S_OK) + goto done; + + if ((hr = load_manifest( doc, path )) != S_OK) goto done; + if ((hr = parse_assembly( doc, &assembly )) != S_OK) goto done; + + if (!DeleteFileW( path )) WARN( "unable to remove manifest file %u\n", GetLastError() ); + else if ((p = strrchrW( path, '\\' ))) + { + *p = 0; + RemoveDirectoryW( path ); + } + if (!strcmpW( assembly->type, win32W )) hr = uninstall_assembly( assembly ); + +done: + if (name_obj) IAssemblyName_Release( name_obj ); + HeapFree( GetProcessHeap(), 0, path ); + free_assembly( assembly ); + if (doc) IXMLDOMDocument_Release( doc ); + if (SUCCEEDED(init)) CoUninitialize(); + cache_unlock( cache ); return hr; } @@ -612,7 +847,12 @@ cache->IAssemblyCache_iface.lpVtbl = &cache_vtbl; cache->refs = 1; - + cache->lock = CreateMutexW( NULL, FALSE, cache_mutex_nameW ); + if (!cache->lock) + { + HeapFree( GetProcessHeap(), 0, cache ); + return HRESULT_FROM_WIN32( GetLastError() ); + } *obj = &cache->IAssemblyCache_iface; return S_OK; } Added: trunk/reactos/dll/win32/sxs/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/name.c?rev=5…
============================================================================== --- trunk/reactos/dll/win32/sxs/name.c (added) +++ trunk/reactos/dll/win32/sxs/name.c [iso-8859-1] Sat May 19 14:52:48 2012 @@ -1,0 +1,402 @@ +/* + * IAssemblyName implementation + * + * Copyright 2012 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" +#include "winsxs.h" + +#include "wine/debug.h" +#include "wine/unicode.h" +#include "sxs_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sxs); + +struct name +{ + IAssemblyName IAssemblyName_iface; + LONG refs; + WCHAR *name; + WCHAR *arch; + WCHAR *token; + WCHAR *type; + WCHAR *version; +}; + +static const WCHAR archW[] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0}; +static const WCHAR tokenW[] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0}; +static const WCHAR typeW[] = {'t','y','p','e',0}; +static const WCHAR versionW[] = {'v','e','r','s','i','o','n',0}; + +static inline struct name *impl_from_IAssemblyName( IAssemblyName *iface ) +{ + return CONTAINING_RECORD( iface, struct name, IAssemblyName_iface ); +} + +static HRESULT WINAPI name_QueryInterface( + IAssemblyName *iface, + REFIID riid, + void **obj ) +{ + struct name *name = impl_from_IAssemblyName( iface ); + + TRACE("%p, %s, %p\n", name, debugstr_guid(riid), obj); + + *obj = NULL; + + if (IsEqualIID( riid, &IID_IUnknown ) || + IsEqualIID( riid, &IID_IAssemblyName )) + { + IUnknown_AddRef( iface ); + *obj = name; + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI name_AddRef( + IAssemblyName *iface ) +{ + struct name *name = impl_from_IAssemblyName( iface ); + return InterlockedIncrement( &name->refs ); +} + +static ULONG WINAPI name_Release( IAssemblyName *iface ) +{ + struct name *name = impl_from_IAssemblyName( iface ); + ULONG refs = InterlockedDecrement( &name->refs ); + + if (!refs) + { + TRACE("destroying %p\n", name); + HeapFree( GetProcessHeap(), 0, name->name ); + HeapFree( GetProcessHeap(), 0, name->arch ); + HeapFree( GetProcessHeap(), 0, name->token ); + HeapFree( GetProcessHeap(), 0, name->type ); + HeapFree( GetProcessHeap(), 0, name->version ); + HeapFree( GetProcessHeap(), 0, name ); + } + return refs; +} + +static HRESULT WINAPI name_SetProperty( + IAssemblyName *iface, + DWORD id, + LPVOID property, + DWORD size ) +{ + FIXME("%p, %d, %p, %d\n", iface, id, property, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI name_GetProperty( + IAssemblyName *iface, + DWORD id, + LPVOID buffer, + LPDWORD buflen ) +{ + FIXME("%p, %d, %p, %p\n", iface, id, buffer, buflen); + return E_NOTIMPL; +} + +static HRESULT WINAPI name_Finalize( + IAssemblyName *iface ) +{ + FIXME("%p\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI name_GetDisplayName( + IAssemblyName *iface, + LPOLESTR buffer, + LPDWORD buflen, + DWORD flags ) +{ + static const WCHAR fmtW[] = {',','%','s','=','\"','%','s','\"',0}; + struct name *name = impl_from_IAssemblyName( iface ); + WCHAR version[30]; + unsigned int len; + + TRACE("%p, %p, %p, 0x%08x\n", iface, buffer, buflen, flags); + + if (!buflen || flags) return E_INVALIDARG; + + len = strlenW( name->name ) + 1; + if (name->arch) len += strlenW( archW ) + strlenW( name->arch ) + 4; + if (name->token) len += strlenW( tokenW ) + strlenW( name->token ) + 4; + if (name->type) len += strlenW( typeW ) + strlenW( name->type ) + 4; + if (name->version) len += strlenW( versionW ) + strlenW( version ) + 4; + if (len > *buflen) + { + *buflen = len; + return HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ); + } + strcpyW( buffer, name->name ); + len = strlenW( buffer ); + if (name->arch) len += sprintfW( buffer + len, fmtW, archW, name->arch ); + if (name->token) len += sprintfW( buffer + len, fmtW, tokenW, name->token ); + if (name->type) len += sprintfW( buffer + len, fmtW, typeW, name->type ); + if (name->version) len += sprintfW( buffer + len, fmtW, versionW, name->version ); + return S_OK; +} + +static HRESULT WINAPI name_Reserved( + IAssemblyName *iface, + REFIID riid, + IUnknown *pUnkReserved1, + IUnknown *pUnkReserved2, + LPCOLESTR szReserved, + LONGLONG llReserved, + LPVOID pvReserved, + DWORD cbReserved, + LPVOID *ppReserved ) +{ + FIXME("%p, %s, %p, %p, %s, %x%08x, %p, %d, %p\n", iface, + debugstr_guid(riid), pUnkReserved1, pUnkReserved2, + debugstr_w(szReserved), (DWORD)(llReserved >> 32), (DWORD)llReserved, + pvReserved, cbReserved, ppReserved); + return E_NOTIMPL; +} + +const WCHAR *get_name_attribute( IAssemblyName *iface, enum name_attr_id id ) +{ + struct name *name = impl_from_IAssemblyName( iface ); + + switch (id) + { + case NAME_ATTR_ID_NAME: return name->name; + case NAME_ATTR_ID_ARCH: return name->arch; + case NAME_ATTR_ID_TOKEN: return name->token; + case NAME_ATTR_ID_TYPE: return name->type; + case NAME_ATTR_ID_VERSION: return name->version; + default: + ERR("unhandled name attribute %u\n", id); + break; + } + return NULL; +} + +static HRESULT WINAPI name_GetName( + IAssemblyName *iface, + LPDWORD buflen, + WCHAR *buffer ) +{ + const WCHAR *name; + int len; + + TRACE("%p, %p, %p\n", iface, buflen, buffer); + + if (!buflen || !buffer) return E_INVALIDARG; + + name = get_name_attribute( iface, NAME_ATTR_ID_NAME ); + len = strlenW( name ) + 1; + if (len > *buflen) + { + *buflen = len; + return HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ); + } + strcpyW( buffer, name ); + *buflen = len + 3; + return S_OK; +} + +static HRESULT parse_version( WCHAR *version, DWORD *high, DWORD *low ) +{ + WORD ver[4]; + WCHAR *p, *q; + unsigned int i; + + memset( ver, 0, sizeof(ver) ); + for (i = 0, p = version; i < 4; i++) + { + if (!*p) break; + q = strchrW( p, '.' ); + if (q) *q = 0; + ver[i] = atolW( p ); + if (!q && i < 3) break; + p = q + 1; + } + *high = (ver[0] << 16) + ver[1]; + *low = (ver[2] << 16) + ver[3]; + return S_OK; +} + +static HRESULT WINAPI name_GetVersion( + IAssemblyName *iface, + LPDWORD high, + LPDWORD low ) +{ + struct name *name = impl_from_IAssemblyName( iface ); + WCHAR *version; + HRESULT hr; + + TRACE("%p, %p, %p\n", iface, high, low); + + if (!name->version) return HRESULT_FROM_WIN32( ERROR_NOT_FOUND ); + if (!(version = strdupW( name->version ))) return E_OUTOFMEMORY; + hr = parse_version( version, high, low ); + HeapFree( GetProcessHeap(), 0, version ); + return hr; +} + +static HRESULT WINAPI name_IsEqual( + IAssemblyName *name1, + IAssemblyName *name2, + DWORD flags ) +{ + FIXME("%p, %p, 0x%08x\n", name1, name2, flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI name_Clone( + IAssemblyName *iface, + IAssemblyName **name ) +{ + FIXME("%p, %p\n", iface, name); + return E_NOTIMPL; +} + +static const IAssemblyNameVtbl name_vtbl = +{ + name_QueryInterface, + name_AddRef, + name_Release, + name_SetProperty, + name_GetProperty, + name_Finalize, + name_GetDisplayName, + name_Reserved, + name_GetName, + name_GetVersion, + name_IsEqual, + name_Clone +}; + +static WCHAR *parse_value( const WCHAR *str, unsigned int *len ) +{ + WCHAR *ret; + const WCHAR *p = str; + + if (*p++ != '\"') return NULL; + while (*p && *p != '\"') p++; + if (!*p) return NULL; + + *len = p - str; + if (!(ret = HeapAlloc( GetProcessHeap(), 0, *len * sizeof(WCHAR) ))) return NULL; + memcpy( ret, str + 1, (*len - 1) * sizeof(WCHAR) ); + ret[*len - 1] = 0; + return ret; +} + +static HRESULT parse_displayname( struct name *name, const WCHAR *displayname ) +{ + const WCHAR *p, *q; + unsigned int len; + + p = q = displayname; + while (*q && *q != ',') q++; + len = q - p; + if (!(name->name = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + memcpy( name->name, p, len * sizeof(WCHAR) ); + name->name[len] = 0; + if (!*q) return S_OK; + + for (;;) + { + p = ++q; + while (*q && *q != '=') q++; + if (!*q) return E_INVALIDARG; + len = q - p; + if (len == sizeof(archW)/sizeof(archW[0]) - 1 && !memcmp( p, archW, len * sizeof(WCHAR) )) + { + p = ++q; + if (!(name->arch = parse_value( p, &len ))) return E_INVALIDARG; + q += len; + } + else if (len == sizeof(tokenW)/sizeof(tokenW[0]) - 1 && !memcmp( p, tokenW, len * sizeof(WCHAR) )) + { + p = ++q; + if (!(name->token = parse_value( p, &len ))) return E_INVALIDARG; + q += len; + } + else if (len == sizeof(typeW)/sizeof(typeW[0]) - 1 && !memcmp( p, typeW, len * sizeof(WCHAR) )) + { + p = ++q; + if (!(name->type = parse_value( p, &len ))) return E_INVALIDARG; + q += len; + } + else if (len == sizeof(versionW)/sizeof(versionW[0]) - 1 && !memcmp( p, versionW, len * sizeof(WCHAR) )) + { + p = ++q; + if (!(name->version = parse_value( p, &len ))) return E_INVALIDARG; + q += len; + } + else return HRESULT_FROM_WIN32( ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME ); + while (*q && *q != ',') q++; + if (!*q) break; + } + return S_OK; +} + +/****************************************************************** + * CreateAssemblyNameObject (SXS.@) + */ +HRESULT WINAPI CreateAssemblyNameObject( + LPASSEMBLYNAME *obj, + LPCWSTR assembly, + DWORD flags, + LPVOID reserved ) +{ + struct name *name; + HRESULT hr; + + TRACE("%p, %s, 0x%08x, %p\n", obj, debugstr_w(assembly), flags, reserved); + + if (!obj) return E_INVALIDARG; + + *obj = NULL; + if (!assembly || !assembly[0] || flags != CANOF_PARSE_DISPLAY_NAME) + return E_INVALIDARG; + + if (!(name = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*name) ))) + return E_OUTOFMEMORY; + + name->IAssemblyName_iface.lpVtbl = &name_vtbl; + name->refs = 1; + + hr = parse_displayname( name, assembly ); + if (hr != S_OK) + { + HeapFree( GetProcessHeap(), 0, name->name ); + HeapFree( GetProcessHeap(), 0, name->arch ); + HeapFree( GetProcessHeap(), 0, name->token ); + HeapFree( GetProcessHeap(), 0, name->type ); + HeapFree( GetProcessHeap(), 0, name->version ); + HeapFree( GetProcessHeap(), 0, name ); + return hr; + } + *obj = &name->IAssemblyName_iface; + return S_OK; +} Propchange: trunk/reactos/dll/win32/sxs/name.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/sxs/sxs.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/sxs.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/sxs/sxs.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sxs/sxs.spec [iso-8859-1] Sat May 19 14:52:48 2012 @@ -1,2 +1,2 @@ @ stdcall CreateAssemblyCache(ptr long) -@ stub CreateAssemblyNameObject +@ stdcall CreateAssemblyNameObject(ptr wstr long ptr) Added: trunk/reactos/dll/win32/sxs/sxs_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/sxs_private.…
============================================================================== --- trunk/reactos/dll/win32/sxs/sxs_private.h (added) +++ trunk/reactos/dll/win32/sxs/sxs_private.h [iso-8859-1] Sat May 19 14:52:48 2012 @@ -1,0 +1,38 @@ +/* + * Copyright 2012 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +enum name_attr_id +{ + NAME_ATTR_ID_NAME, + NAME_ATTR_ID_ARCH, + NAME_ATTR_ID_TOKEN, + NAME_ATTR_ID_TYPE, + NAME_ATTR_ID_VERSION +}; + +const WCHAR *get_name_attribute( IAssemblyName *, enum name_attr_id ); + +static inline WCHAR *strdupW( const WCHAR *src ) +{ + WCHAR *dst; + + if (!src) return NULL; + dst = HeapAlloc( GetProcessHeap(), 0, (strlenW( src ) + 1) * sizeof(WCHAR) ); + if (dst) strcpyW( dst, src ); + return dst; +} Propchange: trunk/reactos/dll/win32/sxs/sxs_private.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/psdk/winsxs.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winsxs.idl?re…
============================================================================== --- trunk/reactos/include/psdk/winsxs.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winsxs.idl [iso-8859-1] Sat May 19 14:52:48 2012 @@ -21,6 +21,7 @@ interface IAssemblyCache; interface IAssemblyCacheItem; +interface IAssemblyName; typedef struct _FUSION_INSTALL_REFERENCE_ { @@ -99,4 +100,99 @@ HRESULT AbortItem(); } +[ + object, + uuid(cd193bc0-b4bc-11D2-9833-00c04fc31d2e), + pointer_default(unique), + local +] +interface IAssemblyName : IUnknown +{ + typedef [public] enum + { + ASM_NAME_PUBLIC_KEY, + ASM_NAME_PUBLIC_KEY_TOKEN, + ASM_NAME_HASH_VALUE, + ASM_NAME_NAME, + ASM_NAME_MAJOR_VERSION, + ASM_NAME_MINOR_VERSION, + ASM_NAME_BUILD_NUMBER, + ASM_NAME_REVISION_NUMBER, + ASM_NAME_CULTURE, + ASM_NAME_PROCESSOR_ID_ARRAY, + ASM_NAME_OSINFO_ARRAY, + ASM_NAME_HASH_ALGID, + ASM_NAME_ALIAS, + ASM_NAME_CODEBASE_URL, + ASM_NAME_CODEBASE_LASTMOD, + ASM_NAME_NULL_PUBLIC_KEY, + ASM_NAME_NULL_PUBLIC_KEY_TOKEN, + ASM_NAME_CUSTOM, + ASM_NAME_NULL_CUSTOM, + ASM_NAME_MVID, + ASM_NAME_MAX_PARAMS + } ASM_NAME; + + typedef [public] enum + { + ASM_DISPLAYF_VERSION = 0x1, + ASM_DISPLAYF_CULTURE = 0x2, + ASM_DISPLAYF_PUBLIC_KEY_TOKEN = 0x4, + ASM_DISPLAYF_PUBLIC_KEY = 0x8, + ASM_DISPLAYF_CUSTOM = 0x10, + ASM_DISPLAYF_PROCESSORARCHITECTURE = 0x20, + ASM_DISPLAYF_LANGUAGEID = 0x40 + } ASM_DISPLAY_FLAGS; + + HRESULT SetProperty( + [in] DWORD id, + [in] LPVOID property, + [in] DWORD size); + + HRESULT GetProperty( + [in] DWORD id, + [out] LPVOID buffer, + [in][out] LPDWORD buflen); + + HRESULT Finalize(); + + HRESULT GetDisplayName( + [out] LPWSTR buffer, + [in][out] LPDWORD buflen, + [in] DWORD flags); + + HRESULT Reserved( + [in] REFIID riid, + [in] IUnknown *pUnkReserved1, + [in] IUnknown *pUnkReserved2, + [in] LPCOLESTR szReserved, + [in] LONGLONG llReserved, + [in] LPVOID pvReserved, + [in] DWORD cbReserved, + [out] LPVOID *ppReserved); + + HRESULT GetName( + [in][out] LPDWORD buflen, + [out] LPWSTR buffer); + + HRESULT GetVersion( + [out] LPDWORD hi, + [out] LPDWORD low); + + HRESULT IsEqual( + [in] IAssemblyName *name, + [in] DWORD flags); + + HRESULT Clone( + [out] IAssemblyName **name); +} + +typedef [unique] IAssemblyName *LPASSEMBLYNAME; +typedef [public] enum +{ + CANOF_PARSE_DISPLAY_NAME = 0x1, + CANOF_SET_DEFAULT_VALUES = 0x2 +} CREATE_ASM_NAME_OBJ_FLAGS; + cpp_quote("HRESULT WINAPI CreateAssemblyCache(IAssemblyCache**,DWORD);") +cpp_quote("HRESULT WINAPI CreateAssemblyNameObject(LPASSEMBLYNAME *,LPCWSTR,DWORD,LPVOID);") 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 May 19 14:52:48 2012 @@ -161,7 +161,7 @@ reactos/dll/win32/stdole2.tlb # Synced to Wine-1.3.37 reactos/dll/win32/stdole32.tlb # Synced to Wine-1.3.37 reactos/dll/win32/sti # Synced to Wine-1.5.4 -reactos/dll/win32/sxs # Synced to Wine-1.3.37 +reactos/dll/win32/sxs # Synced to Wine-1.5.4 reactos/dll/win32/tapi32 # Autosync reactos/dll/win32/traffic # Autosync reactos/dll/win32/twain_32 # Out of sync
12 years, 7 months
1
0
0
0
[akhaldi] 56632: [STI_WINETEST] * Import from Wine 1.5.4.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 19 14:35:44 2012 New Revision: 56632 URL:
http://svn.reactos.org/svn/reactos?rev=56632&view=rev
Log: [STI_WINETEST] * Import from Wine 1.5.4. Added: trunk/rostests/winetests/sti/ (with props) trunk/rostests/winetests/sti/CMakeLists.txt (with props) trunk/rostests/winetests/sti/sti.c (with props) trunk/rostests/winetests/sti/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Sat May 19 14:35:44 2012 @@ -85,6 +85,7 @@ add_subdirectory(shlwapi) add_subdirectory(snmpapi) add_subdirectory(spoolss) +add_subdirectory(sti) add_subdirectory(twain_32) if(NOT MSVC) add_subdirectory(urlmon) # FIXME: msvc build. Propchange: trunk/rostests/winetests/sti/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sat May 19 14:35:44 2012 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/sti/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/sti/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/winetests/sti/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/rostests/winetests/sti/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sti/CMakeLists.…
============================================================================== --- trunk/rostests/winetests/sti/CMakeLists.txt (added) +++ trunk/rostests/winetests/sti/CMakeLists.txt [iso-8859-1] Sat May 19 14:35:44 2012 @@ -1,0 +1,10 @@ + +add_definitions( + -D__ROS_LONG64__ + -D_DLL -D__USE_CRTIMP) + +add_executable(sti_winetest sti.c testlist.c) +target_link_libraries(sti_winetest wine uuid) +set_module_type(sti_winetest win32cui) +add_importlibs(sti_winetest ole32 msvcrt kernel32 ntdll) +add_cd_file(TARGET sti_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/sti/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/sti/sti.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sti/sti.c?rev=5…
============================================================================== --- trunk/rostests/winetests/sti/sti.c (added) +++ trunk/rostests/winetests/sti/sti.c [iso-8859-1] Sat May 19 14:35:44 2012 @@ -1,0 +1,279 @@ +/* + * General still image implementation + * + * Copyright 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#define COBJMACROS +#include <initguid.h> +#include <sti.h> +#include <guiddef.h> +#include <devguid.h> +#include <stdio.h> + +#include "wine/test.h" + +static HMODULE sti_dll; +static HRESULT (WINAPI *pStiCreateInstance)(HINSTANCE,DWORD,PSTIW*,LPUNKNOWN); +static HRESULT (WINAPI *pStiCreateInstanceA)(HINSTANCE,DWORD,PSTIA*,LPUNKNOWN); +static HRESULT (WINAPI *pStiCreateInstanceW)(HINSTANCE,DWORD,PSTIW*,LPUNKNOWN); + +static BOOL aggregator_addref_called; + +static HRESULT WINAPI aggregator_QueryInterface(IUnknown *iface, REFIID riid, void **ppvObject) +{ + return E_NOTIMPL; +} + +static ULONG WINAPI aggregator_AddRef(IUnknown *iface) +{ + aggregator_addref_called = TRUE; + return 2; +} + +static ULONG WINAPI aggregator_Release(IUnknown *iface) +{ + return 1; +} + +static struct IUnknownVtbl aggregator_vtbl = +{ + aggregator_QueryInterface, + aggregator_AddRef, + aggregator_Release +}; + +static BOOL init_function_pointers(void) +{ + sti_dll = LoadLibrary("sti.dll"); + if (sti_dll) + { + pStiCreateInstance = (void*) + GetProcAddress(sti_dll, "StiCreateInstance"); + pStiCreateInstanceA = (void*) + GetProcAddress(sti_dll, "StiCreateInstanceA"); + pStiCreateInstanceW = (void*) + GetProcAddress(sti_dll, "StiCreateInstanceW"); + return TRUE; + } + return FALSE; +} + +static void test_version_flag_versus_aw(void) +{ + HRESULT hr; + + /* Who wins, the STI_VERSION_FLAG_UNICODE or the A/W function? And what about the neutral StiCreateInstance function? */ + + if (pStiCreateInstance) + { + PSTIW pStiW; + hr = pStiCreateInstance(GetModuleHandle(NULL), STI_VERSION_REAL, &pStiW, NULL); + if (SUCCEEDED(hr)) + { + IUnknown *pUnknown; + hr = IUnknown_QueryInterface((IUnknown*)pStiW, &IID_IStillImageW, (void**)&pUnknown); + if (SUCCEEDED(hr)) + { + ok(pUnknown == (IUnknown*)pStiW, "created interface was not IID_IStillImageW\n"); + IUnknown_Release(pUnknown); + } + IUnknown_Release((IUnknown*)pStiW); + } + else + ok(0, "could not create StillImageA, hr = 0x%X\n", hr); + hr = pStiCreateInstance(GetModuleHandle(NULL), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, &pStiW, NULL); + if (SUCCEEDED(hr)) + { + IUnknown *pUnknown; + hr = IUnknown_QueryInterface((IUnknown*)pStiW, &IID_IStillImageW, (void**)&pUnknown); + if (SUCCEEDED(hr)) + { + ok(pUnknown == (IUnknown*)pStiW, "created interface was not IID_IStillImageW\n"); + IUnknown_Release(pUnknown); + } + IUnknown_Release((IUnknown*)pStiW); + } + else + ok(0, "could not create StillImageW, hr = 0x%X\n", hr); + } + else + skip("No StiCreateInstance function\n"); + + if (pStiCreateInstanceA) + { + PSTIA pStiA; + hr = pStiCreateInstanceA(GetModuleHandle(NULL), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, &pStiA, NULL); + if (SUCCEEDED(hr)) + { + IUnknown *pUnknown; + hr = IUnknown_QueryInterface((IUnknown*)pStiA, &IID_IStillImageA, (void**)&pUnknown); + if (SUCCEEDED(hr)) + { + ok(pUnknown == (IUnknown*)pStiA, "created interface was not IID_IStillImageA\n"); + IUnknown_Release(pUnknown); + } + IUnknown_Release((IUnknown*)pStiA); + } + else + todo_wine ok(0, "could not create StillImageA, hr = 0x%X\n", hr); + } + else + skip("No StiCreateInstanceA function\n"); + + if (pStiCreateInstanceW) + { + PSTIW pStiW; + hr = pStiCreateInstanceW(GetModuleHandle(NULL), STI_VERSION_REAL, &pStiW, NULL); + if (SUCCEEDED(hr)) + { + IUnknown *pUnknown; + hr = IUnknown_QueryInterface((IUnknown*)pStiW, &IID_IStillImageW, (void**)&pUnknown); + if (SUCCEEDED(hr)) + { + ok(pUnknown == (IUnknown*)pStiW, "created interface was not IID_IStillImageW\n"); + IUnknown_Release((IUnknown*)pUnknown); + } + IUnknown_Release((IUnknown*)pStiW); + } + else + ok(0, "could not create StillImageW, hr = 0x%X\n", hr); + } + else + skip("No StiCreateInstanceW function\n"); +} + +static void test_stillimage_aggregation(void) +{ + if (pStiCreateInstanceW) + { + IUnknown aggregator = { &aggregator_vtbl }; + IStillImageW *pStiW; + IUnknown *pUnknown; + HRESULT hr; + + /* When aggregating, the outer object must get the non-delegating IUnknown to be + able to control the inner object's reference count and query its interfaces. + But StiCreateInstance* only take PSTI. So how does the non-delegating IUnknown + come back to the outer object calling this function? */ + + hr = pStiCreateInstanceW(GetModuleHandle(NULL), STI_VERSION_REAL, &pStiW, &aggregator); + if (SUCCEEDED(hr)) + { + IStillImageW *pStiW2 = NULL; + + /* Does this interface delegate? */ + aggregator_addref_called = FALSE; + IStillImage_AddRef(pStiW); + ok(!aggregator_addref_called, "the aggregated IStillImageW shouldn't delegate\n"); + IStillImage_Release(pStiW); + + /* Tests show calling IStillImageW_WriteToErrorLog on the interface segfaults on Windows, so I guess it's an IUnknown. + But querying for an IUnknown returns a different interface, which also delegates. + So much for COM being reflexive... + Anyway I doubt apps depend on any of this. */ + + /* And what about the IStillImageW interface? */ + hr = IStillImage_QueryInterface(pStiW, &IID_IStillImageW, (void**)&pStiW2); + if (SUCCEEDED(hr)) + { + ok(pStiW != pStiW2, "the aggregated IStillImageW and its queried IStillImageW unexpectedly match\n"); + /* Does it delegate? */ + aggregator_addref_called = FALSE; + IStillImage_AddRef(pStiW2); + ok(aggregator_addref_called, "the created IStillImageW's IStillImageW should delegate\n"); + IStillImage_Release(pStiW2); + IStillImage_Release(pStiW2); + } + else + ok(0, "could not query for IID_IStillImageW, hr = 0x%x\n", hr); + + IStillImage_Release(pStiW); + } + else + ok(0, "could not create StillImageW, hr = 0x%X\n", hr); + + /* Now do the above tests prove that STI.DLL isn't picky about querying for IUnknown + in CoCreateInterface when aggregating? */ + hr = CoCreateInstance(&CLSID_Sti, &aggregator, CLSCTX_ALL, &IID_IStillImageW, (void**)&pStiW); + ok(FAILED(hr), "CoCreateInstance unexpectedly succeeded when querying for IStillImageW during aggregation\n"); + if (SUCCEEDED(hr)) + IStillImage_Release(pStiW); + hr = CoCreateInstance(&CLSID_Sti, &aggregator, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown); + ok(SUCCEEDED(hr) || + broken(hr == CLASS_E_NOAGGREGATION), /* Win 2000 */ + "CoCreateInstance unexpectedly failed when querying for IUnknown during aggregation, hr = 0x%x\n", hr); + if (SUCCEEDED(hr)) + IUnknown_Release(pUnknown); + } + else + skip("No StiCreateInstanceW function\n"); +} + +static void test_launch_app_registry(void) +{ + static WCHAR appName[] = {'w','i','n','e','s','t','i','t','e','s','t','a','p','p',0}; + IStillImageW *pStiW = NULL; + HRESULT hr; + + if (pStiCreateInstanceW == NULL) + { + win_skip("No StiCreateInstanceW function\n"); + return; + } + + hr = pStiCreateInstance(GetModuleHandle(NULL), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, &pStiW, NULL); + if (SUCCEEDED(hr)) + { + hr = IStillImage_RegisterLaunchApplication(pStiW, appName, appName); + if (hr == E_ACCESSDENIED) + skip("Not authorized to register a launch application\n"); + else if (SUCCEEDED(hr)) + { + hr = IStillImage_UnregisterLaunchApplication(pStiW, appName); + ok(SUCCEEDED(hr), "could not unregister launch application, error 0x%X\n", hr); + } + else + ok(0, "could not register launch application, error 0x%X\n", hr); + IStillImage_Release(pStiW); + } + else + ok(0, "could not create StillImageW, hr = 0x%X\n", hr); +} + +START_TEST(sti) +{ + if (SUCCEEDED(CoInitialize(NULL))) + { + if (init_function_pointers()) + { + test_version_flag_versus_aw(); + test_stillimage_aggregation(); + test_launch_app_registry(); + FreeLibrary(sti_dll); + } + else + skip("could not load sti.dll\n"); + CoUninitialize(); + } + else + skip("CoInitialize failed\n"); +} Propchange: trunk/rostests/winetests/sti/sti.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/sti/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/sti/testlist.c?…
============================================================================== --- trunk/rostests/winetests/sti/testlist.c (added) +++ trunk/rostests/winetests/sti/testlist.c [iso-8859-1] Sat May 19 14:35:44 2012 @@ -1,0 +1,13 @@ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + +extern void func_sti(void); + +const struct test winetest_testlist[] = +{ + { "sti", func_sti }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/sti/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
12 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
23
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
Results per page:
10
25
50
100
200