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 2017
----- 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
632 discussions
Start a n
N
ew thread
Jactry Zeng : kernel32: Add stub for ResolveLocaleName.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: b9a9fe4a042f98521efea3275ded4af4b7cba4c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b9a9fe4a042f98521efea3275…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Wed Jun 28 15:05:21 2017 +0800 kernel32: Add stub for ResolveLocaleName. Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- .../api-ms-win-core-localization-l1-1-0.spec | 2 +- .../api-ms-win-core-localization-l1-2-0.spec | 2 +- .../api-ms-win-core-localization-l1-2-1.spec | 2 +- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/locale.c | 12 ++++++++++++ dlls/kernelbase/kernelbase.spec | 2 +- include/winnls.h | 1 + 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dlls/api-ms-win-core-localization-l1-1-0/api-ms-win-core-localization-l1-1-0.spec b/dlls/api-ms-win-core-localization-l1-1-0/api-ms-win-core-localization-l1-1-0.spec index 31abadc..1e9ea4a 100644 --- a/dlls/api-ms-win-core-localization-l1-1-0/api-ms-win-core-localization-l1-1-0.spec +++ b/dlls/api-ms-win-core-localization-l1-1-0/api-ms-win-core-localization-l1-1-0.spec @@ -39,7 +39,7 @@ @ stub NlsUpdateLocale @ stub NlsUpdateSystemLocale @ stub NlsWriteEtwEvent -@ stub ResolveLocaleName +@ stdcall ResolveLocaleName(wstr ptr long) kernel32.ResolveLocaleName @ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW @ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW @ stdcall SetThreadLocale(long) kernel32.SetThreadLocale diff --git a/dlls/api-ms-win-core-localization-l1-2-0/api-ms-win-core-localization-l1-2-0.spec b/dlls/api-ms-win-core-localization-l1-2-0/api-ms-win-core-localization-l1-2-0.spec index bdbcbb8..49c6d2e 100644 --- a/dlls/api-ms-win-core-localization-l1-2-0/api-ms-win-core-localization-l1-2-0.spec +++ b/dlls/api-ms-win-core-localization-l1-2-0/api-ms-win-core-localization-l1-2-0.spec @@ -47,7 +47,7 @@ @ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long) kernel32.LCMapStringEx @ stdcall LCMapStringW(long long wstr long ptr long) kernel32.LCMapStringW @ stdcall LocaleNameToLCID(wstr long) kernel32.LocaleNameToLCID -@ stub ResolveLocaleName +@ stdcall ResolveLocaleName(wstr ptr long) kernel32.ResolveLocaleName @ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW @ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW @ stub SetProcessPreferredUILanguages diff --git a/dlls/api-ms-win-core-localization-l1-2-1/api-ms-win-core-localization-l1-2-1.spec b/dlls/api-ms-win-core-localization-l1-2-1/api-ms-win-core-localization-l1-2-1.spec index 98ec923..6272d01 100644 --- a/dlls/api-ms-win-core-localization-l1-2-1/api-ms-win-core-localization-l1-2-1.spec +++ b/dlls/api-ms-win-core-localization-l1-2-1/api-ms-win-core-localization-l1-2-1.spec @@ -48,7 +48,7 @@ @ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long) kernel32.LCMapStringEx @ stdcall LCMapStringW(long long wstr long ptr long) kernel32.LCMapStringW @ stdcall LocaleNameToLCID(wstr long) kernel32.LocaleNameToLCID -@ stub ResolveLocaleName +@ stdcall ResolveLocaleName(wstr ptr long) kernel32.ResolveLocaleName @ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW @ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW @ stub SetProcessPreferredUILanguages diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 1a11af5..7ba1978 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1281,7 +1281,7 @@ @ stdcall ResetEvent(long) @ stdcall ResetWriteWatch(ptr long) @ stdcall ResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) ntdll.LdrResolveDelayLoadedAPI -# @ stub ResolveLocaleName +@ stdcall ResolveLocaleName(wstr ptr long) @ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error @ stdcall ResumeThread(long) @ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index a72a8aa..64966e5 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -5893,3 +5893,15 @@ BOOL WINAPI GetFileMUIInfo(DWORD flags, PCWSTR path, FILEMUIINFO *info, DWORD *s SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/****************************************************************************** + * ResolveLocaleName (KERNEL32.@) + */ + +INT WINAPI ResolveLocaleName(LPCWSTR name, LPWSTR localename, INT len) +{ + FIXME("stub: %s, %p, %d\n", wine_dbgstr_w(name), localename, len); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index bb80f21..5dc6fa6 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1345,7 +1345,7 @@ @ stdcall ResetWriteWatch(ptr long) kernel32.ResetWriteWatch @ stdcall ResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) kernel32.ResolveDelayLoadedAPI # @ stub ResolveDelayLoadsFromDll -@ stub ResolveLocaleName +@ stdcall ResolveLocaleName(wstr ptr long) kernel32.ResolveLocaleName @ stdcall RestoreLastError(long) kernel32.RestoreLastError @ stdcall ResumeThread(long) kernel32.ResumeThread @ stdcall RevertToSelf() advapi32.RevertToSelf diff --git a/include/winnls.h b/include/winnls.h index 470acf84..8cb8af6 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -950,6 +950,7 @@ WINBASEAPI INT WINAPI LCMapStringEx(LPCWSTR,DWORD,LPCWSTR,INT,LPWSTR,INT WINBASEAPI LCID WINAPI LocaleNameToLCID(LPCWSTR,DWORD); WINBASEAPI INT WINAPI MultiByteToWideChar(UINT,DWORD,LPCSTR,INT,LPWSTR,INT); WINNORMALIZEAPI INT WINAPI NormalizeString(NORM_FORM,LPCWSTR,INT,LPWSTR,INT); +WINBASEAPI INT WINAPI ResolveLocaleName(LPCWSTR,LPWSTR,INT); WINBASEAPI INT WINAPI SetCalendarInfoA(LCID,CALID,CALTYPE,LPCSTR); WINBASEAPI INT WINAPI SetCalendarInfoW(LCID,CALID,CALTYPE,LPCWSTR); #define SetCalendarInfo WINELIB_NAME_AW(SetCalendarInfo)
1
0
0
0
Nikolay Sivov : dwrite/tests: Use empty text in line metrics test.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: ddb78d73abd590ab62c69e491767e647afc7c2be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ddb78d73abd590ab62c69e491…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 19 14:42:32 2017 +0300 dwrite/tests: Use empty text in line metrics test. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/layout.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 843ab0d..1d9d38a 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -511,6 +511,7 @@ struct renderer_context { FLOAT originX; FLOAT originY; IDWriteTextFormat *format; + const WCHAR *familyW; }; static HRESULT WINAPI testrenderer_IsPixelSnappingDisabled(IDWriteTextRenderer *iface, @@ -634,8 +635,8 @@ static HRESULT WINAPI testrenderer_DrawUnderline(IDWriteTextRenderer *iface, ok(emsize == metrics.designUnitsPerEm, "Unexpected font size %f\n", emsize); /* Expected height is in design units, allow some absolute difference from it. Seems to only happen on Vista */ - ok(abs(metrics.capHeight - underline->runHeight) < 2.0f, "Expected runHeight %u, got %f\n", - metrics.capHeight, underline->runHeight); + ok(abs(metrics.capHeight - underline->runHeight) < 2.0f, "Expected runHeight %u, got %f, family %s\n", + metrics.capHeight, underline->runHeight, wine_dbgstr_w(ctxt->familyW)); IDWriteFontFace_Release(fontface); } @@ -3406,6 +3407,7 @@ static void test_GetLineMetrics(void) static const WCHAR strW[] = {'a','b','c','d',' ',0}; static const WCHAR str2W[] = {'a','b','\r','c','d',0}; static const WCHAR str4W[] = {'a','\r',0}; + static const WCHAR emptyW[] = {0}; IDWriteFontCollection *syscollection; DWRITE_FONT_METRICS fontmetrics; DWRITE_LINE_METRICS metrics[6]; @@ -3450,7 +3452,6 @@ static void test_GetLineMetrics(void) familycount = IDWriteFontCollection_GetFontFamilyCount(syscollection); for (i = 0; i < familycount; i++) { - static const WCHAR mvboliW[] = {'M','V',' ','B','o','l','i',0}; IDWriteLocalizedStrings *names; IDWriteFontFamily *family; IDWriteFont *font; @@ -3509,23 +3510,17 @@ static void test_GetLineMetrics(void) if (!exists) goto cleanup; - /* This will effectively skip on Vista/2008 only, newer systems work just fine with this font. */ - if (!lstrcmpW(nameW, mvboliW)) { - skip("Skipping line metrics test for %s, gives inconsistent results\n", wine_dbgstr_w(nameW)); - goto cleanup; - } - IDWriteFontFace_GetMetrics(fontface, &fontmetrics); hr = IDWriteFactory_CreateTextFormat(factory, nameW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, fontmetrics.designUnitsPerEm, enusW, &format); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IDWriteFactory_CreateTextLayout(factory, strW, 5, format, 30000.0f, 100.0f, &layout); + hr = IDWriteFactory_CreateTextLayout(factory, emptyW, 1, format, 30000.0f, 100.0f, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); memset(metrics, 0, sizeof(metrics)); count = 0; - hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, 2, &count); + hr = IDWriteTextLayout_GetLineMetrics(layout, metrics, sizeof(metrics)/sizeof(metrics[0]), &count); ok(hr == S_OK, "got 0x%08x\n", hr); ok(count == 1, "got %u\n", count); @@ -5101,6 +5096,7 @@ todo_wine memset(&ctxt, 0, sizeof(ctxt)); ctxt.format = format; + ctxt.familyW = nameW; hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0f, 0.0f); ok(hr == S_OK, "got 0x%08x\n", hr);
1
0
0
0
Nikolay Sivov : dwrite: Added ability to specify multiple families per fallback range.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: f4b7e4b5ed13ea17280702ecd4418559d24c3acd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4b7e4b5ed13ea17280702ecd…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 19 14:42:31 2017 +0300 dwrite: Added ability to specify multiple families per fallback range. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 3a820e7..3d187d4 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -189,7 +189,8 @@ static const struct dwritescript_properties dwritescripts_properties[Script_Last const char *debugstr_sa_script(UINT16 script) { - return script < Script_LastId ? debugstr_an((char*)&dwritescripts_properties[script].props.isoScriptCode, 4): "not defined"; + return script < Script_LastId ? debugstr_an((char*)&dwritescripts_properties[script].props.isoScriptCode, 4): + "undefined"; } /* system font falback configuration */ @@ -197,13 +198,13 @@ static const WCHAR meiryoW[] = {'M','e','i','r','y','o',0}; struct fallback_mapping { DWRITE_UNICODE_RANGE range; - const WCHAR *family; + const WCHAR *families[5]; }; static const struct fallback_mapping fontfallback_neutral_data[] = { - { { 0x3000, 0x30ff }, meiryoW }, /* CJK Symbols and Punctuation, Hiragana, Katakana */ - { { 0x31f0, 0x31ff }, meiryoW }, /* Katakana Phonetic Extensions */ - { { 0x4e00, 0x9fff }, meiryoW }, /* CJK Unified Ideographs */ + { { 0x3000, 0x30ff }, { meiryoW } }, /* CJK Symbols and Punctuation, Hiragana, Katakana */ + { { 0x31f0, 0x31ff }, { meiryoW } }, /* Katakana Phonetic Extensions */ + { { 0x4e00, 0x9fff }, { meiryoW } }, /* CJK Unified Ideographs */ }; struct dwrite_fontfallback { @@ -2026,28 +2027,41 @@ static HRESULT fallback_map_characters(IDWriteFont *font, const WCHAR *text, UIN } static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback, const WCHAR *text, UINT32 length, - DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style, DWRITE_FONT_STRETCH stretch, UINT32 *mapped_length, IDWriteFont **mapped_font) + DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style, DWRITE_FONT_STRETCH stretch, UINT32 *mapped_length, + IDWriteFont **mapped_font) { const struct fallback_mapping *mapping; + UINT32 i = 0; HRESULT hr; + *mapped_font = NULL; + mapping = find_fallback_mapping(fallback, text[0]); if (!mapping) { - WARN("no mapping for 0x%x\n", text[0]); + WARN("No mapping range for %#x.\n", text[0]); return E_FAIL; } - /* now let's see what fallback can handle */ - hr = create_matching_font((IDWriteFontCollection*)fallback->systemcollection, mapping->family, weight, style, stretch, mapped_font); - if (FAILED(hr)) { - WARN("failed to create fallback font %s for range [0x%x,0x%x], 0x%08x\n", debugstr_w(mapping->family), - mapping->range.first, mapping->range.last, hr); - return hr; + /* Now let's see what fallback can handle. Pick first font that could be created. */ + while (mapping->families[i]) { + hr = create_matching_font((IDWriteFontCollection *)fallback->systemcollection, mapping->families[i], + weight, style, stretch, mapped_font); + if (hr == S_OK) { + TRACE("Created fallback font for range [%#x, %#x], using family %s.\n", mapping->range.first, + mapping->range.last, debugstr_w(mapping->families[i])); + break; + } + i++; + } + + if (!*mapped_font) { + WARN("Failed to create fallback font for range [%#x, %#x].\n", mapping->range.first, mapping->range.last); + return E_FAIL; } hr = fallback_map_characters(*mapped_font, text, length, mapped_length); if (FAILED(hr)) - WARN("mapping with fallback font %s failed, 0x%08x\n", debugstr_w(mapping->family), hr); + WARN("Mapping with fallback family %s failed, hr %#x.\n", debugstr_w(mapping->families[i]), hr); if (!*mapped_length) { IDWriteFont_Release(*mapped_font);
1
0
0
0
Alexandre Julliard : ntdll: Add support for debug registers in exceptions on x86-64.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: a1b563f41c2246f94467b17d67a369cfbe144a2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a1b563f41c2246f94467b17d6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 19 17:11:38 2017 +0200 ntdll: Add support for debug registers in exceptions on x86-64. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_x86_64.c | 114 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 96 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index f0127f7..08881e7 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -310,6 +310,12 @@ static wine_signal_handler handlers[256]; struct amd64_thread_data { + DWORD_PTR dr0; /* debug registers */ + DWORD_PTR dr1; + DWORD_PTR dr2; + DWORD_PTR dr3; + DWORD_PTR dr6; + DWORD_PTR dr7; void *exit_frame; /* exit frame pointer */ }; @@ -1661,7 +1667,7 @@ static inline BOOL is_inside_signal_stack( void *ptr ) */ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) { - context->ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS; + context->ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_DEBUG_REGISTERS; context->Rax = RAX_sig(sigcontext); context->Rcx = RCX_sig(sigcontext); context->Rdx = RDX_sig(sigcontext); @@ -1698,6 +1704,12 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) #else __asm__("movw %%ss,%0" : "=m" (context->SegSs)); #endif + context->Dr0 = amd64_thread_data()->dr0; + context->Dr1 = amd64_thread_data()->dr1; + context->Dr2 = amd64_thread_data()->dr2; + context->Dr3 = amd64_thread_data()->dr3; + context->Dr6 = amd64_thread_data()->dr6; + context->Dr7 = amd64_thread_data()->dr7; if (FPU_sig(sigcontext)) { context->ContextFlags |= CONTEXT_FLOATING_POINT; @@ -1714,6 +1726,12 @@ static void save_context( CONTEXT *context, const ucontext_t *sigcontext ) */ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext ) { + amd64_thread_data()->dr0 = context->Dr0; + amd64_thread_data()->dr1 = context->Dr1; + amd64_thread_data()->dr2 = context->Dr2; + amd64_thread_data()->dr3 = context->Dr3; + amd64_thread_data()->dr6 = context->Dr6; + amd64_thread_data()->dr7 = context->Dr7; RAX_sig(sigcontext) = context->Rax; RCX_sig(sigcontext) = context->Rcx; RDX_sig(sigcontext) = context->Rdx; @@ -1873,6 +1891,16 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, static void set_cpu_context( const CONTEXT *context ) { DWORD flags = context->ContextFlags & ~CONTEXT_AMD64; + + if (flags & CONTEXT_DEBUG_REGISTERS) + { + amd64_thread_data()->dr0 = context->Dr0; + amd64_thread_data()->dr1 = context->Dr1; + amd64_thread_data()->dr2 = context->Dr2; + amd64_thread_data()->dr3 = context->Dr3; + amd64_thread_data()->dr6 = context->Dr6; + amd64_thread_data()->dr7 = context->Dr7; + } if (flags & CONTEXT_FULL) { if (!(flags & CONTEXT_CONTROL)) @@ -2081,10 +2109,20 @@ NTSTATUS context_from_server( CONTEXT *to, const context_t *from ) */ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) { - NTSTATUS ret; - BOOL self; + NTSTATUS ret = STATUS_SUCCESS; + BOOL self = (handle == GetCurrentThread()); + + /* debug registers require a server call */ + if (self && (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64))) + self = (amd64_thread_data()->dr0 == context->Dr0 && + amd64_thread_data()->dr1 == context->Dr1 && + amd64_thread_data()->dr2 == context->Dr2 && + amd64_thread_data()->dr3 == context->Dr3 && + amd64_thread_data()->dr6 == context->Dr6 && + amd64_thread_data()->dr7 == context->Dr7); + + if (!self) ret = set_thread_context( handle, context, &self ); - ret = set_thread_context( handle, context, &self ); if (self && ret == STATUS_SUCCESS) set_cpu_context( context ); return ret; } @@ -2109,12 +2147,25 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context ) needed_flags &= ~context->ContextFlags; } - if (self && needed_flags) + if (self) { - CONTEXT ctx; - RtlCaptureContext( &ctx ); - copy_context( context, &ctx, ctx.ContextFlags & needed_flags ); - context->ContextFlags |= ctx.ContextFlags & needed_flags; + if (needed_flags) + { + CONTEXT ctx; + RtlCaptureContext( &ctx ); + copy_context( context, &ctx, ctx.ContextFlags & needed_flags ); + context->ContextFlags |= ctx.ContextFlags & needed_flags; + } + /* update the cached version of the debug registers */ + if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) + { + amd64_thread_data()->dr0 = context->Dr0; + amd64_thread_data()->dr1 = context->Dr1; + amd64_thread_data()->dr2 = context->Dr2; + amd64_thread_data()->dr3 = context->Dr3; + amd64_thread_data()->dr6 = context->Dr6; + amd64_thread_data()->dr7 = context->Dr7; + } } return STATUS_SUCCESS; } @@ -2618,14 +2669,42 @@ static void raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) case 3: /* BREAKPOINT_LOAD_SYMBOLS */ case 4: /* BREAKPOINT_UNLOAD_SYMBOLS */ case 5: /* BREAKPOINT_COMMAND_STRING (>= Win2003) */ - goto done; + set_cpu_context( context ); } break; } - status = raise_exception( rec, context, TRUE ); - if (status) raise_status( status, rec ); -done: - set_cpu_context( context ); + status = NtRaiseException( rec, context, TRUE ); + raise_status( status, rec ); +} + + +/********************************************************************** + * raise_trap_exception + */ +static void raise_trap_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) +{ + NTSTATUS status; + + if (rec->ExceptionCode == EXCEPTION_SINGLE_STEP) + { + /* when single stepping can't tell whether this is a hw bp or a + * single step interrupt. try to avoid as much overhead as possible + * and only do a server call if there is any hw bp enabled. */ + + if( !(context->EFlags & 0x100) || (amd64_thread_data()->dr7 & 0xff) ) + { + /* (possible) hardware breakpoint, fetch the debug registers */ + DWORD saved_flags = context->ContextFlags; + context->ContextFlags = CONTEXT_DEBUG_REGISTERS; + NtGetContextThread(GetCurrentThread(), context); + context->ContextFlags |= saved_flags; /* restore flags */ + } + + context->EFlags &= ~0x100; /* clear single-step flag */ + } + + status = NtRaiseException( rec, context, TRUE ); + raise_status( status, rec ); } @@ -2636,9 +2715,8 @@ done: */ static void raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) { - NTSTATUS status = raise_exception( rec, context, TRUE ); - if (status) raise_status( status, rec ); - set_cpu_context( context ); + NTSTATUS status = NtRaiseException( rec, context, TRUE ); + raise_status( status, rec ); } @@ -2747,7 +2825,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) */ static void trap_handler( int signal, siginfo_t *siginfo, void *sigcontext ) { - EXCEPTION_RECORD *rec = setup_exception( sigcontext, raise_generic_exception ); + EXCEPTION_RECORD *rec = setup_exception( sigcontext, raise_trap_exception ); switch (siginfo->si_code) {
1
0
0
0
Alexandre Julliard : ntdll: Move the plaform-specific thread data to the SystemReserved2 TEB field.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: 9e59362ae3d6b52418a7f3519688faea78c280ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e59362ae3d6b52418a7f3519…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 19 15:20:42 2017 +0200 ntdll: Move the plaform-specific thread data to the SystemReserved2 TEB field. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 28 +++++++++++++++++----------- dlls/ntdll/signal_x86_64.c | 4 ++-- include/winternl.h | 4 ++-- tools/winebuild/relay.c | 4 ++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 96d7d26..2301ba4 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -531,25 +531,31 @@ enum i386_trap_code struct x86_thread_data { - DWORD dr0; /* 1bc Debug registers */ - DWORD dr1; /* 1c0 */ - DWORD dr2; /* 1c4 */ - DWORD dr3; /* 1c8 */ - DWORD dr6; /* 1cc */ - DWORD dr7; /* 1d0 */ DWORD fs; /* 1d4 TEB selector */ DWORD gs; /* 1d8 libc selector; update winebuild if you move this! */ - void *vm86_ptr; /* 1dc data for vm86 mode */ - int __pad[7]; /* 1e0 space for ntdll_thread_data (FIXME) */ + DWORD dr0; /* 1dc debug registers */ + DWORD dr1; /* 1e0 */ + DWORD dr2; /* 1e4 */ + DWORD dr3; /* 1e8 */ + DWORD dr6; /* 1ec */ + DWORD dr7; /* 1f0 */ + void *exit_frame; /* 1f4 exit frame pointer */ +#ifdef __HAVE_VM86 + void *vm86_ptr; /* 1f8 data for vm86 mode */ WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ - void *exit_frame; /* 204 exit frame pointer */ +#endif + /* the ntdll_thread_data structure follows here */ }; -C_ASSERT( offsetof( TEB, SpareBytes1 ) + offsetof( struct x86_thread_data, gs ) == 0x1d8 ); +C_ASSERT( offsetof( TEB, SystemReserved2 ) + offsetof( struct x86_thread_data, gs ) == 0x1d8 ); +#ifdef __HAVE_VM86 +C_ASSERT( offsetof( TEB, SystemReserved2 ) + offsetof( struct x86_thread_data, vm86 ) == + offsetof( TEB, GdiTebBatch ) + offsetof( struct ntdll_thread_data, __vm86 )); +#endif static inline struct x86_thread_data *x86_thread_data(void) { - return (struct x86_thread_data *)NtCurrentTeb()->SpareBytes1; + return (struct x86_thread_data *)NtCurrentTeb()->SystemReserved2; } /* Exception record for handling exceptions happening inside exception handlers */ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 4f0df97..f0127f7 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -313,11 +313,11 @@ struct amd64_thread_data void *exit_frame; /* exit frame pointer */ }; -C_ASSERT( sizeof(struct amd64_thread_data) <= sizeof(((TEB *)0)->SpareBytes1) ); +C_ASSERT( sizeof(struct amd64_thread_data) <= sizeof(((TEB *)0)->SystemReserved2) ); static inline struct amd64_thread_data *amd64_thread_data(void) { - return (struct amd64_thread_data *)NtCurrentTeb()->SpareBytes1; + return (struct amd64_thread_data *)NtCurrentTeb()->SystemReserved2; } /*********************************************************************** diff --git a/include/winternl.h b/include/winternl.h index 9dd9fb1..df20da5 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -328,8 +328,8 @@ typedef struct _TEB PVOID SystemReserved1[54]; /* 0cc/0110 used for kernel32 private data in Wine */ LONG ExceptionCode; /* 1a4/02c0 */ ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */ - BYTE SpareBytes1[24]; /* 1bc/02e8 used for ntdll private data in Wine */ - PVOID SystemReserved2[10]; /* 1d4/0300 used for ntdll private data in Wine */ + BYTE SpareBytes1[24]; /* 1bc/02e8 */ + PVOID SystemReserved2[10]; /* 1d4/0300 used for ntdll platform-specific private data in Wine */ GDI_TEB_BATCH GdiTebBatch; /* 1fc/0350 used for ntdll private data in Wine */ HANDLE gdiRgn; /* 6dc/0838 */ HANDLE gdiPen; /* 6e0/0840 */ diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index e9228a0..1cc6465 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -33,8 +33,8 @@ /* offset of the stack pointer relative to %fs:(0) */ #define STACKOFFSET 0xc0 /* FIELD_OFFSET(TEB,WOW32Reserved) */ -/* fix this if the ntdll_thread_regs structure is changed */ -#define GS_OFFSET 0x1d8 /* FIELD_OFFSET(TEB,SpareBytes1) + FIELD_OFFSET(ntdll_thread_data,gs) */ +/* fix this if the x86_thread_data structure is changed */ +#define GS_OFFSET 0x1d8 /* FIELD_OFFSET(TEB,SystemReserved2) + FIELD_OFFSET(struct x86_thread_data,gs) */ #define DPMI_VIF_OFFSET (0x1fc + 0) /* FIELD_OFFSET(TEB,GdiTebBatch) + FIELD_OFFSET(WINE_VM86_TEB_INFO,dpmi_vif) */ #define VM86_PENDING_OFFSET (0x1fc + 4) /* FIELD_OFFSET(TEB,GdiTebBatch) + FIELD_OFFSET(WINE_VM86_TEB_INFO,vm86_pending) */
1
0
0
0
Alexandre Julliard : ntdll: Move the plaform-independent thread data to the GdiTebBatch TEB field.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: b87c66dd656f37b0ad6d78da552c8ce8a0114d9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b87c66dd656f37b0ad6d78da5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 19 15:18:29 2017 +0200 ntdll: Move the plaform-independent thread data to the GdiTebBatch TEB field. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll_misc.h | 35 +++++++++++++---------------------- dlls/ntdll/thread.c | 10 +++++----- include/winternl.h | 2 +- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 1e71fae..ba296d2 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -212,37 +212,28 @@ struct debug_info char output[1024]; /* current output line */ }; -/* thread private data, stored in NtCurrentTeb()->SpareBytes1 */ +/* thread private data, stored in NtCurrentTeb()->GdiTebBatch */ struct ntdll_thread_data { #ifdef __i386__ - DWORD dr0; /* 1bc Debug registers */ - DWORD dr1; /* 1c0 */ - DWORD dr2; /* 1c4 */ - DWORD dr3; /* 1c8 */ - DWORD dr6; /* 1cc */ - DWORD dr7; /* 1d0 */ - DWORD fs; /* 1d4 TEB selector */ - DWORD gs; /* 1d8 libc selector; update winebuild if you move this! */ - void *vm86_ptr; /* 1dc data for vm86 mode */ -#else - void *exit_frame; /* /2e8 exit frame pointer */ + WINE_VM86_TEB_INFO __vm86; /* FIXME: placeholder for vm86 data from struct x86_thread_data */ #endif - struct debug_info *debug_info; /* 1e0/2f0 info for debugstr functions */ - int request_fd; /* 1e4/2f8 fd for sending server requests */ - int reply_fd; /* 1e8/2fc fd for receiving server replies */ - int wait_fd[2]; /* 1ec/300 fd for sleeping server requests */ - BOOL wow64_redir; /* 1f4/308 Wow64 filesystem redirection flag */ - pthread_t pthread_id; /* 1f8/310 pthread thread id */ + struct debug_info *debug_info; /* info for debugstr functions */ + int request_fd; /* fd for sending server requests */ + int reply_fd; /* fd for receiving server replies */ + int wait_fd[2]; /* fd for sleeping server requests */ + BOOL wow64_redir; /* Wow64 filesystem redirection flag */ + pthread_t pthread_id; /* pthread thread id */ +}; + +C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) ); #ifdef __i386__ - WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ - void *exit_frame; /* 204 exit frame pointer */ +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct ntdll_thread_data, __vm86 ) == 0x1fc ); #endif -}; static inline struct ntdll_thread_data *ntdll_get_thread_data(void) { - return (struct ntdll_thread_data *)NtCurrentTeb()->SpareBytes1; + return (struct ntdll_thread_data *)&NtCurrentTeb()->GdiTebBatch; } extern mode_t FILE_umask DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 5089f39..ba1be0f 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -332,7 +332,7 @@ HANDLE thread_init(void) teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer; teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer); - thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; + thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; thread_data->request_fd = -1; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; @@ -440,7 +440,7 @@ void exit_thread( int status ) if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) { - struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; + struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; if (thread_data->pthread_id) { @@ -465,7 +465,7 @@ void exit_thread( int status ) static void start_thread( struct startup_info *info ) { TEB *teb = info->teb; - struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; + struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; PRTL_THREAD_START_ROUTINE func = info->entry_point; void *arg = info->entry_arg; struct debug_info debug_info; @@ -585,7 +585,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * info->entry_point = start; info->entry_arg = param; - thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; + thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch; thread_data->request_fd = request_pipe[1]; thread_data->reply_fd = -1; thread_data->wait_fd[0] = -1; @@ -1027,7 +1027,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, { if (sel == (wine_get_cs() & ~3)) tdi->Entry.HighWord.Bits.Type |= 8; /* code segment */ - else if (sel == (ntdll_get_thread_data()->fs & ~3)) + else if (sel == (wine_get_fs() & ~3)) { ULONG_PTR fs_base = (ULONG_PTR)NtCurrentTeb(); tdi->Entry.BaseLow = fs_base & 0xffff; diff --git a/include/winternl.h b/include/winternl.h index 5cd1664..9dd9fb1 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -330,7 +330,7 @@ typedef struct _TEB ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */ BYTE SpareBytes1[24]; /* 1bc/02e8 used for ntdll private data in Wine */ PVOID SystemReserved2[10]; /* 1d4/0300 used for ntdll private data in Wine */ - GDI_TEB_BATCH GdiTebBatch; /* 1fc/0350 used for vm86 private data in Wine */ + GDI_TEB_BATCH GdiTebBatch; /* 1fc/0350 used for ntdll private data in Wine */ HANDLE gdiRgn; /* 6dc/0838 */ HANDLE gdiPen; /* 6e0/0840 */ HANDLE gdiBrush; /* 6e4/0848 */
1
0
0
0
Alexandre Julliard : ntdll: Add platform-specific versions of the thread data structure.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: f1ef8a4d9d08377c1b04908e413d0fc1c549c7f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1ef8a4d9d08377c1b04908e4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 19 15:14:24 2017 +0200 ntdll: Add platform-specific versions of the thread data structure. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_i386.c | 127 ++++++++++++++++++++++++++------------------- dlls/ntdll/signal_x86_64.c | 22 ++++++-- 2 files changed, 91 insertions(+), 58 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f1ef8a4d9d08377c1b049…
1
0
0
0
Hugh McMaster : regedit: Export value names from the export_data() function.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: 6effc48365b97e058175ded31e260423182bb80a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6effc48365b97e058175ded31…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Jul 19 05:29:22 2017 +0000 regedit: Export value names from the export_data() function. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/regproc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index d3a1f6d..57be5da 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -1311,9 +1311,11 @@ static void export_newline(FILE *fp, BOOL unicode) REGPROC_write_line(fp, newline, unicode); } -static void export_data(FILE *fp, DWORD type, size_t line_len, void *data, size_t size, BOOL unicode) +static void export_data(FILE *fp, WCHAR *value_name, DWORD value_len, DWORD type, + void *data, size_t size, BOOL unicode) { WCHAR *buf = NULL; + size_t line_len = export_value_name(fp, value_name, value_len, unicode); switch (type) { @@ -1385,8 +1387,7 @@ static int export_registry_data(FILE *fp, HKEY key, WCHAR *path, BOOL unicode) rc = RegEnumValueW(key, i, value_name, &value_len, NULL, &type, data, &data_size); if (rc == ERROR_SUCCESS) { - size_t line_len = export_value_name(fp, value_name, value_len, unicode); - export_data(fp, type, line_len, data, data_size, unicode); + export_data(fp, value_name, value_len, type, data, data_size, unicode); i++; } else if (rc == ERROR_MORE_DATA)
1
0
0
0
Hugh McMaster : regedit: Append a newline to the end of the export file.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: 97383a14f7a914709b9e33201fc28961dc243625 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97383a14f7a914709b9e33201…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Jul 19 05:29:16 2017 +0000 regedit: Append a newline to the end of the export file. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/regproc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 54cd982..d3a1f6d 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -1304,10 +1304,16 @@ static void export_hex_data(FILE *fp, WCHAR **buf, DWORD type, DWORD line_len, } } +static void export_newline(FILE *fp, BOOL unicode) +{ + static const WCHAR newline[] = {'\r','\n',0}; + + REGPROC_write_line(fp, newline, unicode); +} + static void export_data(FILE *fp, DWORD type, size_t line_len, void *data, size_t size, BOOL unicode) { WCHAR *buf = NULL; - static const WCHAR newline[] = {'\r','\n',0}; switch (type) { @@ -1328,7 +1334,7 @@ static void export_data(FILE *fp, DWORD type, size_t line_len, void *data, size_ REGPROC_write_line(fp, buf, unicode); HeapFree(GetProcessHeap(), 0, buf); - REGPROC_write_line(fp, newline, unicode); + export_newline(fp, unicode); } static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len) @@ -1498,6 +1504,7 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode) fp = REGPROC_open_export_file(file_name, unicode); ret = export_registry_data(fp, key, path, unicode); + export_newline(fp, unicode); fclose(fp); RegCloseKey(key); @@ -1530,7 +1537,9 @@ static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode) RegCloseKey(key); } + export_newline(fp, unicode); fclose(fp); + return TRUE; }
1
0
0
0
Hugh McMaster : regedit: Export REG_SZ data via the export_data() function.
by Alexandre Julliard
19 Jul '17
19 Jul '17
Module: wine Branch: master Commit: 37b5607ff6fbb8818f439a10b9370805e16b8fb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37b5607ff6fbb8818f439a10b…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Jul 19 05:29:05 2017 +0000 regedit: Export REG_SZ data via the export_data() function. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/regproc.c | 239 ++++++--------------------------------------- 1 file changed, 29 insertions(+), 210 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=37b5607ff6fbb8818f439…
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
64
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
Results per page:
10
25
50
100
200