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
October 2014
----- 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
397 discussions
Start a n
N
ew thread
Nikolay Sivov : dwrite: Refuse to create IDWriteFontFace with invalid collection index.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: d8a66e634c969925b9022a23eefb42ff3314247d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8a66e634c969925b9022a23e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Oct 12 18:18:10 2014 +0400 dwrite: Refuse to create IDWriteFontFace with invalid collection index. --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/font.c | 5 ++++- dlls/dwrite/opentype.c | 43 +++++++++++++++---------------------------- dlls/dwrite/tests/font.c | 10 +++++++--- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index af3ae79..b3bd1df 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -107,7 +107,7 @@ extern HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE /* Opentype font table functions */ extern HRESULT opentype_analyze_font(IDWriteFontFileStream*,UINT32*,DWRITE_FONT_FILE_TYPE*,DWRITE_FONT_FACE_TYPE*,BOOL*) DECLSPEC_HIDDEN; -extern HRESULT find_font_table(IDWriteFontFileStream *stream, UINT32 font_index, UINT32 tag, const void** table_data, void** table_context, UINT32 *table_size, BOOL* found) DECLSPEC_HIDDEN; +extern HRESULT opentype_get_font_table(IDWriteFontFileStream*,DWRITE_FONT_FACE_TYPE,UINT32,UINT32,const void**,void**,UINT32*,BOOL*) DECLSPEC_HIDDEN; extern VOID OpenType_CMAP_GetGlyphIndex(LPVOID data, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN; extern VOID get_font_properties(LPCVOID os2, LPCVOID head, LPCVOID post, DWRITE_FONT_METRICS *metrics, DWRITE_FONT_STRETCH *stretch, DWRITE_FONT_WEIGHT *weight, DWRITE_FONT_STYLE *style) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 3291054..a220501 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -429,7 +429,7 @@ static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace2 *iface, UI continue; tablecontext->file_index = i; - hr = find_font_table(stream, This->data->index, table_tag, table_data, &tablecontext->context, table_size, exists); + hr = opentype_get_font_table(stream, This->data->type, This->data->index, table_tag, table_data, &tablecontext->context, table_size, exists); IDWriteFontFileStream_Release(stream); } @@ -1619,6 +1619,9 @@ HRESULT font_create_fontface(IDWriteFactory *iface, DWRITE_FONT_FACE_TYPE facety *font_face = NULL; + if (facetype != DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION && index) + return E_INVALIDARG; + This = heap_alloc(sizeof(struct dwrite_fontface)); if (!This) return E_OUTOFMEMORY; This->data = heap_alloc(sizeof(struct dwrite_fontface_data)); diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 26ad333..9af04fd 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -225,48 +225,35 @@ HRESULT opentype_analyze_font(IDWriteFontFileStream *stream, UINT32* font_count, return S_OK; } -HRESULT find_font_table(IDWriteFontFileStream *stream, UINT32 font_index, UINT32 tag, const void** table_data, void** table_context, UINT32 *table_size, BOOL* found) +HRESULT opentype_get_font_table(IDWriteFontFileStream *stream, DWRITE_FONT_FACE_TYPE type, UINT32 font_index, UINT32 tag, + const void **table_data, void **table_context, UINT32 *table_size, BOOL *found) { - const CHAR *first_data; - void *first_context; HRESULT hr; TTC_SFNT_V1 *font_header = NULL; void *sfnt_context; TT_TableRecord *table_record = NULL; void *table_record_context; + int table_count, table_offset = 0; int i; - int table_count; - int table_offset = 0; *found = FALSE; - hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&first_data, 0, 4, &first_context); - if (SUCCEEDED(hr)) - { - if (DWRITE_MAKE_OPENTYPE_TAG(first_data[0], first_data[1], first_data[2], first_data[3]) == MS_TTCF_TAG) - { - const TTC_Header_V1 *ttc_header; - void * ttc_context; - hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&ttc_header, 0, sizeof(*ttc_header), &ttc_context); - if (SUCCEEDED(hr)) - { - table_offset = GET_BE_DWORD(ttc_header->OffsetTable[0]); - if (font_index >= GET_BE_DWORD(ttc_header->numFonts)) - hr = E_INVALIDARG; - else - hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&font_header, table_offset, sizeof(*font_header), &sfnt_context); - IDWriteFontFileStream_ReleaseFileFragment(stream, ttc_context); - } - } - else - { - if (font_index > 0) + if (type == DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) { + const TTC_Header_V1 *ttc_header; + void * ttc_context; + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&ttc_header, 0, sizeof(*ttc_header), &ttc_context); + if (SUCCEEDED(hr)) { + table_offset = GET_BE_DWORD(ttc_header->OffsetTable[0]); + if (font_index >= GET_BE_DWORD(ttc_header->numFonts)) hr = E_INVALIDARG; else - hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&font_header, 0, sizeof(*font_header), &sfnt_context); + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&font_header, table_offset, sizeof(*font_header), &sfnt_context); + IDWriteFontFileStream_ReleaseFileFragment(stream, ttc_context); } - IDWriteFontFileStream_ReleaseFileFragment(stream, first_context); } + else + hr = IDWriteFontFileStream_ReadFileFragment(stream, (const void**)&font_header, 0, sizeof(*font_header), &sfnt_context); + if (FAILED(hr)) return hr; diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 582cab0..65cd398 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -982,10 +982,14 @@ static void test_FontLoader(void) ok(face == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %i\n", face); ok(count == 1, "got %i\n", count); - hr = IDWriteFactory_CreateFontFace(factory, face, 1, &ffile, 0, 0, &fface); - ok(hr == S_OK, "got 0x%08x\n",hr); + /* invalid index */ + hr = IDWriteFactory_CreateFontFace(factory, face, 1, &ffile, 1, DWRITE_FONT_SIMULATIONS_NONE, &fface); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IDWriteFactory_CreateFontFace(factory, face, 1, &ffile, 0, DWRITE_FONT_SIMULATIONS_NONE, &fface); + ok(hr == S_OK, "got 0x%08x\n", hr); hr = IDWriteFontFace_GetGlyphIndices(fface, codePoints, 1, indices); - ok(hr == S_OK, "got0x%08x\n",hr); + ok(hr == S_OK, "got 0x%08x\n", hr); ok(indices[0] == 6, "got index %i\n",indices[0]); IDWriteFontFace_Release(fface); IDWriteFontFile_Release(ffile);
1
0
0
0
Jacek Caban : mshtml: Added HTMLTextAreaElement::get_form implementation.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 57243f0dec78b6a40a09cfbdd93525ceaf741867 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57243f0dec78b6a40a09cfbdd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Oct 15 11:43:20 2014 +0200 mshtml: Added HTMLTextAreaElement::get_form implementation. --- dlls/mshtml/htmltextarea.c | 30 ++++++++++++++++++++++++++++-- dlls/mshtml/tests/dom.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 9fb8453..f756e08 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -196,8 +196,34 @@ static HRESULT WINAPI HTMLTextAreaElement_get_disabled(IHTMLTextAreaElement *ifa static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface, IHTMLFormElement **p) { HTMLTextAreaElement *This = impl_from_IHTMLTextAreaElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMHTMLFormElement *nsform; + nsIDOMNode *nsnode; + HTMLDOMNode *node; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMHTMLTextAreaElement_GetForm(This->nstextarea, &nsform); + assert(nsres == NS_OK); + + if(!nsform) { + *p = NULL; + return S_OK; + } + + nsres = nsIDOMHTMLFormElement_QueryInterface(nsform, &IID_nsIDOMNode, (void**)&nsnode); + nsIDOMHTMLFormElement_Release(nsform); + assert(nsres == NS_OK); + + hres = get_node(This->element.node.doc, nsnode, TRUE, &node); + nsIDOMNode_Release(nsnode); + if(FAILED(hres)) + return hres; + + hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLFormElement, (void**)p); + IHTMLDOMNode_Release(&node->IHTMLDOMNode_iface); + return hres; } static HRESULT WINAPI HTMLTextAreaElement_put_defaultValue(IHTMLTextAreaElement *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e1e18dc..5dc9a8f 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1672,6 +1672,20 @@ static void _test_textarea_type(unsigned line, IUnknown *unk) SysFreeString(type); } +#define get_textarea_form(t) _get_textarea_form(__LINE__,t) +static IHTMLFormElement *_get_textarea_form(unsigned line, IUnknown *unk) +{ + IHTMLTextAreaElement *textarea = _get_textarea_iface(line, unk); + IHTMLFormElement *form; + HRESULT hres; + + hres = IHTMLTextAreaElement_get_form(textarea, &form); + IHTMLTextAreaElement_Release(textarea); + ok_(__FILE__,line)(hres == S_OK, "get_type failed: %08x\n", hres); + + return form; +} + #define test_comment_text(c,t) _test_comment_text(__LINE__,c,t) static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext) { @@ -7807,12 +7821,35 @@ static void test_elems2(IHTMLDocument2 *doc) test_elem_set_innerhtml((IUnknown*)div, "<textarea id=\"ta\"></textarea>"); elem = get_elem_by_id(doc, "ta", TRUE); if(elem) { + IHTMLFormElement *form; + test_textarea_value((IUnknown*)elem, NULL); test_textarea_put_value((IUnknown*)elem, "test"); test_textarea_readonly((IUnknown*)elem, VARIANT_FALSE); test_textarea_put_readonly((IUnknown*)elem, VARIANT_TRUE); test_textarea_put_readonly((IUnknown*)elem, VARIANT_FALSE); test_textarea_type((IUnknown*)elem); + + form = get_textarea_form((IUnknown*)elem); + ok(!form, "form = %p\n", form); + + IHTMLElement_Release(elem); + } + + test_elem_set_innerhtml((IUnknown*)div, "<form id=\"fid\"><textarea id=\"ta\"></textarea></form>"); + elem = get_elem_by_id(doc, "ta", TRUE); + if(elem) { + IHTMLFormElement *form; + + elem2 = get_elem_by_id(doc, "fid", TRUE); + ok(elem2 != NULL, "elem2 == NULL\n"); + + form = get_textarea_form((IUnknown*)elem); + ok(form != NULL, "form = NULL\n"); + ok(iface_cmp((IUnknown*)form, (IUnknown*)elem2), "form != elem2\n"); + + IHTMLFormElement_Release(form); + IHTMLElement_Release(elem2); IHTMLElement_Release(elem); }
1
0
0
0
Nikolay Sivov : msdmo: Implement IEnumDMO_Clone(), fix trace messages.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 1f93f5350b017cea0881310bc6a373041000a9ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f93f5350b017cea0881310bc…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Oct 15 08:38:55 2014 +0400 msdmo: Implement IEnumDMO_Clone(), fix trace messages. --- dlls/msdmo/dmoreg.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index f271da6..e8f67c5 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -436,43 +436,38 @@ lerr: return hr; } - /****************************************************************************** * IEnumDMO_fnAddRef */ static ULONG WINAPI IEnumDMO_fnAddRef(IEnumDMO * iface) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - return InterlockedIncrement(&This->ref); + ULONG refCount = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, refCount); + return refCount; } - /************************************************************************** * EnumDMO_QueryInterface */ -static HRESULT WINAPI IEnumDMO_fnQueryInterface( - IEnumDMO* iface, - REFIID riid, - LPVOID *ppvObj) +static HRESULT WINAPI IEnumDMO_fnQueryInterface(IEnumDMO* iface, REFIID riid, void **ppvObj) { + IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj); + *ppvObj = NULL; if (IsEqualIID(riid, &IID_IEnumDMO) || IsEqualIID(riid, &IID_IUnknown)) { *ppvObj = iface; + IEnumDMO_fnAddRef(iface); } - if(*ppvObj) - { - IEnumDMO_fnAddRef(*ppvObj); - return S_OK; - } - - return E_NOINTERFACE; + return *ppvObj ? S_OK : E_NOINTERFACE; } - /****************************************************************************** * IEnumDMO_fnRelease */ @@ -481,6 +476,8 @@ static ULONG WINAPI IEnumDMO_fnRelease(IEnumDMO * iface) IEnumDMOImpl *This = impl_from_IEnumDMO(iface); ULONG refCount = InterlockedDecrement(&This->ref); + TRACE("(%p)->(%d)\n", This, refCount); + if (!refCount) { IEnumDMOImpl_Destructor(This); @@ -512,7 +509,7 @@ static HRESULT WINAPI IEnumDMO_fnNext( IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - TRACE("--> (%p) %d %p %p %p\n", iface, cItemsToFetch, pCLSID, Names, pcItemsFetched); + TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched); if (!pCLSID || !Names || !pcItemsFetched) return E_POINTER; @@ -651,6 +648,7 @@ static HRESULT WINAPI IEnumDMO_fnSkip(IEnumDMO * iface, DWORD cItemsToSkip) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + TRACE("(%p)->(%d)\n", This, cItemsToSkip); This->index += cItemsToSkip; return S_OK; @@ -664,6 +662,7 @@ static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO * iface) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + TRACE("(%p)\n", This); This->index = -1; return S_OK; @@ -673,13 +672,12 @@ static HRESULT WINAPI IEnumDMO_fnReset(IEnumDMO * iface) /****************************************************************************** * IEnumDMO_fnClone */ -static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO * iface, IEnumDMO **ppEnum) +static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO *iface, IEnumDMO **ppEnum) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - - FIXME("(%p)->() to (%p)->() E_NOTIMPL\n", This, ppEnum); - - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, ppEnum); + return IEnumDMO_Constructor(This->guidCategory, This->dwFlags, This->cInTypes, This->pInTypes, + This->cOutTypes, This->pOutTypes, ppEnum); }
1
0
0
0
Nikolay Sivov : msdmo: Cleanup IEnumDMO creation code.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 06c52ce9404423370158e4186d115b2c8bade4a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06c52ce9404423370158e4186…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Oct 15 08:26:08 2014 +0400 msdmo: Cleanup IEnumDMO creation code. --- dlls/msdmo/dmoreg.c | 134 ++++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 66 deletions(-) diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index e0c0719..f271da6 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -352,79 +352,88 @@ static BOOL IEnumDMOImpl_Destructor(IEnumDMOImpl* This) /************************************************************************** * IEnumDMO_Constructor */ -static IEnumDMO * IEnumDMO_Constructor( +static HRESULT IEnumDMO_Constructor( REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, - const DMO_PARTIAL_MEDIATYPE *pOutTypes) + const DMO_PARTIAL_MEDIATYPE *pOutTypes, + IEnumDMO **obj) { - UINT size; IEnumDMOImpl* lpedmo; - BOOL ret = FALSE; + HRESULT hr = S_OK; + UINT size; + + *obj = NULL; lpedmo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumDMOImpl)); + if (!lpedmo) + return E_OUTOFMEMORY; - if (lpedmo) - { - lpedmo->ref = 1; - lpedmo->IEnumDMO_iface.lpVtbl = &edmovt; - lpedmo->index = -1; - lpedmo->guidCategory = guidCategory; - lpedmo->dwFlags = dwFlags; + lpedmo->IEnumDMO_iface.lpVtbl = &edmovt; + lpedmo->ref = 1; + lpedmo->index = -1; + lpedmo->guidCategory = guidCategory; + lpedmo->dwFlags = dwFlags; - if (cInTypes > 0) + if (cInTypes > 0) + { + size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE); + lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size); + if (!lpedmo->pInTypes) { - size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pInTypes) - goto lerr; - memcpy(lpedmo->pInTypes, pInTypes, size); - lpedmo->cInTypes = cInTypes; + hr = E_OUTOFMEMORY; + goto lerr; } + memcpy(lpedmo->pInTypes, pInTypes, size); + lpedmo->cInTypes = cInTypes; + } - if (cOutTypes > 0) + if (cOutTypes > 0) + { + size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE); + lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size); + if (!lpedmo->pOutTypes) { - size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pOutTypes) - goto lerr; - memcpy(lpedmo->pOutTypes, pOutTypes, size); - lpedmo->cOutTypes = cOutTypes; + hr = E_OUTOFMEMORY; + goto lerr; } + memcpy(lpedmo->pOutTypes, pOutTypes, size); + lpedmo->cOutTypes = cOutTypes; + } - /* If not filtering by category enum from media objects root */ - if (IsEqualGUID(guidCategory, &GUID_NULL)) - { - if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, - 0, KEY_READ, &lpedmo->hkey)) - ret = TRUE; - } - else - { - WCHAR szguid[64]; - WCHAR szKey[MAX_PATH]; - - wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, - GUIDToString(szguid, guidCategory)); - if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, - 0, KEY_READ, &lpedmo->hkey)) - ret = TRUE; - } + /* If not filtering by category enum from media objects root */ + if (IsEqualGUID(guidCategory, &GUID_NULL)) + { + if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey)) + hr = E_FAIL; + } + else + { + WCHAR szguid[64]; + WCHAR szKey[MAX_PATH]; -lerr: - if(!ret) - { - IEnumDMOImpl_Destructor(lpedmo); - HeapFree(GetProcessHeap(),0,lpedmo); - lpedmo = NULL; - } + wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, + GUIDToString(szguid, guidCategory)); + if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey)) + hr = E_FAIL; } - TRACE("returning %p\n", lpedmo); +lerr: - return (IEnumDMO*)lpedmo; + if (FAILED(hr)) + { + IEnumDMOImpl_Destructor(lpedmo); + HeapFree(GetProcessHeap(), 0, lpedmo); + } + else + { + TRACE("returning %p\n", lpedmo); + *obj = &lpedmo->IEnumDMO_iface; + } + + return hr; } @@ -446,14 +455,13 @@ static HRESULT WINAPI IEnumDMO_fnQueryInterface( REFIID riid, LPVOID *ppvObj) { - IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - *ppvObj = NULL; - if(IsEqualIID(riid, &IID_IUnknown)) - *ppvObj = This; - else if(IsEqualIID(riid, &IID_IEnumDMO)) - *ppvObj = This; + if (IsEqualIID(riid, &IID_IEnumDMO) || + IsEqualIID(riid, &IID_IUnknown)) + { + *ppvObj = iface; + } if(*ppvObj) { @@ -689,17 +697,11 @@ HRESULT WINAPI DMOEnum( const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **ppEnum) { - HRESULT hres = E_FAIL; - TRACE("guidCategory=%p dwFlags=0x%08x cInTypes=%d cOutTypes=%d\n", guidCategory, dwFlags, cInTypes, cOutTypes); - *ppEnum = IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes, - pInTypes, cOutTypes, pOutTypes); - if (*ppEnum) - hres = S_OK; - - return hres; + return IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes, + pInTypes, cOutTypes, pOutTypes, ppEnum); }
1
0
0
0
Stefan Dösinger : d3d9/tests: Allow a width and height to be passed to create_device() in the d3d9ex tests.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: a426d335a4f4a7a5f5e02ab67610bbcebd0f5ff7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a426d335a4f4a7a5f5e02ab67…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Oct 14 23:17:01 2014 +0200 d3d9/tests: Allow a width and height to be passed to create_device() in the d3d9ex tests. --- dlls/d3d9/tests/d3d9ex.c | 49 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 582538f..03b693c 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -30,6 +30,14 @@ static HMODULE d3d9_handle = 0; static HRESULT (WINAPI *pDirect3DCreate9Ex)(UINT SDKVersion, IDirect3D9Ex **d3d9ex); +struct device_desc +{ + HWND device_window; + unsigned int width; + unsigned int height; + BOOL windowed; +}; + static HWND create_window(void) { WNDCLASSA wc = {0}; @@ -42,7 +50,7 @@ static HWND create_window(void) 0, 0, 640, 480, 0, 0, 0, 0); } -static IDirect3DDevice9Ex *create_device(HWND device_window, HWND focus_window, BOOL windowed) +static IDirect3DDevice9Ex *create_device(HWND focus_window, const struct device_desc *desc) { D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9Ex *device; @@ -52,23 +60,31 @@ static IDirect3DDevice9Ex *create_device(HWND device_window, HWND focus_window, if (FAILED(pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9))) return NULL; - present_parameters.Windowed = windowed; - present_parameters.hDeviceWindow = device_window; - present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.hDeviceWindow = focus_window; + present_parameters.Windowed = TRUE; present_parameters.EnableAutoDepthStencil = TRUE; present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; + if (desc) + { + present_parameters.BackBufferWidth = desc->width; + present_parameters.BackBufferHeight = desc->height; + present_parameters.hDeviceWindow = desc->device_window; + present_parameters.Windowed = desc->windowed; + } + mode.Size = sizeof(mode); - mode.Width = 640; - mode.Height = 480; + mode.Width = present_parameters.BackBufferWidth; + mode.Height = present_parameters.BackBufferHeight; mode.RefreshRate = 0; mode.Format = D3DFMT_A8R8G8B8; mode.ScanLineOrdering = 0; - m = windowed ? NULL : &mode; + m = present_parameters.Windowed ? NULL : &mode; if (SUCCEEDED(IDirect3D9Ex_CreateDeviceEx(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, m, &device))) goto done; @@ -326,7 +342,7 @@ static void test_swapchain_get_displaymode_ex(void) window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping swapchain GetDisplayModeEx tests.\n"); goto out; @@ -537,7 +553,7 @@ static void test_user_memory(void) D3DCAPS9 caps; window = create_window(); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping tests.\n"); goto done; @@ -667,7 +683,7 @@ static void test_reset(void) UINT mode_count = 0; window = create_window(); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping test.\n"); DestroyWindow(window); @@ -1035,7 +1051,7 @@ static void test_reset_resources(void) window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping tests.\n"); goto done; @@ -1101,7 +1117,7 @@ static void test_vidmem_accounting(void) window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping tests.\n"); goto done; @@ -1148,7 +1164,7 @@ static void test_user_memory_getdc(void) window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); - if (!(device = create_device(window, window, TRUE))) + if (!(device = create_device(window, NULL))) { skip("Failed to create a D3D device, skipping tests.\n"); goto done; @@ -1187,10 +1203,15 @@ static void test_lost_device(void) HWND window; HRESULT hr; BOOL ret; + struct device_desc desc; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, NULL, NULL, NULL, NULL); - if (!(device = create_device(window, window, FALSE))) + desc.device_window = window; + desc.width = 640; + desc.height = 480; + desc.windowed = FALSE; + if (!(device = create_device(window, &desc))) { skip("Failed to create a D3D device, skipping tests.\n"); goto done;
1
0
0
0
Sebastian Lackner : ntdll: Improve check_atl_thunk to prevent passing exceptions to the usermode application.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 34b2d920b47122007b65d435e064d018fb37b21f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34b2d920b47122007b65d435e…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Oct 14 06:22:55 2014 +0200 ntdll: Improve check_atl_thunk to prevent passing exceptions to the usermode application. --- dlls/kernel32/tests/virtual.c | 1 - dlls/ntdll/ntdll_misc.h | 2 ++ dlls/ntdll/signal_i386.c | 20 +++++------ dlls/ntdll/virtual.c | 78 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index d258190..73b753e 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -2071,7 +2071,6 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) pRtlRemoveVectoredExceptionHandler( vectored_handler ); ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); - todo_wine ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); } else diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 4370084..aac9320 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -169,6 +169,8 @@ extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLS extern NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err ) DECLSPEC_HIDDEN; extern BOOL virtual_check_buffer_for_read( const void *ptr, SIZE_T size ) DECLSPEC_HIDDEN; extern BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size ) DECLSPEC_HIDDEN; +extern SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size ) DECLSPEC_HIDDEN; +extern SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) DECLSPEC_HIDDEN; extern void VIRTUAL_SetForceExec( BOOL enable ) DECLSPEC_HIDDEN; extern void virtual_release_address_space(void) DECLSPEC_HIDDEN; extern void virtual_set_large_address_space(void) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 7f01554..f97799c 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1633,26 +1633,24 @@ struct atl_thunk static BOOL check_atl_thunk( EXCEPTION_RECORD *rec, CONTEXT *context ) { const struct atl_thunk *thunk = (const struct atl_thunk *)rec->ExceptionInformation[1]; + struct atl_thunk thunk_copy; BOOL ret = FALSE; - if (!virtual_is_valid_code_address( thunk, sizeof(*thunk) )) return FALSE; + if (virtual_uninterrupted_read_memory( thunk, &thunk_copy, sizeof(*thunk) ) != sizeof(*thunk)) + return FALSE; - __TRY + if (thunk_copy.movl == 0x042444c7 && thunk_copy.jmp == 0xe9) { - if (thunk->movl == 0x042444c7 && thunk->jmp == 0xe9) + if (virtual_uninterrupted_write_memory( (DWORD *)context->Esp + 1, + &thunk_copy.this, sizeof(DWORD) ) == sizeof(DWORD)) { - *((DWORD *)context->Esp + 1) = thunk->this; - context->Eip = (DWORD_PTR)(&thunk->func + 1) + thunk->func; + context->Eip = (DWORD_PTR)(&thunk->func + 1) + thunk_copy.func; TRACE( "emulating ATL thunk at %p, func=%08x arg=%08x\n", - thunk, context->Eip, *((DWORD *)context->Esp + 1) ); + thunk, context->Eip, thunk_copy.this ); ret = TRUE; } } - __EXCEPT_PAGE_FAULT - { - return FALSE; - } - __ENDTRY + return ret; } diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index d2bb152..4c4c05d 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1672,6 +1672,84 @@ BOOL virtual_check_buffer_for_write( void *ptr, SIZE_T size ) /*********************************************************************** + * virtual_uninterrupted_read_memory + * + * Similar to NtReadVirtualMemory, but without wineserver calls. Moreover + * permissions are checked before accessing each page, to ensure that no + * exceptions can happen. + */ +SIZE_T virtual_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size ) +{ + struct file_view *view; + sigset_t sigset; + SIZE_T bytes_read = 0; + + if (!size) return 0; + + server_enter_uninterrupted_section( &csVirtual, &sigset ); + if ((view = VIRTUAL_FindView( addr, size ))) + { + if (!(view->protect & VPROT_SYSTEM)) + { + void *page = ROUND_ADDR( addr, page_mask ); + BYTE *p = view->prot + (((const char *)page - (const char *)view->base) >> page_shift); + + while (bytes_read < size && (VIRTUAL_GetUnixProt( *p++ ) & PROT_READ)) + { + SIZE_T block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) ); + memcpy( buffer, addr, block_size ); + + addr = (const void *)((const char *)addr + block_size); + buffer = (void *)((char *)buffer + block_size); + bytes_read += block_size; + } + } + } + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return bytes_read; +} + + +/*********************************************************************** + * virtual_uninterrupted_write_memory + * + * Similar to NtWriteVirtualMemory, but without wineserver calls. Moreover + * permissions are checked before accessing each page, to ensure that no + * exceptions can happen. + */ +SIZE_T virtual_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size ) +{ + struct file_view *view; + sigset_t sigset; + SIZE_T bytes_written = 0; + + if (!size) return 0; + + server_enter_uninterrupted_section( &csVirtual, &sigset ); + if ((view = VIRTUAL_FindView( addr, size ))) + { + if (!(view->protect & VPROT_SYSTEM)) + { + void *page = ROUND_ADDR( addr, page_mask ); + BYTE *p = view->prot + (((const char *)page - (const char *)view->base) >> page_shift); + + while (bytes_written < size && (VIRTUAL_GetUnixProt( *p++ ) & PROT_WRITE)) + { + SIZE_T block_size = min( size, page_size - ((UINT_PTR)addr & page_mask) ); + memcpy( addr, buffer, block_size ); + + addr = (void *)((char *)addr + block_size); + buffer = (const void *)((const char *)buffer + block_size); + bytes_written += block_size; + } + } + } + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return bytes_written; +} + + +/*********************************************************************** * VIRTUAL_SetForceExec * * Whether to force exec prot on all views.
1
0
0
0
Sebastian Lackner : kernel32/tests: Add test to show ATL thunk emulator exceptions are not passed to usermode.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 511a849046e7a1d46d89e80bb9a6c209b79e9481 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=511a849046e7a1d46d89e80bb…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Sat Oct 11 00:35:02 2014 +0200 kernel32/tests: Add test to show ATL thunk emulator exceptions are not passed to usermode. --- dlls/kernel32/tests/virtual.c | 72 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 434d880..d258190 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -35,7 +35,7 @@ #define NUM_THREADS 4 #define MAPPING_SIZE 0x100000 -static HINSTANCE hkernel32; +static HINSTANCE hkernel32, hntdll; static LPVOID (WINAPI *pVirtualAllocEx)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD); static BOOL (WINAPI *pVirtualFreeEx)(HANDLE, LPVOID, SIZE_T, DWORD); static UINT (WINAPI *pGetWriteWatch)(DWORD,LPVOID,SIZE_T,LPVOID*,ULONG_PTR*,ULONG*); @@ -44,6 +44,8 @@ static NTSTATUS (WINAPI *pNtAreMappedFilesTheSame)(PVOID,PVOID); static NTSTATUS (WINAPI *pNtMapViewOfSection)(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, const LARGE_INTEGER *, SIZE_T *, ULONG, ULONG, ULONG); static DWORD (WINAPI *pNtUnmapViewOfSection)(HANDLE, PVOID); static struct _TEB * (WINAPI *pNtCurrentTeb)(void); +static PVOID (WINAPI *pRtlAddVectoredExceptionHandler)(ULONG, PVECTORED_EXCEPTION_HANDLER); +static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID); /* ############################### */ @@ -1843,6 +1845,33 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR return ExceptionContinueExecution; } +static LONG CALLBACK execute_fault_vec_handler( EXCEPTION_POINTERS *ExceptionInfo ) +{ + PEXCEPTION_RECORD rec = ExceptionInfo->ExceptionRecord; + DWORD old_prot; + BOOL success; + + trace( "exception: %08x flags:%x addr:%p info[0]:%ld info[1]:%p\n", + rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, + rec->ExceptionInformation[0], (void *)rec->ExceptionInformation[1] ); + + ok( rec->NumberParameters == 2, "NumberParameters is %d instead of 2\n", rec->NumberParameters ); + ok( rec->ExceptionCode == STATUS_ACCESS_VIOLATION, + "ExceptionCode is %08x instead of STATUS_ACCESS_VIOLATION\n", rec->ExceptionCode ); + + if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) + num_execute_fault_calls++; + + if (rec->ExceptionInformation[0] == EXCEPTION_READ_FAULT) + return EXCEPTION_CONTINUE_SEARCH; + + success = VirtualProtect( (void *)rec->ExceptionInformation[1], 16, PAGE_EXECUTE_READWRITE, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + ok( old_prot == PAGE_NOACCESS, "wrong old prot %x\n", old_prot ); + + return EXCEPTION_CONTINUE_EXECUTION; +} + static inline DWORD send_message_excpt( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { EXCEPTION_REGISTRATION_RECORD frame; @@ -2021,6 +2050,34 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + /* The following test shows that on Windows, even a vectored exception handler + * cannot intercept internal exceptions thrown by the ATL thunk emulation layer. */ + + if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && !(dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)) + { + if (pRtlAddVectoredExceptionHandler && pRtlRemoveVectoredExceptionHandler) + { + PVOID vectored_handler; + + success = VirtualProtect( base, size, PAGE_NOACCESS, &old_prot ); + ok( success, "VirtualProtect failed %u\n", GetLastError() ); + + vectored_handler = pRtlAddVectoredExceptionHandler( TRUE, &execute_fault_vec_handler ); + ok( vectored_handler != 0, "RtlAddVectoredExceptionHandler failed\n" ); + + num_execute_fault_calls = 0; + ret = SendMessageA( hWnd, WM_USER, 0, 0 ); + + pRtlRemoveVectoredExceptionHandler( vectored_handler ); + + ok( ret == 43, "call returned wrong result, expected 43, got %d\n", ret ); + todo_wine + ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + } + else + win_skip( "RtlAddVectoredExceptionHandler or RtlRemoveVectoredExceptionHandler not found\n" ); + } + /* Restore the JMP instruction, set to executable, and then destroy the Window */ memcpy( base, code_jmp, sizeof(code_jmp) ); @@ -3265,15 +3322,18 @@ START_TEST(virtual) } hkernel32 = GetModuleHandleA("kernel32.dll"); + hntdll = GetModuleHandleA("ntdll.dll"); + pVirtualAllocEx = (void *) GetProcAddress(hkernel32, "VirtualAllocEx"); pVirtualFreeEx = (void *) GetProcAddress(hkernel32, "VirtualFreeEx"); pGetWriteWatch = (void *) GetProcAddress(hkernel32, "GetWriteWatch"); pResetWriteWatch = (void *) GetProcAddress(hkernel32, "ResetWriteWatch"); - pNtAreMappedFilesTheSame = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), - "NtAreMappedFilesTheSame" ); - pNtMapViewOfSection = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtMapViewOfSection"); - pNtUnmapViewOfSection = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtUnmapViewOfSection"); - pNtCurrentTeb = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtCurrentTeb" ); + pNtAreMappedFilesTheSame = (void *)GetProcAddress( hntdll, "NtAreMappedFilesTheSame" ); + pNtMapViewOfSection = (void *)GetProcAddress( hntdll, "NtMapViewOfSection" ); + pNtUnmapViewOfSection = (void *)GetProcAddress( hntdll, "NtUnmapViewOfSection" ); + pNtCurrentTeb = (void *)GetProcAddress( hntdll, "NtCurrentTeb" ); + pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlAddVectoredExceptionHandler" ); + pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlRemoveVectoredExceptionHandler" ); test_shared_memory(FALSE); test_shared_memory_ro(FALSE, FILE_MAP_READ|FILE_MAP_WRITE);
1
0
0
0
Qian Hong : ntoskrnl.exe: Export InitSafeBootMode.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 1ec64dcd239e10fb5f90e0a4ffea7bdedec742be URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ec64dcd239e10fb5f90e0a4f…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Tue Oct 14 23:14:00 2014 +0800 ntoskrnl.exe: Export InitSafeBootMode. --- dlls/ntoskrnl.exe/ntoskrnl.c | 1 + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 17a0d39..7bb96fb 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); WINE_DECLARE_DEBUG_CHANNEL(relay); BOOLEAN KdDebuggerEnabled = FALSE; +ULONG InitSafeBootMode = 0; extern LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs ); diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index b9de94b..11aaa2b 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -302,7 +302,7 @@ @ stub InbvSetScrollRegion @ stub InbvSetTextColor @ stub InbvSolidColorFill -@ stub InitSafeBootMode +@ extern InitSafeBootMode @ stdcall IoAcquireCancelSpinLock(ptr) @ stdcall IoAcquireRemoveLockEx(ptr ptr ptr long long) @ stub IoAcquireVpbSpinLock
1
0
0
0
André Hentschel : winhttp/tests: Fix typo.
by Alexandre Julliard
15 Oct '14
15 Oct '14
Module: wine Branch: master Commit: 19fe621dfdcfeb83ca227e2ecf0df5a8d6f8cbf5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19fe621dfdcfeb83ca227e2ec…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue Oct 14 14:55:05 2014 +0200 winhttp/tests: Fix typo. --- dlls/winhttp/tests/winhttp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index cf2312f..1c56923 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -876,7 +876,7 @@ static void test_secure_connection(void) ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT, &info, &size ); ok(ret, "failed to retrieve certificate info %u\n", GetLastError()); - if (!ret) + if (ret) { trace("lpszSubjectInfo %s\n", wine_dbgstr_w(info.lpszSubjectInfo)); trace("lpszIssuerInfo %s\n", wine_dbgstr_w(info.lpszIssuerInfo));
1
0
0
0
Henri Verbeet : d3d8/tests: Allow a width and height to be passed to create_device().
by Alexandre Julliard
14 Oct '14
14 Oct '14
Module: wine Branch: master Commit: 62771c7dda35d535f461f3500c1d70a1ac115146 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62771c7dda35d535f461f3500…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Oct 14 13:56:45 2014 +0200 d3d8/tests: Allow a width and height to be passed to create_device(). --- dlls/d3d8/tests/device.c | 188 +++++++++++++++++++++++++++++------------------ 1 file changed, 115 insertions(+), 73 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=62771c7dda35d535f461f…
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
40
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
Results per page:
10
25
50
100
200