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
February 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
915 discussions
Start a n
N
ew thread
Rémi Bernon : widl: Rename ifref_t iface member to type.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: db580fe9db159f9eef8c50fa6ee16d5b19f5918a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=db580fe9db159f9eef8c50fa…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Feb 17 19:33:30 2021 +0100 widl: Rename ifref_t iface member to type. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/widl/parser.y | 4 ++-- tools/widl/typetree.c | 8 ++++---- tools/widl/typetree.h | 2 +- tools/widl/widltypes.h | 2 +- tools/widl/write_msft.c | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index e9071f8290e..05ca81737d5 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -1826,10 +1826,10 @@ static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface) return list; } -static ifref_t *make_ifref(type_t *iface) +static ifref_t *make_ifref(type_t *type) { ifref_t *l = xmalloc(sizeof(ifref_t)); - l->iface = iface; + l->type = type; l->attrs = NULL; return l; } diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index 203fffcdee6..2f49a92511a 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -565,19 +565,19 @@ type_t *type_runtimeclass_define(type_t *runtimeclass, attr_list_t *attrs, ifref /* FIXME: this should probably not be allowed, here or in coclass, */ /* but for now there's too many places in Wine IDL where it is to */ /* even print a warning. */ - if (!(ifref->iface->defined)) continue; - if (!(requires = type_iface_get_requires(ifref->iface))) continue; + if (!(ifref->type->defined)) continue; + if (!(requires = type_iface_get_requires(ifref->type))) continue; LIST_FOR_EACH_ENTRY(required, requires, ifref_t, entry) { int found = 0; LIST_FOR_EACH_ENTRY(tmp, ifaces, ifref_t, entry) - if ((found = type_is_equal(tmp->iface, required->iface))) break; + if ((found = type_is_equal(tmp->type, required->type))) break; if (!found) error_loc("interface '%s' also requires interface '%s', " "but runtimeclass '%s' does not implement it.\n", - ifref->iface->name, required->iface->name, runtimeclass->name); + ifref->type->name, required->type->name, runtimeclass->name); } } diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h index 96b681e0379..186f42307f4 100644 --- a/tools/widl/typetree.h +++ b/tools/widl/typetree.h @@ -363,7 +363,7 @@ static inline type_t *type_runtimeclass_get_default_iface(const type_t *type) if (!ifaces) return NULL; LIST_FOR_EACH_ENTRY(entry, ifaces, ifref_t, entry) if (is_attr(entry->attrs, ATTR_DEFAULT)) - return entry->iface; + return entry->type; return NULL; } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 7596577493d..f31d40cad91 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -538,7 +538,7 @@ struct _declarator_t { }; struct _ifref_t { - type_t *iface; + type_t *type; attr_list_t *attrs; /* parser-internal */ diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index 5728f041f6f..63635cec011 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -2352,10 +2352,10 @@ static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls) i = 0; if (ifaces) LIST_FOR_EACH_ENTRY( iref, ifaces, ifref_t, entry ) { - if(iref->iface->typelib_idx == -1) - add_interface_typeinfo(typelib, iref->iface); + if(iref->type->typelib_idx == -1) + add_interface_typeinfo(typelib, iref->type); ref = (MSFT_RefRecord*) (typelib->typelib_segment_data[MSFT_SEG_REFERENCES] + offset + i * sizeof(*ref)); - ref->reftype = typelib->typelib_typeinfo_offsets[iref->iface->typelib_idx]; + ref->reftype = typelib->typelib_typeinfo_offsets[iref->type->typelib_idx]; ref->flags = 0; ref->oCustData = -1; ref->onext = -1;
1
0
0
0
Rémi Bernon : d3d11: Create an initial device ID3DDeviceContextState.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: 943d48896e97240499351b7f78480811d6abb320 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=943d48896e97240499351b7f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Feb 16 13:56:01 2021 +0100 d3d11: Create an initial device ID3DDeviceContextState. And use its emulated_interface. This adds a private_refcount to track hidden references, and a reference to the wined3d_device, to keep the d3d_device alive while not publicly referencing it. This uses d3d_device_context_state_AddRef on init so that the initial references are also traced, making it easier to verify that nothing is leaked. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/d3d11_main.c | 1 - dlls/d3d11/d3d11_private.h | 6 ++-- dlls/d3d11/device.c | 69 ++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 61 insertions(+), 15 deletions(-) diff --git a/dlls/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c index 6666876049d..dac59d09999 100644 --- a/dlls/d3d11/d3d11_main.c +++ b/dlls/d3d11/d3d11_main.c @@ -137,7 +137,6 @@ HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapte return E_FAIL; } d3d_device->d3d11_only = TRUE; - d3d_device->emulated_interface = IID_ID3D11Device2; return S_OK; } diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index cdae1104efa..650b5c35871 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -520,7 +520,7 @@ struct d3d_query *unsafe_impl_from_ID3D11Asynchronous(ID3D11Asynchronous *iface) struct d3d_device_context_state { ID3DDeviceContextState ID3DDeviceContextState_iface; - LONG refcount; + LONG refcount, private_refcount; struct wined3d_private_store private_store; struct @@ -546,6 +546,8 @@ struct d3d_device_context_state } ps; GUID emulated_interface; + + struct wined3d_device *wined3d_device; ID3D11Device2 *device; }; @@ -572,8 +574,8 @@ struct d3d_device D3D_FEATURE_LEVEL feature_level; BOOL d3d11_only; - GUID emulated_interface; + struct d3d_device_context_state *state; struct d3d11_immediate_context immediate_context; struct wined3d_device_parent device_parent; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 914b64d6019..87bdd594d81 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -31,8 +31,9 @@ static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops = static inline BOOL d3d_device_is_d3d10_active(struct d3d_device *device) { - return IsEqualGUID(&device->emulated_interface, &IID_ID3D10Device) - || IsEqualGUID(&device->emulated_interface, &IID_ID3D10Device1); + return !device->state + || IsEqualGUID(&device->state->emulated_interface, &IID_ID3D10Device) + || IsEqualGUID(&device->state->emulated_interface, &IID_ID3D10Device1); } /* ID3DDeviceContextState methods */ @@ -62,6 +63,15 @@ static HRESULT STDMETHODCALLTYPE d3d_device_context_state_QueryInterface(ID3DDev return E_NOINTERFACE; } +static ULONG d3d_device_context_state_private_addref(struct d3d_device_context_state *state) +{ + ULONG refcount = InterlockedIncrement(&state->private_refcount); + + TRACE("%p increasing private refcount to %u.\n", state, refcount); + + return refcount; +} + static ULONG STDMETHODCALLTYPE d3d_device_context_state_AddRef(ID3DDeviceContextState *iface) { struct d3d_device_context_state *state = impl_from_ID3DDeviceContextState(iface); @@ -69,16 +79,21 @@ static ULONG STDMETHODCALLTYPE d3d_device_context_state_AddRef(ID3DDeviceContext TRACE("%p increasing refcount to %u.\n", state, refcount); + if (refcount == 1) + { + d3d_device_context_state_private_addref(state); + ID3D11Device2_AddRef(state->device); + } + return refcount; } -static ULONG STDMETHODCALLTYPE d3d_device_context_state_Release(ID3DDeviceContextState *iface) +static void d3d_device_context_state_private_release(struct d3d_device_context_state *state) { - struct d3d_device_context_state *state = impl_from_ID3DDeviceContextState(iface); - ULONG refcount = InterlockedDecrement(&state->refcount); + ULONG refcount = InterlockedDecrement(&state->private_refcount); unsigned int i; - TRACE("%p decreasing refcount to %u.\n", state, refcount); + TRACE("%p decreasing private refcount to %u.\n", state, refcount); if (!refcount) { @@ -104,9 +119,23 @@ static ULONG STDMETHODCALLTYPE d3d_device_context_state_Release(ID3DDeviceContex if (state->gs.cbs[i]) ID3D11Buffer_Release(state->gs.cbs[i]); if (state->ps.cbs[i]) ID3D11Buffer_Release(state->ps.cbs[i]); } - ID3D11Device2_Release(state->device); + wined3d_device_decref(state->wined3d_device); heap_free(state); } +} + +static ULONG STDMETHODCALLTYPE d3d_device_context_state_Release(ID3DDeviceContextState *iface) +{ + struct d3d_device_context_state *state = impl_from_ID3DDeviceContextState(iface); + ULONG refcount = InterlockedDecrement(&state->refcount); + + TRACE("%p decreasing refcount to %u.\n", state, refcount); + + if (!refcount) + { + ID3D11Device2_Release(state->device); + d3d_device_context_state_private_release(state); + } return refcount; } @@ -169,7 +198,7 @@ static void d3d_device_context_state_init(struct d3d_device_context_state *state REFIID emulated_interface) { state->ID3DDeviceContextState_iface.lpVtbl = &d3d_device_context_state_vtbl; - state->refcount = 1; + state->refcount = state->private_refcount = 0; wined3d_private_store_init(&state->private_store); memset(&state->vs, 0, sizeof(state->vs)); @@ -177,8 +206,10 @@ static void d3d_device_context_state_init(struct d3d_device_context_state *state memset(&state->ps, 0, sizeof(state->ps)); state->emulated_interface = *emulated_interface; + wined3d_device_incref(state->wined3d_device = device->wined3d_device); state->device = &device->ID3D11Device2_iface; - ID3D11Device2_AddRef(state->device); + + d3d_device_context_state_AddRef(&state->ID3DDeviceContextState_iface); } /* ID3D11DeviceContext - immediate context methods */ @@ -2770,7 +2801,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_SwapDeviceContextState(ID3 *prev_state = NULL; if ((state_impl = heap_alloc(sizeof(*state_impl)))) { - d3d_device_context_state_init(state_impl, device, &device->emulated_interface); + d3d_device_context_state_init(state_impl, device, &device->state->emulated_interface); d3d11_immediate_context_capture_state(iface, state_impl); *prev_state = &state_impl->ID3DDeviceContextState_iface; } @@ -2779,7 +2810,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_SwapDeviceContextState(ID3 if ((state_impl = impl_from_ID3DDeviceContextState(state))) { d3d11_immediate_context_restore_state(iface, state_impl); - device->emulated_interface = state_impl->emulated_interface; + device->state->emulated_interface = state_impl->emulated_interface; if (d3d_device_is_d3d10_active(device)) FIXME("D3D10 interface emulation not fully implemented yet!\n"); } @@ -4175,6 +4206,7 @@ static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface) if (!refcount) { + if (device->state) d3d_device_context_state_private_release(device->state); d3d11_immediate_context_destroy(&device->immediate_context); if (device->wined3d_device) { @@ -6352,6 +6384,8 @@ static void CDECL device_parent_wined3d_device_created(struct wined3d_device_par struct wined3d_device *wined3d_device) { struct d3d_device *device = device_from_wined3d_device_parent(device_parent); + ID3DDeviceContextState *state; + HRESULT hr; TRACE("device_parent %p, wined3d_device %p.\n", device_parent, wined3d_device); @@ -6359,6 +6393,17 @@ static void CDECL device_parent_wined3d_device_created(struct wined3d_device_par device->wined3d_device = wined3d_device; device->feature_level = d3d_feature_level_from_wined3d(wined3d_device_get_feature_level(wined3d_device)); + + if (FAILED(hr = d3d11_device_CreateDeviceContextState(&device->ID3D11Device2_iface, 0, &device->feature_level, + 1, D3D11_SDK_VERSION, device->d3d11_only ? &IID_ID3D11Device2 : &IID_ID3D10Device1, NULL, + &state))) + ERR("Failed to create the initial device context state, hr %#x.\n", hr); + else + { + device->state = impl_from_ID3DDeviceContextState(state); + d3d_device_context_state_private_addref(device->state); + ID3DDeviceContextState_Release(state); + } } static void CDECL device_parent_mode_changed(struct wined3d_device_parent *device_parent) @@ -6488,7 +6533,7 @@ void d3d_device_init(struct d3d_device *device, void *outer_unknown) /* COM aggregation always takes place */ device->outer_unk = outer_unknown; device->d3d11_only = FALSE; - device->emulated_interface = GUID_NULL; + device->state = NULL; d3d11_immediate_context_init(&device->immediate_context, device); ID3D11DeviceContext1_Release(&device->immediate_context.ID3D11DeviceContext1_iface);
1
0
0
0
Rémi Bernon : d3d11: Make SwapDeviceContextState truly no-op when state is NULL.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: bde070fcf42eb7ed346dd15de943bdb9326d2aff URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bde070fcf42eb7ed346dd15d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Feb 16 13:56:00 2021 +0100 d3d11: Make SwapDeviceContextState truly no-op when state is NULL. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 3 +++ dlls/d3d11/tests/d3d11.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 8e5beb8893b..914b64d6019 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2761,6 +2761,9 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_SwapDeviceContextState(ID3 FIXME("iface %p, state %p, prev_state %p semi-stub!\n", iface, state, prev_state); + if (prev_state) *prev_state = NULL; + if (!state) return; + wined3d_mutex_lock(); if (prev_state) { diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 044c1ce5a17..1505b3fddbc 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -7078,8 +7078,7 @@ static void test_device_context_state(void) previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); - todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); - if (previous_context_state) ID3DDeviceContextState_Release(previous_context_state); + ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); previous_context_state = NULL; ID3D11DeviceContext1_SwapDeviceContextState(context, context_state, &previous_context_state); ok(previous_context_state != NULL, "Failed to get previous context state\n");
1
0
0
0
Jacek Caban : mshtml: Add nsICacheInfoChannel stub implementation.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: edbddef57ecdd0dab5d691f9a202749375823725 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=edbddef57ecdd0dab5d691f9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Feb 17 14:31:17 2021 +0100 mshtml: Add nsICacheInfoChannel stub implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/binding.h | 1 + dlls/mshtml/nsiface.idl | 17 +++++++++ dlls/mshtml/nsio.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) diff --git a/dlls/mshtml/binding.h b/dlls/mshtml/binding.h index 9926fa0dc33..3d1ea6ecc8d 100644 --- a/dlls/mshtml/binding.h +++ b/dlls/mshtml/binding.h @@ -35,6 +35,7 @@ typedef struct { nsIHttpChannel nsIHttpChannel_iface; nsIUploadChannel nsIUploadChannel_iface; nsIHttpChannelInternal nsIHttpChannelInternal_iface; + nsICacheInfoChannel nsICacheInfoChannel_iface; LONG ref; diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index a621007b0cc..2ecd8d93854 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -728,6 +728,23 @@ interface nsIFormPOSTActionChannel : nsIUploadChannel { } +[ + object, + uuid(72c34415-c6eb-48af-851f-772fa9ee5972), + local +] +interface nsICacheInfoChannel : nsISupports +{ + nsresult GetCacheTokenExpirationTime(uint32_t *aCacheTokenExpirationTime); + nsresult GetCacheTokenCachedCharset(nsACString *aCacheTokenCachedCharset); + nsresult SetCacheTokenCachedCharset(const nsACString *aCacheTokenCachedCharset); + nsresult IsFromCache(bool *_retval); + nsresult GetCacheKey(nsISupports **aCacheKey); + nsresult SetCacheKey(nsISupports *aCacheKey); + nsresult GetAllowStaleCacheContent(bool *aAllowStaleCacheContent); + nsresult SetAllowStaleCacheContent(bool aAllowStaleCacheContent); +} + [ object, uuid(8d171460-a716-41f1-92be-8c659db39b45), diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index ee709645873..9ba5a6c8612 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -521,6 +521,9 @@ static nsresult NSAPI nsChannel_QueryInterface(nsIHttpChannel *iface, nsIIDRef r }else if(IsEqualGUID(&IID_nsIHttpChannelInternal, riid)) { TRACE("(%p)->(IID_nsIHttpChannelInternal %p)\n", This, result); *result = is_http_channel(This) ? &This->nsIHttpChannelInternal_iface : NULL; + }else if(IsEqualGUID(&IID_nsICacheInfoChannel, riid)) { + TRACE("(%p)->(IID_nsICacheInfoChannel %p)\n", This, result); + *result = is_http_channel(This) ? &This->nsICacheInfoChannel_iface : NULL; }else { TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result); *result = NULL; @@ -2138,6 +2141,100 @@ static const nsIHttpChannelInternalVtbl nsHttpChannelInternalVtbl = { nsHttpChannelInternal_SetBlockAuthPrompt }; +static inline nsChannel *impl_from_nsICacheInfoChannel(nsICacheInfoChannel *iface) +{ + return CONTAINING_RECORD(iface, nsChannel, nsICacheInfoChannel_iface); +} + +static nsresult NSAPI nsCacheInfoChannel_QueryInterface(nsICacheInfoChannel *iface, nsIIDRef riid, + void **result) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + return nsIHttpChannel_QueryInterface(&This->nsIHttpChannel_iface, riid, result); +} + +static nsrefcnt NSAPI nsCacheInfoChannel_AddRef(nsICacheInfoChannel *iface) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + return nsIHttpChannel_AddRef(&This->nsIHttpChannel_iface); +} + +static nsrefcnt NSAPI nsCacheInfoChannel_Release(nsICacheInfoChannel *iface) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + return nsIHttpChannel_Release(&This->nsIHttpChannel_iface); +} + +static nsresult NSAPI nsCacheInfoChannel_GetCacheTokenExpirationTime(nsICacheInfoChannel *iface, UINT32 *p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_GetCacheTokenCachedCharset(nsICacheInfoChannel *iface, nsACString *p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_SetCacheTokenCachedCharset(nsICacheInfoChannel *iface, const nsACString *p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, debugstr_nsacstr(p)); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_IsFromCache(nsICacheInfoChannel *iface, cpp_bool *p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, p); + *p = FALSE; + return NS_OK; +} + +static nsresult NSAPI nsCacheInfoChannel_GetCacheKey(nsICacheInfoChannel *iface, nsISupports **p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_SetCacheKey(nsICacheInfoChannel *iface, nsISupports *key) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, key); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_GetAllowStaleCacheContent(nsICacheInfoChannel *iface, cpp_bool *p) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static nsresult NSAPI nsCacheInfoChannel_SetAllowStaleCacheContent(nsICacheInfoChannel *iface, cpp_bool allow) +{ + nsChannel *This = impl_from_nsICacheInfoChannel(iface); + FIXME("(%p)->(%x)\n", This, allow); + return E_NOTIMPL; +} + +static const nsICacheInfoChannelVtbl nsCacheInfoChannelVtbl = { + nsCacheInfoChannel_QueryInterface, + nsCacheInfoChannel_AddRef, + nsCacheInfoChannel_Release, + nsCacheInfoChannel_GetCacheTokenExpirationTime, + nsCacheInfoChannel_GetCacheTokenCachedCharset, + nsCacheInfoChannel_SetCacheTokenCachedCharset, + nsCacheInfoChannel_IsFromCache, + nsCacheInfoChannel_GetCacheKey, + nsCacheInfoChannel_SetCacheKey, + nsCacheInfoChannel_GetAllowStaleCacheContent, + nsCacheInfoChannel_SetAllowStaleCacheContent +}; static void invalidate_uri(nsWineURI *This) { @@ -3382,6 +3479,7 @@ static nsresult create_nschannel(nsWineURI *uri, nsChannel **ret) channel->nsIHttpChannel_iface.lpVtbl = &nsChannelVtbl; channel->nsIUploadChannel_iface.lpVtbl = &nsUploadChannelVtbl; channel->nsIHttpChannelInternal_iface.lpVtbl = &nsHttpChannelInternalVtbl; + channel->nsICacheInfoChannel_iface.lpVtbl = &nsCacheInfoChannelVtbl; channel->ref = 1; channel->request_method = METHOD_GET; list_init(&channel->response_headers);
1
0
0
0
Nikolay Sivov : mfreadwrite/reader: Subscribe to allocator's release notifications.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: a0a6fad695d2f9d1eb2601725ac27c9a9949026b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a0a6fad695d2f9d1eb260172…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 17 16:14:04 2021 +0300 mfreadwrite/reader: Subscribe to allocator's release notifications. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/reader.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/dlls/mfreadwrite/reader.c b/dlls/mfreadwrite/reader.c index 6a69196054a..ec7d3fd62e6 100644 --- a/dlls/mfreadwrite/reader.c +++ b/dlls/mfreadwrite/reader.c @@ -112,12 +112,14 @@ struct media_stream IMFMediaType *current; IMFTransform *decoder; IMFVideoSampleAllocatorEx *allocator; + IMFVideoSampleAllocatorNotify notify_cb; unsigned int id; unsigned int index; enum media_stream_state state; unsigned int flags; unsigned int requests; unsigned int responses; + struct source_reader *reader; }; enum source_reader_async_op @@ -126,6 +128,7 @@ enum source_reader_async_op SOURCE_READER_ASYNC_SEEK, SOURCE_READER_ASYNC_FLUSH, SOURCE_READER_ASYNC_SAMPLE_READY, + SOURCE_READER_ASYNC_SA_READY, }; struct source_reader_async_command @@ -153,6 +156,10 @@ struct source_reader_async_command { unsigned int stream_index; } sample; + struct + { + unsigned int stream_index; + } sa; } u; }; @@ -216,6 +223,11 @@ static struct source_reader_async_command *impl_from_async_command_IUnknown(IUnk return CONTAINING_RECORD(iface, struct source_reader_async_command, IUnknown_iface); } +static struct media_stream *impl_stream_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface) +{ + return CONTAINING_RECORD(iface, struct media_stream, notify_cb); +} + static HRESULT WINAPI source_reader_async_command_QueryInterface(IUnknown *iface, REFIID riid, void **obj) { if (IsEqualIID(riid, &IID_IUnknown)) @@ -1533,6 +1545,7 @@ static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader IMFMediaType *media_type) { struct media_stream *stream = &reader->streams[index]; + IMFVideoSampleAllocatorCallback *callback; GUID major = { 0 }; HRESULT hr; @@ -1568,6 +1581,13 @@ static HRESULT source_reader_setup_sample_allocator(struct source_reader *reader if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(stream->allocator, 2, 8, NULL, media_type))) WARN("Failed to initialize sample allocator, hr %#x.\n", hr); + if (SUCCEEDED(IMFVideoSampleAllocatorEx_QueryInterface(stream->allocator, &IID_IMFVideoSampleAllocatorCallback, (void **)&callback))) + { + if (FAILED(hr = IMFVideoSampleAllocatorCallback_SetCallback(callback, &stream->notify_cb))) + WARN("Failed to set allocator callback, hr %#x.\n", hr); + IMFVideoSampleAllocatorCallback_Release(callback); + } + return hr; } @@ -2126,6 +2146,54 @@ static DWORD reader_get_first_stream_index(IMFPresentationDescriptor *descriptor return MF_SOURCE_READER_INVALID_STREAM_INDEX; } +static HRESULT WINAPI stream_sample_allocator_cb_QueryInterface(IMFVideoSampleAllocatorNotify *iface, + REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFVideoSampleAllocatorNotify) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFVideoSampleAllocatorNotify_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI stream_sample_allocator_cb_AddRef(IMFVideoSampleAllocatorNotify *iface) +{ + return 2; +} + +static ULONG WINAPI stream_sample_allocator_cb_Release(IMFVideoSampleAllocatorNotify *iface) +{ + return 1; +} + +static HRESULT WINAPI stream_sample_allocator_cb_NotifyRelease(IMFVideoSampleAllocatorNotify *iface) +{ + struct media_stream *stream = impl_stream_from_IMFVideoSampleAllocatorNotify(iface); + struct source_reader_async_command *command; + + if (SUCCEEDED(source_reader_create_async_op(SOURCE_READER_ASYNC_SA_READY, &command))) + { + command->u.sa.stream_index = stream->index; + MFPutWorkItem(MFASYNC_CALLBACK_QUEUE_STANDARD, &stream->reader->async_commands_callback, &command->IUnknown_iface); + IUnknown_Release(&command->IUnknown_iface); + } + + return S_OK; +} + +static const IMFVideoSampleAllocatorNotifyVtbl stream_sample_allocator_cb_vtbl = +{ + stream_sample_allocator_cb_QueryInterface, + stream_sample_allocator_cb_AddRef, + stream_sample_allocator_cb_Release, + stream_sample_allocator_cb_NotifyRelease, +}; + static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttributes *attributes, BOOL shutdown_on_release, REFIID riid, void **out) { @@ -2195,6 +2263,8 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri if (FAILED(hr)) break; + object->streams[i].notify_cb.lpVtbl = &stream_sample_allocator_cb_vtbl; + object->streams[i].reader = object; object->streams[i].index = i; }
1
0
0
0
Alexandre Julliard : server: Merge the various token information queries.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: 6f7b56a1980868354a0198a6209c89ac17eccad6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6f7b56a1980868354a0198a6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 17 17:10:15 2021 +0100 server: Merge the various token information queries. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/security.c | 17 ++++++++------- include/wine/server_protocol.h | 47 +++++++----------------------------------- server/protocol.def | 18 ++-------------- server/request.h | 35 +++++++++++-------------------- server/token.c | 37 +++------------------------------ server/trace.c | 37 ++++++--------------------------- 6 files changed, 41 insertions(+), 150 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=6f7b56a1980868354a01…
1
0
0
0
Zebediah Figura : ntdll: Implement NtQueryInformationToken(TokenElevation).
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: 3c677c3f08d7523c9473777c8c373ee37254f681 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3c677c3f08d7523c9473777c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 16 23:31:13 2021 -0600 ntdll: Implement NtQueryInformationToken(TokenElevation). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 4 ++-- dlls/ntdll/unix/security.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 8fddd635f55..f43ac2431e1 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -8130,7 +8130,7 @@ static void test_elevation(void) ok(type == TokenElevationTypeLimited, "got type %#x\n", type); ret = GetTokenInformation(linked.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); - todo_wine ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); + ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); /* Asking for the linked token again gives us a different token. */ ret = GetTokenInformation(token, TokenLinkedToken, &linked2, sizeof(linked2), &size); @@ -8141,7 +8141,7 @@ static void test_elevation(void) ok(type == TokenElevationTypeLimited, "got type %#x\n", type); ret = GetTokenInformation(linked2.LinkedToken, TokenElevation, &elevation, sizeof(elevation), &size); ok(ret, "got error %u\n", GetLastError()); - todo_wine ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); + ok(elevation.TokenIsElevated == FALSE, "got elevation %#x\n", elevation.TokenIsElevated); check_different_token(linked.LinkedToken, linked2.LinkedToken); diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c index c8cd04b70f3..48bdb5a3689 100644 --- a/dlls/ntdll/unix/security.c +++ b/dlls/ntdll/unix/security.c @@ -403,11 +403,15 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c break; case TokenElevation: + SERVER_START_REQ( get_token_elevation ) { TOKEN_ELEVATION *elevation = info; - FIXME("QueryInformationToken( ..., TokenElevation, ...) semi-stub\n"); - elevation->TokenIsElevated = TRUE; + + req->handle = wine_server_obj_handle( token ); + status = wine_server_call( req ); + if (!status) elevation->TokenIsElevated = (reply->elevation == TokenElevationTypeFull); } + SERVER_END_REQ; break; case TokenSessionId:
1
0
0
0
Zebediah Figura : ntdll: Implement NtQueryInformationToken(TokenLinkedToken).
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: ec9244f056b1063be602412a34a12d46f74debb2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec9244f056b1063be602412a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 16 23:31:12 2021 -0600 ntdll: Implement NtQueryInformationToken(TokenLinkedToken). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 11 +++++------ dlls/ntdll/unix/security.c | 14 +++++++++++++- include/wine/server_protocol.h | 19 ++++++++++++++++++- server/process.c | 2 +- server/protocol.def | 8 ++++++++ server/request.h | 6 ++++++ server/security.h | 2 +- server/token.c | 33 +++++++++++++++++++++++++++++++-- server/trace.c | 13 +++++++++++++ 9 files changed, 96 insertions(+), 12 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ec9244f056b1063be602…
1
0
0
0
Zebediah Figura : ntdll: Implement NtQueryInformationToken(TokenElevationType).
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: c96749790b064a08ce866b459acce70c12c78a71 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c96749790b064a08ce866b45…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 16 23:31:11 2021 -0600 ntdll: Implement NtQueryInformationToken(TokenElevationType). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/security.c | 8 ++++++-- include/wine/server_protocol.h | 19 ++++++++++++++++++- server/protocol.def | 8 ++++++++ server/request.h | 6 ++++++ server/token.c | 20 +++++++++++++++++--- server/trace.c | 13 +++++++++++++ 6 files changed, 68 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c index fc9cc9d4572..04f1b43a5cb 100644 --- a/dlls/ntdll/unix/security.c +++ b/dlls/ntdll/unix/security.c @@ -391,11 +391,15 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c break; case TokenElevationType: + SERVER_START_REQ( get_token_elevation ) { TOKEN_ELEVATION_TYPE *type = info; - FIXME("QueryInformationToken( ..., TokenElevationType, ...) semi-stub\n"); - *type = TokenElevationTypeFull; + + req->handle = wine_server_obj_handle( token ); + status = wine_server_call( req ); + if (!status) *type = reply->elevation; } + SERVER_END_REQ; break; case TokenElevation: diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index ec34867caf1..bf9536ddcc8 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4936,6 +4936,20 @@ struct get_token_statistics_reply +struct get_token_elevation_request +{ + struct request_header __header; + obj_handle_t handle; +}; +struct get_token_elevation_reply +{ + struct reply_header __header; + int elevation; + char __pad_12[4]; +}; + + + struct create_completion_request { struct request_header __header; @@ -5627,6 +5641,7 @@ enum request REQ_get_kernel_object_handle, REQ_make_process_system, REQ_get_token_statistics, + REQ_get_token_elevation, REQ_create_completion, REQ_open_completion, REQ_add_completion, @@ -5908,6 +5923,7 @@ union generic_request struct get_kernel_object_handle_request get_kernel_object_handle_request; struct make_process_system_request make_process_system_request; struct get_token_statistics_request get_token_statistics_request; + struct get_token_elevation_request get_token_elevation_request; struct create_completion_request create_completion_request; struct open_completion_request open_completion_request; struct add_completion_request add_completion_request; @@ -6187,6 +6203,7 @@ union generic_reply struct get_kernel_object_handle_reply get_kernel_object_handle_reply; struct make_process_system_reply make_process_system_reply; struct get_token_statistics_reply get_token_statistics_reply; + struct get_token_elevation_reply get_token_elevation_reply; struct create_completion_reply create_completion_reply; struct open_completion_reply open_completion_reply; struct add_completion_reply add_completion_reply; @@ -6220,7 +6237,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 678 +#define SERVER_PROTOCOL_VERSION 679 /* ### protocol_version end ### */ diff --git a/server/protocol.def b/server/protocol.def index fb3ee3a52de..43899bee240 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3433,6 +3433,14 @@ struct handle_info @END +/* Get the token elevation type */ +@REQ(get_token_elevation) + obj_handle_t handle; /* handle to the token */ +@REPLY + int elevation; /* token elevation type */ +@END + + /* Create I/O completion port */ @REQ(create_completion) unsigned int access; /* desired access to a port */ diff --git a/server/request.h b/server/request.h index d1ff4cc7a82..4313b42ca52 100644 --- a/server/request.h +++ b/server/request.h @@ -364,6 +364,7 @@ DECL_HANDLER(release_kernel_object); DECL_HANDLER(get_kernel_object_handle); DECL_HANDLER(make_process_system); DECL_HANDLER(get_token_statistics); +DECL_HANDLER(get_token_elevation); DECL_HANDLER(create_completion); DECL_HANDLER(open_completion); DECL_HANDLER(add_completion); @@ -644,6 +645,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_get_kernel_object_handle, (req_handler)req_make_process_system, (req_handler)req_get_token_statistics, + (req_handler)req_get_token_elevation, (req_handler)req_create_completion, (req_handler)req_open_completion, (req_handler)req_add_completion, @@ -2105,6 +2107,10 @@ C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, impersonation_level) = C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, group_count) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_token_statistics_reply, privilege_count) == 36 ); C_ASSERT( sizeof(struct get_token_statistics_reply) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_token_elevation_request, handle) == 12 ); +C_ASSERT( sizeof(struct get_token_elevation_request) == 16 ); +C_ASSERT( FIELD_OFFSET(struct get_token_elevation_reply, elevation) == 8 ); +C_ASSERT( sizeof(struct get_token_elevation_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct create_completion_request, access) == 12 ); C_ASSERT( FIELD_OFFSET(struct create_completion_request, concurrent) == 16 ); C_ASSERT( sizeof(struct create_completion_request) == 24 ); diff --git a/server/token.c b/server/token.c index 2ae1cb1780a..5499841dd50 100644 --- a/server/token.c +++ b/server/token.c @@ -126,6 +126,7 @@ struct token ACL *default_dacl; /* the default DACL to assign to objects created by this user */ TOKEN_SOURCE source; /* source of the token */ int impersonation_level; /* impersonation level this token is capable of if non-primary token */ + int elevation; /* elevation type */ }; struct privilege @@ -541,7 +542,7 @@ static struct token *create_token( unsigned primary, const SID *user, const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count, const ACL *default_dacl, TOKEN_SOURCE source, const luid_t *modified_id, - int impersonation_level ) + int impersonation_level, int elevation ) { struct token *token = alloc_object( &token_ops ); if (token) @@ -563,6 +564,7 @@ static struct token *create_token( unsigned primary, const SID *user, token->impersonation_level = impersonation_level; token->default_dacl = NULL; token->primary_group = NULL; + token->elevation = elevation; /* copy user */ token->user = memdup( user, security_sid_len( user )); @@ -678,7 +680,7 @@ struct token *token_duplicate( struct token *src_token, unsigned primary, token = create_token( primary, src_token->user, NULL, 0, NULL, 0, src_token->default_dacl, src_token->source, modified_id, - impersonation_level ); + impersonation_level, src_token->elevation ); if (!token) return token; /* copy groups */ @@ -890,7 +892,7 @@ struct token *token_create_admin( void ) static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}}; token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ), admin_privs, ARRAY_SIZE( admin_privs ), default_dacl, - admin_source, NULL, -1 ); + admin_source, NULL, -1, TokenElevationTypeFull ); /* we really need a primary group */ assert( token->primary_group ); } @@ -1665,3 +1667,15 @@ DECL_HANDLER(set_token_default_dacl) release_object( token ); } } + +DECL_HANDLER(get_token_elevation) +{ + struct token *token; + + if ((token = (struct token *)get_handle_obj( current->process, req->handle, + TOKEN_QUERY, &token_ops ))) + { + reply->elevation = token->elevation; + release_object( token ); + } +} diff --git a/server/trace.c b/server/trace.c index 4e83550d028..128dd1191f8 100644 --- a/server/trace.c +++ b/server/trace.c @@ -4184,6 +4184,16 @@ static void dump_get_token_statistics_reply( const struct get_token_statistics_r fprintf( stderr, ", privilege_count=%d", req->privilege_count ); } +static void dump_get_token_elevation_request( const struct get_token_elevation_request *req ) +{ + fprintf( stderr, " handle=%04x", req->handle ); +} + +static void dump_get_token_elevation_reply( const struct get_token_elevation_reply *req ) +{ + fprintf( stderr, " elevation=%d", req->elevation ); +} + static void dump_create_completion_request( const struct create_completion_request *req ) { fprintf( stderr, " access=%08x", req->access ); @@ -4696,6 +4706,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_kernel_object_handle_request, (dump_func)dump_make_process_system_request, (dump_func)dump_get_token_statistics_request, + (dump_func)dump_get_token_elevation_request, (dump_func)dump_create_completion_request, (dump_func)dump_open_completion_request, (dump_func)dump_add_completion_request, @@ -4973,6 +4984,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_kernel_object_handle_reply, (dump_func)dump_make_process_system_reply, (dump_func)dump_get_token_statistics_reply, + (dump_func)dump_get_token_elevation_reply, (dump_func)dump_create_completion_reply, (dump_func)dump_open_completion_reply, NULL, @@ -5250,6 +5262,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "get_kernel_object_handle", "make_process_system", "get_token_statistics", + "get_token_elevation", "create_completion", "open_completion", "add_completion",
1
0
0
0
Zebediah Figura : advapi32/tests: Add some tests for token elevation.
by Alexandre Julliard
17 Feb '21
17 Feb '21
Module: wine Branch: master Commit: 133e061244be0800fd040c947ba0ad15cfe38f68 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=133e061244be0800fd040c94…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 16 23:31:10 2021 -0600 advapi32/tests: Add some tests for token elevation. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/security.c | 263 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=133e061244be0800fd04…
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
92
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
Results per page:
10
25
50
100
200