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
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
December 2012
----- 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
2 participants
549 discussions
Start a n
N
ew thread
Caron Jensen : wined3d: Add new Radeon HD 6570 GL renderer string.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: e51bd123156ecdb8c0b7065477f8e16ae7864926 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e51bd123156ecdb8c0b706547…
Author: Caron Jensen <caron(a)codeweavers.com> Date: Fri Dec 28 09:29:30 2012 -0600 wined3d: Add new Radeon HD 6570 GL renderer string. --- dlls/wined3d/directx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 9a1a83c..ce15232 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1711,6 +1711,7 @@ static enum wined3d_pci_device select_card_amd_binary(const struct wined3d_gl_in {"HD 6630M",CARD_AMD_RADEON_HD6600M}, {"HD 6600M",CARD_AMD_RADEON_HD6600M}, {"HD 6600", CARD_AMD_RADEON_HD6600}, + {"HD 6570", CARD_AMD_RADEON_HD6600}, {"HD 6500M",CARD_AMD_RADEON_HD6600M}, {"HD 6500", CARD_AMD_RADEON_HD6600}, {"HD 6400", CARD_AMD_RADEON_HD6400},
1
0
0
0
Jacek Caban : urlmon: Fixed some tests on IE10.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 5487d2c35a07b128a4f570ffd060a6505dfceeed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5487d2c35a07b128a4f570ffd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Dec 28 14:59:42 2012 +0100 urlmon: Fixed some tests on IE10. --- dlls/urlmon/tests/protocol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 889f3a9..89c2a0c 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -2437,7 +2437,7 @@ static BOOL file_protocol_start(IInternetProtocol *protocol, LPCWSTR url, CHECK_CALLED(GetBindInfo); if(!(bindf & BINDF_FROMURLMON)) - CHECK_CALLED(ReportProgress_DIRECTBIND); + CLEAR_CALLED(ReportProgress_DIRECTBIND); /* Not called by IE10 */ if(is_first) { CHECK_CALLED(ReportProgress_SENDINGREQUEST); CHECK_CALLED(ReportProgress_CACHEFILENAMEAVAILABLE);
1
0
0
0
Jacek Caban : atl: Reimplemented AtlModuleRegisterTypeLib on top of AtlRegisterTypeLib.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: c0cfd44ce90aa84ba6c69294831bd1c7e97cee61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0cfd44ce90aa84ba6c692948…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Dec 28 14:23:56 2012 +0100 atl: Reimplemented AtlModuleRegisterTypeLib on top of AtlRegisterTypeLib. --- configure | 2 +- configure.ac | 2 +- dlls/atl/Makefile.in | 2 +- dlls/atl/atl_main.c | 17 ++--------------- dlls/atl80/Makefile.in | 1 + 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 13cd76d..f13d0ed 100755 --- a/configure +++ b/configure @@ -15380,7 +15380,7 @@ wine_fn_config_dll atl enable_atl implib wine_fn_config_test dlls/atl/tests atl_test wine_fn_config_dll atl100 enable_atl100 implib wine_fn_config_test dlls/atl100/tests atl100_test -wine_fn_config_dll atl80 enable_atl80 +wine_fn_config_dll atl80 enable_atl80 implib wine_fn_config_dll authz enable_authz wine_fn_config_dll avicap32 enable_avicap32 implib wine_fn_config_dll avifil32 enable_avifil32 implib,po diff --git a/configure.ac b/configure.ac index f27c201..2cfa4d8 100644 --- a/configure.ac +++ b/configure.ac @@ -2555,7 +2555,7 @@ WINE_CONFIG_DLL(atl,,[implib]) WINE_CONFIG_TEST(dlls/atl/tests) WINE_CONFIG_DLL(atl100,,[implib]) WINE_CONFIG_TEST(dlls/atl100/tests) -WINE_CONFIG_DLL(atl80) +WINE_CONFIG_DLL(atl80,,[implib]) WINE_CONFIG_DLL(authz) WINE_CONFIG_DLL(avicap32,,[implib]) WINE_CONFIG_DLL(avifil32,,[implib,po]) diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in index cb114ff..fb986f9 100644 --- a/dlls/atl/Makefile.in +++ b/dlls/atl/Makefile.in @@ -1,6 +1,6 @@ MODULE = atl.dll IMPORTLIB = atl -IMPORTS = uuid atl100 oleaut32 ole32 user32 +IMPORTS = uuid atl80 atl100 oleaut32 ole32 user32 EXTRADEFS = -D_ATL_VER=_ATL_VER_30 C_SRCS = atl_main.c diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 5ef083e..f75ecee 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -225,7 +225,7 @@ HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const if (bRegTypeLib) { - hRes = AtlModuleRegisterTypeLib(pM, NULL); + hRes = AtlRegisterTypeLib(pM->m_hInstTypeLib, NULL); if (FAILED(hRes)) return hRes; } @@ -276,25 +276,12 @@ HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid, */ HRESULT WINAPI AtlModuleRegisterTypeLib(_ATL_MODULEW *pm, LPCOLESTR lpszIndex) { - HRESULT hRes; - BSTR path; - ITypeLib *typelib; - TRACE("%p %s\n", pm, debugstr_w(lpszIndex)); if (!pm) return E_INVALIDARG; - hRes = AtlModuleLoadTypeLib(pm, lpszIndex, &path, &typelib); - - if (SUCCEEDED(hRes)) - { - hRes = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */ - ITypeLib_Release(typelib); - SysFreeString(path); - } - - return hRes; + return AtlRegisterTypeLib(pm->m_hInstTypeLib, lpszIndex); } /*********************************************************************** diff --git a/dlls/atl80/Makefile.in b/dlls/atl80/Makefile.in index 1b83f5f..71cb651 100644 --- a/dlls/atl80/Makefile.in +++ b/dlls/atl80/Makefile.in @@ -1,4 +1,5 @@ MODULE = atl80.dll +IMPORTLIB = atl80 IMPORTS = atl100 oleaut32 EXTRADEFS = -D_ATL_VER=_ATL_VER_80
1
0
0
0
Jacek Caban : atl80: Added AtlRegisterTypeLib implementation ( based on AtlModuleRegisterTypeLib).
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: ef3f65b5ffe455f4ac43112e7864ab9f14e4fefc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef3f65b5ffe455f4ac43112e7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Dec 28 14:23:27 2012 +0100 atl80: Added AtlRegisterTypeLib implementation (based on AtlModuleRegisterTypeLib). --- dlls/atl80/Makefile.in | 1 + dlls/atl80/atl80.c | 31 ++++++++++++++++++++++++++++--- dlls/atl80/atl80.spec | 2 +- include/atlbase.h | 1 + 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dlls/atl80/Makefile.in b/dlls/atl80/Makefile.in index 70f416f..1b83f5f 100644 --- a/dlls/atl80/Makefile.in +++ b/dlls/atl80/Makefile.in @@ -1,4 +1,5 @@ MODULE = atl80.dll +IMPORTS = atl100 oleaut32 EXTRADEFS = -D_ATL_VER=_ATL_VER_80 diff --git a/dlls/atl80/atl80.c b/dlls/atl80/atl80.c index b250d32..c85f75e 100644 --- a/dlls/atl80/atl80.c +++ b/dlls/atl80/atl80.c @@ -16,11 +16,36 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <stdarg.h> -#include "windef.h" -#include "winbase.h" +#define COBJMACROS + #include "atlbase.h" +#include "wine/debug.h" +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(atl); + +/*********************************************************************** + * AtlRegisterTypeLib [atl80.19] + */ +HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE inst, const WCHAR *index) +{ + ITypeLib *typelib; + BSTR path; + HRESULT hres; + + TRACE("(%p %s)\n", inst, debugstr_w(index)); + + hres = AtlLoadTypeLib(inst, index, &path, &typelib); + if(FAILED(hres)) + return hres; + + hres = RegisterTypeLib(typelib, path, NULL); /* FIXME: pass help directory */ + ITypeLib_Release(typelib); + SysFreeString(path); + return hres; +} + /*********************************************************************** * AtlGetVersion [atl80.@] */ diff --git a/dlls/atl80/atl80.spec b/dlls/atl80/atl80.spec index c6e589e..e4d73f1 100644 --- a/dlls/atl80/atl80.spec +++ b/dlls/atl80/atl80.spec @@ -6,7 +6,7 @@ 15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr) atl100.AtlComModuleGetClassObject 17 stub AtlComModuleRegisterClassObjects 18 stub AtlComModuleRegisterServer(ptr long ptr) -19 stub AtlRegisterTypeLib(ptr wstr) +19 stdcall AtlRegisterTypeLib(ptr wstr) 20 stub AtlComModuleRevokeClassObjects 22 stub AtlComModuleUnregisterServer 23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr) atl100.AtlUpdateRegistryFromResourceD diff --git a/include/atlbase.h b/include/atlbase.h index ee8167c..39c3741 100644 --- a/include/atlbase.h +++ b/include/atlbase.h @@ -252,6 +252,7 @@ HRESULT WINAPI AtlUnmarshalPtr(IStream *pStream, const IID *iid, IUnknown **ppUn HRESULT WINAPI AtlCreateRegistrar(IRegistrar**); HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE,LPCOLESTR,BOOL,struct _ATL_REGMAP_ENTRY*,IRegistrar*); HRESULT WINAPI AtlLoadTypeLib(HINSTANCE,LPCOLESTR,BSTR*,ITypeLib**); +HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE,LPCOLESTR); HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID,const struct _ATL_CATMAP_ENTRY*,BOOL); HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE*,REFCLSID,REFIID,void**);
1
0
0
0
Jacek Caban : atl100: Added support for typelibs in separate files in AtlLoadTypeLib.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 7d23d3ecd64d77a2f4310b04e19d9d1a7fc6542e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d23d3ecd64d77a2f4310b04e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Dec 28 14:23:07 2012 +0100 atl100: Added support for typelibs in separate files in AtlLoadTypeLib. --- dlls/atl100/atl.c | 56 +++++++++++++++++++++++++++++++++++----- dlls/atl100/tests/Makefile.in | 2 +- dlls/atl100/tests/atl.c | 45 +++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 8 deletions(-) diff --git a/dlls/atl100/atl.c b/dlls/atl100/atl.c index 219365d..accc88c 100644 --- a/dlls/atl100/atl.c +++ b/dlls/atl100/atl.c @@ -22,9 +22,20 @@ #include "atlbase.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(atl100); +static inline void *heap_alloc(size_t len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); +} + static ICatRegister *catreg; /*********************************************************************** @@ -268,25 +279,56 @@ void WINAPI AtlCallTermFunc(_ATL_MODULE *pM) } /*********************************************************************** - * AtlLoadTypeLib [atl100.@] + * AtlLoadTypeLib [atl100.56] */ HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib) { - OLECHAR path[MAX_PATH+8]; /* leave some space for index */ + size_t path_len, index_len; + ITypeLib *typelib = NULL; + WCHAR *path; HRESULT hres; + static const WCHAR tlb_extW[] = {'.','t','l','b',0}; + TRACE("(%p %s %p %p)\n", inst, debugstr_w(lpszIndex), pbstrPath, ppTypeLib); - GetModuleFileNameW(inst, path, MAX_PATH); - if(lpszIndex) - lstrcatW(path, lpszIndex); + index_len = lpszIndex ? strlenW(lpszIndex) : 0; + path = heap_alloc((MAX_PATH+index_len)*sizeof(WCHAR) + sizeof(tlb_extW)); + if(!path) + return E_OUTOFMEMORY; + + path_len = GetModuleFileNameW(inst, path, MAX_PATH); + if(!path_len) + return HRESULT_FROM_WIN32(GetLastError()); + + if(index_len) + memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR)); + + hres = LoadTypeLib(path, &typelib); + if(FAILED(hres)) { + WCHAR *ptr; + + for(ptr = path+path_len-1; ptr > path && *ptr != '\\' && *ptr != '.'; ptr--); + if(*ptr != '.') + ptr = path+path_len; + memcpy(ptr, tlb_extW, sizeof(tlb_extW)); + hres = LoadTypeLib(path, &typelib); + } + + if(SUCCEEDED(hres)) { + *pbstrPath = SysAllocString(path); + if(!*pbstrPath) { + ITypeLib_Release(typelib); + hres = E_OUTOFMEMORY; + } + } - hres = LoadTypeLib(path, ppTypeLib); + heap_free(path); if(FAILED(hres)) return hres; - *pbstrPath = SysAllocString(path); + *ppTypeLib = typelib; return S_OK; } diff --git a/dlls/atl100/tests/Makefile.in b/dlls/atl100/tests/Makefile.in index 29e83d0..7af0bcd 100644 --- a/dlls/atl100/tests/Makefile.in +++ b/dlls/atl100/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = atl100.dll -IMPORTS = atl100 ole32 advapi32 +IMPORTS = atl100 oleaut32 ole32 advapi32 EXTRADEFS = -D_ATL_VER=_ATL_VER_100 C_SRCS = \ diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c index 59268de..35ef34b 100644 --- a/dlls/atl100/tests/atl.c +++ b/dlls/atl100/tests/atl.c @@ -156,12 +156,57 @@ static void test_regcat(void) test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}"); } +static void test_typelib(void) +{ + ITypeLib *typelib; + HINSTANCE inst; + size_t len; + BSTR path; + HRESULT hres; + + static const WCHAR scrrun_dll_suffixW[] = {'\\','s','c','r','r','u','n','.','d','l','l',0}; + static const WCHAR mshtml_tlb_suffixW[] = {'\\','m','s','h','t','m','l','.','t','l','b',0}; + + inst = LoadLibraryA("scrrun.dll"); + ok(inst != NULL, "Could not load scrrun.dll\n"); + + typelib = NULL; + hres = AtlLoadTypeLib(inst, NULL, &path, &typelib); + ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres); + FreeLibrary(inst); + + len = SysStringLen(path); + ok(len > sizeof(scrrun_dll_suffixW)/sizeof(WCHAR) + && lstrcmpiW(path+len-sizeof(scrrun_dll_suffixW)/sizeof(WCHAR), scrrun_dll_suffixW), + "unexpected path %s\n", wine_dbgstr_w(path)); + SysFreeString(path); + ok(typelib != NULL, "typelib == NULL\n"); + ITypeLib_Release(typelib); + + inst = LoadLibraryA("mshtml.dll"); + ok(inst != NULL, "Could not load mshtml.dll\n"); + + typelib = NULL; + hres = AtlLoadTypeLib(inst, NULL, &path, &typelib); + ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres); + FreeLibrary(inst); + + len = SysStringLen(path); + ok(len > sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR) + && lstrcmpiW(path+len-sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR), mshtml_tlb_suffixW), + "unexpected path %s\n", wine_dbgstr_w(path)); + SysFreeString(path); + ok(typelib != NULL, "typelib == NULL\n"); + ITypeLib_Release(typelib); +} + START_TEST(atl) { CoInitialize(NULL); test_winmodule(); test_regcat(); + test_typelib(); CoUninitialize(); }
1
0
0
0
Nikolay Sivov : xmllite: Implement decoding new input chunk from stream, use it for comment parsing.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 5c2005ea14e7fc5217615044c9488b8de017c971 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c2005ea14e7fc5217615044c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 28 12:17:06 2012 +0400 xmllite: Implement decoding new input chunk from stream, use it for comment parsing. --- dlls/xmllite/reader.c | 94 +++++++++++++++++++++++++++++++++++------- dlls/xmllite/xmllite_main.c | 2 +- 2 files changed, 79 insertions(+), 17 deletions(-) diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index c802550..a6caf66 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -361,7 +361,9 @@ static HRESULT readerinput_query_for_stream(xmlreaderinput *readerinput) static HRESULT readerinput_growraw(xmlreaderinput *readerinput) { encoded_buffer *buffer = &readerinput->buffer->encoded; - ULONG len = buffer->allocated - buffer->written, read; + /* to make sure aligned length won't exceed allocated length */ + ULONG len = buffer->allocated - buffer->written - 4; + ULONG read; HRESULT hr; /* always try to get aligned to 4 bytes, so the only case we can get partialy read characters is @@ -445,20 +447,37 @@ static int readerinput_get_utf8_convlen(xmlreaderinput *readerinput) return len; } -/* returns byte length of complete char sequence for specified code page, */ -static int readerinput_get_convlen(xmlreaderinput *readerinput, UINT cp) +/* Returns byte length of complete char sequence for buffer code page, + it's relative to current buffer position which is currently used for BOM handling + only. */ +static int readerinput_get_convlen(xmlreaderinput *readerinput) { encoded_buffer *buffer = &readerinput->buffer->encoded; int len; - if (cp == CP_UTF8) + if (readerinput->buffer->code_page == CP_UTF8) len = readerinput_get_utf8_convlen(readerinput); else len = buffer->written; + TRACE("%d\n", len - (int)(buffer->cur - buffer->data)); return len - (buffer->cur - buffer->data); } +/* It's possbile that raw buffer has some leftovers from last conversion - some char + sequence that doesn't represent a full code point. Length argument should be calculated with + readerinput_get_convlen(). */ +static void readerinput_shrinkraw(xmlreaderinput *readerinput, int len) +{ + encoded_buffer *buffer = &readerinput->buffer->encoded; + memmove(buffer->data, buffer->cur + (buffer->written - len), len); + /* everything lower cur is lost too */ + buffer->written -= len + (buffer->cur - buffer->data); + /* after this point we don't need cur pointer really, + it's used only to mark where actual data begins when first chunk is read */ + buffer->cur = buffer->data; +} + /* note that raw buffer content is kept */ static void readerinput_switchencoding(xmlreaderinput *readerinput, xml_encoding enc) { @@ -472,7 +491,8 @@ static void readerinput_switchencoding(xmlreaderinput *readerinput, xml_encoding hr = get_code_page(enc, &cp); if (FAILED(hr)) return; - len = readerinput_get_convlen(readerinput, cp); + readerinput->buffer->code_page = cp; + len = readerinput_get_convlen(readerinput); TRACE("switching to cp %d\n", cp); @@ -482,7 +502,6 @@ static void readerinput_switchencoding(xmlreaderinput *readerinput, xml_encoding readerinput_grow(readerinput, len); memcpy(dest->data, src->cur, len); dest->written += len*sizeof(WCHAR); - readerinput->buffer->code_page = cp; return; } @@ -491,7 +510,6 @@ static void readerinput_switchencoding(xmlreaderinput *readerinput, xml_encoding ptr = (WCHAR*)dest->data; MultiByteToWideChar(cp, 0, src->cur, len, ptr, dest_len); ptr[dest_len] = 0; - readerinput->buffer->code_page = cp; dest->written += dest_len*sizeof(WCHAR); } @@ -510,9 +528,45 @@ static void reader_shrink(xmlreader *reader) } } +/* This is a normal way for reader to get new data converted from raw buffer to utf16 buffer. + It won't attempt to shrink but will grow destination buffer if needed */ +static void reader_more(xmlreader *reader) +{ + xmlreaderinput *readerinput = reader->input; + encoded_buffer *src = &readerinput->buffer->encoded; + encoded_buffer *dest = &readerinput->buffer->utf16; + UINT cp = readerinput->buffer->code_page; + int len, dest_len; + WCHAR *ptr; + + /* get some raw data from stream first */ + readerinput_growraw(readerinput); + len = readerinput_get_convlen(readerinput); + + /* just copy for UTF-16 case */ + if (cp == ~0) + { + readerinput_grow(readerinput, len); + memcpy(dest->data, src->cur, len); + dest->written += len*sizeof(WCHAR); + return; + } + + dest_len = MultiByteToWideChar(cp, 0, src->cur, len, NULL, 0); + readerinput_grow(readerinput, dest_len); + ptr = (WCHAR*)dest->data; + MultiByteToWideChar(cp, 0, src->cur, len, ptr, dest_len); + ptr[dest_len] = 0; + dest->written += dest_len*sizeof(WCHAR); + /* get rid of processed data */ + readerinput_shrinkraw(readerinput, len); +} + static inline const WCHAR *reader_get_cur(xmlreader *reader) { - return (WCHAR*)reader->input->buffer->utf16.cur; + WCHAR *ptr = (WCHAR*)reader->input->buffer->utf16.cur; + if (!*ptr) reader_more(reader); + return ptr; } static int reader_cmp(xmlreader *reader, const WCHAR *str) @@ -794,18 +848,26 @@ static HRESULT reader_parse_comment(xmlreader *reader) while (*ptr) { - if (ptr[0] == '-' && ptr[1] == '-') + if (ptr[0] == '-') { - if (ptr[2] == '>') + if (ptr[1] == '-') { - TRACE("%s\n", debugstr_wn(start, ptr-start)); - /* skip '-->' */ - reader_skipn(reader, 3); - reader->nodetype = XmlNodeType_Comment; - return S_OK; + if (ptr[2] == '>') + { + TRACE("%s\n", debugstr_wn(start, ptr-start)); + /* skip '-->' */ + reader_skipn(reader, 3); + reader->nodetype = XmlNodeType_Comment; + return S_OK; + } + else + return WC_E_COMMENT; } else - return WC_E_COMMENT; + { + ptr++; + reader_more(reader); + } } else { diff --git a/dlls/xmllite/xmllite_main.c b/dlls/xmllite/xmllite_main.c index d72903a..43833bc 100644 --- a/dlls/xmllite/xmllite_main.c +++ b/dlls/xmllite/xmllite_main.c @@ -30,7 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(xmllite); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + TRACE("(%p, %u, %p)\n", hinstDLL, fdwReason, lpvReserved); switch (fdwReason) {
1
0
0
0
Nikolay Sivov : oledb32: Support data source properties from init string passed to GetDataSource().
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 3e8d4e76e5daf46ca3d2776a0aedcde51226c48d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3e8d4e76e5daf46ca3d2776a0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 28 14:59:23 2012 +0400 oledb32: Support data source properties from init string passed to GetDataSource(). --- dlls/oledb32/datainit.c | 84 +++++++++++++++++++++++++++++++++++++++-- dlls/oledb32/tests/database.c | 2 +- 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index 1316c0f..c710367 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -289,6 +289,32 @@ static void free_dbpropset(ULONG count, DBPROPSET *propset) CoTaskMemFree(propset); } +static HRESULT set_dbpropset(BSTR name, BSTR value, DBPROPSET **propset) +{ + static const WCHAR datasourceW[] = {'D','a','t','a',' ','S','o','u','r','c','e',0}; + + *propset = CoTaskMemAlloc(sizeof(DBPROPSET)); + (*propset)->rgProperties = CoTaskMemAlloc(sizeof(DBPROP)); + + if (!strcmpW(datasourceW, name)) + { + (*propset)->cProperties = 1; + (*propset)->guidPropertySet = DBPROPSET_DBINIT; + (*propset)->rgProperties[0].dwPropertyID = DBPROP_INIT_DATASOURCE; + (*propset)->rgProperties[0].dwOptions = DBPROPOPTIONS_REQUIRED; + (*propset)->rgProperties[0].dwStatus = 0; + memset(&(*propset)->rgProperties[0].colid, 0, sizeof(DBID)); + V_VT(&(*propset)->rgProperties[0].vValue) = VT_BSTR; + V_BSTR(&(*propset)->rgProperties[0].vValue) = SysAllocString(value); + return S_OK; + } + else + { + FIXME("unsupported property %s\n", debugstr_w(name)); + return E_FAIL; + } +} + /*** IDataInitialize methods ***/ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *outer, DWORD clsctx, LPWSTR initstring, REFIID riid, IUnknown **datasource) @@ -296,11 +322,13 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o static const WCHAR providerW[] = {'P','r','o','v','i','d','e','r','=',0}; static const WCHAR msdasqlW[] = {'M','S','D','A','S','Q','L',0}; datainit *This = impl_from_IDataInitialize(iface); + IDBProperties *dbprops; + DBPROPSET *propset; WCHAR *prov = NULL; CLSID provclsid; HRESULT hr; - FIXME("(%p)->(%p 0x%x %s %s %p): semi-stub\n", This, outer, clsctx, debugstr_w(initstring), debugstr_guid(riid), datasource); + TRACE("(%p)->(%p 0x%x %s %s %p)\n", This, outer, clsctx, debugstr_w(initstring), debugstr_guid(riid), datasource); /* first get provider name */ provclsid = IID_NULL; @@ -340,9 +368,7 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o /* check for provider mismatch if it was specified in init string */ if (*datasource && prov) { - IDBProperties *dbprops; DBPROPIDSET propidset; - DBPROPSET *propset; enum DBPROPENUM prop; CLSID initprov; ULONG count; @@ -385,7 +411,57 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o hr = create_db_init((void**)datasource); } - /* FIXME: set properties from init string */ + /* now set properties */ + if (initstring) + { + static const WCHAR scolW[] = {';',0}; + static const WCHAR eqW[] = {'=',0}; + WCHAR *eq, *start; + + hr = IUnknown_QueryInterface(*datasource, &IID_IDBProperties, (void**)&dbprops); + if (FAILED(hr)) + { + WARN("provider doesn't support IDBProperties\n"); + return hr; + } + + start = initstring; + while ((eq = strstrW(start, eqW))) + { + static const WCHAR providerW[] = {'P','r','o','v','i','d','e','r',0}; + WCHAR *scol = strstrW(eq+1, scolW); + BSTR value, name; + + name = SysAllocStringLen(start, eq - start); + /* skip equal sign to get value */ + eq++; + value = SysAllocStringLen(eq, scol ? scol - eq : -1); + + /* skip semicolon if present */ + if (scol) scol++; + start = scol; + + if (!strcmpW(name, providerW)) + { + SysFreeString(name); + SysFreeString(value); + continue; + } + + TRACE("property (name=%s, value=%s)\n", debugstr_w(name), debugstr_w(value)); + + hr = set_dbpropset(name, value, &propset); + SysFreeString(name); + SysFreeString(value); + if (FAILED(hr)) return hr; + + hr = IDBProperties_SetProperties(dbprops, 1, propset); + free_dbpropset(1, propset); + TRACE("provider ret 0x%08x\n", hr); + } + + IDBProperties_Release(dbprops); + } return hr; } diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c index ede1074..4d3694c 100644 --- a/dlls/oledb32/tests/database.c +++ b/dlls/oledb32/tests/database.c @@ -58,7 +58,7 @@ static void test_GetDataSource(WCHAR *initstring) static void test_database(void) { static WCHAR initstring_jet[] = {'P','r','o','v','i','d','e','r','=','M','i','c','r','o','s','o','f','t','.', - 'J','e','t','.','O','L','E','D','B','.','4','.','0',';',0, + 'J','e','t','.','O','L','E','D','B','.','4','.','0',';', 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';',0}; static WCHAR initstring_default[] = {'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';',0}; IDataInitialize *datainit = NULL;
1
0
0
0
André Hentschel : netstat: Initial implementation.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 6e989604a32249c3a74834fa9a47438a81445b99 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e989604a32249c3a74834fa9…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Thu Dec 27 19:03:38 2012 +0100 netstat: Initial implementation. --- configure | 1 + configure.ac | 1 + po/ar.po | 69 ++++++++++++++ po/bg.po | 73 +++++++++++++++ po/ca.po | 76 ++++++++++++++++ po/cs.po | 75 +++++++++++++++ po/da.po | 76 ++++++++++++++++ po/de.po | 76 ++++++++++++++++ po/el.po | 72 +++++++++++++++ po/en.po | 68 ++++++++++++++ po/en_US.po | 68 ++++++++++++++ po/eo.po | 74 +++++++++++++++ po/es.po | 76 ++++++++++++++++ po/fa.po | 69 ++++++++++++++ po/fi.po | 76 ++++++++++++++++ po/fr.po | 76 ++++++++++++++++ po/he.po | 76 ++++++++++++++++ po/hi.po | 68 ++++++++++++++ po/hu.po | 76 ++++++++++++++++ po/it.po | 76 ++++++++++++++++ po/ja.po | 76 ++++++++++++++++ po/ko.po | 76 ++++++++++++++++ po/lt.po | 76 ++++++++++++++++ po/ml.po | 68 ++++++++++++++ po/nb_NO.po | 76 ++++++++++++++++ po/nl.po | 76 ++++++++++++++++ po/or.po | 68 ++++++++++++++ po/pa.po | 68 ++++++++++++++ po/pl.po | 76 ++++++++++++++++ po/pt_BR.po | 76 ++++++++++++++++ po/pt_PT.po | 76 ++++++++++++++++ po/rm.po | 68 ++++++++++++++ po/ro.po | 76 ++++++++++++++++ po/ru.po | 76 ++++++++++++++++ po/sk.po | 76 ++++++++++++++++ po/sl.po | 76 ++++++++++++++++ po/sr_RS(a)cyrillic.po | 74 +++++++++++++++ po/sr_RS(a)latin.po | 74 +++++++++++++++ po/sv.po | 76 ++++++++++++++++ po/te.po | 68 ++++++++++++++ po/th.po | 72 +++++++++++++++ po/tr.po | 76 ++++++++++++++++ po/uk.po | 76 ++++++++++++++++ po/wa.po | 68 ++++++++++++++ po/wine.pot | 68 ++++++++++++++ po/zh_CN.po | 74 +++++++++++++++ po/zh_TW.po | 76 ++++++++++++++++ programs/netstat/Makefile.in | 10 ++ programs/netstat/netstat.c | 206 ++++++++++++++++++++++++++++++++++++++++++ programs/netstat/netstat.h | 38 ++++++++ programs/netstat/netstat.rc | 45 +++++++++ 51 files changed, 3607 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6e989604a32249c3a7483…
1
0
0
0
Jacek Caban : wininet: Properly handle output buffer size in InternetGetCookieA.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: f877fe9ba4562edb19752b456b7bd908fd5dc95d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f877fe9ba4562edb19752b456…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Dec 27 17:54:29 2012 +0100 wininet: Properly handle output buffer size in InternetGetCookieA. --- dlls/wininet/cookie.c | 16 +++++++++++++--- dlls/wininet/tests/internet.c | 7 +++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index cd761b1..76f9ac5 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -678,7 +678,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, LPSTR lpCookieData, LPDWORD lpdwSize) { WCHAR *url, *name; - DWORD len; + DWORD len, size; BOOL r; TRACE("(%s %s %p %p(%u))\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName), @@ -701,8 +701,18 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, { r = InternetGetCookieW( url, name, szCookieData, &len ); - *lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len, - lpCookieData, lpCookieData ? *lpdwSize : 0, NULL, NULL ); + if(r) { + size = WideCharToMultiByte( CP_ACP, 0, szCookieData, len, NULL, 0, NULL, NULL); + if(lpCookieData) { + if(*lpdwSize >= size) { + WideCharToMultiByte( CP_ACP, 0, szCookieData, len, lpCookieData, *lpdwSize, NULL, NULL); + }else { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + r = FALSE; + } + } + *lpdwSize = size; + } heap_free( szCookieData ); } diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index 8b0071c..c93c37a 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -414,6 +414,13 @@ static void test_complicated_cookie(void) ok(strstr(buffer,"M=N")==NULL,"M=N present\n"); ok(strstr(buffer,"O=P")==NULL,"O=P present\n"); + len = 10; + memset(buffer, 0xac, sizeof(buffer)); + ret = InternetGetCookie("
http://testing.example.com
", NULL, buffer, &len); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "InternetGetCookie returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError()); + ok(len == 19, "len = %u\n", len); + len = 1024; ret = InternetGetCookieW(testing_example_comW, NULL, NULL, &len); ok(ret == TRUE,"InternetGetCookieW failed\n");
1
0
0
0
Jacek Caban : wininet: Properly handle output buffer size in InternetGetCookieW.
by Alexandre Julliard
28 Dec '12
28 Dec '12
Module: wine Branch: master Commit: 0c02e358418986c8139b787d098a1c41c8014254 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0c02e358418986c8139b787d0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Dec 27 17:54:19 2012 +0100 wininet: Properly handle output buffer size in InternetGetCookieW. --- dlls/wininet/cookie.c | 75 +++++++++++++++++++++++++--------------- dlls/wininet/http.c | 2 +- dlls/wininet/internet.h | 2 +- dlls/wininet/tests/internet.c | 7 ++++ 4 files changed, 56 insertions(+), 30 deletions(-) diff --git a/dlls/wininet/cookie.c b/dlls/wininet/cookie.c index 0dd93d9..cd761b1 100644 --- a/dlls/wininet/cookie.c +++ b/dlls/wininet/cookie.c @@ -31,6 +31,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <assert.h> #ifdef HAVE_UNISTD_H # include <unistd.h> #endif @@ -529,9 +530,10 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain) heap_free(deadDomain); } -BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) +DWORD get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) { - unsigned cnt = 0, len, domain_count = 0, cookie_count = 0; + unsigned cnt = 0, len, name_len, domain_count = 0, cookie_count = 0; + WCHAR *ptr = cookie_data; cookie_domain *domain; FILETIME tm; @@ -562,49 +564,62 @@ BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD continue; } - if(!cookie_data) { /* return the size of the buffer required to lpdwSize */ - if (cookie_count) - cnt += 2; /* '; ' */ - cnt += strlenW(cookie_iter->lpCookieName); - if ((len = strlenW(cookie_iter->lpCookieData))) { - cnt += 1; /* = */ - cnt += len; - } - }else { - static const WCHAR szsc[] = { ';',' ',0 }; - static const WCHAR szname[] = { '%','s',0 }; - static const WCHAR szdata[] = { '=','%','s',0 }; - - if (cookie_count) cnt += snprintfW(cookie_data + cnt, *size - cnt, szsc); - cnt += snprintfW(cookie_data + cnt, *size - cnt, szname, cookie_iter->lpCookieName); - - if (cookie_iter->lpCookieData[0]) - cnt += snprintfW(cookie_data + cnt, *size - cnt, szdata, cookie_iter->lpCookieData); + if (cookie_count) + cnt += 2; /* '; ' */ + cnt += name_len = strlenW(cookie_iter->lpCookieName); + if ((len = strlenW(cookie_iter->lpCookieData))) { + cnt += 1; /* = */ + cnt += len; + } - TRACE("Cookie: %s\n", debugstr_w(cookie_data)); + if(ptr) { + if(*size > cnt) { + if(cookie_count) { + *ptr++ = ';'; + *ptr++ = ' '; + } + + memcpy(ptr, cookie_iter->lpCookieName, name_len*sizeof(WCHAR)); + ptr += name_len; + + if(len) { + *ptr++ = '='; + memcpy(ptr, cookie_iter->lpCookieData, len*sizeof(WCHAR)); + ptr += len; + } + + assert(cookie_data+cnt == ptr); + TRACE("Cookie: %s\n", debugstr_wn(cookie_data, cnt)); + }else { + /* Stop writing data, just compute the size */ + ptr = NULL; + } } + cookie_count++; } } LeaveCriticalSection(&cookie_cs); - if (!domain_count) { + if(ptr) + *ptr = 0; + + if (!cnt) { TRACE("no cookies found for %s\n", debugstr_w(host)); - SetLastError(ERROR_NO_MORE_ITEMS); - return FALSE; + return ERROR_NO_MORE_ITEMS; } - if(!cookie_data) { + if(!cookie_data || !ptr) { *size = (cnt + 1) * sizeof(WCHAR); TRACE("returning %u\n", *size); - return TRUE; + return cookie_data ? ERROR_INSUFFICIENT_BUFFER : ERROR_SUCCESS; } *size = cnt + 1; TRACE("Returning %u (from %u domains): %s\n", cnt, domain_count, debugstr_w(cookie_data)); - return cnt != 0; + return ERROR_SUCCESS; } /*********************************************************************** @@ -624,6 +639,7 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, LPWSTR lpCookieData, LPDWORD lpdwSize) { WCHAR host[INTERNET_MAX_HOST_NAME_LENGTH], path[INTERNET_MAX_PATH_LENGTH]; + DWORD res; BOOL ret; TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), lpCookieData, lpdwSize); @@ -641,7 +657,10 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, return FALSE; } - return get_cookie(host, path, lpCookieData, lpdwSize); + res = get_cookie(host, path, lpCookieData, lpdwSize); + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index f890363..9e3e8e4 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4008,7 +4008,7 @@ static void HTTP_InsertCookies(http_request_t *request) if(!host) return; - if(!get_cookie(host->lpszValue, request->path, NULL, &cookie_size)) + if(get_cookie(host->lpszValue, request->path, NULL, &cookie_size) != ERROR_SUCCESS) return; size = sizeof(cookieW) + cookie_size * sizeof(WCHAR) + sizeof(szCrLf); diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 10002d4..3d2bd35 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -517,7 +517,7 @@ DWORD HTTP_Connect(appinfo_t*,LPCWSTR, BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, struct sockaddr *psa, socklen_t *sa_len) DECLSPEC_HIDDEN; -BOOL get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN; +DWORD get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN; BOOL set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN; diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index 1b4ee46..8b0071c 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -426,6 +426,13 @@ static void test_complicated_cookie(void) ok(len == 19, "len = %u\n", len); ok(lstrlenW(wbuf) == 18, "strlenW(wbuf) = %u\n", lstrlenW(wbuf)); + len = 10; + memset(wbuf, 0xac, sizeof(wbuf)); + ret = InternetGetCookieW(testing_example_comW, NULL, wbuf, &len); + ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "InternetGetCookieW returned: %x(%u), expected ERROR_INSUFFICIENT_BUFFER\n", ret, GetLastError()); + ok(len == 38, "len = %u\n", len); + len = 1024; ret = InternetGetCookie("
http://testing.example.com/foobar
", NULL, buffer, &len); ok(ret == TRUE,"InternetGetCookie failed\n");
1
0
0
0
← Newer
1
2
3
4
...
55
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
Results per page:
10
25
50
100
200