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
June 2015
----- 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
610 discussions
Start a n
N
ew thread
Nikolay Sivov : kernel32: Simplify the way EnumCalendarInfo vs EnumCalendarInfoEx are handled internally.
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: c1c42d3caf1af36400006c3e4dfe67c519f65028 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c1c42d3caf1af36400006c3e4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jun 28 15:58:30 2015 +0300 kernel32: Simplify the way EnumCalendarInfo vs EnumCalendarInfoEx are handled internally. --- dlls/kernel32/lcformat.c | 122 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 38 deletions(-) diff --git a/dlls/kernel32/lcformat.c b/dlls/kernel32/lcformat.c index 8ec1d8a..ea96167 100644 --- a/dlls/kernel32/lcformat.c +++ b/dlls/kernel32/lcformat.c @@ -1971,26 +1971,29 @@ BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) return TRUE; } +enum enumcalendar_callback_type { + CALLBACK_ENUMPROC, + CALLBACK_ENUMPROCEX, +}; + +struct enumcalendar_context { + enum enumcalendar_callback_type type; /* callback kind */ + union { + CALINFO_ENUMPROCW callback; /* user callback pointer */ + CALINFO_ENUMPROCEXW callbackex; + } u; + LCID lcid; /* locale of interest */ + CALID calendar; /* specific calendar or ENUM_ALL_CALENDARS */ + CALTYPE caltype; /* calendar information type */ + BOOL unicode; /* A vs W callback type, only for regular and Ex callbacks */ +}; + /****************************************************************************** - * NLS_EnumCalendarInfoAW <internal> + * NLS_EnumCalendarInfo <internal> * Enumerates calendar information for a specified locale. * * PARAMS - * calinfoproc [I] Pointer to the callback - * locale [I] The locale for which to retrieve calendar information. - * This parameter can be a locale identifier created by the - * MAKELCID macro, or one of the following values: - * LOCALE_SYSTEM_DEFAULT - * Use the default system locale. - * LOCALE_USER_DEFAULT - * Use the default user locale. - * calendar [I] The calendar for which information is requested, or - * ENUM_ALL_CALENDARS. - * caltype [I] The type of calendar information to be returned. Note - * that only one CALTYPE value can be specified per call - * of this function, except where noted. - * unicode [I] Specifies if the callback expects a unicode string. - * ex [I] Specifies if the callback needs the calendar identifier. + * ctxt [I] enumeration context, see 'struct enumcalendar_context' * * RETURNS * Success: TRUE. @@ -2005,14 +2008,14 @@ BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) * TODO * The above note should be respected by GetCalendarInfoA. */ -static BOOL NLS_EnumCalendarInfoAW(void *calinfoproc, LCID locale, - CALID calendar, CALTYPE caltype, BOOL unicode, BOOL ex ) +static BOOL NLS_EnumCalendarInfo(const struct enumcalendar_context *ctxt) { WCHAR *buf, *opt = NULL, *iter = NULL; + CALID calendar = ctxt->calendar; BOOL ret = FALSE; int bufSz = 200; /* the size of the buffer */ - if (calinfoproc == NULL) + if (ctxt->u.callback == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; @@ -2027,7 +2030,7 @@ static BOOL NLS_EnumCalendarInfoAW(void *calinfoproc, LCID locale, if (calendar == ENUM_ALL_CALENDARS) { - int optSz = GetLocaleInfoW(locale, LOCALE_IOPTIONALCALENDAR, NULL, 0); + int optSz = GetLocaleInfoW(ctxt->lcid, LOCALE_IOPTIONALCALENDAR, NULL, 0); if (optSz > 1) { opt = HeapAlloc(GetProcessHeap(), 0, optSz * sizeof(WCHAR)); @@ -2036,30 +2039,30 @@ static BOOL NLS_EnumCalendarInfoAW(void *calinfoproc, LCID locale, SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - if (GetLocaleInfoW(locale, LOCALE_IOPTIONALCALENDAR, opt, optSz)) + if (GetLocaleInfoW(ctxt->lcid, LOCALE_IOPTIONALCALENDAR, opt, optSz)) iter = opt; } - calendar = NLS_GetLocaleNumber(locale, LOCALE_ICALENDARTYPE); + calendar = NLS_GetLocaleNumber(ctxt->lcid, LOCALE_ICALENDARTYPE); } while (TRUE) /* loop through calendars */ { do /* loop until there's no error */ { - if (caltype & CAL_RETURN_NUMBER) - ret = GetCalendarInfoW(locale, calendar, caltype, NULL, bufSz / sizeof(WCHAR), (LPDWORD)buf); - else if (unicode) - ret = GetCalendarInfoW(locale, calendar, caltype, buf, bufSz / sizeof(WCHAR), NULL); - else ret = GetCalendarInfoA(locale, calendar, caltype, (CHAR*)buf, bufSz / sizeof(CHAR), NULL); + if (ctxt->caltype & CAL_RETURN_NUMBER) + ret = GetCalendarInfoW(ctxt->lcid, calendar, ctxt->caltype, NULL, bufSz / sizeof(WCHAR), (LPDWORD)buf); + else if (ctxt->unicode) + ret = GetCalendarInfoW(ctxt->lcid, calendar, ctxt->caltype, buf, bufSz / sizeof(WCHAR), NULL); + else ret = GetCalendarInfoA(ctxt->lcid, calendar, ctxt->caltype, (CHAR*)buf, bufSz / sizeof(CHAR), NULL); if (!ret) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { /* so resize it */ int newSz; - if (unicode) - newSz = GetCalendarInfoW(locale, calendar, caltype, NULL, 0, NULL) * sizeof(WCHAR); - else newSz = GetCalendarInfoA(locale, calendar, caltype, NULL, 0, NULL) * sizeof(CHAR); + if (ctxt->unicode) + newSz = GetCalendarInfoW(ctxt->lcid, calendar, ctxt->caltype, NULL, 0, NULL) * sizeof(WCHAR); + else newSz = GetCalendarInfoA(ctxt->lcid, calendar, ctxt->caltype, NULL, 0, NULL) * sizeof(CHAR); if (bufSz >= newSz) { ERR("Buffer resizing disorder: was %d, requested %d.\n", bufSz, newSz); @@ -2079,10 +2082,17 @@ static BOOL NLS_EnumCalendarInfoAW(void *calinfoproc, LCID locale, * we must check for Ex, but we don't care about Unicode * because the buffer is already in the correct format. */ - if (ex) { - ret = ((CALINFO_ENUMPROCEXW)calinfoproc)(buf, calendar); - } else - ret = ((CALINFO_ENUMPROCW)calinfoproc)(buf); + switch (ctxt->type) + { + case CALLBACK_ENUMPROC: + ret = ctxt->u.callback(buf); + break; + case CALLBACK_ENUMPROCEX: + ret = ctxt->u.callbackex(buf, calendar); + break; + default: + ; + } if (!ret) { /* the callback told to stop */ ret = TRUE; @@ -2118,8 +2128,17 @@ cleanup: BOOL WINAPI EnumCalendarInfoA( CALINFO_ENUMPROCA calinfoproc,LCID locale, CALID calendar,CALTYPE caltype ) { + struct enumcalendar_context ctxt; + TRACE("(%p,0x%08x,0x%08x,0x%08x)\n", calinfoproc, locale, calendar, caltype); - return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, FALSE, FALSE); + + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = (CALINFO_ENUMPROCW)calinfoproc; + ctxt.lcid = locale; + ctxt.calendar = calendar; + ctxt.caltype = caltype; + ctxt.unicode = FALSE; + return NLS_EnumCalendarInfo(&ctxt); } /****************************************************************************** @@ -2130,8 +2149,17 @@ BOOL WINAPI EnumCalendarInfoA( CALINFO_ENUMPROCA calinfoproc,LCID locale, BOOL WINAPI EnumCalendarInfoW( CALINFO_ENUMPROCW calinfoproc,LCID locale, CALID calendar,CALTYPE caltype ) { + struct enumcalendar_context ctxt; + TRACE("(%p,0x%08x,0x%08x,0x%08x)\n", calinfoproc, locale, calendar, caltype); - return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, TRUE, FALSE); + + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = calinfoproc; + ctxt.lcid = locale; + ctxt.calendar = calendar; + ctxt.caltype = caltype; + ctxt.unicode = TRUE; + return NLS_EnumCalendarInfo(&ctxt); } /****************************************************************************** @@ -2142,8 +2170,17 @@ BOOL WINAPI EnumCalendarInfoW( CALINFO_ENUMPROCW calinfoproc,LCID locale, BOOL WINAPI EnumCalendarInfoExA( CALINFO_ENUMPROCEXA calinfoproc,LCID locale, CALID calendar,CALTYPE caltype ) { + struct enumcalendar_context ctxt; + TRACE("(%p,0x%08x,0x%08x,0x%08x)\n", calinfoproc, locale, calendar, caltype); - return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, FALSE, TRUE); + + ctxt.type = CALLBACK_ENUMPROCEX; + ctxt.u.callbackex = (CALINFO_ENUMPROCEXW)calinfoproc; + ctxt.lcid = locale; + ctxt.calendar = calendar; + ctxt.caltype = caltype; + ctxt.unicode = FALSE; + return NLS_EnumCalendarInfo(&ctxt); } /****************************************************************************** @@ -2154,6 +2191,15 @@ BOOL WINAPI EnumCalendarInfoExA( CALINFO_ENUMPROCEXA calinfoproc,LCID locale, BOOL WINAPI EnumCalendarInfoExW( CALINFO_ENUMPROCEXW calinfoproc,LCID locale, CALID calendar,CALTYPE caltype ) { + struct enumcalendar_context ctxt; + TRACE("(%p,0x%08x,0x%08x,0x%08x)\n", calinfoproc, locale, calendar, caltype); - return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, TRUE, TRUE); + + ctxt.type = CALLBACK_ENUMPROCEX; + ctxt.u.callbackex = calinfoproc; + ctxt.lcid = locale; + ctxt.calendar = calendar; + ctxt.caltype = caltype; + ctxt.unicode = TRUE; + return NLS_EnumCalendarInfo(&ctxt); }
1
0
0
0
Nikolay Sivov : gdi32: Add a separate helper to load FT_Short values ( Coverity).
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 7ebdd58556e83644122b0012959fcad2f2609548 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7ebdd58556e83644122b00129…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jun 28 13:02:55 2015 +0300 gdi32: Add a separate helper to load FT_Short values (Coverity). --- dlls/gdi32/freetype.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 06b1b1e..07d80a2 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1511,7 +1511,15 @@ static LONG reg_load_dword(HKEY hkey, const WCHAR *value, DWORD *data) return ERROR_SUCCESS; } -static LONG reg_load_ftlong(HKEY hkey, const WCHAR *value, FT_Long *data) +static inline LONG reg_load_ftlong(HKEY hkey, const WCHAR *value, FT_Long *data) +{ + DWORD dw; + LONG ret = reg_load_dword(hkey, value, &dw); + *data = dw; + return ret; +} + +static inline LONG reg_load_ftshort(HKEY hkey, const WCHAR *value, FT_Short *data) { DWORD dw; LONG ret = reg_load_dword(hkey, value, &dw); @@ -1557,7 +1565,7 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu needed = sizeof(face->fs); RegQueryValueExW(hkey_face, face_font_sig_value, NULL, NULL, (BYTE*)&face->fs, &needed); - if(reg_load_dword(hkey_face, face_height_value, (DWORD*)&face->size.height) != ERROR_SUCCESS) + if(reg_load_ftshort(hkey_face, face_height_value, &face->size.height) != ERROR_SUCCESS) { face->scalable = TRUE; memset(&face->size, 0, sizeof(face->size)); @@ -1565,11 +1573,11 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu else { face->scalable = FALSE; - reg_load_dword(hkey_face, face_width_value, (DWORD*)&face->size.width); + reg_load_ftshort(hkey_face, face_width_value, &face->size.width); reg_load_ftlong(hkey_face, face_size_value, &face->size.size); reg_load_ftlong(hkey_face, face_x_ppem_value, &face->size.x_ppem); reg_load_ftlong(hkey_face, face_y_ppem_value, &face->size.y_ppem); - reg_load_dword(hkey_face, face_internal_leading_value, (DWORD*)&face->size.internal_leading); + reg_load_ftshort(hkey_face, face_internal_leading_value, &face->size.internal_leading); TRACE("Adding bitmap size h %d w %d size %ld x_ppem %ld y_ppem %ld\n", face->size.height, face->size.width, face->size.size >> 6,
1
0
0
0
Nikolay Sivov : oleaut32: Use context redirects when creating typelib marshaler proxy/stub.
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 50a66f28eec5f2874973f7d4ad25424979736546 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=50a66f28eec5f2874973f7d4a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jun 28 11:16:23 2015 +0300 oleaut32: Use context redirects when creating typelib marshaler proxy/stub. --- dlls/oleaut32/tmarshal.c | 101 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 86 insertions(+), 15 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 7bf62b7..a2d1ea1 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -263,18 +263,71 @@ PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface, REFIID iid, LPVOID *ppv) { static ULONG WINAPI PSFacBuf_AddRef(LPPSFACTORYBUFFER iface) { return 2; } static ULONG WINAPI PSFacBuf_Release(LPPSFACTORYBUFFER iface) { return 1; } -static HRESULT -_get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { - HRESULT hres; +struct ifacepsredirect_data +{ + ULONG size; + DWORD mask; + GUID iid; + ULONG nummethods; + GUID tlbid; + GUID base; + ULONG name_len; + ULONG name_offset; +}; + +struct tlibredirect_data +{ + ULONG size; + DWORD res; + ULONG name_len; + ULONG name_offset; + LANGID langid; + WORD flags; + ULONG help_len; + ULONG help_offset; + WORD major_version; + WORD minor_version; +}; + +static BOOL actctx_get_typelib_module(REFIID riid, WCHAR *module, DWORD len) +{ + struct ifacepsredirect_data *iface; + struct tlibredirect_data *tlib; + ACTCTX_SECTION_KEYED_DATA data; + WCHAR *ptrW; + + data.cbSize = sizeof(data); + if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, + riid, &data)) + return FALSE; + + iface = (struct ifacepsredirect_data*)data.lpData; + if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION, + &iface->tlbid, &data)) + return FALSE; + + tlib = (struct tlibredirect_data*)data.lpData; + ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset); + + if (tlib->name_len/sizeof(WCHAR) >= len) { + ERR("need larger module buffer, %u\n", tlib->name_len); + return FALSE; + } + + memcpy(module, ptrW, tlib->name_len); + module[tlib->name_len/sizeof(WCHAR)] = 0; + return TRUE; +} + +static HRESULT reg_get_typelib_module(REFIID riid, WCHAR *module, DWORD len) +{ HKEY ikey; REGSAM opposite = (sizeof(void*) == 8) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; BOOL is_wow64; char tlguid[200],typelibkey[300],interfacekey[300],ver[100]; char tlfn[260]; - OLECHAR tlfnW[260]; DWORD tlguidlen, verlen, type; LONG tlfnlen, err; - ITypeLib *tl; sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib", riid->Data1, riid->Data2, riid->Data3, @@ -318,19 +371,37 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { } #endif } - MultiByteToWideChar(CP_ACP, 0, tlfn, -1, tlfnW, sizeof(tlfnW) / sizeof(tlfnW[0])); - hres = LoadTypeLib(tlfnW,&tl); - if (hres) { - ERR("Failed to load typelib for %s, but it should be there.\n",debugstr_guid(riid)); - return hres; + MultiByteToWideChar(CP_ACP, 0, tlfn, -1, module, len); + return S_OK; +} + +static HRESULT +_get_typeinfo_for_iid(REFIID riid, ITypeInfo **typeinfo) +{ + OLECHAR moduleW[260]; + ITypeLib *typelib; + HRESULT hres; + + *typeinfo = NULL; + + moduleW[0] = 0; + if (!actctx_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0]))) { + hres = reg_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0])); + if (FAILED(hres)) + return hres; } - hres = ITypeLib_GetTypeInfoOfGuid(tl,riid,ti); - if (hres) { - ERR("typelib does not contain info for %s?\n",debugstr_guid(riid)); - ITypeLib_Release(tl); + + hres = LoadTypeLib(moduleW, &typelib); + if (hres != S_OK) { + ERR("Failed to load typelib for %s, but it should be there.\n",debugstr_guid(riid)); return hres; } - ITypeLib_Release(tl); + + hres = ITypeLib_GetTypeInfoOfGuid(typelib, riid, typeinfo); + ITypeLib_Release(typelib); + if (hres != S_OK) + ERR("typelib does not contain info for %s\n", debugstr_guid(riid)); + return hres; }
1
0
0
0
Nikolay Sivov : winecfg: Fix string buffer length for override settings ( Valgrind).
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: d11b498c813bdce1756a22c54accf78a0bf034bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d11b498c813bdce1756a22c54…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 27 23:19:56 2015 +0300 winecfg: Fix string buffer length for override settings (Valgrind). --- programs/winecfg/libraries.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/winecfg/libraries.c b/programs/winecfg/libraries.c index f00449d..ff3f67a 100644 --- a/programs/winecfg/libraries.c +++ b/programs/winecfg/libraries.c @@ -106,7 +106,7 @@ static enum dllmode string_to_mode(char *in) enum dllmode res; len = strlen(in); - out = HeapAlloc(GetProcessHeap(), 0, len); + out = HeapAlloc(GetProcessHeap(), 0, len + 1); /* remove the spaces */ for (i = j = 0; i <= len; ++i) {
1
0
0
0
Nikolay Sivov : winecfg: Fix a leak when applying drive changes (Coverity) .
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 74c3a4a7e72f67aa2d415e41f6666a19518f6de2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74c3a4a7e72f67aa2d415e41f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 27 23:14:11 2015 +0300 winecfg: Fix a leak when applying drive changes (Coverity). --- programs/winecfg/drive.c | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index 8cad14a..b5ef69d 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -367,6 +367,7 @@ void apply_drive_changes(void) } else WINE_WARN( "failed to set drive %c: to %s type %u err %u\n", 'a' + i, wine_dbgstr_a(drives[i].unixpath), drives[i].type, GetLastError() ); + HeapFree( GetProcessHeap(), 0, ioctl ); } CloseHandle( mgr ); }
1
0
0
0
Nikolay Sivov : shell32: Fix memory leak on NULL return length (Coverity).
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 7ca31b81195ac39ddb3feb49624b57a7d92da994 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7ca31b81195ac39ddb3feb496…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 27 22:07:39 2015 +0300 shell32: Fix memory leak on NULL return length (Coverity). --- dlls/shell32/assoc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 21df493..90d00a8 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -745,7 +745,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface, static const WCHAR edit_flags[] = {'E','d','i','t','F','l','a','g','s',0}; IQueryAssociationsImpl *This = impl_from_IQueryAssociations(iface); - void *data; + void *data = NULL; DWORD size; HRESULT hres; @@ -761,10 +761,8 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface, return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); hres = ASSOC_GetValue(This->hkeyProgID, edit_flags, &data, &size); - if(FAILED(hres) || !pcbOut) - return hres; - - hres = ASSOC_ReturnData(pvOut, pcbOut, data, size); + if(SUCCEEDED(hres) && pcbOut) + hres = ASSOC_ReturnData(pvOut, pcbOut, data, size); HeapFree(GetProcessHeap(), 0, data); return hres; default:
1
0
0
0
Nikolay Sivov : ole32: Handle EnumElements() failure (Coverity).
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 64456de761f9264f4bcbebcf34323e0b07353e4b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64456de761f9264f4bcbebcf3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 27 20:25:52 2015 +0300 ole32: Handle EnumElements() failure (Coverity). --- dlls/ole32/storage32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index b1bad38..220e17e 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2421,7 +2421,12 @@ static HRESULT deleteStorageContents( /* * Enumerate the elements */ - IStorage_EnumElements( childStorage, 0, 0, 0, &elements); + hr = IStorage_EnumElements(childStorage, 0, 0, 0, &elements); + if (FAILED(hr)) + { + IStorage_Release(childStorage); + return hr; + } do {
1
0
0
0
Nikolay Sivov : gdiplus: Check GetMetadataFormat() return value (Coverity) .
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: c2ae34c54d5e385c8f85a2b28a0328bf57e1fd0d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2ae34c54d5e385c8f85a2b28…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jun 27 14:29:37 2015 +0300 gdiplus: Check GetMetadataFormat() return value (Coverity). --- dlls/gdiplus/image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 351c5b3..73f2f74 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -3058,8 +3058,8 @@ static BOOL get_bool_property(IWICMetadataReader *reader, const GUID *guid, cons PROPVARIANT id, value; BOOL ret = FALSE; - IWICMetadataReader_GetMetadataFormat(reader, &format); - if (!IsEqualGUID(&format, guid)) return FALSE; + hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + if (FAILED(hr) || !IsEqualGUID(&format, guid)) return FALSE; PropVariantInit(&id); PropVariantInit(&value); @@ -3085,8 +3085,8 @@ static PropertyItem *get_property(IWICMetadataReader *reader, const GUID *guid, PROPVARIANT id, value; PropertyItem *item = NULL; - IWICMetadataReader_GetMetadataFormat(reader, &format); - if (!IsEqualGUID(&format, guid)) return NULL; + hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + if (FAILED(hr) || !IsEqualGUID(&format, guid)) return NULL; PropVariantInit(&id); PropVariantInit(&value);
1
0
0
0
Nikolay Sivov : user32: Added stubs for ShutdownBlockReasonCreate/ ShutdownBlockReasonDestroy.
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 48246a149ed1d4e97338421a376b8f791a2d1dbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48246a149ed1d4e97338421a3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jun 26 21:35:28 2015 +0300 user32: Added stubs for ShutdownBlockReasonCreate/ShutdownBlockReasonDestroy. --- dlls/user32/user32.spec | 2 ++ dlls/user32/user_main.c | 20 ++++++++++++++++++++ include/winuser.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index a8bbe83..5cc0f55 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -697,6 +697,8 @@ @ stub ShowStartGlass @ stdcall ShowWindow(long long) @ stdcall ShowWindowAsync(long long) +@ stdcall ShutdownBlockReasonCreate(long wstr) +@ stdcall ShutdownBlockReasonDestroy(long) # @ stub SoftModalMessageBox @ stdcall SubtractRect(ptr ptr ptr) @ stdcall SwapMouseButton(long) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 12764e6..718abe0 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -409,3 +409,23 @@ int WINAPI RegisterServicesProcess(DWORD ServicesProcessId) FIXME("(0x%x): stub\n", ServicesProcessId); return 0; } + +/*********************************************************************** + * ShutdownBlockReasonCreate (USER32.@) + */ +BOOL WINAPI ShutdownBlockReasonCreate(HWND hwnd, LPCWSTR reason) +{ + FIXME("(%p, %s): stub\n", hwnd, debugstr_w(reason)); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +/*********************************************************************** + * ShutdownBlockReasonDestroy (USER32.@) + */ +BOOL WINAPI ShutdownBlockReasonDestroy(HWND hwnd) +{ + FIXME("(%p): stub\n", hwnd); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} diff --git a/include/winuser.h b/include/winuser.h index e9804a9..118aa73 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3992,6 +3992,8 @@ WINUSERAPI BOOL WINAPI ShowScrollBar(HWND,INT,BOOL); WINUSERAPI BOOL WINAPI ShowOwnedPopups(HWND,BOOL); WINUSERAPI BOOL WINAPI ShowWindow(HWND,INT); WINUSERAPI BOOL WINAPI ShowWindowAsync(HWND,INT); +WINUSERAPI BOOL WINAPI ShutdownBlockReasonCreate(HWND,LPCWSTR); +WINUSERAPI BOOL WINAPI ShutdownBlockReasonDestroy(HWND); WINUSERAPI BOOL WINAPI SubtractRect(LPRECT,const RECT*,const RECT*); WINUSERAPI BOOL WINAPI SwapMouseButton(BOOL); WINUSERAPI BOOL WINAPI SwitchDesktop(HDESK);
1
0
0
0
Jacek Caban : user32: Limit number of hooks called recursively.
by Alexandre Julliard
29 Jun '15
29 Jun '15
Module: wine Branch: master Commit: 4bcb4881ae9e7fc2cc4d32aa3ba7f36e46d6fc5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4bcb4881ae9e7fc2cc4d32aa3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 26 19:37:41 2015 +0200 user32: Limit number of hooks called recursively. --- dlls/user32/hook.c | 15 ++++++++++++- dlls/user32/tests/msg.c | 54 +++++++++++++++++++++++++++++++++++++++++++++- dlls/user32/user_private.h | 1 + 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/dlls/user32/hook.c b/dlls/user32/hook.c index 281b88e..090ec17 100644 --- a/dlls/user32/hook.c +++ b/dlls/user32/hook.c @@ -413,7 +413,19 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA } else if (info->proc) { + struct user_thread_info *thread_info = get_user_thread_info(); HMODULE free_module = 0; + + /* + * Windows protects from stack overflow in recursive hook calls. Different Windows + * allow different depths. + */ + if (thread_info->hook_call_depth >= 25) + { + WARN("Too many hooks called recursively, skipping call.\n"); + return 0; + } + TRACE( "calling hook %p %s code %x wp %lx lp %lx module %s\n", info->proc, hook_names[info->id-WH_MINHOOK], code, wparam, lparam, debugstr_w(info->module) ); @@ -421,16 +433,17 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA if (!info->module[0] || (info->proc = get_hook_proc( info->proc, info->module, &free_module )) != NULL) { - struct user_thread_info *thread_info = get_user_thread_info(); HHOOK prev = thread_info->hook; BOOL prev_unicode = thread_info->hook_unicode; thread_info->hook = info->handle; thread_info->hook_unicode = info->next_unicode; + thread_info->hook_call_depth++; ret = call_hook_proc( info->proc, info->id, code, wparam, lparam, info->prev_unicode, info->next_unicode ); thread_info->hook = prev; thread_info->hook_unicode = prev_unicode; + thread_info->hook_call_depth--; if (free_module) FreeLibrary(free_module); } diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index a515550..831a56b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -9182,6 +9182,54 @@ todo_wine { "unexpected error %d\n", GetLastError()); } +static HWND hook_hwnd; +static HHOOK recursive_hook; +static int hook_depth, max_hook_depth; + +static LRESULT WINAPI rec_get_message_hook(int code, WPARAM w, LPARAM l) +{ + LRESULT res; + MSG msg; + BOOL b; + + hook_depth++; + if(hook_depth > max_hook_depth) + max_hook_depth = hook_depth; + + b = PeekMessageW(&msg, hook_hwnd, 0, 0, PM_NOREMOVE); + ok(b, "PeekMessage failed\n"); + + res = CallNextHookEx(recursive_hook, code, w, l); + + hook_depth--; + return res; +} + +static void test_recursive_hook(void) +{ + MSG msg; + BOOL b; + + hook_hwnd = CreateWindowA("Static", NULL, WS_POPUP, 0, 0, 200, 60, NULL, NULL, NULL, NULL); + ok(hook_hwnd != NULL, "CreateWindow failed\n"); + + recursive_hook = SetWindowsHookExW(WH_GETMESSAGE, rec_get_message_hook, NULL, GetCurrentThreadId()); + ok(recursive_hook != NULL, "SetWindowsHookEx failed\n"); + + PostMessageW(hook_hwnd, WM_USER, 0, 0); + PostMessageW(hook_hwnd, WM_USER+1, 0, 0); + + hook_depth = 0; + GetMessageW(&msg, hook_hwnd, 0, 0); + ok(15 < max_hook_depth && max_hook_depth < 45, "max_hook_depth = %d\n", max_hook_depth); + trace("max_hook_depth = %d\n", max_hook_depth); + + b = UnhookWindowsHookEx(recursive_hook); + ok(b, "UnhokWindowsHookEx failed\n"); + + DestroyWindow(hook_hwnd); +} + static const struct message ScrollWindowPaint1[] = { { WM_PAINT, sent }, { WM_ERASEBKGND, sent|beginpaint }, @@ -14946,7 +14994,11 @@ START_TEST(msg) test_timers(); test_timers_no_wnd(); test_timers_exceptions(); - if (hCBT_hook) test_set_hook(); + if (hCBT_hook) + { + test_set_hook(); + test_recursive_hook(); + } test_DestroyWindow(); test_DispatchMessage(); test_SendMessageTimeout(); diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 1fbecb9..d3affb0 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -175,6 +175,7 @@ struct user_thread_info DWORD changed_mask; /* Current queue changed mask */ WORD recursion_count; /* SendMessage recursion counter */ WORD message_count; /* Get/PeekMessage loop counter */ + WORD hook_call_depth; /* Number of recursively called hook procs */ BOOL hook_unicode; /* Is current hook unicode? */ HHOOK hook; /* Current hook */ struct received_message_info *receive_info; /* Message being currently received */
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
61
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
Results per page:
10
25
50
100
200