winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2009
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
1067 discussions
Start a n
N
ew thread
Detlef Riekenberg : urlmon/tests: Add tests for the ZoneEnumerator.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 694bf576d0d94fa1dfdb6a378655df3018f203f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=694bf576d0d94fa1dfdb6a378…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Jul 2 22:08:14 2009 +0200 urlmon/tests: Add tests for the ZoneEnumerator. --- dlls/urlmon/tests/sec_mgr.c | 120 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 120 insertions(+), 0 deletions(-) diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c index 325e1db..e35cf48 100644 --- a/dlls/urlmon/tests/sec_mgr.c +++ b/dlls/urlmon/tests/sec_mgr.c @@ -1,5 +1,6 @@ /* * Copyright 2005-2006 Jacek Caban for CodeWeavers + * Copyright 2009 Detlef Riekenberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -281,6 +282,74 @@ static void test_polices(void) IInternetZoneManager_Release(zonemgr); } +static void test_CreateZoneEnumerator(void) +{ + IInternetZoneManager *zonemgr = NULL; + HRESULT hr; + DWORD dwEnum; + DWORD dwEnum2; + DWORD dwCount; + DWORD dwCount2; + + hr = CoInternetCreateZoneManager(NULL, &zonemgr, 0); + ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr); + if (FAILED(hr)) + return; + + dwEnum=0xdeadbeef; + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, NULL, 0); + ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef), + "got 0x%x with 0x%x (expected E_INVALIDARG with 0xdeadbeef)\n", hr, dwEnum); + + dwCount=0xdeadbeef; + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, NULL, &dwCount, 0); + ok((hr == E_INVALIDARG) && (dwCount == 0xdeadbeef), + "got 0x%x and 0x%x (expected E_INVALIDARG and 0xdeadbeef)\n", hr, dwCount); + + dwEnum=0xdeadbeef; + dwCount=0xdeadbeef; + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0xffffffff); + ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef), + "got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n", + hr, dwEnum, dwCount); + + dwEnum=0xdeadbeef; + dwCount=0xdeadbeef; + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 1); + ok((hr == E_INVALIDARG) && (dwEnum == 0xdeadbeef) && (dwCount == 0xdeadbeef), + "got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)\n", + hr, dwEnum, dwCount); + + dwEnum=0xdeadbeef; + dwCount=0xdeadbeef; + /* Normal use */ + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + + if (SUCCEEDED(hr)) { + dwEnum2=0xdeadbeef; + dwCount2=0xdeadbeef; + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum2, &dwCount2, 0); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + if (SUCCEEDED(hr)) { + /* native urlmon has an incrementing counter for dwEnum */ + hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum2); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + } + + hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + + /* Destroy the Enumerator twice is detected and handled in native urlmon */ + hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum); + ok((hr == E_INVALIDARG), "got 0x%x (expected E_INVALIDARG)\n", hr); + } + + /* ::Release succeed also, when a ::DestroyZoneEnumerator is missing */ + hr = IInternetZoneManager_Release(zonemgr); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); +} + static void test_GetZoneActionPolicy(void) { IInternetZoneManager *zonemgr = NULL; @@ -321,6 +390,55 @@ static void test_GetZoneActionPolicy(void) IInternetZoneManager_Release(zonemgr); } +static void test_GetZoneAt(void) +{ + IInternetZoneManager *zonemgr = NULL; + HRESULT hr; + DWORD dwEnum; + DWORD dwCount; + DWORD dwZone; + DWORD i; + + hr = CoInternetCreateZoneManager(NULL, &zonemgr, 0); + ok(hr == S_OK, "CoInternetCreateZoneManager result: 0x%x\n", hr); + if (FAILED(hr)) + return; + + hr = IInternetZoneManager_CreateZoneEnumerator(zonemgr, &dwEnum, &dwCount, 0); + if (FAILED(hr)) + goto cleanup; + + if (0) { + /* this crashes with native urlmon */ + hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, 0, NULL); + } + + dwZone = 0xdeadbeef; + hr = IInternetZoneManager_GetZoneAt(zonemgr, 0xdeadbeef, 0, &dwZone); + ok(hr == E_INVALIDARG, + "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone); + + for (i = 0; i < dwCount; i++) + { + dwZone = 0xdeadbeef; + hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, i, &dwZone); + ok(hr == S_OK, "#%d: got x%x with %d (expected S_OK)\n", i, hr, dwZone); + } + + dwZone = 0xdeadbeef; + /* MSDN (index .. must be .. less than or equal to) is wrong */ + hr = IInternetZoneManager_GetZoneAt(zonemgr, dwEnum, dwCount, &dwZone); + ok(hr == E_INVALIDARG, + "got 0x%x with 0x%x (expected E_INVALIDARG)\n", hr, dwZone); + + hr = IInternetZoneManager_DestroyZoneEnumerator(zonemgr, dwEnum); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + +cleanup: + hr = IInternetZoneManager_Release(zonemgr); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); +} + static void test_GetZoneAttributes(void) { IInternetZoneManager *zonemgr = NULL; @@ -382,7 +500,9 @@ START_TEST(sec_mgr) test_SecurityManager(); test_polices(); + test_CreateZoneEnumerator(); test_GetZoneActionPolicy(); + test_GetZoneAt(); test_GetZoneAttributes(); OleUninitialize();
1
0
0
0
Detlef Riekenberg : urlmon: Implement the ZoneEnumerator.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 9a7f221b130aa10c1d3639d40e63988419bed2b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a7f221b130aa10c1d3639d40…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Jul 2 22:04:43 2009 +0200 urlmon: Implement the ZoneEnumerator. --- dlls/urlmon/sec_mgr.c | 158 +++++++++++++++++++++++++++++++++++++++++---- dlls/urlmon/urlmon_main.h | 5 ++ 2 files changed, 149 insertions(+), 14 deletions(-) diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c index 19286b1..47caf18 100644 --- a/dlls/urlmon/sec_mgr.c +++ b/dlls/urlmon/sec_mgr.c @@ -3,6 +3,7 @@ * * Copyright (c) 2004 Huw D M Davies * Copyright 2004 Jacek Caban + * Copyright 2009 Detlef Riekenberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,6 +39,12 @@ static const WCHAR iconW[] = {'I','c','o','n',0}; static const WCHAR minlevelW[] = {'M','i','n','L','e','v','e','l',0}; static const WCHAR recommendedlevelW[] = {'R','e','c','o','m','m','e','n','d','e','d', 'L','e','v','e','l',0}; +static const WCHAR wszZonesKey[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\', + 'Z','o','n','e','s','\\',0}; /******************************************************************** * get_string_from_reg [internal] @@ -205,13 +212,6 @@ static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone, LPWSTR *ret_url) static HRESULT open_zone_key(HKEY parent_key, DWORD zone, HKEY *hkey) { - static const WCHAR wszZonesKey[] = - {'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\', - 'Z','o','n','e','s','\\',0}; static const WCHAR wszFormat[] = {'%','s','%','l','d',0}; WCHAR key_name[sizeof(wszZonesKey)/sizeof(WCHAR)+8]; @@ -673,8 +673,69 @@ HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) typedef struct { const IInternetZoneManagerVtbl* lpVtbl; LONG ref; + LPDWORD *zonemaps; + DWORD zonemap_count; } ZoneMgrImpl; + +/*********************************************************************** + * build_zonemap_from_reg [internal] + * + * Enumerate the Zones in the Registry and return the Zones in a DWORD-array + * The number of the Zones is returned in data[0] + */ +static LPDWORD build_zonemap_from_reg(void) +{ + WCHAR name[32]; + HKEY hkey; + LPDWORD data = NULL; + DWORD allocated = 6; /* space for the zonecount and Zone "0" upto Zone "4" */ + DWORD used = 0; + DWORD res; + DWORD len; + + + res = RegOpenKeyW(HKEY_CURRENT_USER, wszZonesKey, &hkey); + if (res) + return NULL; + + data = heap_alloc(allocated * sizeof(DWORD)); + if (!data) + goto cleanup; + + while (!res) { + name[0] = '\0'; + len = sizeof(name) / sizeof(name[0]); + res = RegEnumKeyExW(hkey, used, name, &len, NULL, NULL, NULL, NULL); + + if (!res) { + used++; + if (used == allocated) { + LPDWORD new_data; + + allocated *= 2; + new_data = heap_realloc_zero(data, allocated * sizeof(DWORD)); + if (!new_data) + goto cleanup; + + data = new_data; + } + data[used] = atoiW(name); + } + } + if (used) { + RegCloseKey(hkey); + data[0] = used; + return data; + } + +cleanup: + /* something failed */ + RegCloseKey(hkey); + heap_free(data); + return NULL; +} + /******************************************************************** * IInternetZoneManager_QueryInterface */ @@ -723,6 +784,8 @@ static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface) TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); if(!refCount) { + while (This->zonemap_count) heap_free(This->zonemaps[--This->zonemap_count]); + heap_free(This->zonemaps); heap_free(This); URLMON_UnlockModule(); } @@ -876,8 +939,51 @@ static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* ifa DWORD* pdwCount, DWORD dwFlags) { - FIXME("(%p)->(%p %p %08x) stub\n", iface, pdwEnum, pdwCount, dwFlags); - return E_NOTIMPL; + ZoneMgrImpl* This = (ZoneMgrImpl*)iface; + LPDWORD * new_maps; + LPDWORD data; + DWORD i; + + TRACE("(%p)->(%p, %p, 0x%08x)\n", This, pdwEnum, pdwCount, dwFlags); + if (!pdwEnum || !pdwCount || (dwFlags != 0)) + return E_INVALIDARG; + + data = build_zonemap_from_reg(); + TRACE("found %d zones\n", data ? data[0] : -1); + + if (!data) + return E_FAIL; + + for (i = 0; i < This->zonemap_count; i++) { + if (This->zonemaps && !This->zonemaps[i]) { + This->zonemaps[i] = data; + *pdwEnum = i; + *pdwCount = data[0]; + return S_OK; + } + } + + if (This->zonemaps) { + /* try to double the nr. of pointers in the array */ + new_maps = heap_realloc_zero(This->zonemaps, This->zonemap_count * 2 * sizeof(LPDWORD)); + if (new_maps) + This->zonemap_count *= 2; + } + else + { + This->zonemap_count = 2; + new_maps = heap_alloc_zero(This->zonemap_count * sizeof(LPDWORD)); + } + + if (!new_maps) { + heap_free(data); + return E_FAIL; + } + This->zonemaps = new_maps; + This->zonemaps[i] = data; + *pdwEnum = i; + *pdwCount = data[0]; + return S_OK; } /******************************************************************** @@ -888,8 +994,21 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface, DWORD dwIndex, DWORD* pdwZone) { - FIXME("(%p)->(%08x %08x %p) stub\n", iface, dwEnum, dwIndex, pdwZone); - return E_NOTIMPL; + ZoneMgrImpl* This = (ZoneMgrImpl*)iface; + LPDWORD data; + + TRACE("(%p)->(0x%08x, %d, %p)\n", This, dwEnum, dwIndex, pdwZone); + + /* make sure, that dwEnum and dwIndex are in the valid range */ + if (dwEnum < This->zonemap_count) { + if ((data = This->zonemaps[dwEnum])) { + if (dwIndex < data[0]) { + *pdwZone = data[dwIndex + 1]; + return S_OK; + } + } + } + return E_INVALIDARG; } /******************************************************************** @@ -898,8 +1017,19 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface, static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface, DWORD dwEnum) { - FIXME("(%p)->(%08x) stub\n", iface, dwEnum); - return E_NOTIMPL; + ZoneMgrImpl* This = (ZoneMgrImpl*)iface; + LPDWORD data; + + TRACE("(%p)->(0x%08x)\n", This, dwEnum); + /* make sure, that dwEnum is valid */ + if (dwEnum < This->zonemap_count) { + if ((data = This->zonemaps[dwEnum])) { + This->zonemaps[dwEnum] = NULL; + heap_free(data); + return S_OK; + } + } + return E_INVALIDARG; } /******************************************************************** @@ -937,7 +1067,7 @@ static const IInternetZoneManagerVtbl ZoneMgrImplVtbl = { HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) { - ZoneMgrImpl* ret = heap_alloc(sizeof(ZoneMgrImpl)); + ZoneMgrImpl* ret = heap_alloc_zero(sizeof(ZoneMgrImpl)); TRACE("(%p %p)\n", pUnkOuter, ppobj); ret->lpVtbl = &ZoneMgrImplVtbl; diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 1b5d8d5..62a7e91 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -151,6 +151,11 @@ static inline void *heap_realloc(void *mem, size_t len) return HeapReAlloc(GetProcessHeap(), 0, mem, len); } +static inline void *heap_realloc_zero(void *mem, size_t len) +{ + return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); +} + static inline BOOL heap_free(void *mem) { return HeapFree(GetProcessHeap(), 0, mem);
1
0
0
0
Alexandre Julliard : ntdll: Fix the formatting of the get_token_groups request for 64-bit.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 2e2f6af0dec4075795709d906de06efa7c5e8975 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e2f6af0dec4075795709d906…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 3 13:58:09 2009 +0200 ntdll: Fix the formatting of the get_token_groups request for 64-bit. --- dlls/ntdll/nt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 89d796d..c457028 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -321,7 +321,7 @@ NTSTATUS WINAPI NtQueryInformationToken( struct token_groups *tg = buffer; unsigned int *attr = (unsigned int *)(tg + 1); ULONG i; - const int non_sid_portion = (sizeof(struct token_groups) + tg->count * sizeof(unsigned long)); + const int non_sid_portion = (sizeof(struct token_groups) + tg->count * sizeof(unsigned int)); SID *sids = (SID *)((char *)tokeninfo + FIELD_OFFSET( TOKEN_GROUPS, Groups[tg->count] )); ULONG needed_bytes = FIELD_OFFSET( TOKEN_GROUPS, Groups[tg->count] ) + reply->user_len - non_sid_portion;
1
0
0
0
Alexandre Julliard : ole32/tests: Fix the HMETAFILE_UserSize prototype.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 05beb0daed66a8791f2871aec1e71205ff771c11 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=05beb0daed66a8791f2871aec…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 3 13:57:21 2009 +0200 ole32/tests: Fix the HMETAFILE_UserSize prototype. --- dlls/ole32/tests/usrmarshal.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/tests/usrmarshal.c b/dlls/ole32/tests/usrmarshal.c index fde0034..a655397 100644 --- a/dlls/ole32/tests/usrmarshal.c +++ b/dlls/ole32/tests/usrmarshal.c @@ -29,7 +29,7 @@ #include "wine/test.h" -ULONG __RPC_USER HMETAFILE_UserSize(ULONG *, unsigned long, HMETAFILE *); +ULONG __RPC_USER HMETAFILE_UserSize(ULONG *, ULONG, HMETAFILE *); unsigned char * __RPC_USER HMETAFILE_UserMarshal(ULONG *, unsigned char *, HMETAFILE *); unsigned char * __RPC_USER HMETAFILE_UserUnmarshal(ULONG *, unsigned char *, HMETAFILE *); void __RPC_USER HMETAFILE_UserFree(ULONG *, HMETAFILE *);
1
0
0
0
Alexandre Julliard : oleaut32: Replace long and unsigned long by more appropriate types.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 8fce9369b8609664a63b8d30a8b3791f93412ce3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8fce9369b8609664a63b8d30a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 3 13:48:54 2009 +0200 oleaut32: Replace long and unsigned long by more appropriate types. --- dlls/oleaut32/olefont.c | 4 ++-- dlls/oleaut32/typelib.c | 6 +++--- dlls/oleaut32/typelib2.c | 2 +- dlls/oleaut32/variant.c | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 3e00844..a9b2c04 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -132,8 +132,8 @@ struct OLEFontImpl /* * Size ratio */ - long cyLogical; - long cyHimetric; + LONG cyLogical; + LONG cyHimetric; IConnectionPoint *pPropertyNotifyCP; IConnectionPoint *pFontEventsCP; diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 10f5e23..1f104f8 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -938,7 +938,7 @@ typedef struct tagITypeLibImpl BSTR DocString; BSTR HelpFile; BSTR HelpStringDll; - unsigned long dwHelpContext; + DWORD dwHelpContext; int TypeInfoCount; /* nr of typeinfo's in librarry */ struct tagITypeInfoImpl *pTypeInfo; /* linked list of type info data */ int ctCustData; /* number of items in cust data list */ @@ -1058,8 +1058,8 @@ typedef struct tagITypeInfoImpl BSTR Name; BSTR DocString; BSTR DllName; - unsigned long dwHelpContext; - unsigned long dwHelpStringContext; + DWORD dwHelpContext; + DWORD dwHelpStringContext; /* functions */ TLBFuncDesc * funclist; /* linked list with function descriptions */ diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index b011342..0f641d4 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -760,7 +760,7 @@ static int ctl2_alloc_custdata( if (offset == -1) return offset; *((unsigned short *)&This->typelib_segment_data[MSFT_SEG_CUSTDATA][offset]) = VT_UI4; - *((unsigned long *)&This->typelib_segment_data[MSFT_SEG_CUSTDATA][offset+2]) = V_UI4(pVarVal); + *((unsigned int *)&This->typelib_segment_data[MSFT_SEG_CUSTDATA][offset+2]) = V_UI4(pVarVal); break; default: diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 7a5f325..e92a63d 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -5571,7 +5571,9 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result) V_VT(result) = VT_I8; V_I8(result) = V_I8(&lv) % V_I8(&rv); - TRACE("V_I8(left) == %ld, V_I8(right) == %ld, V_I8(result) == %ld\n", (long)V_I8(&lv), (long)V_I8(&rv), (long)V_I8(result)); + TRACE("V_I8(left) == %s, V_I8(right) == %s, V_I8(result) == %s\n", + wine_dbgstr_longlong(V_I8(&lv)), wine_dbgstr_longlong(V_I8(&rv)), + wine_dbgstr_longlong(V_I8(result))); /* convert left and right to the destination type */ rc = VariantChangeType(result, result, 0, resT);
1
0
0
0
Alexandre Julliard : rpcrt4: Replace long and unsigned long by more appropriate types.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 8de0242885a6cc49a6b98582aa3378b9c438c629 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8de0242885a6cc49a6b98582a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 3 13:42:57 2009 +0200 rpcrt4: Replace long and unsigned long by more appropriate types. --- dlls/rpcrt4/ndr_stubless.h | 2 +- dlls/rpcrt4/rpc_assoc.c | 4 +- dlls/rpcrt4/rpc_assoc.h | 2 +- dlls/rpcrt4/rpc_binding.c | 2 +- dlls/rpcrt4/rpc_defs.h | 18 ++++++++-------- dlls/rpcrt4/rpc_epmap.c | 16 +++++++------- dlls/rpcrt4/rpc_message.c | 49 +++++++++++++++++++++---------------------- dlls/rpcrt4/rpc_message.h | 14 ++++++------ 8 files changed, 53 insertions(+), 54 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8de0242885a6cc49a6b98…
1
0
0
0
Piotr Caban : jscript: Fix strings allocation.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: c001ffae2c68e7e47640f1a9a5895a16b44d08fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c001ffae2c68e7e47640f1a9a…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Jul 3 02:45:32 2009 +0200 jscript: Fix strings allocation. --- dlls/jscript/date.c | 45 +++++++++++++++++++++++++-------------------- 1 files changed, 25 insertions(+), 20 deletions(-) diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index d20ee96..9dcc8a7 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -531,11 +531,13 @@ static HRESULT Date_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA GetLocaleInfoW(lcid_en, month_id, month, size); len += size-1; - year = year_from_time(time)/10; - while(year) { + year = year_from_time(time); + if(year<0) + year = -year+1; + do { year /= 10; len++; - } + } while(year); year = year_from_time(time); if(year<0) { @@ -544,11 +546,11 @@ static HRESULT Date_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA len += 5; } - day = date_from_time(time)/10; - while(day) { + day = date_from_time(time); + do { day /= 10; len++; - } + } while(day); day = date_from_time(time); offset = date->bias + @@ -733,11 +735,13 @@ static HRESULT Date_toUTCString(DispatchEx *dispex, LCID lcid, WORD flags, DISPP GetLocaleInfoW(lcid_en, month_id, month, size); len += size-1; - year = year_from_time(date->time)/10; - while(year) { + year = year_from_time(date->time); + if(year<0) + year = -year+1; + do { year /= 10; len++; - } + } while(year); year = year_from_time(date->time); if(year<0) { @@ -746,11 +750,11 @@ static HRESULT Date_toUTCString(DispatchEx *dispex, LCID lcid, WORD flags, DISPP len += 5; } - day = date_from_time(date->time)/10; - while(day) { + day = date_from_time(date->time); + do { day /= 10; len++; - } + } while(day); day = date_from_time(date->time); date_str = SysAllocStringLen(NULL, len); @@ -842,11 +846,13 @@ static HRESULT Date_toDateString(DispatchEx *dispex, LCID lcid, WORD flags, DISP GetLocaleInfoW(lcid_en, month_id, month, size); len += size-1; - year = year_from_time(time)/10; - while(year) { + year = year_from_time(time); + if(year<0) + year = -year+1; + do { year /= 10; len++; - } + } while(year); year = year_from_time(time); if(year<0) { @@ -855,11 +861,11 @@ static HRESULT Date_toDateString(DispatchEx *dispex, LCID lcid, WORD flags, DISP len += 5; } - day = date_from_time(time)/10; - while(day) { + day = date_from_time(time); + do { day /= 10; len++; - } + } while(day); day = date_from_time(time); date_str = SysAllocStringLen(NULL, len); @@ -2172,9 +2178,8 @@ static HRESULT create_date(script_ctx_t *ctx, BOOL use_constr, DOUBLE time, Disp DateInstance *date; HRESULT hres; TIME_ZONE_INFORMATION tzi; - DWORD dret; - dret = GetTimeZoneInformation(&tzi); + GetTimeZoneInformation(&tzi); date = heap_alloc_zero(sizeof(DateInstance)); if(!date)
1
0
0
0
Piotr Caban : jscript: Added DateConstr_UTC implementation.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 60ddd438d3bc23079a3c2108e400d3252ef48821 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=60ddd438d3bc23079a3c2108e…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Jul 3 02:45:22 2009 +0200 jscript: Added DateConstr_UTC implementation. --- dlls/jscript/date.c | 158 +++++++++++++++++++++++++++++---------------------- 1 files changed, 89 insertions(+), 69 deletions(-) diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index 7888a1c..d20ee96 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2210,8 +2210,92 @@ static HRESULT DateConstr_parse(DispatchEx *dispex, LCID lcid, WORD flags, DISPP static HRESULT DateConstr_UTC(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT year, month, vdate, hours, minutes, seconds, ms; + DOUBLE y; + int arg_no = arg_cnt(dp); + HRESULT hres; + + TRACE("\n"); + + if(arg_no>0) { + hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &year); + if(FAILED(hres)) + return hres; + y = num_val(&year); + if(0<=y && y<=99) + y += 1900; + } + else y = 1900; + + if(arg_no>1) { + hres = to_number(dispex->ctx, get_arg(dp, 1), ei, &month); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&month) = VT_R8; + V_R8(&month) = 0; + } + + if(arg_no>2) { + hres = to_number(dispex->ctx, get_arg(dp, 2), ei, &vdate); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&vdate) = VT_R8; + V_R8(&vdate) = 1; + } + + if(arg_no>3) { + hres = to_number(dispex->ctx, get_arg(dp, 3), ei, &hours); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&hours) = VT_R8; + V_R8(&hours) = 0; + } + + if(arg_no>4) { + hres = to_number(dispex->ctx, get_arg(dp, 4), ei, &minutes); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&minutes) = VT_R8; + V_R8(&minutes) = 0; + } + + if(arg_no>5) { + hres = to_number(dispex->ctx, get_arg(dp, 5), ei, &seconds); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&seconds) = VT_R8; + V_R8(&seconds) = 0; + } + + if(arg_no>6) { + hres = to_number(dispex->ctx, get_arg(dp, 6), ei, &ms); + if(FAILED(hres)) + return hres; + } + else { + V_VT(&ms) = VT_R8; + V_R8(&ms) = 0; + } + + if(retv) { + V_VT(retv) = VT_R8; + V_R8(retv) = time_clip(make_date( + make_day(y, num_val(&month), num_val(&vdate)), + make_time(num_val(&hours), num_val(&minutes), + num_val(&seconds), num_val(&ms)))); + } + + return S_OK; } static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -2266,76 +2350,12 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP /* ECMA-262 3rd Edition 15.9.3.1 */ default: { - VARIANT year, month, vdate, hours, minutes, seconds, ms; + VARIANT ret_date; DateInstance *di; - int arg_no = arg_cnt(dp), y; - - hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &year); - if(FAILED(hres)) - return hres; - y = num_val(&year); - if(0<=y && y<=99) - y += 1900; - - hres = to_number(dispex->ctx, get_arg(dp, 1), ei, &month); - if(FAILED(hres)) - return hres; - - if(arg_no>2) { - hres = to_number(dispex->ctx, get_arg(dp, 2), ei, &vdate); - if(FAILED(hres)) - return hres; - } - else { - V_VT(&vdate) = VT_R8; - V_R8(&vdate) = 1; - } - - if(arg_no>3) { - hres = to_number(dispex->ctx, get_arg(dp, 3), ei, &hours); - if(FAILED(hres)) - return hres; - } - else { - V_VT(&hours) = VT_R8; - V_R8(&hours) = 0; - } - - if(arg_no>4) { - hres = to_number(dispex->ctx, get_arg(dp, 4), ei, &minutes); - if(FAILED(hres)) - return hres; - } - else { - V_VT(&minutes) = VT_R8; - V_R8(&minutes) = 0; - } - - if(arg_no>5) { - hres = to_number(dispex->ctx, get_arg(dp, 5), ei, &seconds); - if(FAILED(hres)) - return hres; - } - else { - V_VT(&seconds) = VT_R8; - V_R8(&seconds) = 0; - } - - if(arg_no>6) { - hres = to_number(dispex->ctx, get_arg(dp, 6), ei, &ms); - if(FAILED(hres)) - return hres; - } - else { - V_VT(&ms) = VT_R8; - V_R8(&ms) = 0; - } + DateConstr_UTC(dispex, lcid, flags, dp, &ret_date, ei, sp); - hres = create_date(dispex->ctx, TRUE, time_clip( - make_date(make_day(y, num_val(&month), num_val(&vdate)), - make_time(num_val(&hours), num_val(&minutes), - num_val(&seconds), num_val(&ms)))), &date); + hres = create_date(dispex->ctx, TRUE, num_val(&ret_date), &date); if(FAILED(hres)) return hres;
1
0
0
0
Piotr Caban : jscript: Added stub implementation of Date constructor properties.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: 41e297af1120e5f0007f46a42cd0b49021506c88 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41e297af1120e5f0007f46a42…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Fri Jul 3 02:45:12 2009 +0200 jscript: Added stub implementation of Date constructor properties. --- dlls/jscript/array.c | 2 +- dlls/jscript/bool.c | 2 +- dlls/jscript/date.c | 33 ++++++++++++++++++++++++++++++++- dlls/jscript/dispex.c | 2 +- dlls/jscript/function.c | 19 +++++++++++-------- dlls/jscript/jscript.h | 5 ++++- dlls/jscript/number.c | 2 +- dlls/jscript/object.c | 2 +- dlls/jscript/regexp.c | 2 +- dlls/jscript/string.c | 2 +- 10 files changed, 54 insertions(+), 17 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=41e297af1120e5f0007f4…
1
0
0
0
Vincent Povirk : windowscodecs: Add test for IWICPalette.
by Alexandre Julliard
03 Jul '09
03 Jul '09
Module: wine Branch: master Commit: dd5a9a0aa11577da5016efdf3424f3f65686aaf8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd5a9a0aa11577da5016efdf3…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Jul 1 17:39:13 2009 -0500 windowscodecs: Add test for IWICPalette. --- dlls/windowscodecs/tests/Makefile.in | 3 +- dlls/windowscodecs/tests/palette.c | 158 ++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+), 1 deletions(-) diff --git a/dlls/windowscodecs/tests/Makefile.in b/dlls/windowscodecs/tests/Makefile.in index 829bbdd..2bb8c01 100644 --- a/dlls/windowscodecs/tests/Makefile.in +++ b/dlls/windowscodecs/tests/Makefile.in @@ -6,7 +6,8 @@ TESTDLL = windowscodecs.dll IMPORTS = kernel32 ole32 CTESTS = \ - bmpformat.c + bmpformat.c \ + palette.c @MAKE_TEST_RULES@ diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c new file mode 100644 index 0000000..d1e5c88 --- /dev/null +++ b/dlls/windowscodecs/tests/palette.c @@ -0,0 +1,158 @@ +/* + * Copyright 2009 Vincent Povirk 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 "objbase.h" +#include "wincodec.h" +#include "wine/test.h" + +static void test_custom_palette(void) +{ + IWICImagingFactory *factory; + IWICPalette *palette; + HRESULT hr; + WICBitmapPaletteType type=0xffffffff; + UINT count=1; + const WICColor initcolors[4]={0xff000000,0xff0000ff,0xffffff00,0xffffffff}; + WICColor colors[4]; + BOOL boolresult; + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void**)&factory); + ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr); + if (!SUCCEEDED(hr)) return; + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(SUCCEEDED(hr), "CreatePalette failed, hr=%x\n", hr); + if (SUCCEEDED(hr)) + { + hr = IWICPalette_GetType(palette, &type); + ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr); + ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr); + ok(count == 0, "expected 0, got %u\n", count); + + hr = IWICPalette_GetColors(palette, 0, colors, &count); + ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr); + ok(count == 0, "expected 0, got %u\n", count); + + hr = IWICPalette_GetColors(palette, 4, colors, &count); + ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr); + ok(count == 0, "expected 0, got %u\n", count); + + memcpy(colors, initcolors, sizeof(initcolors)); + hr = IWICPalette_InitializeCustom(palette, colors, 4); + ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr); + + hr = IWICPalette_GetType(palette, &type); + ok(SUCCEEDED(hr), "GetType failed, hr=%x\n", hr); + ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %x\n", type); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(SUCCEEDED(hr), "GetColorCount failed, hr=%x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + memset(colors, 0, sizeof(colors)); + count = 0; + hr = IWICPalette_GetColors(palette, 4, colors, &count); + ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + ok(!memcmp(colors, initcolors, sizeof(colors)), "got unexpected palette data\n"); + + memset(colors, 0, sizeof(colors)); + count = 0; + hr = IWICPalette_GetColors(palette, 2, colors, &count); + ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(!memcmp(colors, initcolors, sizeof(WICColor)*2), "got unexpected palette data\n"); + + count = 0; + hr = IWICPalette_GetColors(palette, 6, colors, &count); + ok(SUCCEEDED(hr), "GetColors failed, hr=%x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_HasAlpha(palette, &boolresult); + ok(SUCCEEDED(hr), "HasAlpha failed, hr=%x\n", hr); + ok(!boolresult, "expected FALSE, got TRUE\n"); + + hr = IWICPalette_IsBlackWhite(palette, &boolresult); + ok(SUCCEEDED(hr), "IsBlackWhite failed, hr=%x\n", hr); + ok(!boolresult, "expected FALSE, got TRUE\n"); + + hr = IWICPalette_IsGrayscale(palette, &boolresult); + ok(SUCCEEDED(hr), "IsGrayscale failed, hr=%x\n", hr); + ok(!boolresult, "expected FALSE, got TRUE\n"); + + /* try a palette with some alpha in it */ + colors[2] = 0x80ffffff; + hr = IWICPalette_InitializeCustom(palette, colors, 4); + ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr); + + hr = IWICPalette_HasAlpha(palette, &boolresult); + ok(SUCCEEDED(hr), "HasAlpha failed, hr=%x\n", hr); + ok(boolresult, "expected TRUE, got FALSE\n"); + + /* setting to a 0-color palette is acceptable */ + hr = IWICPalette_InitializeCustom(palette, NULL, 0); + ok(SUCCEEDED(hr), "InitializeCustom failed, hr=%x\n", hr); + + /* IWICPalette is paranoid about NULL pointers */ + hr = IWICPalette_GetType(palette, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_GetColorCount(palette, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_InitializeCustom(palette, NULL, 4); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_GetColors(palette, 4, NULL, &count); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_GetColors(palette, 4, colors, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_HasAlpha(palette, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_IsBlackWhite(palette, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + hr = IWICPalette_IsGrayscale(palette, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %x\n", hr); + + IWICPalette_Release(palette); + } + + IWICImagingFactory_Release(factory); +} + +START_TEST(palette) +{ + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + test_custom_palette(); + + CoUninitialize(); +}
1
0
0
0
← Newer
1
...
87
88
89
90
91
92
93
...
107
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Results per page:
10
25
50
100
200