winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2012
----- 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
712 discussions
Start a n
N
ew thread
Hans Leidekker : wbemprox: Reset the number of rows only when the table was filled dynamically.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 317d0028281c09e217294936f6c5a983bc49f649 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=317d0028281c09e217294936f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jul 25 13:12:57 2012 +0200 wbemprox: Reset the number of rows only when the table was filled dynamically. --- dlls/wbemprox/table.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/wbemprox/table.c b/dlls/wbemprox/table.c index 5e79de5..d3ad06d 100644 --- a/dlls/wbemprox/table.c +++ b/dlls/wbemprox/table.c @@ -243,9 +243,9 @@ static void clear_table( struct table *table ) } } } - table->num_rows = 0; if (table->fill) { + table->num_rows = 0; heap_free( table->data ); table->data = NULL; }
1
0
0
0
Hans Leidekker : wbemprox: Fix corner cases in IEnumWbemClassObject::Skip.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 2c5da008f7a8a1772e6c41a371c41c8fd2eb2950 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2c5da008f7a8a1772e6c41a37…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jul 25 13:12:42 2012 +0200 wbemprox: Fix corner cases in IEnumWbemClassObject::Skip. --- dlls/wbemprox/class.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index 5bd9c1c..af7d8f5 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -167,7 +167,9 @@ static HRESULT WINAPI enum_class_object_Skip( if (lTimeout != WBEM_INFINITE) FIXME("timeout not supported\n"); - if (ec->index + nCount >= view->count) + if (!view->count) return WBEM_S_FALSE; + + if (nCount > view->count - ec->index) { ec->index = view->count - 1; return WBEM_S_FALSE;
1
0
0
0
Hans Leidekker : wbemprox: Add helpers for retrieving class instances.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 0f11ac361e39c370f5fe995dc41bb81ab9df574b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f11ac361e39c370f5fe995dc…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jul 25 13:12:28 2012 +0200 wbemprox: Add helpers for retrieving class instances. --- dlls/wbemprox/services.c | 65 ++++++++++++++++++++------------------ dlls/wbemprox/wbemprox_private.h | 1 + 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 8edd2f6..e8c5461 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -235,40 +235,54 @@ static HRESULT WINAPI wbem_services_QueryObjectSink( return WBEM_E_FAILED; } -static HRESULT WINAPI wbem_services_GetObject( - IWbemServices *iface, - const BSTR strObjectPath, - LONG lFlags, - IWbemContext *pCtx, - IWbemClassObject **ppObject, - IWbemCallResult **ppCallResult ) +static HRESULT create_instance_enum( const WCHAR *class, IEnumWbemClassObject **iter ) { static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0}; - IEnumWbemClassObject *iter; WCHAR *query; HRESULT hr; - TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strObjectPath), lFlags, - pCtx, ppObject, ppCallResult); - - if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags); + query = heap_alloc( strlenW( class ) * sizeof(WCHAR) + sizeof(selectW) ); + if (!query) return E_OUTOFMEMORY; - /* FIXME: parse path */ - - if (!(query = heap_alloc( strlenW( strObjectPath ) * sizeof(WCHAR) + sizeof(selectW) ))) - return E_OUTOFMEMORY; strcpyW( query, selectW ); - strcatW( query, strObjectPath ); + strcatW( query, class ); - hr = exec_query( query, &iter ); + hr = exec_query( query, iter ); heap_free( query ); + return hr; +} + +HRESULT get_object( const WCHAR *path, IWbemClassObject **obj ) +{ + IEnumWbemClassObject *iter; + HRESULT hr; + + /* FIXME: parse path */ + + hr = create_instance_enum( path, &iter ); if (hr != S_OK) return hr; - hr = WbemClassObject_create( NULL, iter, 0, (void **)ppObject ); + hr = WbemClassObject_create( NULL, iter, 0, (void **)obj ); IEnumWbemClassObject_Release( iter ); return hr; } +static HRESULT WINAPI wbem_services_GetObject( + IWbemServices *iface, + const BSTR strObjectPath, + LONG lFlags, + IWbemContext *pCtx, + IWbemClassObject **ppObject, + IWbemCallResult **ppCallResult ) +{ + TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strObjectPath), lFlags, + pCtx, ppObject, ppCallResult); + + if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags); + + return get_object( strObjectPath, ppObject ); +} + static HRESULT WINAPI wbem_services_GetObjectAsync( IWbemServices *iface, const BSTR strObjectPath, @@ -397,22 +411,11 @@ static HRESULT WINAPI wbem_services_CreateInstanceEnum( IWbemContext *pCtx, IEnumWbemClassObject **ppEnum ) { - static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0}; - WCHAR *query; - HRESULT hr; - TRACE("%p, %s, 0%08x, %p, %p\n", iface, debugstr_w(strClass), lFlags, pCtx, ppEnum); if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags); - if (!(query = heap_alloc( strlenW( strClass ) * sizeof(WCHAR) + sizeof(selectW) ))) - return E_OUTOFMEMORY; - strcpyW( query, selectW ); - strcatW( query, strClass ); - - hr = exec_query( query, ppEnum ); - heap_free( query ); - return hr; + return create_instance_enum( strClass, ppEnum ); } static HRESULT WINAPI wbem_services_CreateInstanceEnumAsync( diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 14c97b2..725ea8c 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -142,6 +142,7 @@ HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN; HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN; +HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN; HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemServices_create(IUnknown *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
1
0
0
0
Hans Leidekker : wbemprox: Implement IWbemClassObject::Put.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 53d1cc1ed63ea0bf376ccd4e2d1c372dc7f8bd48 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53d1cc1ed63ea0bf376ccd4e2…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jul 25 13:12:10 2012 +0200 wbemprox: Implement IWbemClassObject::Put. --- dlls/wbemprox/class.c | 9 ++++- dlls/wbemprox/query.c | 61 ++++++++++++++++++++++++++++++++++++++ dlls/wbemprox/table.c | 43 ++++++++++++++++++++++++++ dlls/wbemprox/wbemprox_private.h | 2 + 4 files changed, 113 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c index ff729f2..5bd9c1c 100644 --- a/dlls/wbemprox/class.c +++ b/dlls/wbemprox/class.c @@ -300,8 +300,13 @@ static HRESULT WINAPI class_object_Put( VARIANT *pVal, CIMTYPE Type ) { - FIXME("%p, %s, %08x, %p, %u\n", iface, debugstr_w(wszName), lFlags, pVal, Type); - return E_NOTIMPL; + struct class_object *co = impl_from_IWbemClassObject( iface ); + struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter ); + struct view *view = ec->query->view; + + TRACE("%p, %s, %08x, %p, %u\n", iface, debugstr_w(wszName), lFlags, pVal, Type); + + return put_propval( view, co->index, wszName, pVal, Type ); } static HRESULT WINAPI class_object_Delete( diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 74b48e4..15423d9 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -641,6 +641,67 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR return S_OK; } +static HRESULT variant_to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type ) +{ + if (!var) + { + *val = 0; + return S_OK; + } + switch (V_VT( var )) + { + case VT_BSTR: + *val = (INT_PTR)SysAllocString( V_BSTR( var ) ); + if (!*val) return E_OUTOFMEMORY; + *type = CIM_STRING; + break; + case VT_I2: + *val = V_I2( var ); + *type = CIM_SINT16; + break; + case VT_UI2: + *val = V_UI2( var ); + *type = CIM_UINT16; + break; + case VT_I4: + *val = V_I4( var ); + *type = CIM_SINT32; + break; + case VT_UI4: + *val = V_UI4( var ); + *type = CIM_UINT32; + break; + case VT_NULL: + *val = 0; + break; + default: + ERR("unhandled type %u\n", V_VT( var )); + return WBEM_E_FAILED; + } + return S_OK; +} + +HRESULT put_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *var, CIMTYPE type ) +{ + HRESULT hr; + UINT column, row = view->result[index]; + LONGLONG val; + + hr = get_column_index( view->table, name, &column ); + if (hr != S_OK) + { + FIXME("no support for creating new properties\n"); + return WBEM_E_FAILED; + } + if (is_method( view->table, column ) || !(view->table->columns[column].type & COL_FLAG_DYNAMIC)) + return WBEM_E_FAILED; + + hr = variant_to_longlong( var, &val, &type ); + if (hr != S_OK) return hr; + + return set_value( view->table, row, column, val, type ); +} + HRESULT get_properties( const struct view *view, SAFEARRAY **props ) { SAFEARRAY *sa; diff --git a/dlls/wbemprox/table.c b/dlls/wbemprox/table.c index c3757d5..5e79de5 100644 --- a/dlls/wbemprox/table.c +++ b/dlls/wbemprox/table.c @@ -180,6 +180,49 @@ BSTR get_value_bstr( const struct table *table, UINT row, UINT column ) return NULL; } +HRESULT set_value( const struct table *table, UINT row, UINT column, LONGLONG val, + CIMTYPE type ) +{ + UINT col_offset, row_size; + BYTE *ptr; + + if ((table->columns[column].type & COL_TYPE_MASK) != type) return WBEM_E_TYPE_MISMATCH; + + col_offset = get_column_offset( table, column ); + row_size = get_row_size( table ); + ptr = table->data + row * row_size + col_offset; + + switch (table->columns[column].type & COL_TYPE_MASK) + { + case CIM_DATETIME: + case CIM_STRING: + *(WCHAR **)ptr = (WCHAR *)(INT_PTR)val; + break; + case CIM_SINT16: + *(INT16 *)ptr = val; + break; + case CIM_UINT16: + *(UINT16 *)ptr = val; + break; + case CIM_SINT32: + *(INT32 *)ptr = val; + break; + case CIM_UINT32: + *(UINT32 *)ptr = val; + break; + case CIM_SINT64: + *(INT64 *)ptr = val; + break; + case CIM_UINT64: + *(UINT64 *)ptr = val; + break; + default: + FIXME("unhandled column type %u\n", type); + return WBEM_E_FAILED; + } + return S_OK; +} + static void clear_table( struct table *table ) { UINT i, j, type; diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 5f095c6..14c97b2 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -137,8 +137,10 @@ void free_table( struct table * ) DECLSPEC_HIDDEN; HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC_HIDDEN; HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN; BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN; +HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN; HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; +HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN; HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN; HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
1
0
0
0
Michael Stefaniuc : cabinet: Simplify the "pointer to start of array" idiom .
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: b41c71e3ab1a5b3bb3b54456267ebf680293a8ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b41c71e3ab1a5b3bb3b544562…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Jul 25 12:39:56 2012 +0200 cabinet: Simplify the "pointer to start of array" idiom. --- dlls/cabinet/fdi.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c index d091dbb..7fcf4cb 100644 --- a/dlls/cabinet/fdi.c +++ b/dlls/cabinet/fdi.c @@ -820,20 +820,20 @@ static int QTMfdi_init(int window, int level, fdi_decomp_state *decomp_state) { /* initialize arithmetic coding models */ - QTMfdi_initmodel(&QTM(model7), &QTM(m7sym)[0], 7, 0); + QTMfdi_initmodel(&QTM(model7), QTM(m7sym), 7, 0); - QTMfdi_initmodel(&QTM(model00), &QTM(m00sym)[0], 0x40, 0x00); - QTMfdi_initmodel(&QTM(model40), &QTM(m40sym)[0], 0x40, 0x40); - QTMfdi_initmodel(&QTM(model80), &QTM(m80sym)[0], 0x40, 0x80); - QTMfdi_initmodel(&QTM(modelC0), &QTM(mC0sym)[0], 0x40, 0xC0); + QTMfdi_initmodel(&QTM(model00), QTM(m00sym), 0x40, 0x00); + QTMfdi_initmodel(&QTM(model40), QTM(m40sym), 0x40, 0x40); + QTMfdi_initmodel(&QTM(model80), QTM(m80sym), 0x40, 0x80); + QTMfdi_initmodel(&QTM(modelC0), QTM(mC0sym), 0x40, 0xC0); /* model 4 depends on table size, ranges from 20 to 24 */ - QTMfdi_initmodel(&QTM(model4), &QTM(m4sym)[0], (msz < 24) ? msz : 24, 0); + QTMfdi_initmodel(&QTM(model4), QTM(m4sym), (msz < 24) ? msz : 24, 0); /* model 5 depends on table size, ranges from 20 to 36 */ - QTMfdi_initmodel(&QTM(model5), &QTM(m5sym)[0], (msz < 36) ? msz : 36, 0); + QTMfdi_initmodel(&QTM(model5), QTM(m5sym), (msz < 36) ? msz : 36, 0); /* model 6pos depends on table size, ranges from 20 to 42 */ - QTMfdi_initmodel(&QTM(model6pos), &QTM(m6psym)[0], msz, 0); - QTMfdi_initmodel(&QTM(model6len), &QTM(m6lsym)[0], 27, 0); + QTMfdi_initmodel(&QTM(model6pos), QTM(m6psym), msz, 0); + QTMfdi_initmodel(&QTM(model6len), QTM(m6lsym), 27, 0); return DECR_OK; } @@ -2082,7 +2082,7 @@ static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state ZeroMemory(&fdin, sizeof(FDINOTIFICATION)); fdin.psz1 = (cab->mii.nextname) ? cab->mii.nextname : &emptystring; fdin.psz2 = (cab->mii.nextinfo) ? cab->mii.nextinfo : &emptystring; - fdin.psz3 = &userpath[0]; + fdin.psz3 = userpath; fdin.fdie = FDIERROR_NONE; fdin.pv = pvUser;
1
0
0
0
Michael Stefaniuc : dnsapi: Remove a superfluous TRUE-FALSE conditional expression.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: d8bdd4cc01464796445d56d0a1a6bf10d4f70a76 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8bdd4cc01464796445d56d0a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Jul 25 12:38:40 2012 +0200 dnsapi: Remove a superfluous TRUE-FALSE conditional expression. --- dlls/dnsapi/record.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/dnsapi/record.c b/dlls/dnsapi/record.c index fbdcae7..3316f05 100644 --- a/dlls/dnsapi/record.c +++ b/dlls/dnsapi/record.c @@ -136,7 +136,7 @@ BOOL WINAPI DnsRecordCompare( PDNS_RECORD r1, PDNS_RECORD r2 ) r1->Flags.DW != r2->Flags.DW || r1->dwReserved != r2->dwReserved) return FALSE; - wide = (r1->Flags.S.CharSet == DnsCharSetUnicode) ? TRUE : FALSE; + wide = r1->Flags.S.CharSet == DnsCharSetUnicode; if (dns_strcmpX( r1->pName, r2->pName, wide )) return FALSE; switch (r1->wType)
1
0
0
0
Francois Gouget : d3dcompiler_43: Make debug_dump_ir_expr() static.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 3dd26315a4d33e9cb1df3290837fe780cec29f63 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3dd26315a4d33e9cb1df32908…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Jul 25 11:10:00 2012 +0200 d3dcompiler_43: Make debug_dump_ir_expr() static. --- dlls/d3dcompiler_43/utils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 9c4f6ca..242f5fb 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1817,7 +1817,7 @@ static const char *debug_expr_op(const struct hlsl_ir_expr *expr) } /* Dumps the expression in a prefix "operator (operands)" form */ -void debug_dump_ir_expr(const struct hlsl_ir_expr *expr) +static void debug_dump_ir_expr(const struct hlsl_ir_expr *expr) { unsigned int i;
1
0
0
0
Alexandre Julliard : opengl32: Store the modified extension string in the context.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 5923e32ef1b10f741e20d2feba1a1a60d67fa6b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5923e32ef1b10f741e20d2feb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 25 14:49:02 2012 +0200 opengl32: Store the modified extension string in the context. --- dlls/opengl32/wgl.c | 75 ++++++++++++++++++++++++++++---------------------- 1 files changed, 42 insertions(+), 33 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 84b37c8..162f132 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -67,10 +67,11 @@ enum wgl_handle_type struct opengl_context { - DWORD tid; /* thread that the context is current in */ - HDC draw_dc; /* current drawing DC */ - HDC read_dc; /* current reading DC */ - struct wgl_context *drv_ctx; /* driver context */ + DWORD tid; /* thread that the context is current in */ + HDC draw_dc; /* current drawing DC */ + HDC read_dc; /* current reading DC */ + GLubyte *extensions; /* extension string */ + struct wgl_context *drv_ctx; /* driver context */ }; struct wgl_handle @@ -215,6 +216,7 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc) } if (hglrc == NtCurrentTeb()->glCurrentRC) wglMakeCurrent( 0, 0 ); ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx ); + HeapFree( GetProcessHeap(), 0, ptr->u.context->extensions ); HeapFree( GetProcessHeap(), 0, ptr->u.context ); free_handle_ptr( ptr ); return TRUE; @@ -1480,26 +1482,41 @@ GLint WINAPI wine_glDebugEntry( GLint unknown1, GLint unknown2 ) } /* build the extension string by filtering out the disabled extensions */ -static char *build_gl_extensions( const char *extensions ) +static GLubyte *filter_extensions( const char *extensions ) { - char *p, *str, *disabled = NULL; + static const char *disabled; + char *p, *str; const char *end; - HKEY hkey; TRACE( "GL_EXTENSIONS:\n" ); if (!extensions) extensions = ""; - /* @@ Wine registry key: HKCU\Software\Wine\OpenGL */ - if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey )) + if (!disabled) { - DWORD size, ret = RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, NULL, &size ); - if (!ret && (disabled = HeapAlloc( GetProcessHeap(), 0, size ))) - ret = RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, (BYTE *)disabled, &size ); - RegCloseKey( hkey ); - if (ret) *disabled = 0; + HKEY hkey; + DWORD size; + + str = NULL; + /* @@ Wine registry key: HKCU\Software\Wine\OpenGL */ + if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey )) + { + if (!RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, NULL, &size )) + { + str = HeapAlloc( GetProcessHeap(), 0, size ); + if (RegQueryValueExA( hkey, "DisabledExtensions", 0, NULL, (BYTE *)str, &size )) *str = 0; + } + RegCloseKey( hkey ); + } + if (str) + { + if (InterlockedCompareExchangePointer( (void **)&disabled, str, NULL )) + HeapFree( GetProcessHeap(), 0, str ); + } + else disabled = ""; } + if (!disabled[0]) return NULL; if ((str = HeapAlloc( GetProcessHeap(), 0, strlen(extensions) + 2 ))) { p = str; @@ -1521,8 +1538,7 @@ static char *build_gl_extensions( const char *extensions ) } *p = 0; } - HeapFree( GetProcessHeap(), 0, disabled ); - return str; + return (GLubyte *)str; } /*********************************************************************** @@ -1530,24 +1546,17 @@ static char *build_gl_extensions( const char *extensions ) */ const GLubyte * WINAPI wine_glGetString( GLenum name ) { - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - static const GLubyte *gl_extensions; - - /* this is for buggy nvidia driver, crashing if called from a different - thread with no context */ - if(wglGetCurrentContext() == NULL) - return NULL; - - if (name != GL_EXTENSIONS) return funcs->gl.p_glGetString(name); + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + const GLubyte *ret = funcs->gl.p_glGetString( name ); - if (!gl_extensions) - { - const char *orig_ext = (const char *)funcs->gl.p_glGetString(GL_EXTENSIONS); - char *new_ext = build_gl_extensions( orig_ext ); - if (InterlockedCompareExchangePointer( (void **)&gl_extensions, new_ext, NULL )) - HeapFree( GetProcessHeap(), 0, new_ext ); - } - return gl_extensions; + if (name == GL_EXTENSIONS && ret) + { + struct wgl_handle *ptr = get_current_context_ptr(); + if (ptr->u.context->extensions || + ((ptr->u.context->extensions = filter_extensions( (const char *)ret )))) + ret = ptr->u.context->extensions; + } + return ret; } /***********************************************************************
1
0
0
0
Alexandre Julliard : opengl32: Store the context current DCs on the opengl32 side.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 5f157e18e2267f29a2051bca602640bd42c9070d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f157e18e2267f29a2051bca6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 25 14:28:47 2012 +0200 opengl32: Store the context current DCs on the opengl32 side. --- dlls/opengl32/make_opengl | 1 - dlls/opengl32/opengl_norm.c | 2 -- dlls/opengl32/wgl.c | 19 +++++++++++++------ dlls/winex11.drv/opengl.c | 31 +------------------------------ include/wine/wgl_driver.h | 3 +-- 5 files changed, 15 insertions(+), 41 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index fd5a264..cf6d4e1 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -622,7 +622,6 @@ my %wgl_functions = [ "UINT", "mask" ] ] ], "wglCreateContext" => [ "struct wgl_context *", [ [ "HDC", "hdc" ] ] ], "wglDeleteContext" => [ "void", [ [ "struct wgl_context *", "context" ] ] ], - "wglGetCurrentDC" => [ "HDC", [ [ "struct wgl_context *", "context" ] ] ], "wglGetPixelFormat" => [ "INT", [ [ "HDC", "hdc" ] ] ], "wglGetProcAddress" => [ "PROC", [ [ "LPCSTR", "name" ] ] ], "wglMakeCurrent" => [ "BOOL", [ [ "HDC", "hdc" ], diff --git a/dlls/opengl32/opengl_norm.c b/dlls/opengl32/opengl_norm.c index 41898a9..2f5dab7 100644 --- a/dlls/opengl32/opengl_norm.c +++ b/dlls/opengl32/opengl_norm.c @@ -3027,7 +3027,6 @@ void WINAPI wine_glViewport( GLint x, GLint y, GLsizei width, GLsizei height ) { static BOOL null_wglCopyContext( struct wgl_context * src, struct wgl_context * dst, UINT mask ) { return 0; } static struct wgl_context * null_wglCreateContext( HDC hdc ) { return 0; } static void null_wglDeleteContext( struct wgl_context * context ) { } -static HDC null_wglGetCurrentDC( struct wgl_context * context ) { return 0; } static INT null_wglGetPixelFormat( HDC hdc ) { return 0; } static PROC null_wglGetProcAddress( LPCSTR name ) { return 0; } static BOOL null_wglMakeCurrent( HDC hdc, struct wgl_context * context ) { return 0; } @@ -3375,7 +3374,6 @@ struct opengl_funcs null_opengl_funcs = null_wglCopyContext, null_wglCreateContext, null_wglDeleteContext, - null_wglGetCurrentDC, null_wglGetPixelFormat, null_wglGetProcAddress, null_wglMakeCurrent, diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 3dc2b18..84b37c8 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -68,6 +68,8 @@ enum wgl_handle_type struct opengl_context { DWORD tid; /* thread that the context is current in */ + HDC draw_dc; /* current drawing DC */ + HDC read_dc; /* current reading DC */ struct wgl_context *drv_ctx; /* driver context */ }; @@ -236,6 +238,8 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) { if (prev) prev->u.context->tid = 0; ptr->u.context->tid = GetCurrentThreadId(); + ptr->u.context->draw_dc = hdc; + ptr->u.context->read_dc = hdc; NtCurrentTeb()->glCurrentRC = hglrc; NtCurrentTeb()->glTable = ptr->funcs; } @@ -315,6 +319,8 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) { if (prev) prev->u.context->tid = 0; ptr->u.context->tid = GetCurrentThreadId(); + ptr->u.context->draw_dc = draw_hdc; + ptr->u.context->read_dc = read_hdc; NtCurrentTeb()->glCurrentRC = hglrc; NtCurrentTeb()->glTable = ptr->funcs; } @@ -343,10 +349,10 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) */ HDC WINAPI wglGetCurrentReadDCARB(void) { - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + struct wgl_handle *ptr = get_current_context_ptr(); - if (!funcs->ext.p_wglGetCurrentReadDCARB) return 0; - return funcs->ext.p_wglGetCurrentReadDCARB(); + if (!ptr) return 0; + return ptr->u.context->read_dc; } /*********************************************************************** @@ -373,9 +379,10 @@ BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst) */ HDC WINAPI wglGetCurrentDC(void) { - struct wgl_handle *context = get_current_context_ptr(); - if (!context) return 0; - return context->funcs->wgl.p_wglGetCurrentDC( context->u.context->drv_ctx ); + struct wgl_handle *ptr = get_current_context_ptr(); + + if (!ptr) return 0; + return ptr->u.context->draw_dc; } /*********************************************************************** diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 22c608e..4f906e2 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -151,7 +151,6 @@ struct wgl_context int numAttribs; /* This is needed for delaying wglCreateContextAttribsARB */ int attribList[16]; /* This is needed for delaying wglCreateContextAttribsARB */ GLXContext ctx; - HDC read_hdc; Drawable drawables[2]; BOOL refresh_drawables; Pixmap pixmap; /* pixmap for memory DCs */ @@ -1497,22 +1496,6 @@ static void glxdrv_wglDeleteContext(struct wgl_context *ctx) HeapFree( GetProcessHeap(), 0, ctx ); } -/** - * X11DRV_wglGetCurrentReadDCARB - * - * For OpenGL32 wglGetCurrentReadDCARB. - */ -static HDC X11DRV_wglGetCurrentReadDCARB(void) -{ - HDC ret = 0; - struct wgl_context *ctx = NtCurrentTeb()->glContext; - - if (ctx) ret = ctx->read_hdc; - - TRACE(" returning %p (GL drawable %lu)\n", ret, ctx ? ctx->drawables[1] : 0); - return ret; -} - /*********************************************************************** * glxdrv_wglGetProcAddress */ @@ -1600,7 +1583,6 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) ctx->has_been_current = TRUE; ctx->hdc = hdc; - ctx->read_hdc = hdc; ctx->drawables[0] = escape.gl_drawable; ctx->drawables[1] = escape.gl_drawable; ctx->refresh_drawables = FALSE; @@ -1663,7 +1645,6 @@ static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct { ctx->has_been_current = TRUE; ctx->hdc = draw_hdc; - ctx->read_hdc = read_hdc; ctx->drawables[0] = escape_draw.gl_drawable; ctx->drawables[1] = escape_read.gl_drawable; ctx->refresh_drawables = FALSE; @@ -1731,15 +1712,6 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de return FALSE; } -/*********************************************************************** - * glxdrv_wglGetCurrentDC - */ -static HDC glxdrv_wglGetCurrentDC( struct wgl_context *ctx ) -{ - TRACE("hdc %p\n", ctx->hdc); - return ctx->hdc; -} - static void flush_pixmap( struct wgl_context *ctx ) { char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; @@ -2912,7 +2884,7 @@ static void X11DRV_WineGL_LoadExtensions(void) if (glxRequireVersion(3)) { register_extension( "WGL_ARB_make_current_read" ); - opengl_funcs.ext.p_wglGetCurrentReadDCARB = X11DRV_wglGetCurrentReadDCARB; + opengl_funcs.ext.p_wglGetCurrentReadDCARB = (void *)1; /* never called */ opengl_funcs.ext.p_wglMakeContextCurrentARB = X11DRV_wglMakeContextCurrentARB; } @@ -3338,7 +3310,6 @@ static struct opengl_funcs opengl_funcs = glxdrv_wglCopyContext, /* p_wglCopyContext */ glxdrv_wglCreateContext, /* p_wglCreateContext */ glxdrv_wglDeleteContext, /* p_wglDeleteContext */ - glxdrv_wglGetCurrentDC, /* p_wglGetCurrentDC */ glxdrv_wglGetPixelFormat, /* p_wglGetPixelFormat */ glxdrv_wglGetProcAddress, /* p_wglGetProcAddress */ glxdrv_wglMakeCurrent, /* p_wglMakeCurrent */ diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h index 79fc321..209c361 100644 --- a/include/wine/wgl_driver.h +++ b/include/wine/wgl_driver.h @@ -7,7 +7,7 @@ #define WINE_GLAPI #endif -#define WINE_WGL_DRIVER_VERSION 4 +#define WINE_WGL_DRIVER_VERSION 5 struct wgl_context; struct wgl_pbuffer; @@ -19,7 +19,6 @@ struct opengl_funcs BOOL (WINE_GLAPI *p_wglCopyContext)(struct wgl_context *,struct wgl_context *,UINT); struct wgl_context * (WINE_GLAPI *p_wglCreateContext)(HDC); void (WINE_GLAPI *p_wglDeleteContext)(struct wgl_context *); - HDC (WINE_GLAPI *p_wglGetCurrentDC)(struct wgl_context *); INT (WINE_GLAPI *p_wglGetPixelFormat)(HDC); PROC (WINE_GLAPI *p_wglGetProcAddress)(LPCSTR); BOOL (WINE_GLAPI *p_wglMakeCurrent)(HDC,struct wgl_context *);
1
0
0
0
Alexandre Julliard : opengl32: Allocate a separate context structure to store generic information.
by Alexandre Julliard
25 Jul '12
25 Jul '12
Module: wine Branch: master Commit: 2077a58c2182251b9577ce6be0a117949bdad34f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2077a58c2182251b9577ce6be…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 16 22:53:28 2012 +0200 opengl32: Allocate a separate context structure to store generic information. --- dlls/opengl32/wgl.c | 76 ++++++++++++++++++++++++++++++++------------------- 1 files changed, 48 insertions(+), 28 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index ca953e0..3dc2b18 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -65,16 +65,21 @@ enum wgl_handle_type HANDLE_TYPE_MASK = 15 << 12 }; +struct opengl_context +{ + DWORD tid; /* thread that the context is current in */ + struct wgl_context *drv_ctx; /* driver context */ +}; + struct wgl_handle { UINT handle; - DWORD tid; struct opengl_funcs *funcs; union { - struct wgl_context *context; /* for HANDLE_CONTEXT */ - struct wgl_pbuffer *pbuffer; /* for HANDLE_PBUFFER */ - struct wgl_handle *next; /* for free handles */ + struct opengl_context *context; /* for HANDLE_CONTEXT */ + struct wgl_pbuffer *pbuffer; /* for HANDLE_PBUFFER */ + struct wgl_handle *next; /* for free handles */ } u; }; @@ -183,7 +188,8 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) if ((dst = get_handle_ptr( hglrcDst, HANDLE_CONTEXT ))) { if (src->funcs != dst->funcs) SetLastError( ERROR_INVALID_HANDLE ); - else ret = src->funcs->wgl.p_wglCopyContext( src->u.context, dst->u.context, mask ); + else ret = src->funcs->wgl.p_wglCopyContext( src->u.context->drv_ctx, + dst->u.context->drv_ctx, mask ); } release_handle_ptr( dst ); release_handle_ptr( src ); @@ -199,14 +205,15 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc) if (!ptr) return FALSE; - if (ptr->tid && ptr->tid != GetCurrentThreadId()) + if (ptr->u.context->tid && ptr->u.context->tid != GetCurrentThreadId()) { SetLastError( ERROR_BUSY ); release_handle_ptr( ptr ); return FALSE; } if (hglrc == NtCurrentTeb()->glCurrentRC) wglMakeCurrent( 0, 0 ); - ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context ); + ptr->funcs->wgl.p_wglDeleteContext( ptr->u.context->drv_ctx ); + HeapFree( GetProcessHeap(), 0, ptr->u.context ); free_handle_ptr( ptr ); return TRUE; } @@ -222,13 +229,13 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) if (hglrc) { if (!(ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT ))) return FALSE; - if (!ptr->tid || ptr->tid == GetCurrentThreadId()) + if (!ptr->u.context->tid || ptr->u.context->tid == GetCurrentThreadId()) { - ret = ptr->funcs->wgl.p_wglMakeCurrent( hdc, ptr->u.context ); + ret = ptr->funcs->wgl.p_wglMakeCurrent( hdc, ptr->u.context->drv_ctx ); if (ret) { - if (prev) prev->tid = 0; - ptr->tid = GetCurrentThreadId(); + if (prev) prev->u.context->tid = 0; + ptr->u.context->tid = GetCurrentThreadId(); NtCurrentTeb()->glCurrentRC = hglrc; NtCurrentTeb()->glTable = ptr->funcs; } @@ -243,7 +250,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) else if (prev) { if (!prev->funcs->wgl.p_wglMakeCurrent( 0, NULL )) return FALSE; - prev->tid = 0; + prev->u.context->tid = 0; NtCurrentTeb()->glCurrentRC = 0; NtCurrentTeb()->glTable = &null_opengl_funcs; } @@ -263,17 +270,23 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attribs ) { HGLRC ret = 0; - struct wgl_context *context; + struct wgl_context *drv_ctx; struct wgl_handle *share_ptr = NULL; + struct opengl_context *context; struct opengl_funcs *funcs = get_dc_funcs( hdc ); if (!funcs || !funcs->ext.p_wglCreateContextAttribsARB) return 0; if (share && !(share_ptr = get_handle_ptr( share, HANDLE_CONTEXT ))) return 0; - if ((context = funcs->ext.p_wglCreateContextAttribsARB( hdc, share_ptr ? share_ptr->u.context : NULL, - attribs ))) + if ((drv_ctx = funcs->ext.p_wglCreateContextAttribsARB( hdc, + share_ptr ? share_ptr->u.context->drv_ctx : NULL, attribs ))) { - ret = alloc_handle( HANDLE_CONTEXT, funcs, context ); - if (!ret) funcs->wgl.p_wglDeleteContext( context ); + if ((context = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*context) ))) + { + context->drv_ctx = drv_ctx; + if (!(ret = alloc_handle( HANDLE_CONTEXT, funcs, context ))) + HeapFree( GetProcessHeap(), 0, context ); + } + if (!ret) funcs->wgl.p_wglDeleteContext( drv_ctx ); } release_handle_ptr( share_ptr ); return ret; @@ -293,14 +306,15 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) if (hglrc) { if (!(ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT ))) return FALSE; - if (!ptr->tid || ptr->tid == GetCurrentThreadId()) + if (!ptr->u.context->tid || ptr->u.context->tid == GetCurrentThreadId()) { ret = (ptr->funcs->ext.p_wglMakeContextCurrentARB && - ptr->funcs->ext.p_wglMakeContextCurrentARB( draw_hdc, read_hdc, ptr->u.context )); + ptr->funcs->ext.p_wglMakeContextCurrentARB( draw_hdc, read_hdc, + ptr->u.context->drv_ctx )); if (ret) { - if (prev) prev->tid = 0; - ptr->tid = GetCurrentThreadId(); + if (prev) prev->u.context->tid = 0; + ptr->u.context->tid = GetCurrentThreadId(); NtCurrentTeb()->glCurrentRC = hglrc; NtCurrentTeb()->glTable = ptr->funcs; } @@ -315,7 +329,7 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) else if (prev) { if (!prev->funcs->wgl.p_wglMakeCurrent( 0, NULL )) return FALSE; - prev->tid = 0; + prev->u.context->tid = 0; NtCurrentTeb()->glCurrentRC = 0; NtCurrentTeb()->glTable = &null_opengl_funcs; } @@ -347,7 +361,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst) if ((dst = get_handle_ptr( hglrcDst, HANDLE_CONTEXT ))) { if (src->funcs != dst->funcs) SetLastError( ERROR_INVALID_HANDLE ); - else ret = src->funcs->wgl.p_wglShareLists( src->u.context, dst->u.context ); + else ret = src->funcs->wgl.p_wglShareLists( src->u.context->drv_ctx, dst->u.context->drv_ctx ); } release_handle_ptr( dst ); release_handle_ptr( src ); @@ -361,7 +375,7 @@ HDC WINAPI wglGetCurrentDC(void) { struct wgl_handle *context = get_current_context_ptr(); if (!context) return 0; - return context->funcs->wgl.p_wglGetCurrentDC( context->u.context ); + return context->funcs->wgl.p_wglGetCurrentDC( context->u.context->drv_ctx ); } /*********************************************************************** @@ -370,13 +384,19 @@ HDC WINAPI wglGetCurrentDC(void) HGLRC WINAPI wglCreateContext(HDC hdc) { HGLRC ret = 0; - struct wgl_context *context; + struct wgl_context *drv_ctx; + struct opengl_context *context; struct opengl_funcs *funcs = get_dc_funcs( hdc ); if (!funcs) return 0; - if (!(context = funcs->wgl.p_wglCreateContext( hdc ))) return 0; - ret = alloc_handle( HANDLE_CONTEXT, funcs, context ); - if (!ret) funcs->wgl.p_wglDeleteContext( context ); + if (!(drv_ctx = funcs->wgl.p_wglCreateContext( hdc ))) return 0; + if ((context = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*context) ))) + { + context->drv_ctx = drv_ctx; + if (!(ret = alloc_handle( HANDLE_CONTEXT, funcs, context ))) + HeapFree( GetProcessHeap(), 0, context ); + } + if (!ret) funcs->wgl.p_wglDeleteContext( drv_ctx ); return ret; }
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
72
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
Results per page:
10
25
50
100
200