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
March 2018
----- 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
785 discussions
Start a n
N
ew thread
Henri Verbeet : usp10: Simplify GPOS_expand_script_cache().
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: c2a876c041a3f0b848af890a6b27c09856c47757 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c2a876c041a3f0b848af890a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Mar 15 11:56:42 2018 +0330 usp10: Simplify GPOS_expand_script_cache(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/opentype.c | 80 ++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 74620a3..521b816 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -2565,6 +2565,23 @@ unsigned int OpenType_apply_GPOS_lookup(const ScriptCache *script_cache, const O lookup_index, glyphs, glyph_index, glyph_count, goffset); } +static LoadedScript *usp10_script_cache_add_script(ScriptCache *script_cache, OPENTYPE_TAG tag) +{ + LoadedScript *script; + + if (!usp10_array_reserve((void **)&script_cache->scripts, &script_cache->scripts_size, + script_cache->script_count + 1, sizeof(*script_cache->scripts))) + { + ERR("Failed to grow scripts array.\n"); + return NULL; + } + + script = &script_cache->scripts[script_cache->script_count++]; + script->tag = tag; + + return script; +} + static LoadedScript *usp10_script_cache_get_script(ScriptCache *script_cache, OPENTYPE_TAG tag) { size_t i; @@ -2610,57 +2627,34 @@ static void GSUB_initialize_script_cache(ScriptCache *psc) static void GPOS_expand_script_cache(ScriptCache *psc) { - int i, count; - const OT_ScriptList *script; - const GPOS_Header* header = (const GPOS_Header*)psc->GPOS_Table; - LoadedScript *loaded_script; + SIZE_T initial_count, count, i; + const OT_ScriptList *list; + const GPOS_Header *header; + LoadedScript *script; + OPENTYPE_TAG tag; - if (!header) + if (!(header = psc->GPOS_Table)) return; - script = (const OT_ScriptList*)((const BYTE*)header + GET_BE_WORD(header->ScriptList)); - count = GET_BE_WORD(script->ScriptCount); - - if (!count) + list = (const OT_ScriptList *)((const BYTE *)header + GET_BE_WORD(header->ScriptList)); + if (!(count = GET_BE_WORD(list->ScriptCount))) return; - if (!psc->script_count) - { - psc->script_count = count; - TRACE("initializing %li scripts in this font\n",psc->script_count); - if (psc->script_count) - { - psc->scripts = heap_alloc_zero(psc->script_count * sizeof(*psc->scripts)); - for (i = 0; i < psc->script_count; i++) - { - int offset = GET_BE_WORD(script->ScriptRecord[i].Script); - psc->scripts[i].tag = MS_MAKE_TAG(script->ScriptRecord[i].ScriptTag[0], script->ScriptRecord[i].ScriptTag[1], script->ScriptRecord[i].ScriptTag[2], script->ScriptRecord[i].ScriptTag[3]); - psc->scripts[i].gpos_table = ((const BYTE*)script + offset); - } - } - } - else + TRACE("Initialising %lu scripts in this font.\n", count); + + initial_count = psc->script_count; + for (i = 0; i < count; ++i) { - for (i = 0; i < count; i++) - { - int offset = GET_BE_WORD(script->ScriptRecord[i].Script); - OPENTYPE_TAG tag = MS_MAKE_TAG(script->ScriptRecord[i].ScriptTag[0], script->ScriptRecord[i].ScriptTag[1], script->ScriptRecord[i].ScriptTag[2], script->ScriptRecord[i].ScriptTag[3]); + tag = MS_MAKE_TAG(list->ScriptRecord[i].ScriptTag[0], + list->ScriptRecord[i].ScriptTag[1], + list->ScriptRecord[i].ScriptTag[2], + list->ScriptRecord[i].ScriptTag[3]); - if (!(loaded_script = usp10_script_cache_get_script(psc, tag))) - { - if (!usp10_array_reserve((void **)&psc->scripts, &psc->scripts_size, - psc->script_count + 1, sizeof(*psc->scripts))) - { - ERR("Failed grow scripts array.\n"); - return; - } + if (!(initial_count && (script = usp10_script_cache_get_script(psc, tag))) + && !(script = usp10_script_cache_add_script(psc, tag))) + return; - loaded_script = &psc->scripts[psc->script_count]; - ++psc->script_count; - loaded_script->tag = tag; - } - loaded_script->gpos_table = (const BYTE *)script + offset; - } + script->gpos_table = (const BYTE *)list + GET_BE_WORD(list->ScriptRecord[i].Script); } }
1
0
0
0
Andrey Gusev : dmime: Fix misplaced parenthesis.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: f80efd4460684f59c092de4e8d727649b7353d97 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f80efd4460684f59c092de4e…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Thu Mar 15 14:07:18 2018 +0200 dmime: Fix misplaced parenthesis. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/dmobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dmime/dmobject.c b/dlls/dmime/dmobject.c index 00e52f0..25f3198 100644 --- a/dlls/dmime/dmobject.c +++ b/dlls/dmime/dmobject.c @@ -292,7 +292,7 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, desc->dwValidData = 0; desc->dwSize = sizeof(*desc); - while ((hr = stream_next_chunk(stream, &chunk) == S_OK)) { + while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) { switch (chunk.id) { case DMUS_FOURCC_GUID_CHUNK: if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
1
0
0
0
Piotr Caban : wininet: Fix https connections over proxy.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: ea0dae6db2e8a18949e0ccf6b957782abc8925a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea0dae6db2e8a18949e0ccf6…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Mar 15 18:22:08 2018 +0100 wininet: Fix https connections over proxy. Successful CONNECT request switch to tunnel instead of having a message body. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 6716c80..d77e528 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -5147,6 +5147,8 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, remove_header(request, szProxy_Authorization, TRUE); destroy_authinfo(request->proxyAuthInfo); request->proxyAuthInfo = NULL; + request->contentLength = 0; + request->netconn_stream.content_length = 0; secure_proxy_connect = FALSE; loop_next = TRUE;
1
0
0
0
Matteo Bruni : d3d9/tests: Add a d3d9ex test for device caps.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: 1ba91ec9b45f6fe67537274e00cdd385e8c9324b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1ba91ec9b45f6fe67537274e…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 14 19:53:23 2018 +0100 d3d9/tests: Add a d3d9ex test for device caps. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/d3d9ex.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 6d7bd22..77e09c3 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -3911,6 +3911,138 @@ static void test_format_unknown(void) DestroyWindow(window); } +static void test_device_caps(void) +{ + IDirect3DDevice9Ex *device; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + window = create_window(); + if (!(device = create_device(window, NULL))) + { + skip("Failed to create a D3D device.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9Ex_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + ok(!(caps.Caps & ~(D3DCAPS_OVERLAY | D3DCAPS_READ_SCANLINE)), + "Caps field has unexpected flags %#x.\n", caps.Caps); + ok(!(caps.Caps2 & ~(D3DCAPS2_NO2DDURING3DSCENE | D3DCAPS2_FULLSCREENGAMMA + | D3DCAPS2_CANRENDERWINDOWED | D3DCAPS2_CANCALIBRATEGAMMA | D3DCAPS2_RESERVED + | D3DCAPS2_CANMANAGERESOURCE | D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_CANAUTOGENMIPMAP + | D3DCAPS2_CANSHARERESOURCE)), + "Caps2 field has unexpected flags %#x.\n", caps.Caps2); + /* AMD doesn't filter all the ddraw / d3d9 caps. Consider that behavior + * broken. */ + ok(!(caps.Caps3 & ~(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD + | D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION | D3DCAPS3_COPY_TO_VIDMEM + | D3DCAPS3_COPY_TO_SYSTEMMEM | D3DCAPS3_DXVAHD | D3DCAPS3_DXVAHD_LIMITED + | D3DCAPS3_RESERVED)), + "Caps3 field has unexpected flags %#x.\n", caps.Caps3); + ok(!(caps.PrimitiveMiscCaps & ~(D3DPMISCCAPS_MASKZ | D3DPMISCCAPS_LINEPATTERNREP + | D3DPMISCCAPS_CULLNONE | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLCCW + | D3DPMISCCAPS_COLORWRITEENABLE | D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + | D3DPMISCCAPS_CLIPTLVERTS | D3DPMISCCAPS_TSSARGTEMP | D3DPMISCCAPS_BLENDOP + | D3DPMISCCAPS_NULLREFERENCE | D3DPMISCCAPS_INDEPENDENTWRITEMASKS + | D3DPMISCCAPS_PERSTAGECONSTANT | D3DPMISCCAPS_FOGANDSPECULARALPHA + | D3DPMISCCAPS_SEPARATEALPHABLEND | D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS + | D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING | D3DPMISCCAPS_FOGVERTEXCLAMPED + | D3DPMISCCAPS_POSTBLENDSRGBCONVERT)), + "PrimitiveMiscCaps field has unexpected flags %#x.\n", caps.PrimitiveMiscCaps); + ok(!(caps.RasterCaps & ~(D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_PAT | D3DPRASTERCAPS_ZTEST + | D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_FOGTABLE | D3DPRASTERCAPS_ANTIALIASEDGES + | D3DPRASTERCAPS_MIPMAPLODBIAS | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZBUFFERLESSHSR + | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_ANISOTROPY | D3DPRASTERCAPS_WBUFFER + | D3DPRASTERCAPS_WFOG | D3DPRASTERCAPS_ZFOG | D3DPRASTERCAPS_COLORPERSPECTIVE + | D3DPRASTERCAPS_SCISSORTEST | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS + | D3DPRASTERCAPS_DEPTHBIAS | D3DPRASTERCAPS_MULTISAMPLE_TOGGLE)), + "RasterCaps field has unexpected flags %#x.\n", caps.RasterCaps); + /* D3DPBLENDCAPS_SRCCOLOR2 and D3DPBLENDCAPS_INVSRCCOLOR2 are only + * advertised on the reference rasterizer and WARP. */ + ok(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) + || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR + | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), + "SrcBlendCaps field has unexpected flags %#x.\n", caps.SrcBlendCaps); + ok(!(caps.DestBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR)) + || broken(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA | D3DPBLENDCAPS_BLENDFACTOR + | D3DPBLENDCAPS_SRCCOLOR2 | D3DPBLENDCAPS_INVSRCCOLOR2))), + "DestBlendCaps field has unexpected flags %#x.\n", caps.DestBlendCaps); + ok(!(caps.TextureCaps & ~(D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 + | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_SQUAREONLY + | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE | D3DPTEXTURECAPS_ALPHAPALETTE + | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PROJECTED + | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_VOLUMEMAP | D3DPTEXTURECAPS_MIPMAP + | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP + | D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2 + | D3DPTEXTURECAPS_NOPROJECTEDBUMPENV)), + "TextureCaps field has unexpected flags %#x.\n", caps.TextureCaps); + ok(!(caps.TextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_CONVOLUTIONMONO + | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "TextureFilterCaps field has unexpected flags %#x.\n", caps.TextureFilterCaps); + ok(!(caps.CubeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "CubeTextureFilterCaps field has unexpected flags %#x.\n", caps.CubeTextureFilterCaps); + ok(!(caps.VolumeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MINFGAUSSIANQUAD | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + | D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)), + "VolumeTextureFilterCaps field has unexpected flags %#x.\n", caps.VolumeTextureFilterCaps); + ok(!(caps.LineCaps & ~(D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST | D3DLINECAPS_BLEND + | D3DLINECAPS_ALPHACMP | D3DLINECAPS_FOG | D3DLINECAPS_ANTIALIAS)), + "LineCaps field has unexpected flags %#x.\n", caps.LineCaps); + ok(!(caps.StencilCaps & ~(D3DSTENCILCAPS_KEEP | D3DSTENCILCAPS_ZERO | D3DSTENCILCAPS_REPLACE + | D3DSTENCILCAPS_INCRSAT | D3DSTENCILCAPS_DECRSAT | D3DSTENCILCAPS_INVERT + | D3DSTENCILCAPS_INCR | D3DSTENCILCAPS_DECR | D3DSTENCILCAPS_TWOSIDED)), + "StencilCaps field has unexpected flags %#x.\n", caps.StencilCaps); + ok(!(caps.VertexProcessingCaps & ~(D3DVTXPCAPS_TEXGEN | D3DVTXPCAPS_MATERIALSOURCE7 + | D3DVTXPCAPS_DIRECTIONALLIGHTS | D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_LOCALVIEWER + | D3DVTXPCAPS_TWEENING | D3DVTXPCAPS_TEXGEN_SPHEREMAP + | D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER)), + "VertexProcessingCaps field has unexpected flags %#x.\n", caps.VertexProcessingCaps); + /* Both Nvidia and AMD give 10 here. */ + ok(caps.MaxActiveLights <= 10, + "MaxActiveLights field has unexpected value %u.\n", caps.MaxActiveLights); + /* AMD gives 6, Nvidia returns 8. */ + ok(caps.MaxUserClipPlanes <= 8, + "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); + + refcount = IDirect3DDevice9Ex_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(d3d9ex) { DEVMODEW current_mode; @@ -3960,4 +4092,5 @@ START_TEST(d3d9ex) test_swapchain_parameters(); test_backbuffer_resize(); test_format_unknown(); + test_device_caps(); }
1
0
0
0
Matteo Bruni : d3d9/tests: Add a test for device caps.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: c4eec9f8f8bb078b95c22ff0c58d3c34e26602e1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4eec9f8f8bb078b95c22ff0…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 14 19:53:22 2018 +0100 d3d9/tests: Add a test for device caps. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/device.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=c4eec9f8f8bb078b95c2…
1
0
0
0
Matteo Bruni : d3d8/tests: Add a test for device caps.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: d2822647e94edc545642bb82137ca4346fd27a30 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d2822647e94edc545642bb82…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 14 19:53:21 2018 +0100 d3d8/tests: Add a test for device caps. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/tests/device.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 851de3f..4d0ef71 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8586,6 +8586,121 @@ static void test_swapchain_multisample_reset(void) DestroyWindow(window); } +static void test_device_caps(void) +{ + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create a D3D device.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + ok(!(caps.Caps & ~D3DCAPS_READ_SCANLINE), "Caps field has unexpected flags %#x.\n", caps.Caps); + ok(!(caps.Caps2 & ~(D3DCAPS2_CANCALIBRATEGAMMA | D3DCAPS2_CANRENDERWINDOWED + | D3DCAPS2_CANMANAGERESOURCE | D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_FULLSCREENGAMMA + | D3DCAPS2_NO2DDURING3DSCENE | D3DCAPS2_RESERVED)), + "Caps2 field has unexpected flags %#x.\n", caps.Caps2); + /* Nvidia returns that 0x400 flag, which is is probably Vista+ + * D3DCAPS3_DXVAHD from d3d9caps.h */ + /* AMD doesn't filter all the ddraw / d3d9 caps. Consider that behavior + * broken. */ + ok(!(caps.Caps3 & ~(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD | D3DCAPS3_RESERVED | 0x400)) + || broken(!(caps.Caps3 & ~(D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD | 0x80))), + "Caps3 field has unexpected flags %#x.\n", caps.Caps3); + ok(!(caps.PrimitiveMiscCaps & ~(D3DPMISCCAPS_MASKZ | D3DPMISCCAPS_LINEPATTERNREP + | D3DPMISCCAPS_CULLNONE | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLCCW + | D3DPMISCCAPS_COLORWRITEENABLE | D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + | D3DPMISCCAPS_CLIPTLVERTS | D3DPMISCCAPS_TSSARGTEMP | D3DPMISCCAPS_BLENDOP + | D3DPMISCCAPS_NULLREFERENCE)) + || broken(!(caps.PrimitiveMiscCaps & ~0x003fdff6)), + "PrimitiveMiscCaps field has unexpected flags %#x.\n", caps.PrimitiveMiscCaps); + /* AMD includes an unknown 0x2 flag. */ + ok(!(caps.RasterCaps & ~(D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_PAT | D3DPRASTERCAPS_ZTEST + | D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_FOGTABLE | D3DPRASTERCAPS_ANTIALIASEDGES + | D3DPRASTERCAPS_MIPMAPLODBIAS | D3DPRASTERCAPS_ZBIAS | D3DPRASTERCAPS_ZBUFFERLESSHSR + | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_ANISOTROPY | D3DPRASTERCAPS_WBUFFER + | D3DPRASTERCAPS_WFOG | D3DPRASTERCAPS_ZFOG | D3DPRASTERCAPS_COLORPERSPECTIVE + | D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE)) + || broken(!(caps.RasterCaps & ~0x0ff7f19b)), + "RasterCaps field has unexpected flags %#x.\n", caps.RasterCaps); + ok(!(caps.SrcBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA)), + "SrcBlendCaps field has unexpected flags %#x.\n", caps.SrcBlendCaps); + ok(!(caps.DestBlendCaps & ~(D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR + | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA + | D3DPBLENDCAPS_DESTALPHA | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR + | D3DPBLENDCAPS_INVDESTCOLOR | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA + | D3DPBLENDCAPS_BOTHINVSRCALPHA)), + "DestBlendCaps field has unexpected flags %#x.\n", caps.DestBlendCaps); + ok(!(caps.TextureCaps & ~(D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_POW2 + | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_SQUAREONLY + | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE | D3DPTEXTURECAPS_ALPHAPALETTE + | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PROJECTED + | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_VOLUMEMAP | D3DPTEXTURECAPS_MIPMAP + | D3DPTEXTURECAPS_MIPVOLUMEMAP | D3DPTEXTURECAPS_MIPCUBEMAP + | D3DPTEXTURECAPS_CUBEMAP_POW2 | D3DPTEXTURECAPS_VOLUMEMAP_POW2)), + "TextureCaps field has unexpected flags %#x.\n", caps.TextureCaps); + ok(!(caps.TextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFAFLATCUBIC + | D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC)) + || broken(!(caps.TextureFilterCaps & ~0x0703073f)), + "TextureFilterCaps field has unexpected flags %#x.\n", caps.TextureFilterCaps); + ok(!(caps.CubeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFAFLATCUBIC + | D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC)), + "CubeTextureFilterCaps field has unexpected flags %#x.\n", caps.CubeTextureFilterCaps); + ok(!(caps.VolumeTextureFilterCaps & ~(D3DPTFILTERCAPS_MINFPOINT | D3DPTFILTERCAPS_MINFLINEAR + | D3DPTFILTERCAPS_MINFANISOTROPIC | D3DPTFILTERCAPS_MIPFPOINT + | D3DPTFILTERCAPS_MIPFLINEAR | D3DPTFILTERCAPS_MAGFPOINT | D3DPTFILTERCAPS_MAGFLINEAR + | D3DPTFILTERCAPS_MAGFANISOTROPIC | D3DPTFILTERCAPS_MAGFAFLATCUBIC + | D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC)), + "VolumeTextureFilterCaps field has unexpected flags %#x.\n", caps.VolumeTextureFilterCaps); + ok(!(caps.LineCaps & ~(D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST | D3DLINECAPS_BLEND + | D3DLINECAPS_ALPHACMP | D3DLINECAPS_FOG)), + "LineCaps field has unexpected flags %#x.\n", caps.LineCaps); + ok(!(caps.StencilCaps & ~(D3DSTENCILCAPS_KEEP | D3DSTENCILCAPS_ZERO | D3DSTENCILCAPS_REPLACE + | D3DSTENCILCAPS_INCRSAT | D3DSTENCILCAPS_DECRSAT | D3DSTENCILCAPS_INVERT + | D3DSTENCILCAPS_INCR | D3DSTENCILCAPS_DECR)), + "StencilCaps field has unexpected flags %#x.\n", caps.StencilCaps); + ok(!(caps.VertexProcessingCaps & ~(D3DVTXPCAPS_TEXGEN | D3DVTXPCAPS_MATERIALSOURCE7 + | D3DVTXPCAPS_DIRECTIONALLIGHTS | D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_LOCALVIEWER + | D3DVTXPCAPS_TWEENING | D3DVTXPCAPS_NO_VSDT_UBYTE4)), + "VertexProcessingCaps field has unexpected flags %#x.\n", caps.VertexProcessingCaps); + /* Both Nvidia and AMD give 10 here. */ + ok(caps.MaxActiveLights <= 10, + "MaxActiveLights field has unexpected value %u.\n", caps.MaxActiveLights); + /* AMD gives 6, Nvidia returns 8. */ + ok(caps.MaxUserClipPlanes <= 8, + "MaxUserClipPlanes field has unexpected value %u.\n", caps.MaxUserClipPlanes); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll"); @@ -8695,6 +8810,7 @@ START_TEST(device) test_destroyed_window(); test_clip_planes_limits(); test_swapchain_multisample_reset(); + test_device_caps(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); }
1
0
0
0
Stefan Leichter : ntdll/tests: Add tests for RtlCreateRegistryKey.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: f2c51ab7611a057e5027ab4473578c7e5ec023c3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f2c51ab7611a057e5027ab44…
Author: Stefan Leichter <sle85276(a)gmx.de> Date: Mon Mar 12 00:15:37 2018 +0100 ntdll/tests: Add tests for RtlCreateRegistryKey. Signed-off-by: Stefan Leichter <sle85276(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/reg.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index ddd400e..79344e7 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -145,6 +145,7 @@ static NTSTATUS (WINAPI * pRtlUnicodeStringToAnsiString)(PSTRING, PUNICODE_STRIN static NTSTATUS (WINAPI * pRtlFreeHeap)(PVOID, ULONG, PVOID); static LPVOID (WINAPI * pRtlAllocateHeap)(PVOID,ULONG,ULONG); static NTSTATUS (WINAPI * pRtlZeroMemory)(PVOID, ULONG); +static NTSTATUS (WINAPI * pRtlCreateRegistryKey)(ULONG, PWSTR); static NTSTATUS (WINAPI * pRtlpNtQueryValueKey)(HANDLE,ULONG*,PBYTE,DWORD*,void *); static NTSTATUS (WINAPI * pNtNotifyChangeKey)(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); static NTSTATUS (WINAPI * pNtNotifyChangeMultipleKeys)(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE, @@ -196,6 +197,7 @@ static BOOL InitFunctionPtrs(void) NTDLL_GET_PROC(RtlFreeHeap) NTDLL_GET_PROC(RtlAllocateHeap) NTDLL_GET_PROC(RtlZeroMemory) + NTDLL_GET_PROC(RtlCreateRegistryKey) NTDLL_GET_PROC(RtlpNtQueryValueKey) NTDLL_GET_PROC(RtlOpenCurrentUser) NTDLL_GET_PROC(NtWaitForSingleObject) @@ -1940,6 +1942,74 @@ static void test_notify(void) pNtClose(events[1]); } +static void test_RtlCreateRegistryKey(void) +{ + static WCHAR empty[] = {0}; + static const WCHAR key1[] = {'\\','R','t','l','C','r','e','a','t','e','R','e','g','i','s','t','r','y','K','e','y',0}; + UNICODE_STRING str; + SIZE_T size; + NTSTATUS status; + + RtlDuplicateUnicodeString(1, &winetestpath, &str); + size = str.MaximumLength + sizeof(key1)* sizeof(WCHAR) * 2; + str.Buffer = pRtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, str.Buffer, size); + str.MaximumLength = size; + pRtlAppendUnicodeToString(&str, key1); + pRtlAppendUnicodeToString(&str, key1); + + /* should work */ + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE, winetestpath.Buffer); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, winetestpath.Buffer); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER, NULL); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER | RTL_REGISTRY_OPTIONAL, NULL); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER, empty); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER | RTL_REGISTRY_OPTIONAL, empty); + ok(status == STATUS_SUCCESS, "RtlCreateRegistryKey failed: %08x\n", status); + + /* invalid first parameter */ + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER+1, winetestpath.Buffer); + ok(status == STATUS_INVALID_PARAMETER, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_INVALID_PARAMETER); + + status = pRtlCreateRegistryKey((RTL_REGISTRY_USER+1) | RTL_REGISTRY_OPTIONAL, winetestpath.Buffer); + ok(status == STATUS_INVALID_PARAMETER, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_INVALID_PARAMETER); + + /* invalid second parameter */ + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE, NULL); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_PATH_SYNTAX_BAD); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, NULL); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_PATH_SYNTAX_BAD); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE, empty); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_PATH_SYNTAX_BAD); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, empty); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_PATH_SYNTAX_BAD); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE, str.Buffer); + ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_NAME_NOT_FOUND); + + status = pRtlCreateRegistryKey(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, str.Buffer); + ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_OBJECT_NAME_NOT_FOUND); + + /* both parameters invalid */ + status = pRtlCreateRegistryKey(RTL_REGISTRY_USER+1, NULL); + ok(status == STATUS_INVALID_PARAMETER, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_INVALID_PARAMETER); + + status = pRtlCreateRegistryKey((RTL_REGISTRY_USER+1) | RTL_REGISTRY_OPTIONAL, NULL); + ok(status == STATUS_INVALID_PARAMETER, "RtlCreateRegistryKey unexpected return value: %08x, expected %08x\n", status, STATUS_INVALID_PARAMETER); +} + START_TEST(reg) { static const WCHAR winetest[] = {'\\','W','i','n','e','T','e','s','t',0}; @@ -1965,6 +2035,7 @@ START_TEST(reg) test_NtQueryValueKey(); test_long_value_name(); test_notify(); + test_RtlCreateRegistryKey(); test_NtDeleteKey(); test_symlinks(); test_redirection();
1
0
0
0
Stefan Leichter : ntdll: Implement RtlCreateRegistryKey.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: 535419a2bf8da3fd21cfdede44bf51026a97b94d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=535419a2bf8da3fd21cfdede…
Author: Stefan Leichter <sle85276(a)gmx.de> Date: Mon Mar 12 00:15:27 2018 +0100 ntdll: Implement RtlCreateRegistryKey. Signed-off-by: Stefan Leichter <sle85276(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/reg.c | 69 ++++++++++++++++++++++++++++++------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/winternl.h | 1 + 4 files changed, 60 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index e545eaf..04e108c 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -509,7 +509,7 @@ @ stdcall RtlCreateProcessParameters(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) @ stub RtlCreatePropertySet @ stdcall RtlCreateQueryDebugBuffer(long long) -@ stub RtlCreateRegistryKey +@ stdcall RtlCreateRegistryKey(long wstr) @ stdcall RtlCreateSecurityDescriptor(ptr long) # @ stub RtlCreateSystemVolumeInformationFolder @ stub RtlCreateTagHeap diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index a34c863..c6acd76 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -1133,13 +1133,10 @@ static NTSTATUS RTL_ReportRegistryValue(PKEY_VALUE_FULL_INFORMATION pInfo, } -static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle) +static NTSTATUS RTL_KeyHandleCreateObject(ULONG RelativeTo, PCWSTR Path, POBJECT_ATTRIBUTES regkey, PUNICODE_STRING str) { - UNICODE_STRING KeyString; - OBJECT_ATTRIBUTES regkey; PCWSTR base; INT len; - NTSTATUS status; static const WCHAR empty[] = {0}; static const WCHAR control[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e', @@ -1191,17 +1188,30 @@ static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle) } len = (strlenW(base) + strlenW(Path) + 1) * sizeof(WCHAR); - KeyString.Buffer = RtlAllocateHeap(GetProcessHeap(), 0, len); - if (KeyString.Buffer == NULL) + str->Buffer = RtlAllocateHeap(GetProcessHeap(), 0, len); + if (str->Buffer == NULL) return STATUS_NO_MEMORY; - strcpyW(KeyString.Buffer, base); - strcatW(KeyString.Buffer, Path); - KeyString.Length = len - sizeof(WCHAR); - KeyString.MaximumLength = len; - InitializeObjectAttributes(®key, &KeyString, OBJ_CASE_INSENSITIVE, NULL, NULL); + strcpyW(str->Buffer, base); + strcatW(str->Buffer, Path); + str->Length = len - sizeof(WCHAR); + str->MaximumLength = len; + InitializeObjectAttributes(regkey, str, OBJ_CASE_INSENSITIVE, NULL, NULL); + return STATUS_SUCCESS; +} + +static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle) +{ + OBJECT_ATTRIBUTES regkey; + UNICODE_STRING string; + NTSTATUS status; + + status = RTL_KeyHandleCreateObject(RelativeTo, Path, ®key, &string); + if(status != STATUS_SUCCESS) + return status; + status = NtOpenKey(handle, KEY_ALL_ACCESS, ®key); - RtlFreeHeap(GetProcessHeap(), 0, KeyString.Buffer); + RtlFreeUnicodeString( &string ); return status; } @@ -1415,6 +1425,41 @@ NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG RelativeTo, IN PWSTR Path) } /************************************************************************* + * RtlCreateRegistryKey [NTDLL.@] + * + * Add a key to the registry given by absolute or relative path + * + * PARAMS + * RelativeTo [I] Registry path that Path refers to + * path [I] Path to key + * + * RETURNS + * STATUS_SUCCESS or an appropriate NTSTATUS error code. + */ +NTSTATUS WINAPI RtlCreateRegistryKey(ULONG RelativeTo, PWSTR path) +{ + OBJECT_ATTRIBUTES regkey; + UNICODE_STRING string; + HANDLE handle; + NTSTATUS status; + + RelativeTo &= ~RTL_REGISTRY_OPTIONAL; + + if (!RelativeTo && (path == NULL || path[0] == 0)) + return STATUS_OBJECT_PATH_SYNTAX_BAD; + if (RelativeTo <= RTL_REGISTRY_USER && (path == NULL || path[0] == 0)) + return STATUS_SUCCESS; + status = RTL_KeyHandleCreateObject(RelativeTo, path, ®key, &string); + if(status != STATUS_SUCCESS) + return status; + + status = NtCreateKey(&handle, KEY_ALL_ACCESS, ®key, 0, NULL, REG_OPTION_NON_VOLATILE, NULL); + if (handle) NtClose(handle); + RtlFreeUnicodeString( &string ); + return status; +} + +/************************************************************************* * RtlDeleteRegistryValue [NTDLL.@] * * Query multiple registry values with a single call. diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 901f0ee..9464b38 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -976,7 +976,7 @@ @ stdcall RtlCreateAcl(ptr long long) @ stdcall RtlCreateAtomTable(long ptr) @ stdcall RtlCreateHeap(long ptr long long ptr ptr) -@ stub RtlCreateRegistryKey +@ stdcall RtlCreateRegistryKey(long wstr) @ stdcall RtlCreateSecurityDescriptor(ptr long) @ stub RtlCreateSystemVolumeInformationFolder @ stdcall RtlCreateUnicodeString(ptr wstr) diff --git a/include/winternl.h b/include/winternl.h index 5e4d8b7..f01344c 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2517,6 +2517,7 @@ NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP); NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG); NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*); NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN); +NTSYSAPI NTSTATUS WINAPI RtlCreateRegistryKey(ULONG,PWSTR); NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG); NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN); NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1
0
0
0
Stefan Leichter : ntdll: Fix RtlCheckRegistryKey when called with empty path.
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: f07e8ca8f01106b6d41a933f0ac393b30d505bad URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f07e8ca8f01106b6d41a933f…
Author: Stefan Leichter <sle85276(a)gmx.de> Date: Mon Mar 12 00:14:55 2018 +0100 ntdll: Fix RtlCheckRegistryKey when called with empty path. Signed-off-by: Stefan Leichter <sle85276(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/reg.c | 4 +++- dlls/ntdll/tests/reg.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index 2dd75be..a34c863 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -1401,10 +1401,12 @@ NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG RelativeTo, IN PWSTR Path) TRACE("(%d, %s)\n", RelativeTo, debugstr_w(Path)); - if((!RelativeTo) && Path == NULL) + if(!RelativeTo && (Path == NULL || Path[0] == 0)) return STATUS_OBJECT_PATH_SYNTAX_BAD; if(RelativeTo & RTL_REGISTRY_HANDLE) return STATUS_SUCCESS; + if((RelativeTo <= RTL_REGISTRY_USER) && (Path == NULL || Path[0] == 0)) + return STATUS_SUCCESS; status = RTL_GetKeyHandle(RelativeTo, Path, &handle); if (handle) NtClose(handle); diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 7d2e566..ddd400e 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -671,6 +671,7 @@ static void test_RtlOpenCurrentUser(void) static void test_RtlCheckRegistryKey(void) { + static WCHAR empty[] = {0}; NTSTATUS status; status = pRtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, winetestpath.Buffer); @@ -678,6 +679,18 @@ static void test_RtlCheckRegistryKey(void) status = pRtlCheckRegistryKey((RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL), winetestpath.Buffer); ok(status == STATUS_SUCCESS, "RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and RTL_REGISTRY_OPTIONAL: 0x%08x\n", status); + + status = pRtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, NULL); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and Path being NULL: 0x%08x\n", status); + + status = pRtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, empty); + ok(status == STATUS_OBJECT_PATH_SYNTAX_BAD, "RtlCheckRegistryKey with RTL_REGISTRY_ABSOLUTE and Path being empty: 0x%08x\n", status); + + status = pRtlCheckRegistryKey(RTL_REGISTRY_USER, NULL); + ok(status == STATUS_SUCCESS, "RtlCheckRegistryKey with RTL_REGISTRY_USER and Path being NULL: 0x%08x\n", status); + + status = pRtlCheckRegistryKey(RTL_REGISTRY_USER, empty); + ok(status == STATUS_SUCCESS, "RtlCheckRegistryKey with RTL_REGISTRY_USER and Path being empty: 0x%08x\n", status); } static void test_NtFlushKey(void)
1
0
0
0
Henri Verbeet : wined3d: Reject managed/ scratch textures with dynamic usage in texture_init().
by Alexandre Julliard
16 Mar '18
16 Mar '18
Module: wine Branch: master Commit: 4d4fc7ae347da73ff69f8adc357886a6ad893050 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d4fc7ae347da73ff69f8adc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Mar 15 11:56:41 2018 +0330 wined3d: Reject managed/scratch textures with dynamic usage in texture_init(). For consistency with volumetexture_init(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index e5a83ce..e1f02a5 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -2198,8 +2198,14 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 return WINED3DERR_INVALIDCALL; } - if (desc->usage & WINED3DUSAGE_DYNAMIC && wined3d_resource_access_is_managed(desc->access)) - FIXME("Trying to create a managed texture with dynamic usage.\n"); + if (desc->usage & WINED3DUSAGE_DYNAMIC && (wined3d_resource_access_is_managed(desc->access) + || desc->usage & WINED3DUSAGE_SCRATCH)) + { + WARN("Attempted to create a dynamic texture with access %s and usage %s.\n", + wined3d_debug_resource_access(desc->access), debug_d3dusage(desc->usage)); + return WINED3DERR_INVALIDCALL; + } + if (!(desc->usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL)) && (flags & WINED3D_TEXTURE_CREATE_MAPPABLE)) WARN("Creating a mappable texture that doesn't specify dynamic usage.\n");
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
79
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
Results per page:
10
25
50
100
200