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
July 2007
----- 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
3 participants
957 discussions
Start a n
N
ew thread
Mikołaj Zalewski : comctl32: tooltips: Remove broken support for non-NULL-terminated strings in TOOLTIPS_GetDispInfo [AW].
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: f53e31418006ad899716007b41fbcb9ad409a24d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f53e31418006ad899716007b4…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Thu Jul 19 16:13:45 2007 +0200 comctl32: tooltips: Remove broken support for non-NULL-terminated strings in TOOLTIPS_GetDispInfo[AW]. --- dlls/comctl32/comctl32.h | 1 + dlls/comctl32/comctl32undoc.c | 41 +++++++++++++++++++++++++++++++++++++++++ dlls/comctl32/tooltips.c | 21 ++++++--------------- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index e7a3598..5917a9b 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -148,6 +148,7 @@ VOID COMCTL32_RefreshSysColors(void); void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal); void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground); INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen); +INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen); BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc); BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc); diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index d17436f..6f434a6 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -922,6 +922,47 @@ INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) return len; } +/************************************************************************** + * Str_GetPtrAtoW [internal] + * + * Converts a multibyte string into a unicode string + * + * PARAMS + * lpSrc [I] Pointer to the multibyte source string + * lpDest [O] Pointer to caller supplied storage for the unicode string + * nMaxLen [I] Size, in characters, of the destination buffer + * + * RETURNS + * Length, in characters, of the converted string. + */ + +INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) +{ + INT len; + + TRACE("(%s %p %d)\n", debugstr_a(lpSrc), lpDest, nMaxLen); + + if (!lpDest && lpSrc) + return MultiByteToWideChar(CP_ACP, 0, lpSrc, -1, 0, 0); + + if (nMaxLen == 0) + return 0; + + if (lpSrc == NULL) { + lpDest[0] = '\0'; + return 0; + } + + len = MultiByteToWideChar(CP_ACP, 0, lpSrc, -1, 0, 0); + if (len >= nMaxLen) + len = nMaxLen - 1; + + MultiByteToWideChar(CP_ACP, 0, lpSrc, -1, lpDest, len); + lpDest[len] = '\0'; + + return len; +} + /************************************************************************** * Str_SetPtrAtoW [internal] diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 4e11c5c..9dd1970 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -336,17 +336,11 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO infoPtr->szTipText[0] = '\0'; } else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKA) { - INT max_len = (ttnmdi.lpszText == &ttnmdi.szText[0]) ? - sizeof(ttnmdi.szText)/sizeof(ttnmdi.szText[0]) : -1; - MultiByteToWideChar(CP_ACP, 0, ttnmdi.lpszText, max_len, - infoPtr->szTipText, INFOTIPSIZE); + Str_GetPtrAtoW(ttnmdi.lpszText, infoPtr->szTipText, INFOTIPSIZE); if (ttnmdi.uFlags & TTF_DI_SETITEM) { - INT len = MultiByteToWideChar(CP_ACP, 0, ttnmdi.lpszText, - max_len, NULL, 0); toolPtr->hinst = 0; - toolPtr->lpszText = Alloc (len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, ttnmdi.lpszText, -1, - toolPtr->lpszText, len); + toolPtr->lpszText = NULL; + Str_SetPtrW(&toolPtr->lpszText, infoPtr->szTipText); } } else { @@ -385,14 +379,11 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO infoPtr->szTipText[0] = '\0'; } else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACKW) { - INT max_len = (ttnmdi.lpszText == &ttnmdi.szText[0]) ? - sizeof(ttnmdi.szText)/sizeof(ttnmdi.szText[0]) : INFOTIPSIZE-1; - lstrcpynW(infoPtr->szTipText, ttnmdi.lpszText, max_len); + Str_GetPtrW(ttnmdi.lpszText, infoPtr->szTipText, INFOTIPSIZE); if (ttnmdi.uFlags & TTF_DI_SETITEM) { - INT len = max(strlenW(ttnmdi.lpszText), max_len); toolPtr->hinst = 0; - toolPtr->lpszText = Alloc ((len+1) * sizeof(WCHAR)); - memcpy(toolPtr->lpszText, ttnmdi.lpszText, (len+1) * sizeof(WCHAR)); + toolPtr->lpszText = NULL; + Str_SetPtrW(&toolPtr->lpszText, infoPtr->szTipText); } } else {
1
0
0
0
Mikołaj Zalewski : comctl32: toolbar: Test and fix invalid indexes passed in TB_ISBUTTON*.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 31be5005c633dee1476a77d93aa27e9c3f628c79 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31be5005c633dee1476a77d93…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Thu Jul 19 12:48:46 2007 +0200 comctl32: toolbar: Test and fix invalid indexes passed in TB_ISBUTTON*. --- dlls/comctl32/tests/toolbar.c | 9 +++++++++ dlls/comctl32/toolbar.c | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index f5476d3..b46ef0d 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -147,6 +147,15 @@ static void basic_test(void) ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1000, 0), "A1 pressed\n"); ok(!SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1007, 0), "B2 not pressed\n"); ok(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 1008, 0), "B3 pressed\n"); + + /* tests with invalid index */ + compare(SendMessage(hToolbar, TB_ISBUTTONCHECKED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessage(hToolbar, TB_ISBUTTONPRESSED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessage(hToolbar, TB_ISBUTTONENABLED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessage(hToolbar, TB_ISBUTTONINDETERMINATE, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessage(hToolbar, TB_ISBUTTONHIGHLIGHTED, 0xdeadbeef, 0), -1L, "%ld"); + compare(SendMessage(hToolbar, TB_ISBUTTONHIDDEN, 0xdeadbeef, 0), -1L, "%ld"); + DestroyWindow(hToolbar); } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index da6ceab..275d3d5 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -3840,7 +3840,7 @@ TOOLBAR_IsButtonChecked (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return FALSE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_CHECKED); } @@ -3854,7 +3854,7 @@ TOOLBAR_IsButtonEnabled (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return FALSE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_ENABLED); } @@ -3868,7 +3868,7 @@ TOOLBAR_IsButtonHidden (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return TRUE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_HIDDEN); } @@ -3882,7 +3882,7 @@ TOOLBAR_IsButtonHighlighted (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return FALSE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_MARKED); } @@ -3896,7 +3896,7 @@ TOOLBAR_IsButtonIndeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return FALSE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_INDETERMINATE); } @@ -3910,7 +3910,7 @@ TOOLBAR_IsButtonPressed (HWND hwnd, WPARAM wParam, LPARAM lParam) nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); if (nIndex == -1) - return FALSE; + return -1; return (infoPtr->buttons[nIndex].fsState & TBSTATE_PRESSED); }
1
0
0
0
Dmitry Timoshkov : winuser.h: Add RealChildWindowFromPoint declaration.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 648f7b1d9ffa442433983eacb365e9544bff940d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=648f7b1d9ffa442433983eacb…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Jul 19 21:34:53 2007 +0900 winuser.h: Add RealChildWindowFromPoint declaration. --- include/winuser.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/winuser.h b/include/winuser.h index 38f6add..1c650bc 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -4813,6 +4813,7 @@ UINT WINAPI PrivateExtractIconExW(LPCWSTR,int,HICON*,HICON*,UINT); UINT WINAPI PrivateExtractIconsA(LPCSTR,int,int,int,HICON*,UINT*,UINT,UINT); UINT WINAPI PrivateExtractIconsW(LPCWSTR,int,int,int,HICON*,UINT*,UINT,UINT); BOOL WINAPI PtInRect(const RECT*,POINT); +HWND WINAPI RealChildWindowFromPoint(HWND,POINT); UINT WINAPI RealGetWindowClassA(HWND,LPSTR,UINT); UINT WINAPI RealGetWindowClassW(HWND,LPWSTR,UINT); #define RealGetWindowClass WINELIB_NAME_AW(RealGetWindowClass)
1
0
0
0
Alexandre Julliard : ntdll: Add support for abbreviated empty elements in manifests.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 1207d9b5937f7c8fb67d9e4b4843f13c74bea85a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1207d9b5937f7c8fb67d9e4b4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 20 11:19:17 2007 +0200 ntdll: Add support for abbreviated empty elements in manifests. --- dlls/ntdll/actctx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 823bbcb..08383e3 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -569,7 +569,7 @@ static BOOL next_xml_elem(xmlbuf_t* xmlbuf, xmlstr_t* elem) } xmlbuf->ptr = ptr; - while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>') + while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>' && (*ptr != '/' || ptr == xmlbuf->ptr)) ptr++; elem->ptr = xmlbuf->ptr;
1
0
0
0
Alexandre Julliard : ntdll: Don' t fail to load manifests that contain unknown elements or attributes.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: a24f9cc101ff9d3c983e45953018c383df9b1fac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a24f9cc101ff9d3c983e45953…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jul 20 11:18:41 2007 +0200 ntdll: Don't fail to load manifests that contain unknown elements or attributes. Print FIXMEs for errors that really cause the loading to fail. --- dlls/ntdll/actctx.c | 117 ++++++++++++++++++++++++--------------------------- 1 files changed, 55 insertions(+), 62 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a24f9cc101ff9d3c983e4…
1
0
0
0
Alexandre Julliard : ntdll: Add support for optional flag in dependencies.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 84a318265d71d587c50c8168d2950e92e9516acc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84a318265d71d587c50c8168d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 19 18:14:23 2007 +0200 ntdll: Add support for optional flag in dependencies. --- dlls/ntdll/actctx.c | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index eb4214a..6b5d6b2 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -94,6 +94,7 @@ struct assembly_identity WCHAR *language; struct version version; enum assembly_id_type type; + BOOL optional; }; struct entity @@ -213,6 +214,7 @@ struct actctx_loader #define NAME_ATTR "name" #define NEWVERSION_ATTR "newVersion" #define OLDVERSION_ATTR "oldVersion" +#define OPTIONAL_ATTR "optional" #define PROCESSORARCHITECTURE_ATTR "processorArchitecture" #define PUBLICKEYTOKEN_ATTR "publicKeyToken" #define TLBID_ATTR "tlbid" @@ -690,7 +692,6 @@ static BOOL parse_assembly_identity_elem(xmlbuf_t* xmlbuf, ACTIVATION_CONTEXT* a TRACE("\n"); - memset(ai, 0, sizeof(*ai)); while (next_xml_attr(xmlbuf, &attr_name, &attr_value, &error, &end)) { if (xmlstr_cmp(&attr_name, NAME_ATTR)) @@ -1008,8 +1009,7 @@ static BOOL parse_clr_surrogate_elem(xmlbuf_t* xmlbuf, struct assembly* assembly return parse_expect_elem(xmlbuf, ELEM_END(CLRSURROGATE_ELEM)) && parse_end_element(xmlbuf); } -static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf, - struct actctx_loader* acl) +static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, BOOL optional) { struct assembly_identity ai; xmlstr_t elem; @@ -1019,6 +1019,9 @@ static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf, if (!parse_expect_no_attr(xmlbuf, &end) || end) return end; + memset(&ai, 0, sizeof(ai)); + ai.optional = optional; + if (!parse_expect_elem(xmlbuf, ASSEMBLYIDENTITY_ELEM) || !parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai)) return FALSE; @@ -1049,12 +1052,23 @@ static BOOL parse_dependent_assembly_elem(xmlbuf_t* xmlbuf, static BOOL parse_dependency_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl) { - xmlstr_t elem; - BOOL end = FALSE, ret = TRUE; + xmlstr_t attr_name, attr_value, elem; + BOOL end = FALSE, ret = TRUE, error, optional = FALSE; TRACE("\n"); - if (!parse_expect_no_attr(xmlbuf, &end) || end) return end; + while (next_xml_attr(xmlbuf, &attr_name, &attr_value, &error, &end)) + { + if (xmlstr_cmp(&attr_name, OPTIONAL_ATTR)) + { + optional = xmlstr_cmp( &attr_value, "yes" ); + TRACE("optional=%s\n", debugstr_xmlstr(&attr_value)); + } + else + { + WARN("unknown attr %s=%s\n", debugstr_xmlstr(&attr_name), debugstr_xmlstr(&attr_value)); + } + } while (ret && (ret = next_xml_elem(xmlbuf, &elem))) { @@ -1065,7 +1079,7 @@ static BOOL parse_dependency_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl) } else if (xmlstr_cmp(&elem, DEPENDENTASSEMBLY_ELEM)) { - ret = parse_dependent_assembly_elem(xmlbuf, acl); + ret = parse_dependent_assembly_elem(xmlbuf, acl, optional); } else { @@ -1760,9 +1774,12 @@ static NTSTATUS parse_depend_manifests(struct actctx_loader* acl) { if (lookup_assembly(acl, &acl->dependencies[i]) != STATUS_SUCCESS) { - FIXME( "Could not find assembly %s\n", debugstr_w(acl->dependencies[i].name) ); - status = STATUS_SXS_CANT_GEN_ACTCTX; - break; + if (!acl->dependencies[i].optional) + { + FIXME( "Could not find dependent assembly %s\n", debugstr_w(acl->dependencies[i].name) ); + status = STATUS_SXS_CANT_GEN_ACTCTX; + break; + } } } /* FIXME should now iterate through all refs */
1
0
0
0
Alexandre Julliard : ntdll: Cope with missing assemblyIdentity elements in manifests.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: b2b6fc1288525f290129ed8bfddd886fe090e3cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b2b6fc1288525f290129ed8bf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 19 18:13:27 2007 +0200 ntdll: Cope with missing assemblyIdentity elements in manifests. --- dlls/ntdll/actctx.c | 30 +++++++++++++----------------- 1 files changed, 13 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 26bdf31..eb4214a 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -1174,7 +1174,6 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, { xmlstr_t attr_name, attr_value, elem; BOOL end = FALSE, error, version = FALSE, xmlns = FALSE, ret = TRUE; - struct assembly_identity ai; TRACE("(%p)\n", xmlbuf); @@ -1224,28 +1223,24 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, else if (assembly->type == ASSEMBLY_MANIFEST && assembly->no_inherit) return FALSE; - if (!xmlstr_cmp(&elem, ASSEMBLYIDENTITY_ELEM)) + if (xmlstr_cmp(&elem, ASSEMBLYIDENTITY_ELEM)) { - WARN("expected assemblyIdentity element, got %s\n", debugstr_xmlstr(&elem)); - return FALSE; - } - - if (!parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai)) return FALSE; + if (!parse_assembly_identity_elem(xmlbuf, acl->actctx, &assembly->id)) return FALSE; + ret = next_xml_elem(xmlbuf, &elem); - if (expected_ai) - { - /* FIXME: more tests */ - if (assembly->type == ASSEMBLY_MANIFEST && - memcmp(&ai.version, &expected_ai->version, sizeof(ai.version))) + if (expected_ai) { - WARN("wrong version\n"); - return FALSE; + /* FIXME: more tests */ + if (assembly->type == ASSEMBLY_MANIFEST && + memcmp(&assembly->id.version, &expected_ai->version, sizeof(assembly->id.version))) + { + FIXME("wrong version\n"); + return FALSE; + } } } - assembly->id = ai; - - while (ret && (ret = next_xml_elem(xmlbuf, &elem))) + while (ret) { if (xmlstr_cmp(&elem, ELEM_END(ASSEMBLY_ELEM))) { @@ -1281,6 +1276,7 @@ static BOOL parse_assembly_elem(xmlbuf_t* xmlbuf, struct actctx_loader* acl, WARN("wrong element %s\n", debugstr_xmlstr(&elem)); ret = FALSE; } + if (ret) ret = next_xml_elem(xmlbuf, &elem); } return ret;
1
0
0
0
Alexandre Julliard : ntdll: Skip xml comments in manifests.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 272af8fa1eca695182384d8903b532c4a0f6b6f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=272af8fa1eca695182384d890…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 19 18:10:45 2007 +0200 ntdll: Skip xml comments in manifests. --- dlls/ntdll/actctx.c | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index b819dc1..26bdf31 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -541,14 +541,31 @@ static BOOL next_xml_elem(xmlbuf_t* xmlbuf, xmlstr_t* elem) { const char* ptr; - ptr = memchr(xmlbuf->ptr, '<', xmlbuf->end - xmlbuf->ptr); - if (!ptr) + for (;;) { - xmlbuf->ptr = xmlbuf->end; - return FALSE; + ptr = memchr(xmlbuf->ptr, '<', xmlbuf->end - xmlbuf->ptr); + if (!ptr) + { + xmlbuf->ptr = xmlbuf->end; + return FALSE; + } + ptr++; + if (ptr + 3 < xmlbuf->end && !strncmp( ptr, "!--", 3 )) /* skip comment */ + { + for (ptr += 3; ptr + 3 <= xmlbuf->end; ptr++) + if (ptr[0] == '-' && ptr[1] == '-' && ptr[2] == '>') break; + + if (ptr + 3 > xmlbuf->end) + { + xmlbuf->ptr = xmlbuf->end; + return FALSE; + } + xmlbuf->ptr = ptr + 3; + } + else break; } - xmlbuf->ptr = ++ptr; + xmlbuf->ptr = ptr; while (ptr < xmlbuf->end && !isxmlspace(*ptr) && *ptr != '>') ptr++;
1
0
0
0
Alexandre Julliard : ntdll: Added manifest lookup in global winsxs directory ( based on a patch by Jacek Caban).
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 214fb6e84e1609b6e61c072719cda4124b667eb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=214fb6e84e1609b6e61c07271…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 19 18:09:35 2007 +0200 ntdll: Added manifest lookup in global winsxs directory (based on a patch by Jacek Caban). --- dlls/ntdll/actctx.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 142 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index df2a66f..b819dc1 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -1535,6 +1535,146 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, return status; } +static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) +{ + static const WCHAR lookup_fmtW[] = + {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_', + '*', /* FIXME */ + '.','m','a','n','i','f','e','s','t',0}; + + WCHAR *lookup, *ret = NULL; + UNICODE_STRING lookup_us; + IO_STATUS_BLOCK io; + unsigned int data_pos = 0, data_len; + char buffer[8192]; + + if (!(lookup = RtlAllocateHeap( GetProcessHeap(), 0, + (strlenW(ai->arch) + strlenW(ai->name) + + strlenW(ai->public_key) + 20) * sizeof(WCHAR) + + sizeof(lookup_fmtW) ))) + return NULL; + + sprintfW( lookup, lookup_fmtW, ai->arch, ai->name, ai->public_key, ai->version.major, ai->version.minor); + RtlInitUnicodeString( &lookup_us, lookup ); + + NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ); + if (io.u.Status == STATUS_SUCCESS) + { + FILE_BOTH_DIR_INFORMATION *dir_info; + WCHAR *tmp; + ULONG build, revision; + + data_len = io.Information; + + for (;;) + { + if (data_pos >= data_len) + { + NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileBothDirectoryInformation, FALSE, &lookup_us, FALSE ); + if (io.u.Status != STATUS_SUCCESS) break; + data_len = io.Information; + data_pos = 0; + } + dir_info = (FILE_BOTH_DIR_INFORMATION*)(buffer + data_pos); + + if (dir_info->NextEntryOffset) data_pos += dir_info->NextEntryOffset; + else data_pos = data_len; + + tmp = (WCHAR *)dir_info->FileName + (strchrW(lookup, '*') - lookup); + build = atoiW(tmp); + if (build < ai->version.build) continue; + tmp = strchrW(tmp, '.') + 1; + revision = atoiW(tmp); + if (build == ai->version.build && revision < ai->version.revision) + continue; + ai->version.build = build; + ai->version.revision = revision; + if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, dir_info->FileNameLength + sizeof(WCHAR) ))) + { + memcpy( ret, dir_info->FileName, dir_info->FileNameLength ); + ret[dir_info->FileNameLength/sizeof(WCHAR)] = 0; + } + break; + } + } + RtlFreeHeap( GetProcessHeap(), 0, lookup ); + return ret; +} + +static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identity* ai) +{ + struct assembly_identity sxs_ai; + UNICODE_STRING path_us; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK io; + WCHAR *path, *file = NULL; + HANDLE handle; + + static const WCHAR manifest_dirW[] = + {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s',0}; + + if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE; + + if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, windows_dir.Length + sizeof(manifest_dirW) ))) + return STATUS_NO_MEMORY; + + memcpy( path, windows_dir.Buffer, windows_dir.Length ); + memcpy( path + windows_dir.Length/sizeof(WCHAR), manifest_dirW, sizeof(manifest_dirW) ); + + if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL )) + { + RtlFreeHeap( GetProcessHeap(), 0, path ); + return STATUS_NO_SUCH_FILE; + } + RtlFreeHeap( GetProcessHeap(), 0, path ); + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &path_us; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT )) + { + sxs_ai = *ai; + file = lookup_manifest_file( handle, &sxs_ai ); + NtClose( handle ); + } + if (!file) + { + RtlFreeUnicodeString( &path_us ); + return STATUS_NO_SUCH_FILE; + } + + /* append file name to directory path */ + if (!(path = RtlReAllocateHeap( GetProcessHeap(), 0, path_us.Buffer, + path_us.Length + (strlenW(file) + 2) * sizeof(WCHAR) ))) + { + RtlFreeHeap( GetProcessHeap(), 0, file ); + RtlFreeUnicodeString( &path_us ); + return STATUS_NO_MEMORY; + } + + path[path_us.Length/sizeof(WCHAR)] = '\\'; + strcpyW( path + path_us.Length/sizeof(WCHAR) + 1, file ); + RtlFreeHeap( GetProcessHeap(), 0, file ); + RtlInitUnicodeString( &path_us, path ); + + if (!open_nt_file( &handle, &path_us )) + { + io.u.Status = get_manifest_in_manifest_file(acl, &sxs_ai, path_us.Buffer, handle); + NtClose( handle ); + } + else io.u.Status = STATUS_NO_SUCH_FILE; + + RtlFreeUnicodeString( &path_us ); + return io.u.Status; +} + static NTSTATUS lookup_assembly(struct actctx_loader* acl, struct assembly_identity* ai) { @@ -1545,6 +1685,8 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, UNICODE_STRING nameW; HANDLE file; + if ((status = lookup_winsxs(acl, ai)) != STATUS_NO_SUCH_FILE) return status; + /* FIXME: add support for language specific lookup */ nameW.Buffer = NULL;
1
0
0
0
Jacek Caban : ntdll: Store the windows directory too.
by Alexandre Julliard
20 Jul '07
20 Jul '07
Module: wine Branch: master Commit: 125e710ff1d620ae8949f08cb22e040ef59c5d83 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=125e710ff1d620ae8949f08cb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jul 19 18:05:59 2007 +0200 ntdll: Store the windows directory too. --- dlls/ntdll/loader.c | 2 ++ dlls/ntdll/ntdll_misc.h | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index bdf09f3..ca06e89 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -91,6 +91,7 @@ static UINT tls_module_count; /* number of modules with TLS directory */ static UINT tls_total_size; /* total size of TLS storage */ static const IMAGE_TLS_DIRECTORY **tls_dirs; /* array of TLS directories */ +UNICODE_STRING windows_dir = { 0, 0, NULL }; /* windows directory */ UNICODE_STRING system_dir = { 0, 0, NULL }; /* system directory */ static RTL_CRITICAL_SECTION loader_section; @@ -2312,6 +2313,7 @@ void __wine_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ) PLIST_ENTRY mark, entry; LPWSTR buffer, p; + RtlCreateUnicodeString( &windows_dir, windir ); RtlCreateUnicodeString( &system_dir, sysdir ); strcpyW( user_shared_data->NtSystemRoot, windir ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 4f730f7..8f41ff8 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -76,6 +76,7 @@ extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY FARPROC origfun, DWORD ordinal, const WCHAR *user ); extern void RELAY_SetupDLL( HMODULE hmod ); extern void SNOOP_SetupDLL( HMODULE hmod ); +extern UNICODE_STRING windows_dir; extern UNICODE_STRING system_dir; /* redefine these to make sure we don't reference kernel symbols */
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
96
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
Results per page:
10
25
50
100
200