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 2021
----- 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
1165 discussions
Start a n
N
ew thread
Nikolay Sivov : d3d10/effect: Remove unused field from pass structure.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: cf05d892621bfe5cf1b9a1e178bc1e1c4ae84667 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cf05d892621bfe5cf1b9a1e1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Oct 1 09:13:57 2021 +0300 d3d10/effect: Remove unused field from pass structure. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10/d3d10_private.h | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index 38733862753..648a7b0240a 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -223,7 +223,6 @@ struct d3d10_effect_pass struct d3d10_effect_technique *technique; char *name; - DWORD start; DWORD object_count; DWORD annotation_count; struct d3d10_effect_object *objects;
1
0
0
0
Nikolay Sivov : d3d10/effect: Set corresponding flag for pooled variables.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: ea24e203da5ed0c1291064a01dcf60a27bcef4af URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea24e203da5ed0c1291064a0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Oct 1 09:13:56 2021 +0300 d3d10/effect: Set corresponding flag for pooled variables. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10/d3d10_private.h | 1 + dlls/d3d10/effect.c | 26 ++++++++---- dlls/d3d10/tests/effect.c | 100 +++++++++++++++++++++++++++++++-------------- 3 files changed, 88 insertions(+), 39 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ea24e203da5ed0c12910…
1
0
0
0
Nikolay Sivov : d3d10/effect: Fix handling samplers array binding.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: d11195067fd920a002bc2e5fbcbca13a8ce1639a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d11195067fd920a002bc2e5f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Oct 1 09:13:55 2021 +0300 d3d10/effect: Fix handling samplers array binding. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10/effect.c | 50 +++++++++++++++----------- dlls/d3d10/tests/effect.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 20 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 70a99601eea..8ff7ed53963 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3973,6 +3973,29 @@ static void update_buffer(ID3D10Device *device, struct d3d10_effect_variable *v) b->changed = FALSE; } +static void set_sampler(ID3D10Device *device, D3D10_SHADER_VARIABLE_TYPE shader_type, + struct d3d10_effect_variable *v, unsigned int bind_point) +{ + switch (shader_type) + { + case D3D10_SVT_VERTEXSHADER: + ID3D10Device_VSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + case D3D10_SVT_PIXELSHADER: + ID3D10Device_PSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + case D3D10_SVT_GEOMETRYSHADER: + ID3D10Device_GSSetSamplers(device, bind_point, 1, &v->u.state.object.sampler); + break; + + default: + WARN("Incorrect shader type to bind sampler.\n"); + break; + } +} + static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShaderVariable *variable) { struct d3d10_effect_variable *v = impl_from_ID3D10EffectShaderVariable(variable); @@ -3980,7 +4003,7 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad struct d3d10_effect_shader_resource *sr; struct d3d10_effect_variable *rsrc_v; ID3D10ShaderResourceView **srv; - unsigned int i; + unsigned int i, j; for (i = 0; i < sv->resource_count; ++i) { @@ -4045,27 +4068,14 @@ static void apply_shader_resources(ID3D10Device *device, struct ID3D10EffectShad break; case D3D10_SIT_SAMPLER: - switch (v->type->basetype) + if (!rsrc_v->type->element_count) { - case D3D10_SVT_VERTEXSHADER: - ID3D10Device_VSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - case D3D10_SVT_PIXELSHADER: - ID3D10Device_PSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - case D3D10_SVT_GEOMETRYSHADER: - ID3D10Device_GSSetSamplers(device, sr->bind_point, sr->bind_count, - &rsrc_v->u.state.object.sampler); - break; - - default: - WARN("Incorrect shader type to bind sampler.\n"); - break; + set_sampler(device, v->type->basetype, rsrc_v, sr->bind_point); + break; } + + for (j = 0; j < sr->bind_count; ++j) + set_sampler(device, v->type->basetype, &rsrc_v->elements[j], sr->bind_point + j); break; default: diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 60be8186f8b..f7b536b2fb0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5769,6 +5769,55 @@ static DWORD fx_test_resource_variable[] = 0x00070000, 0x02120000, 0x00070000, 0x00000000, 0x00070000, 0x057a0000, 0x00000000, }; +#if 0 +Texture2D t_a[2]; + +SamplerState s[2] : register(s1); + +float4 PS( float4 pos : SV_POSITION ) : SV_Target +{ + return t_a[1].Sample(s[1], float2(0, 0)); +} + +technique10 rsrc_test +{ + pass p0 + { + SetPixelShader(CompileShader(ps_4_0, PS())); + } +} +#endif +static DWORD fx_test_resource_variable2[] = +{ + 0x43425844, 0xb62313ac, 0x8116090b, 0xdc1d2951, 0xfc18ca42, 0x00000001, 0x0000035a, 0x00000001, + 0x00000024, 0x30315846, 0x0000032e, 0xfeff1001, 0x00000000, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x0000028a, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74786554, + 0x32657275, 0x00040044, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x000c0000, + 0x5f740000, 0x61530061, 0x656c706d, 0x61745372, 0x2e006574, 0x02000000, 0x02000000, 0x00000000, + 0x00000000, 0x00000000, 0x15000000, 0x73000000, 0x72737200, 0x65745f63, 0x70007473, 0x02180030, + 0x58440000, 0xb2424342, 0x3c889e83, 0xb8b8fc18, 0x749f2920, 0x0001877a, 0x02180000, 0x00050000, + 0x00340000, 0x00c80000, 0x00fc0000, 0x01300000, 0x019c0000, 0x44520000, 0x008c4645, 0x00000000, + 0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x0100ffff, 0x00620000, 0x005c0000, 0x00030000, + 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00020000, 0x00010000, 0x005e0000, 0x00020000, + 0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00020000, 0x000c0000, 0x00730000, 0x00615f74, + 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, + 0x31207265, 0x00312e30, 0x5349abab, 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, + 0x00010000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000, 0x534f505f, 0x4f495449, 0x534f004e, + 0x002c4e47, 0x00010000, 0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, + 0x000f0000, 0x56530000, 0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000, + 0x005a0000, 0x60000300, 0x00020010, 0x18580000, 0x70000400, 0x00010010, 0x55550000, 0x00650000, + 0x20f20300, 0x00000010, 0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x7e460000, 0x00010010, 0x60000000, 0x00020010, 0x003e0000, 0x54530100, + 0x00745441, 0x00020000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, + 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00660000, 0x00000000, + 0x002a0000, 0x000e0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x00570000, 0x003b0000, 0x00000000, + 0xffff0000, 0x0000ffff, 0x00000000, 0x00000000, 0x00590000, 0x00010000, 0x00000000, 0x00630000, + 0x00010000, 0x00000000, 0x00070000, 0x00000000, 0x00070000, 0x02820000, 0x00000000, +}; + static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv, ID3D10Texture2D **tex) { @@ -5812,10 +5861,13 @@ static ID3D10EffectShaderResourceVariable *get_effect_shader_resource_variable_( static void test_effect_resource_variable(void) { + ID3D10SamplerState *samplers[D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT]; ID3D10ShaderResourceView *srv0, *srv_a[2], *srv_tmp[2]; ID3D10EffectShaderResourceVariable *t0, *t_a, *t_a_0; ID3D10EffectTechnique *technique; ID3D10Texture2D *tex0, *tex_a[2]; + ID3D10EffectSamplerVariable *s; + ID3D10SamplerState *sampler[2]; D3D10_EFFECT_DESC effect_desc; D3D10_PASS_DESC pass_desc; ID3D10EffectVariable *var; @@ -5938,6 +5990,45 @@ static void test_effect_resource_variable(void) effect->lpVtbl->Release(effect); + hr = create_effect(fx_test_resource_variable2, 0, device, NULL, &effect); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + technique = effect->lpVtbl->GetTechniqueByName(effect, "rsrc_test"); + ok(!!technique, "Got unexpected technique %p.\n", technique); + pass = technique->lpVtbl->GetPassByName(technique, "p0"); + ok(!!pass, "Got unexpected pass %p.\n", pass); + + var = effect->lpVtbl->GetVariableByName(effect, "s"); + ok(var->lpVtbl->IsValid(var), "Expected valid variable.\n"); + + s = var->lpVtbl->AsSampler(var); + ok(s->lpVtbl->IsValid(s), "Expected valid sample variable.\n"); + + hr = s->lpVtbl->GetSampler(s, 0, &sampler[0]); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = s->lpVtbl->GetSampler(s, 1, &sampler[1]); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = pass->lpVtbl->Apply(pass, 0); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ID3D10Device_PSGetSamplers(device, 0, ARRAY_SIZE(samplers), samplers); + for (i = 0; i < ARRAY_SIZE(samplers); ++i) + { + if (i == 1 || i == 2) + { + ok(samplers[i] == sampler[i - 1], "Unexpected sampler at %u.\n", i); + } + else + ok(!samplers[i], "Unexpected sampler at %u.\n", i); + if (samplers[i]) + ID3D10SamplerState_Release(samplers[i]); + } + for (i = 0; i < ARRAY_SIZE(sampler); ++i) + ID3D10SamplerState_Release(sampler[i]); + + effect->lpVtbl->Release(effect); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); }
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement HTMLStyleSheet's addRule.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: e670d0a81a57f2a344ff6445af335a85e8132c63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e670d0a81a57f2a344ff6445…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Oct 1 16:12:46 2021 +0300 mshtml: Implement HTMLStyleSheet's addRule. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstylesheet.c | 36 ++++++++++++++++++++++++++++++++++-- dlls/mshtml/tests/dom.js | 26 ++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 4519b06155e..b6f1c980760 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -795,9 +795,41 @@ static HRESULT WINAPI HTMLStyleSheet_addRule(IHTMLStyleSheet *iface, BSTR bstrSe BSTR bstrStyle, LONG lIndex, LONG *plIndex) { HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); - FIXME("(%p)->(%s %s %d %p)\n", This, debugstr_w(bstrSelector), debugstr_w(bstrStyle), + const WCHAR format[] = L"%s {%s}"; + nsIDOMCSSRuleList *nslist = NULL; + UINT32 length, new_index; + nsAString nsstr; + nsresult nsres; + WCHAR *rule; + size_t len; + + TRACE("(%p)->(%s %s %d %p)\n", This, debugstr_w(bstrSelector), debugstr_w(bstrStyle), lIndex, plIndex); - return E_NOTIMPL; + + if(!bstrSelector || !bstrStyle || !bstrSelector[0] || !bstrStyle[0]) + return E_INVALIDARG; + + nsres = nsIDOMCSSStyleSheet_GetCssRules(This->nsstylesheet, &nslist); + if(NS_FAILED(nsres)) + return E_FAIL; + nsIDOMCSSRuleList_GetLength(nslist, &length); + + if(lIndex > length) + lIndex = length; + + len = ARRAY_SIZE(format) - 4 /* %s twice */ + wcslen(bstrSelector) + wcslen(bstrStyle); + if(!(rule = heap_alloc(len * sizeof(WCHAR)))) + return E_OUTOFMEMORY; + swprintf(rule, len, format, bstrSelector, bstrStyle); + + nsAString_InitDepend(&nsstr, rule); + nsres = nsIDOMCSSStyleSheet_InsertRule(This->nsstylesheet, &nsstr, lIndex, &new_index); + if(NS_FAILED(nsres)) WARN("failed: %08x\n", nsres); + nsAString_Finish(&nsstr); + heap_free(rule); + + *plIndex = new_index; + return map_nsresult(nsres); } static HRESULT WINAPI HTMLStyleSheet_removeImport(IHTMLStyleSheet *iface, LONG lIndex) diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 73c2b3b0866..3a2b96a7958 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -405,6 +405,32 @@ sync_test("stylesheets", function() { stylesheet.insertRule(".input { margin-left: 1px; }", 3); ok(false, "expected exception"); }catch(e) {} + + id = stylesheet.addRule(".p", "margin-top: 2px"); + ok(id === 2, "id = " + id); + ok(document.styleSheets.length === 1, "document.styleSheets.length = " + document.styleSheets.length); + ok(stylesheet.rules.length === 3, "stylesheet.rules.length = " + stylesheet.rules.length); + + id = stylesheet.addRule(".pre", "border: none", -1); + ok(id === 3, "id = " + id); + ok(stylesheet.rules.length === 4, "stylesheet.rules.length = " + stylesheet.rules.length); + + id = stylesheet.addRule(".h1", " ", 0); + ok(id === 0, "id = " + id); + ok(stylesheet.rules.length === 5, "stylesheet.rules.length = " + stylesheet.rules.length); + + id = stylesheet.addRule(".h2", "color: black", 8); + ok(id === 5, "id = " + id); + ok(stylesheet.rules.length === 6, "stylesheet.rules.length = " + stylesheet.rules.length); + + try { + stylesheet.addRule("", "border: none", 0); + ok(false, "expected exception"); + }catch(e) {} + try { + stylesheet.addRule(".img", "", 0); + ok(false, "expected exception"); + }catch(e) {} }); sync_test("storage", function() {
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement HTMLAreaElement's href prop.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 2412a04d84be4062ce5eaabb9ec1e96316aa3d91 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2412a04d84be4062ce5eaabb…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Oct 1 16:12:45 2021 +0300 mshtml: Implement HTMLAreaElement's href prop. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlarea.c | 36 ++++++++++++++++++++++++---- dlls/mshtml/tests/dom.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 92 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index a0708c4b062..e785871e244 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -129,15 +129,43 @@ static HRESULT WINAPI HTMLAreaElement_get_coords(IHTMLAreaElement *iface, BSTR * static HRESULT WINAPI HTMLAreaElement_put_href(IHTMLAreaElement *iface, BSTR v) { HTMLAreaElement *This = impl_from_IHTMLAreaElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&nsstr, v); + nsres = nsIDOMHTMLAreaElement_SetHref(This->nsarea, &nsstr); + nsAString_Finish(&nsstr); + if(NS_FAILED(nsres)) + return E_FAIL; + + return S_OK; } static HRESULT WINAPI HTMLAreaElement_get_href(IHTMLAreaElement *iface, BSTR *p) { HTMLAreaElement *This = impl_from_IHTMLAreaElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString href_str; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&href_str, NULL); + nsres = nsIDOMHTMLAreaElement_GetHref(This->nsarea, &href_str); + if(NS_SUCCEEDED(nsres)) { + const PRUnichar *href; + + nsAString_GetData(&href_str, &href); + hres = nsuri_to_url(href, TRUE, p); + }else { + ERR("GetHref failed: %08x\n", nsres); + hres = E_FAIL; + } + + nsAString_Finish(&href_str); + return hres; } static HRESULT WINAPI HTMLAreaElement_put_target(IHTMLAreaElement *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 67d79780907..3bae9e08225 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -77,6 +77,7 @@ static const char elem_test_str[] = "<script id=\"sc\" type=\"text/javascript\"><!--\nfunction Testing() {}\n// -->\n</script>" "<test /><object id=\"objid\" name=\"objname\" vspace=100></object><embed />" "<img id=\"imgid\" name=\"WineImg\"/>" + "<area id=\"area\" href=\"
http://test\
">" "<iframe src=\"about:blank\" id=\"ifr\"></iframe>" "<form id=\"frm\"></form>" "<div id=\"attr\" attr1=\"attr1\" attr2 attr3=\"attr3\"></div>" @@ -918,6 +919,17 @@ static IHTMLAnchorElement *_get_anchor_iface(unsigned line, IUnknown *unk) return anchor; } +#define get_area_iface(u) _get_area_iface(__LINE__,u) +static IHTMLAreaElement *_get_area_iface(unsigned line, IUnknown *unk) +{ + IHTMLAreaElement *area; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLAreaElement, (void**)&area); + ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLAreaElement: %08x\n", hres); + return area; +} + #define get_textarea_iface(u) _get_textarea_iface(__LINE__,u) static IHTMLTextAreaElement *_get_textarea_iface(unsigned line, IUnknown *unk) { @@ -1704,6 +1716,36 @@ static void _test_anchor_hash(unsigned line, IHTMLElement *elem, const WCHAR *ex SysFreeString(str); } +#define test_area_href(a,h) _test_area_href(__LINE__,a,h) +static void _test_area_href(unsigned line, IUnknown *unk, const WCHAR *exhref) +{ + IHTMLAreaElement *area = _get_area_iface(line, unk); + BSTR str; + HRESULT hres; + + hres = IHTMLAreaElement_get_href(area, &str); + ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08x\n", hres); + ok_(__FILE__,line)(!lstrcmpW(str, exhref), "href = %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(exhref)); + SysFreeString(str); + + _test_disp_value(line, unk, exhref); +} + +#define test_area_put_href(a,h) _test_area_put_href(__LINE__,a,h) +static void _test_area_put_href(unsigned line, IUnknown *unk, const WCHAR *exhref) +{ + IHTMLAreaElement *area = _get_area_iface(line, unk); + BSTR str; + HRESULT hres; + + str = SysAllocString(exhref); + hres = IHTMLAreaElement_put_href(area, str); + ok_(__FILE__,line)(hres == S_OK, "get_href failed: %08x\n", hres); + SysFreeString(str); + + _test_disp_value(line, unk, exhref); +} + #define test_option_text(o,t) _test_option_text(__LINE__,o,t) static void _test_option_text(unsigned line, IHTMLOptionElement *option, const WCHAR *text) { @@ -8763,6 +8805,7 @@ static void test_elems(IHTMLDocument2 *doc) ET_OBJECT, ET_EMBED, ET_IMG, + ET_AREA, ET_IFRAME, ET_FORM, ET_DIV @@ -8803,8 +8846,8 @@ static void test_elems(IHTMLDocument2 *doc) ok(hres == S_OK, "get_links failed: %08x\n", hres); if(hres == S_OK) { - static const elem_type_t images_types[] = {ET_A}; - test_elem_collection((IUnknown*)collection, images_types, 1); + static const elem_type_t link_types[] = {ET_A,ET_AREA}; + test_elem_collection((IUnknown*)collection, link_types, 2); IHTMLElementCollection_Release(collection); } @@ -9211,6 +9254,21 @@ static void test_elems(IHTMLDocument2 *doc) IHTMLElement_Release(elem); } + elem = get_elem_by_id(doc, L"area", TRUE); + if(elem) { + test_area_href((IUnknown*)elem, L"
http://test/
"); + + /* Change the href */ + test_area_put_href((IUnknown*)elem, L"
http://test1/
"); + test_area_href((IUnknown*)elem, L"
http://test1/
"); + + /* Restore the href */ + test_area_put_href((IUnknown*)elem, L"
http://test/
"); + test_area_href((IUnknown*)elem, L"
http://test/
"); + + IHTMLElement_Release(elem); + } + elem = get_doc_elem_by_id(doc, L"metaid"); if(elem) { test_meta_name((IUnknown*)elem, L"meta name");
1
0
0
0
Gabriel Ivăncescu : mshtml: Expose toString() for WineDOMTokenList.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: ec665f1c7d1d010f8afb49550225439a2c760775 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec665f1c7d1d010f8afb4955…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Oct 1 16:12:44 2021 +0300 mshtml: Expose toString() for WineDOMTokenList. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlelem.c | 10 ++++++++++ dlls/mshtml/mshtml_private_iface.idl | 2 ++ dlls/mshtml/tests/dom.js | 2 ++ 3 files changed, 14 insertions(+) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 4e5aba7c344..b07de03be2d 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6612,6 +6612,15 @@ static HRESULT WINAPI token_list_remove(IWineDOMTokenList *iface, BSTR token) return token_list_add_remove(iface, token, TRUE); } +static HRESULT WINAPI token_list_toString(IWineDOMTokenList *iface, BSTR *String) +{ + struct token_list *token_list = impl_from_IWineDOMTokenList(iface); + + TRACE("(%p)->(%p)\n", token_list, String); + + return IHTMLElement_get_className(token_list->element, String); +} + static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = { token_list_QueryInterface, token_list_AddRef, @@ -6622,6 +6631,7 @@ static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = { token_list_Invoke, token_list_add, token_list_remove, + token_list_toString }; static inline struct token_list *token_list_from_DispatchEx(DispatchEx *iface) diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 2292e2cf76b..5755afdfe5c 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -115,6 +115,8 @@ interface IWineDOMTokenList : IDispatch HRESULT add([in] BSTR token); [id(2)] HRESULT remove([in] BSTR token); + [id(3)] + HRESULT toString([retval, out] BSTR *String); } } /* library MSHTML_private */ diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index efbab663902..73c2b3b0866 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -528,6 +528,7 @@ sync_test("classList", function() { classList.add("c"); ok(elem.className === "a b c 4", "(2) Expected className 'a b c 4', got " + elem.className); ok(("" + classList) === "a b c 4", "Expected classList value 'a b c 4', got " + classList); + ok(classList.toString() === "a b c 4", "Expected classList toString 'a b c 4', got " + classList.toString()); var exception = false @@ -609,4 +610,5 @@ sync_test("classList", function() { elem.className = " testclass foobar "; ok(("" + classList) === " testclass foobar ", "Expected classList value ' testclass foobar ', got " + classList); + ok(classList.toString() === " testclass foobar ", "Expected classList toString ' testclass foobar ', got " + classList.toString()); });
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement proper value for WineDOMTokenList.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 31883ce4ac5231ba528f09b6b4f04067cde40bf9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=31883ce4ac5231ba528f09b6…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Oct 1 16:12:43 2021 +0300 mshtml: Implement proper value for WineDOMTokenList. It returns the classes as specified in className. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlelem.c | 32 +++++++++++++++++++++++++++++++- dlls/mshtml/tests/dom.js | 4 ++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index d9554f4668d..4e5aba7c344 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -6624,12 +6624,42 @@ static const IWineDOMTokenListVtbl WineDOMTokenListVtbl = { token_list_remove, }; +static inline struct token_list *token_list_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, struct token_list, dispex); +} + +static HRESULT token_list_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + struct token_list *token_list = token_list_from_DispatchEx(dispex); + HRESULT hres; + + switch(flags) { + case DISPATCH_PROPERTYGET: + hres = IHTMLElement_get_className(token_list->element, &V_BSTR(res)); + if(FAILED(hres)) + return hres; + V_VT(res) = VT_BSTR; + break; + default: + FIXME("Unimplemented flags %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; +} + +static const dispex_static_data_vtbl_t token_list_dispex_vtbl = { + token_list_value +}; + static const tid_t token_list_iface_tids[] = { IWineDOMTokenList_tid, 0 }; static dispex_static_data_t token_list_dispex = { - NULL, + &token_list_dispex_vtbl, IWineDOMTokenList_tid, token_list_iface_tids }; diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 0085b40efed..efbab663902 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -527,6 +527,7 @@ sync_test("classList", function() { classList.add("c"); ok(elem.className === "a b c 4", "(2) Expected className 'a b c 4', got " + elem.className); + ok(("" + classList) === "a b c 4", "Expected classList value 'a b c 4', got " + classList); var exception = false @@ -605,4 +606,7 @@ sync_test("classList", function() { classList.remove("b"); ok(elem.className === "", "remove: expected className '', got " + elem.className); + + elem.className = " testclass foobar "; + ok(("" + classList) === " testclass foobar ", "Expected classList value ' testclass foobar ', got " + classList); });
1
0
0
0
Gabriel Ivăncescu : mshtml: Adjust the IWineHTMLWindowPrivate ids.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: f640a446e3c660a12c40a6a33cfef10e80410067 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f640a446e3c660a12c40a6a3…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Fri Oct 1 16:12:42 2021 +0300 mshtml: Adjust the IWineHTMLWindowPrivate ids. So it doesn't clash with IHTMLWindow2, which uses low ids ('console' clashes with 'history'). Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/mshtml_private_iface.idl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private_iface.idl b/dlls/mshtml/mshtml_private_iface.idl index 491f4afb0b6..2292e2cf76b 100644 --- a/dlls/mshtml/mshtml_private_iface.idl +++ b/dlls/mshtml/mshtml_private_iface.idl @@ -83,9 +83,9 @@ interface IWineMSHTMLConsole : IDispatch ] interface IWineHTMLWindowPrivate : IDispatch { - [id(1)] + [id(50)] HRESULT requestAnimationFrame([in] VARIANT *expr, [retval, out] VARIANT *timer_id); - [propget, id(2)] + [propget, id(51)] HRESULT console([retval, out] IDispatch **console); }
1
0
0
0
Huw Davies : nsiproxy: Build with msvcrt.
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: 37097b96874f043d87c22df4055d5f85be356c51 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37097b96874f043d87c22df4…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Oct 1 15:07:06 2021 +0100 nsiproxy: Build with msvcrt. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 - configure.ac | 1 - dlls/nsiproxy.sys/Makefile.in | 5 +++-- dlls/nsiproxy.sys/device.c | 36 ++++++++++++++++++++++++++++-------- dlls/nsiproxy.sys/ip.c | 6 ++++++ dlls/nsiproxy.sys/ndis.c | 9 +++++++-- dlls/nsiproxy.sys/nsi.c | 30 ++++++++++++++++++++++++++++++ dlls/nsiproxy.sys/tcp.c | 4 ++++ dlls/nsiproxy.sys/udp.c | 4 ++++ 9 files changed, 82 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 038391a4439..2a429f4c13d 100755 --- a/configure +++ b/configure @@ -8343,7 +8343,6 @@ if test "x$ac_cv_cflags__Wl___disable_stdcall_fixup" = xyes; then : fi ;; esac enable_iphlpapi=${enable_iphlpapi:-no} - enable_nsiproxy_sys=${enable_nsiproxy_sys:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no} with_x=${with_x:-no} diff --git a/configure.ac b/configure.ac index da80562c445..913692c828a 100644 --- a/configure.ac +++ b/configure.ac @@ -725,7 +725,6 @@ case $host_os in esac dnl Disable modules that can't be used on Windows enable_iphlpapi=${enable_iphlpapi:-no} - enable_nsiproxy_sys=${enable_nsiproxy_sys:-no} enable_loader=${enable_loader:-no} enable_server=${enable_server:-no} dnl Disable dependencies that are not useful on Windows diff --git a/dlls/nsiproxy.sys/Makefile.in b/dlls/nsiproxy.sys/Makefile.in index b33ea0e4c8a..95f2a205816 100644 --- a/dlls/nsiproxy.sys/Makefile.in +++ b/dlls/nsiproxy.sys/Makefile.in @@ -1,8 +1,9 @@ MODULE = nsiproxy.sys -IMPORTS = ntoskrnl uuid +UNIXLIB = nsiproxy.so +IMPORTS = ntoskrnl EXTRALIBS = $(PROCSTAT_LIBS) -EXTRADLLFLAGS = -Wl,--subsystem,native -mcygwin +EXTRADLLFLAGS = -Wl,--subsystem,native C_SRCS = \ device.c \ diff --git a/dlls/nsiproxy.sys/device.c b/dlls/nsiproxy.sys/device.c index 80a025acfc9..3afd76487ff 100644 --- a/dlls/nsiproxy.sys/device.c +++ b/dlls/nsiproxy.sys/device.c @@ -32,10 +32,24 @@ #include "netiodef.h" #include "wine/nsi.h" #include "wine/debug.h" -#include "nsiproxy_private.h" +#include "wine/unixlib.h" WINE_DEFAULT_DEBUG_CHANNEL(nsi); +static unixlib_handle_t nsiproxy_handle; + +static NTSTATUS nsiproxy_call( unsigned int code, void *args ) +{ + return __wine_unix_call( nsiproxy_handle, code, args ); +} + +enum unix_calls +{ + nsi_enumerate_all_ex, + nsi_get_all_parameters_ex, + nsi_get_parameter_ex, +}; + static void nsiproxy_enumerate_all( IRP *irp ) { IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); @@ -73,7 +87,7 @@ static void nsiproxy_enumerate_all( IRP *irp ) enum_all.static_size = in->static_size; enum_all.count = in->count; - irp->IoStatus.u.Status = nsi_enumerate_all_ex( &enum_all ); + irp->IoStatus.u.Status = nsiproxy_call( nsi_enumerate_all_ex, &enum_all ); if (irp->IoStatus.u.Status == STATUS_SUCCESS || irp->IoStatus.u.Status == STATUS_BUFFER_OVERFLOW) { irp->IoStatus.Information = out_len; @@ -119,7 +133,7 @@ static void nsiproxy_get_all_parameters( IRP *irp ) get_all.static_data = out + in->rw_size + in->dynamic_size; get_all.static_size = in->static_size; - irp->IoStatus.u.Status = nsi_get_all_parameters_ex( &get_all ); + irp->IoStatus.u.Status = nsiproxy_call( nsi_get_all_parameters_ex, &get_all ); irp->IoStatus.Information = (irp->IoStatus.u.Status == STATUS_SUCCESS) ? out_len : 0; } @@ -152,7 +166,7 @@ static void nsiproxy_get_parameter( IRP *irp ) get_param.data_size = out_len; get_param.data_offset = in->data_offset; - irp->IoStatus.u.Status = nsi_get_parameter_ex( &get_param ); + irp->IoStatus.u.Status = nsiproxy_call( nsi_get_parameter_ex, &get_param ); irp->IoStatus.Information = irp->IoStatus.u.Status == STATUS_SUCCESS ? out_len : 0; } @@ -193,14 +207,12 @@ static NTSTATUS WINAPI nsi_ioctl( DEVICE_OBJECT *device, IRP *irp ) static int add_device( DRIVER_OBJECT *driver ) { - static const WCHAR name_str[] = {'\\','D','e','v','i','c','e','\\','N','s','i',0}; - static const WCHAR link_str[] = {'\\','?','?','\\','N','s','i',0}; UNICODE_STRING name, link; DEVICE_OBJECT *device; NTSTATUS status; - RtlInitUnicodeString( &name, name_str ); - RtlInitUnicodeString( &link, link_str ); + RtlInitUnicodeString( &name, L"\\Device\\Nsi" ); + RtlInitUnicodeString( &link, L"\\??\\Nsi" ); if (!(status = IoCreateDevice( driver, 0, &name, FILE_DEVICE_NETWORK, FILE_DEVICE_SECURE_OPEN, FALSE, &device ))) status = IoCreateSymbolicLink( &link, &name ); @@ -215,8 +227,16 @@ static int add_device( DRIVER_OBJECT *driver ) NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) { + HMODULE instance; + NTSTATUS status; + TRACE( "(%p, %s)\n", driver, debugstr_w( path->Buffer ) ); + RtlPcToFileHeader( &DriverEntry, (void *)&instance ); + status = NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs, + &nsiproxy_handle, sizeof(nsiproxy_handle), NULL ); + if (status) return status; + driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = nsi_ioctl; add_device( driver ); diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 90ea7957204..2e69c289c16 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -18,6 +18,12 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep unix +#endif + +#define _NTSYSTEM_ + #include "config.h" #include <stdarg.h> diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index 90112da31bb..8971b69c2db 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -18,6 +18,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <stdarg.h> @@ -85,6 +89,7 @@ #include "wine/nsi.h" #include "wine/list.h" #include "wine/debug.h" +#include "wine/unixlib.h" #include "nsiproxy_private.h" @@ -251,9 +256,9 @@ static WCHAR *strdupAtoW( const char *str ) DWORD len; if (!str) return ret; - len = MultiByteToWideChar( CP_UNIXCP, 0, str, -1, NULL, 0 ); + len = strlen( str ) + 1; ret = malloc( len * sizeof(WCHAR) ); - if (ret) MultiByteToWideChar( CP_UNIXCP, 0, str, -1, ret, len ); + if (ret) ntdll_umbstowcs( str, len, ret, len ); return ret; } diff --git a/dlls/nsiproxy.sys/nsi.c b/dlls/nsiproxy.sys/nsi.c index e29446abb50..ccfc325a085 100644 --- a/dlls/nsiproxy.sys/nsi.c +++ b/dlls/nsiproxy.sys/nsi.c @@ -17,6 +17,9 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep unix +#endif #include <stdarg.h> @@ -28,9 +31,11 @@ #include "winioctl.h" #include "ddk/wdm.h" #include "ifdef.h" +#define __WINE_INIT_NPI_MODULEID #include "netiodef.h" #include "wine/nsi.h" #include "wine/debug.h" +#include "wine/unixlib.h" #include "nsiproxy_private.h" WINE_DEFAULT_DEBUG_CHANNEL(nsi); @@ -121,3 +126,28 @@ NTSTATUS nsi_get_parameter_ex( struct nsi_get_parameter_ex *params ) return entry->get_parameter( params->key, params->key_size, params->param_type, params->data, params->data_size, params->data_offset ); } + +static NTSTATUS unix_nsi_enumerate_all_ex( void *args ) +{ + struct nsi_enumerate_all_ex *params = (struct nsi_enumerate_all_ex *)args; + return nsi_enumerate_all_ex( params ); +} + +static NTSTATUS unix_nsi_get_all_parameters_ex( void *args ) +{ + struct nsi_get_all_parameters_ex *params = (struct nsi_get_all_parameters_ex *)args; + return nsi_get_all_parameters_ex( params ); +} + +static NTSTATUS unix_nsi_get_parameter_ex( void *args ) +{ + struct nsi_get_parameter_ex *params = (struct nsi_get_parameter_ex *)args; + return nsi_get_parameter_ex( params ); +} + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + unix_nsi_enumerate_all_ex, + unix_nsi_get_all_parameters_ex, + unix_nsi_get_parameter_ex +}; diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index b60e53ea15e..55311a4affc 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -19,6 +19,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <stdarg.h> diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index f25aac98ba0..0cc2cadbc98 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -18,6 +18,10 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep unix +#endif + #include "config.h" #include <stdarg.h> #include <stddef.h>
1
0
0
0
Huw Davies : nsiproxy: Switch memory allocations to malloc().
by Alexandre Julliard
01 Oct '21
01 Oct '21
Module: wine Branch: master Commit: f6917badf1924096b979fd38a4bebbf80d002568 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f6917badf1924096b979fd38…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Oct 1 15:07:05 2021 +0100 nsiproxy: Switch memory allocations to malloc(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsiproxy.sys/ip.c | 13 ++++++------- dlls/nsiproxy.sys/ndis.c | 11 +++++------ dlls/nsiproxy.sys/tcp.c | 33 ++++++++++++++++----------------- dlls/nsiproxy.sys/udp.c | 9 ++++----- 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 7308e4a687e..90ea7957204 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -94,7 +94,6 @@ #include "ifdef.h" #include "ipmib.h" #include "netiodef.h" -#include "wine/heap.h" #include "wine/nsi.h" #include "wine/debug.h" @@ -933,12 +932,12 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, vo if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) == -1) return STATUS_NOT_SUPPORTED; - buf = heap_alloc( needed ); + buf = malloc( needed ); if (!buf) return STATUS_NO_MEMORY; if (sysctl( mib, ARRAY_SIZE(mib), buf, &needed, NULL, 0 ) == -1) { - heap_free( buf ); + free( buf ); return STATUS_NOT_SUPPORTED; } @@ -982,7 +981,7 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, vo } next += rtm->rtm_msglen; } - heap_free( buf ); + free( buf ); } #else FIXME( "not implemented\n" ); @@ -1122,12 +1121,12 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) < 0) return STATUS_NOT_SUPPORTED; - buf = heap_alloc( needed ); + buf = malloc( needed ); if (!buf) return STATUS_NO_MEMORY; if (sysctl( mib, 6, buf, &needed, NULL, 0 ) < 0) { - heap_free( buf ); + free( buf ); return STATUS_NOT_SUPPORTED; } @@ -1225,7 +1224,7 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void } num++; } - HeapFree( GetProcessHeap (), 0, buf ); + free( buf ); } #else FIXME( "not implemented\n" ); diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index b46b53b536c..90112da31bb 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -84,7 +84,6 @@ #include "ddk/wdm.h" #include "wine/nsi.h" #include "wine/list.h" -#include "wine/heap.h" #include "wine/debug.h" #include "nsiproxy_private.h" @@ -253,7 +252,7 @@ static WCHAR *strdupAtoW( const char *str ) if (!str) return ret; len = MultiByteToWideChar( CP_UNIXCP, 0, str, -1, NULL, 0 ); - ret = heap_alloc( len * sizeof(WCHAR) ); + ret = malloc( len * sizeof(WCHAR) ); if (ret) MultiByteToWideChar( CP_UNIXCP, 0, str, -1, ret, len ); return ret; } @@ -264,7 +263,7 @@ static struct if_entry *add_entry( DWORD index, char *name ) int name_len = strlen( name ); if (name_len >= IFNAMSIZ - 1) return NULL; - entry = heap_alloc( sizeof(*entry) ); + entry = malloc( sizeof(*entry) ); if (!entry) return NULL; entry->if_index = index; @@ -272,7 +271,7 @@ static struct if_entry *add_entry( DWORD index, char *name ) entry->if_name = strdupAtoW( name ); if (!entry->if_name) { - heap_free( entry ); + free( entry ); return NULL; } @@ -385,7 +384,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_ struct if_data ifdata; if (sysctl( mib, ARRAY_SIZE(mib), NULL, &needed, NULL, 0 ) == -1) goto done; - buf = heap_alloc( needed ); + buf = malloc( needed ); if (!buf) goto done; if (sysctl( mib, ARRAY_SIZE(mib), buf, &needed, NULL, 0 ) == -1) goto done; for (end = buf + needed; buf < end; buf += ifm->ifm_msglen) @@ -408,7 +407,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_ } } done: - heap_free( buf ); + free( buf ); } #endif } diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 6b431e93c8e..b60e53ea15e 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -97,7 +97,6 @@ #include "netiodef.h" #include "ws2ipdef.h" #include "tcpmib.h" -#include "wine/heap.h" #include "wine/nsi.h" #include "wine/debug.h" #include "wine/server.h" @@ -269,7 +268,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) { if (!table_size) table_size = 4; else table_size *= 2; - if (!(table = heap_realloc( table, table_size * sizeof(table[0]) ))) + if (!(table = realloc( table, table_size * sizeof(table[0]) ))) { fclose( fp ); goto failed; @@ -301,7 +300,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) { if (!table_size) table_size = 4; else table_size *= 2; - if (!(table = heap_realloc( table, table_size * sizeof(table[0]) ))) + if (!(table = realloc( table, table_size * sizeof(table[0]) ))) { freeifaddrs( addrs ); goto failed; @@ -325,7 +324,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) return table; failed: - heap_free( table ); + free( table ); return NULL; } @@ -356,7 +355,7 @@ struct pid_map *get_pid_map( unsigned int *num_entries ) NTSTATUS ret; char *buffer = NULL, *new_buffer; - if (!(buffer = heap_alloc( buffer_len ))) return NULL; + if (!(buffer = malloc( buffer_len ))) return NULL; for (;;) { @@ -371,17 +370,17 @@ struct pid_map *get_pid_map( unsigned int *num_entries ) if (ret != STATUS_INFO_LENGTH_MISMATCH) break; - if (!(new_buffer = heap_realloc( buffer, buffer_len ))) + if (!(new_buffer = realloc( buffer, buffer_len ))) { - heap_free( buffer ); + free( buffer ); return NULL; } buffer = new_buffer; } - if (!(map = heap_alloc( process_count * sizeof(*map) ))) + if (!(map = malloc( process_count * sizeof(*map) ))) { - heap_free( buffer ); + free( buffer ); return NULL; } @@ -400,7 +399,7 @@ struct pid_map *get_pid_map( unsigned int *num_entries ) pos += process->thread_count * sizeof(struct thread_info); } - heap_free( buffer ); + free( buffer ); *num_entries = process_count; return map; } @@ -495,7 +494,7 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN int fd_len = proc_pidinfo( map[i].unix_pid, PROC_PIDLISTFDS, 0, NULL, 0 ); if (fd_len <= 0) continue; - fds = heap_alloc( fd_len ); + fds = malloc( fd_len ); if (!fds) continue; proc_pidinfo( map[i].unix_pid, PROC_PIDLISTFDS, 0, fds, fd_len ); @@ -507,12 +506,12 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN proc_pidfdinfo( map[i].unix_pid, fds[j].proc_fd, PROC_PIDFDSOCKETINFO, &sock, sizeof(sock) ); if (sock.psi.soi_pcb == inode) { - heap_free( fds ); + free( fds ); return map[i].pid; } } - heap_free( fds ); + free( fds ); } return 0; #else @@ -638,7 +637,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * goto err; } - buf = heap_alloc( len ); + buf = malloc( len ); if (!buf) { status = STATUS_NO_MEMORY; @@ -728,7 +727,7 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * num++; } err: - heap_free( buf ); + free( buf ); } #else FIXME( "not implemented\n" ); @@ -738,8 +737,8 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * if (!want_data || num <= *count) *count = num; else status = STATUS_BUFFER_OVERFLOW; - heap_free( pid_map ); - heap_free( addr_scopes ); + free( pid_map ); + free( addr_scopes ); return status; } diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index c2dcc2c38e8..f25aac98ba0 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -77,7 +77,6 @@ #include "netiodef.h" #include "ws2ipdef.h" #include "udpmib.h" -#include "wine/heap.h" #include "wine/nsi.h" #include "wine/debug.h" #include "wine/server.h" @@ -309,7 +308,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void goto err; } - buf = heap_alloc( len ); + buf = malloc( len ); if (!buf) { status = STATUS_NO_MEMORY; @@ -386,7 +385,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void num++; } err: - heap_free( buf ); + free( buf ); } #else FIXME( "not implemented\n" ); @@ -396,8 +395,8 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void if (!want_data || num <= *count) *count = num; else status = STATUS_BUFFER_OVERFLOW; - heap_free( pid_map ); - heap_free( addr_scopes ); + free( pid_map ); + free( addr_scopes ); return status; }
1
0
0
0
← Newer
1
...
109
110
111
112
113
114
115
116
117
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200