winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2011
----- 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
849 discussions
Start a n
N
ew thread
Alexandre Julliard : gdi32: Add null driver entry points for the text functions.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 1fc5603cc958a9b112b6bca23f0c1fe472b4fd2c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fc5603cc958a9b112b6bca23…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 15 20:42:49 2011 +0100 gdi32: Add null driver entry points for the text functions. --- dlls/gdi32/driver.c | 38 ++++++++++++++++-- dlls/gdi32/font.c | 95 +++++++++++++++++++++++----------------------- dlls/gdi32/gdi_private.h | 2 +- 3 files changed, 81 insertions(+), 54 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=1fc5603cc958a9b112b6b…
1
0
0
0
Alexandre Julliard : gdi32: Don't allocate a GDI handle for saved DCs.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 7b970a165778833f8d7cd4ffd877b9b14d2c4938 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b970a165778833f8d7cd4ffd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Mar 16 11:41:49 2011 +0100 gdi32: Don't allocate a GDI handle for saved DCs. --- dlls/gdi32/dc.c | 76 ++++++++++++++++----------------------------- dlls/gdi32/gdi_private.h | 4 +- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index b0a7151..d70d2c2 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -160,18 +160,27 @@ DC *alloc_dc_ptr( const DC_FUNCTIONS *funcs, WORD magic ) /*********************************************************************** - * free_dc_ptr + * free_dc_state */ -BOOL free_dc_ptr( DC *dc ) +static void free_dc_state( DC *dc ) { - assert( dc->refcount == 1 ); - if (free_gdi_handle( dc->hSelf ) != dc) return FALSE; /* shouldn't happen */ if (dc->hClipRgn) DeleteObject( dc->hClipRgn ); if (dc->hMetaRgn) DeleteObject( dc->hMetaRgn ); if (dc->hMetaClipRgn) DeleteObject( dc->hMetaClipRgn ); if (dc->hVisRgn) DeleteObject( dc->hVisRgn ); PATH_DestroyGdiPath( &dc->path ); - return HeapFree( GetProcessHeap(), 0, dc ); + HeapFree( GetProcessHeap(), 0, dc ); +} + + +/*********************************************************************** + * free_dc_ptr + */ +void free_dc_ptr( DC *dc ) +{ + assert( dc->refcount == 1 ); + free_gdi_handle( dc->hSelf ); + free_dc_state( dc ); } @@ -373,7 +382,6 @@ void DC_UpdateXforms( DC *dc ) INT CDECL nulldrv_SaveDC( PHYSDEV dev ) { DC *newdc, *dc = get_nulldrv_dc( dev ); - INT ret; if (!(newdc = HeapAlloc( GetProcessHeap(), 0, sizeof(*newdc )))) return 0; newdc->flags = dc->flags | DC_SAVED; @@ -422,22 +430,8 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev ) newdc->BoundsRect = dc->BoundsRect; newdc->gdiFont = dc->gdiFont; - newdc->thread = GetCurrentThreadId(); - newdc->refcount = 1; - newdc->saveLevel = 0; - newdc->saved_dc = 0; - PATH_InitGdiPath( &newdc->path ); - newdc->pAbortProc = NULL; - newdc->hookProc = NULL; - - if (!(newdc->hSelf = alloc_gdi_handle( &newdc->header, dc->header.type, &dc_funcs ))) - { - HeapFree( GetProcessHeap(), 0, newdc ); - return 0; - } - /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */ newdc->hVisRgn = 0; @@ -454,20 +448,19 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev ) newdc->hMetaRgn = CreateRectRgn( 0, 0, 0, 0 ); CombineRgn( newdc->hMetaRgn, dc->hMetaRgn, 0, RGN_COPY ); } + /* don't bother recomputing hMetaClipRgn, we'll do that in SetDCState */ if (!PATH_AssignGdiPath( &newdc->path, &dc->path )) { release_dc_ptr( dc ); - free_dc_ptr( newdc ); + free_dc_state( newdc ); return 0; } newdc->saved_dc = dc->saved_dc; - dc->saved_dc = newdc->hSelf; - ret = ++dc->saveLevel; - release_dc_ptr( newdc ); - return ret; + dc->saved_dc = newdc; + return ++dc->saveLevel; } @@ -476,8 +469,7 @@ INT CDECL nulldrv_SaveDC( PHYSDEV dev ) */ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level ) { - DC *dcs, *dc = get_nulldrv_dc( dev ); - HDC hdcs, first_dcs; + DC *dcs, *first_dcs, *dc = get_nulldrv_dc( dev ); INT save_level; /* find the state level to restore */ @@ -485,21 +477,12 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level ) if (abs(level) > dc->saveLevel || level == 0) return FALSE; if (level < 0) level = dc->saveLevel + level + 1; first_dcs = dc->saved_dc; - for (hdcs = first_dcs, save_level = dc->saveLevel; save_level > level; save_level--) - { - if (!(dcs = get_dc_ptr( hdcs ))) return FALSE; - hdcs = dcs->saved_dc; - release_dc_ptr( dcs ); - } + for (dcs = first_dcs, save_level = dc->saveLevel; save_level > level; save_level--) + dcs = dcs->saved_dc; /* restore the state */ - if (!(dcs = get_dc_ptr( hdcs ))) return FALSE; - if (!PATH_AssignGdiPath( &dc->path, &dcs->path )) - { - release_dc_ptr( dcs ); - return FALSE; - } + if (!PATH_AssignGdiPath( &dc->path, &dcs->path )) return FALSE; dc->flags = dcs->flags & ~DC_SAVED; dc->layout = dcs->layout; @@ -577,16 +560,13 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level ) dcs->saved_dc = 0; dc->saveLevel = save_level - 1; - release_dc_ptr( dcs ); - /* now destroy all the saved DCs */ while (first_dcs) { - if (!(dcs = get_dc_ptr( first_dcs ))) break; - hdcs = dcs->saved_dc; - free_dc_ptr( dcs ); - first_dcs = hdcs; + DC *next = first_dcs->saved_dc; + free_dc_state( first_dcs ); + first_dcs = next; } return TRUE; } @@ -841,12 +821,10 @@ BOOL WINAPI DeleteDC( HDC hdc ) while (dc->saveLevel) { - DC * dcs; - HDC hdcs = dc->saved_dc; - if (!(dcs = get_dc_ptr( hdcs ))) break; + DC *dcs = dc->saved_dc; dc->saved_dc = dcs->saved_dc; dc->saveLevel--; - free_dc_ptr( dcs ); + free_dc_state( dcs ); } if (!(dc->flags & DC_SAVED)) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 996a435..c9f653e 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -253,7 +253,7 @@ typedef struct tagDC LONG refcount; /* thread refcount */ LONG dirty; /* dirty flag */ INT saveLevel; - HDC saved_dc; + struct tagDC *saved_dc; DWORD_PTR dwHookData; DCHOOKPROC hookProc; /* DC hook */ @@ -376,7 +376,7 @@ extern void CLIPPING_UpdateGCRegion( DC * dc ) DECLSPEC_HIDDEN; /* dc.c */ extern DC *alloc_dc_ptr( const DC_FUNCTIONS *funcs, WORD magic ) DECLSPEC_HIDDEN; -extern BOOL free_dc_ptr( DC *dc ) DECLSPEC_HIDDEN; +extern void free_dc_ptr( DC *dc ) DECLSPEC_HIDDEN; extern DC *get_dc_ptr( HDC hdc ) DECLSPEC_HIDDEN; extern void release_dc_ptr( DC *dc ) DECLSPEC_HIDDEN; extern void update_dc( DC *dc ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Add null driver entry points for the DC state functions.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: e6d153bbf6e767d2ecea0289827188a19929acbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6d153bbf6e767d2ecea02898…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 15 20:17:58 2011 +0100 gdi32: Add null driver entry points for the DC state functions. --- dlls/gdi32/dc.c | 116 +++++++++++++++++----------------------------- dlls/gdi32/driver.c | 11 +++- dlls/gdi32/enhmfdrv/dc.c | 9 ++-- dlls/gdi32/gdi_private.h | 4 +- 4 files changed, 58 insertions(+), 82 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e6d153bbf6e767d2ecea0…
1
0
0
0
Alexandre Julliard : gdi32: Add null driver entry points for the bitmap functions.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 122b5bf7841c6717894f22c951c5285feda7779b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=122b5bf7841c6717894f22c95…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 15 19:51:06 2011 +0100 gdi32: Add null driver entry points for the bitmap functions. --- dlls/gdi32/bitmap.c | 127 ++++++++++++++++++++++++++++------------------ dlls/gdi32/brush.c | 2 +- dlls/gdi32/dib.c | 40 +++------------ dlls/gdi32/driver.c | 22 ++++++-- dlls/gdi32/gdi_private.h | 6 ++- 5 files changed, 107 insertions(+), 90 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=122b5bf7841c6717894f2…
1
0
0
0
Jacek Caban : mshtml: Notify parser about script evaluation.
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: dc96c688d397eb4ef1392ee6a98f3eb6b176dc56 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc96c688d397eb4ef1392ee6a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 13:45:46 2011 +0100 mshtml: Notify parser about script evaluation. --- dlls/mshtml/mutation.c | 22 ++++++++++++++++- dlls/mshtml/nsiface.idl | 49 ++++++++++++++++++++++++++++++++++++++- dlls/mshtml/tests/exectest.html | 4 +- 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 94217e9..2117e49 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -310,9 +310,10 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo return NS_OK; } -static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_iface, nsISupports *arg) +static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_iface, nsISupports *parser_iface) { nsIDOMHTMLScriptElement *nsscript; + nsIParser *nsparser = NULL; nsresult nsres; TRACE("(%p)->(%p)\n", doc, script_iface); @@ -323,7 +324,24 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa return nsres; } + if(parser_iface) { + nsres = nsISupports_QueryInterface(parser_iface, &IID_nsIParser, (void**)&nsparser); + if(NS_FAILED(nsres)) { + ERR("Could not get nsIParser iface: %08x\n", nsres); + nsparser = NULL; + } + } + + if(nsparser) + nsIParser_BeginEvaluatingParserInsertedScript(nsparser); + doc_insert_script(doc->basedoc.window, nsscript); + + if(nsparser) { + nsIParser_EndEvaluatingParserInsertedScript(nsparser); + nsIParser_Release(nsparser); + } + nsIDOMHTMLScriptElement_Release(nsscript); return NS_OK; } @@ -649,7 +667,7 @@ static nsresult NSAPI nsDocumentObserver_DoneAddingChildren(nsIDocumentObserver if(NS_SUCCEEDED(nsres)) { TRACE("script node\n"); - add_script_runner(This, run_insert_script, (nsISupports*)nsscript, NULL); + add_script_runner(This, run_insert_script, (nsISupports*)nsscript, (nsISupports*)aParser); nsIDOMHTMLScriptElement_Release(nsscript); } diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 1df22b3..b6367b4 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -150,7 +150,9 @@ typedef nsISupports nsIControllers; typedef nsISupports nsIDOMValidityState; typedef nsISupports nsIPluginInstanceOwner; typedef nsISupports nsIPluginStreamListener; -typedef nsISupports nsIParser; +typedef nsISupports nsIContentSink; +typedef nsISupports nsIParserFilter; +typedef nsISupports nsIDTD; [ object, @@ -2960,6 +2962,51 @@ interface nsIMutationObserver : nsISupports [ object, + uuid(cbc0cbd8-bbb7-46d6-a551-378a6953a714), + local +] +interface nsIParser : nsISupports +{ + typedef int nsDTDMode; + typedef int eParserCommands; + + void SetContentSink(nsIContentSink *aSink); + nsIContentSink *GetContentSink(); + void GetCommand(nsACString *aCommand); + void SetCommand2(const char *aCommand); + void SetCommand(eParserCommands aParserCommand); + void SetDocumentCharset(const nsACString *aCharset, PRInt32 aSource); + void GetDocumentCharset(nsACString *oCharset, PRInt32 *oSource); + void SetParserFilter(nsIParserFilter *aFilter); + nsresult GetChannel(nsIChannel **aChannel); + nsresult GetDTD(nsIDTD **aDTD); + nsresult GetStreamListener(nsIStreamListener **aListener); + nsresult ContinueInterruptedParsing(); + void BlockParser(); + void UnblockParser(); + PRBool IsParserEnabled(); + PRBool IsComplete(); + nsresult Parse(nsIURI *aURL, nsIRequestObserver *aListener, void *aKey, nsDTDMode aMode); + nsresult Parse2(const nsAString *aSourceBuffer, void *aKey, const nsACString *aMimeType, PRBool aLastCall, nsDTDMode aMode); + void *GetRootContextKey(); + nsresult Terminate(); + nsresult ParseFragment(const nsAString *aSourceBuffer, void *aKey, void /*nsTArray<nsString>*/ *aTagStack, + PRBool aXMLMode, const nsACString *aContentType, nsDTDMode aMode); + nsresult ParseFragment2(const nsAString *aSourceBuffer, nsIContent *aTargetNode, nsIAtom *aContextLocalName, + PRInt32 aContextNamespace, PRBool aQuirks); + nsresult BuildModel(); + nsresult CancelParsingEvents(); + void Reset(); + PRBool CanInterrupt(); + PRBool IsInsertionPointDefined(); + void BeginEvaluatingParserInsertedScript(); + void EndEvaluatingParserInsertedScript(); + void MarkAsNotScriptCreated(); + PRBool IsScriptCreated(); +} + +[ + object, uuid(3d005225-210f-4b07-b1d9-96020574c437), local ] diff --git a/dlls/mshtml/tests/exectest.html b/dlls/mshtml/tests/exectest.html index 65d3701..1d84917 100644 --- a/dlls/mshtml/tests/exectest.html +++ b/dlls/mshtml/tests/exectest.html @@ -15,12 +15,12 @@ ok(len === 3, "init length = " + len); document.write("<script>" + "var len = document.getElementsByTagName('div').length;" - + "external.todo_wine_ok(len === 3, 'unexpected length ' + len);" + + "ok(len === 3, 'unexpected length ' + len);" + "executed = true;" + "<" + "/script>"); len = document.getElementsByTagName('script').length; -external.todo_wine_ok(len === 2, "script col length = " + len); +ok(len === 2, "script col length = " + len); ok(executed, "writen script not executed"); external.reportSuccess();
1
0
0
0
Jacek Caban : mshtml: Wine Gecko 1.2.0 release.
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: 699e41cdd8bcda1276c98cb6d9dd0503e9465099 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=699e41cdd8bcda1276c98cb6d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 15 13:45:29 2011 +0100 mshtml: Wine Gecko 1.2.0 release. --- dlls/appwiz.cpl/addons.c | 8 ++-- dlls/mshtml/htmldoc.c | 4 +- dlls/mshtml/mshtml_private.h | 5 +- dlls/mshtml/mutation.c | 75 +++++++++++++++++++---------- dlls/mshtml/nsembed.c | 9 ++- dlls/mshtml/nsiface.idl | 110 +++++++++++++++++++++++++++++++++-------- dlls/mshtml/nsio.c | 22 ++++++++- 7 files changed, 174 insertions(+), 59 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=699e41cdd8bcda1276c98…
1
0
0
0
Jörg Höhle : winealsa: Favour HeapAlloc() over malloc().
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: e52f5773e11af076d07f8573fe20fd48cbbf9b87 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e52f5773e11af076d07f8573f…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Mar 9 02:23:10 2011 +0100 winealsa: Favour HeapAlloc() over malloc(). --- dlls/winealsa.drv/wavein.c | 22 +++++++++++----------- dlls/winealsa.drv/waveout.c | 32 +++++++++++++------------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index 2075805..32442fa 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -369,7 +369,6 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_ALLOCATED; } - wwi->pcm = 0; flags = SND_PCM_NONBLOCK; if ( (err=snd_pcm_open(&pcm, wwi->pcmname, SND_PCM_STREAM_CAPTURE, flags)) < 0 ) @@ -393,7 +392,11 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) hw_params = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, snd_pcm_hw_params_sizeof() ); sw_params = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, snd_pcm_sw_params_sizeof() ); - + if (!hw_params || !sw_params) + { + ret = MMSYSERR_NOMEM; + goto error; + } snd_pcm_hw_params_any(pcm, hw_params); #define EXIT_ON_ERROR(f,e,txt) do \ @@ -488,14 +491,9 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) ALSA_TraceParameters(hw_params, sw_params, FALSE); /* now, we can save all required data for later use... */ - if ( wwi->hw_params ) - snd_pcm_hw_params_free(wwi->hw_params); - snd_pcm_hw_params_malloc(&(wwi->hw_params)); - snd_pcm_hw_params_copy(wwi->hw_params, hw_params); wwi->dwBufferSize = snd_pcm_frames_to_bytes(pcm, buffer_size); wwi->lpQueuePtr = wwi->lpPlayPtr = wwi->lpLoopPtr = NULL; - wwi->pcm = pcm; ALSA_InitRingMessage(&wwi->msgRing); @@ -519,8 +517,10 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) CloseHandle(wwi->hStartUpEvent); wwi->hStartUpEvent = NULL; - HeapFree( GetProcessHeap(), 0, hw_params ); HeapFree( GetProcessHeap(), 0, sw_params ); + wwi->hw_params = hw_params; + wwi->pcm = pcm; + widNotifyClient(wwi, WIM_OPEN, 0L, 0L); return MMSYSERR_NOERROR; @@ -548,12 +548,12 @@ static DWORD widClose(WORD wDevID) return MMSYSERR_BADDEVICEID; } - if (WInDev[wDevID].pcm == NULL) { + wwi = &WInDev[wDevID]; + if (wwi->pcm == NULL) { WARN("Requested to close already closed device %d!\n", wDevID); return MMSYSERR_BADDEVICEID; } - wwi = &WInDev[wDevID]; if (wwi->lpQueuePtr) { WARN("buffers still playing !\n"); return WAVERR_STILLPLAYING; @@ -563,7 +563,7 @@ static DWORD widClose(WORD wDevID) } ALSA_DestroyRingMessage(&wwi->msgRing); - snd_pcm_hw_params_free(wwi->hw_params); + HeapFree( GetProcessHeap(), 0, wwi->hw_params ); wwi->hw_params = NULL; snd_pcm_close(wwi->pcm); diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 6c50f89..ac3db1a 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -576,7 +576,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) WINE_WAVEDEV* wwo; snd_pcm_t * pcm = NULL; snd_hctl_t * hctl = NULL; - snd_pcm_hw_params_t * hw_params = NULL; + snd_pcm_hw_params_t * hw_params; snd_pcm_sw_params_t * sw_params; snd_pcm_access_t access; snd_pcm_format_t format = -1; @@ -680,8 +680,8 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) } while(0) sw_params = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, snd_pcm_sw_params_sizeof() ); - snd_pcm_hw_params_malloc(&hw_params); - if (! hw_params) + hw_params = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, snd_pcm_hw_params_sizeof() ); + if (!hw_params || !sw_params) { retcode = MMSYSERR_NOMEM; goto errexit; @@ -797,11 +797,9 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwo->format.Format.nBlockAlign); HeapFree( GetProcessHeap(), 0, sw_params ); - wwo->pcm = pcm; - wwo->hctl = hctl; - if ( wwo->hw_params ) - snd_pcm_hw_params_free(wwo->hw_params); wwo->hw_params = hw_params; + wwo->hctl = hctl; + wwo->pcm = pcm; wodNotifyClient(wwo, WOM_OPEN, 0L, 0L); return MMSYSERR_NOERROR; @@ -816,9 +814,7 @@ errexit: snd_hctl_close(hctl); } - if ( hw_params ) - snd_pcm_hw_params_free(hw_params); - + HeapFree( GetProcessHeap(), 0, hw_params ); HeapFree( GetProcessHeap(), 0, sw_params ); if (wwo->msgRing.ring_buffer_size > 0) ALSA_DestroyRingMessage(&wwo->msgRing); @@ -841,12 +837,12 @@ static DWORD wodClose(WORD wDevID) return MMSYSERR_BADDEVICEID; } - if (WOutDev[wDevID].pcm == NULL) { + wwo = &WOutDev[wDevID]; + if (wwo->pcm == NULL) { WARN("Requested to close already closed device %d!\n", wDevID); return MMSYSERR_BADDEVICEID; } - wwo = &WOutDev[wDevID]; if (wwo->lpQueuePtr) { WARN("buffers still playing !\n"); return WAVERR_STILLPLAYING; @@ -856,20 +852,18 @@ static DWORD wodClose(WORD wDevID) } ALSA_DestroyRingMessage(&wwo->msgRing); - if (wwo->hw_params) - snd_pcm_hw_params_free(wwo->hw_params); + HeapFree( GetProcessHeap(), 0, wwo->hw_params ); wwo->hw_params = NULL; - if (wwo->pcm) - snd_pcm_close(wwo->pcm); - wwo->pcm = NULL; - if (wwo->hctl) { snd_hctl_free(wwo->hctl); snd_hctl_close(wwo->hctl); + wwo->hctl = NULL; } - wwo->hctl = NULL; + + snd_pcm_close(wwo->pcm); + wwo->pcm = NULL; wodNotifyClient(wwo, WOM_CLOSE, 0L, 0L); }
1
0
0
0
Jörg Höhle : winealsa: Ignore failure to notify winmm wave clients.
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: 8df872535ec4757c318adbcff9a001b6522c214e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8df872535ec4757c318adbcff…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Mar 9 02:45:31 2011 +0100 winealsa: Ignore failure to notify winmm wave clients. --- dlls/winealsa.drv/wavein.c | 15 ++++++--------- dlls/winealsa.drv/waveout.c | 17 +++++++---------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index f92f18d..2075805 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -68,7 +68,7 @@ DWORD ALSA_WidNumDevs; /************************************************************************** * widNotifyClient [internal] */ -static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) +static void widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2); @@ -80,14 +80,11 @@ static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD_PTR dwParam1, D !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, (HDRVR)wwi->waveDesc.hWave, wMsg, wwi->waveDesc.dwInstance, dwParam1, dwParam2)) { WARN("can't notify client !\n"); - return MMSYSERR_ERROR; } break; default: FIXME("Unknown callback message %u\n", wMsg); - return MMSYSERR_INVALPARAM; } - return MMSYSERR_NOERROR; } /************************************************************************** @@ -524,7 +521,8 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) HeapFree( GetProcessHeap(), 0, hw_params ); HeapFree( GetProcessHeap(), 0, sw_params ); - return widNotifyClient(wwi, WIM_OPEN, 0L, 0L); + widNotifyClient(wwi, WIM_OPEN, 0L, 0L); + return MMSYSERR_NOERROR; error: snd_pcm_close(pcm); @@ -541,7 +539,6 @@ error: */ static DWORD widClose(WORD wDevID) { - DWORD ret = MMSYSERR_NOERROR; WINE_WAVEDEV* wwi; TRACE("(%u);\n", wDevID); @@ -559,7 +556,7 @@ static DWORD widClose(WORD wDevID) wwi = &WInDev[wDevID]; if (wwi->lpQueuePtr) { WARN("buffers still playing !\n"); - ret = WAVERR_STILLPLAYING; + return WAVERR_STILLPLAYING; } else { if (wwi->hThread) { ALSA_AddRingMessage(&wwi->msgRing, WINE_WM_CLOSING, 0, TRUE); @@ -572,10 +569,10 @@ static DWORD widClose(WORD wDevID) snd_pcm_close(wwi->pcm); wwi->pcm = NULL; - ret = widNotifyClient(wwi, WIM_CLOSE, 0L, 0L); + widNotifyClient(wwi, WIM_CLOSE, 0L, 0L); } - return ret; + return MMSYSERR_NOERROR; } /************************************************************************** diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 6dcd80f..6c50f89 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -69,7 +69,7 @@ DWORD ALSA_WodNumDevs; /************************************************************************** * wodNotifyClient [internal] */ -static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) +static void wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { TRACE("wMsg = 0x%04x dwParm1 = %lx dwParam2 = %lx\n", wMsg, dwParam1, dwParam2); @@ -81,14 +81,11 @@ static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD_PTR dwParam1, D !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, (HDRVR)wwo->waveDesc.hWave, wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) { WARN("can't notify client !\n"); - return MMSYSERR_ERROR; } break; default: FIXME("Unknown callback message %u\n", wMsg); - return MMSYSERR_INVALPARAM; } - return MMSYSERR_NOERROR; } /************************************************************************** @@ -364,7 +361,7 @@ static void wodPlayer_Reset(WINE_WAVEDEV* wwo, BOOL reset) ((LPWAVEHDR)param)->dwFlags &= ~WHDR_INQUEUE; ((LPWAVEHDR)param)->dwFlags |= WHDR_DONE; - wodNotifyClient(wwo, WOM_DONE, param, 0); + wodNotifyClient(wwo, WOM_DONE, param, 0); } ALSA_ResetRingMessage(&wwo->msgRing); LeaveCriticalSection(&wwo->msgRing.msg_crst); @@ -806,7 +803,8 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) snd_pcm_hw_params_free(wwo->hw_params); wwo->hw_params = hw_params; - return wodNotifyClient(wwo, WOM_OPEN, 0L, 0L); + wodNotifyClient(wwo, WOM_OPEN, 0L, 0L); + return MMSYSERR_NOERROR; errexit: if (pcm) @@ -834,7 +832,6 @@ errexit: */ static DWORD wodClose(WORD wDevID) { - DWORD ret = MMSYSERR_NOERROR; WINE_WAVEDEV* wwo; TRACE("(%u);\n", wDevID); @@ -852,7 +849,7 @@ static DWORD wodClose(WORD wDevID) wwo = &WOutDev[wDevID]; if (wwo->lpQueuePtr) { WARN("buffers still playing !\n"); - ret = WAVERR_STILLPLAYING; + return WAVERR_STILLPLAYING; } else { if (wwo->hThread) { ALSA_AddRingMessage(&wwo->msgRing, WINE_WM_CLOSING, 0, TRUE); @@ -874,10 +871,10 @@ static DWORD wodClose(WORD wDevID) } wwo->hctl = NULL; - ret = wodNotifyClient(wwo, WOM_CLOSE, 0L, 0L); + wodNotifyClient(wwo, WOM_CLOSE, 0L, 0L); } - return ret; + return MMSYSERR_NOERROR; }
1
0
0
0
Jörg Höhle : winealsa: Open must fail when recorder thread creation fails.
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: 04e3bda4104d7151cf0c1e676e7ffe39c3430f4c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=04e3bda4104d7151cf0c1e676…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Sun Mar 6 23:03:52 2011 +0100 winealsa: Open must fail when recorder thread creation fails. --- dlls/winealsa.drv/wavein.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index daf73be..f92f18d 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -511,8 +511,13 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwi->dwThreadID)); - if (wwi->hThread) - SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); + if (!wwi->hThread) { + ERR("Thread creation for the widRecorder failed!\n"); + CloseHandle(wwi->hStartUpEvent); + ret = MMSYSERR_NOMEM; + goto error; + } + SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwi->hStartUpEvent, INFINITE); CloseHandle(wwi->hStartUpEvent); wwi->hStartUpEvent = NULL; @@ -525,6 +530,8 @@ error: snd_pcm_close(pcm); HeapFree( GetProcessHeap(), 0, hw_params ); HeapFree( GetProcessHeap(), 0, sw_params ); + if (wwi->msgRing.ring_buffer_size > 0) + ALSA_DestroyRingMessage(&wwi->msgRing); return ret; }
1
0
0
0
Jörg Höhle : winealsa: CreateEvent and CreateThread return NULL on error, not INVALID_HANDLE_VALUE.
by Alexandre Julliard
15 Mar '11
15 Mar '11
Module: wine Branch: master Commit: 56f2c5800f731e4c5e2ca38fec62e19598752985 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56f2c5800f731e4c5e2ca38fe…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Sun Mar 6 22:13:18 2011 +0100 winealsa: CreateEvent and CreateThread return NULL on error, not INVALID_HANDLE_VALUE. --- dlls/winealsa.drv/alsa.c | 6 +++--- dlls/winealsa.drv/wavein.c | 4 ++-- dlls/winealsa.drv/waveout.c | 10 ++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index ca775a2..122817c 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -127,7 +127,7 @@ void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep) */ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR param, BOOL wait) { - HANDLE hEvent = INVALID_HANDLE_VALUE; + HANDLE hEvent = NULL; EnterCriticalSection(&omr->msg_crst); if ((omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size))) @@ -151,7 +151,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p if (wait) { hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - if (hEvent == INVALID_HANDLE_VALUE) + if (!hEvent) { ERR("can't create event !?\n"); LeaveCriticalSection(&omr->msg_crst); @@ -173,7 +173,7 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR p { omr->messages[omr->msg_tosave].msg = msg; omr->messages[omr->msg_tosave].param = param; - omr->messages[omr->msg_tosave].hEvent = INVALID_HANDLE_VALUE; + omr->messages[omr->msg_tosave].hEvent = NULL; omr->msg_tosave = (omr->msg_tosave + 1) % omr->ring_buffer_size; } LeaveCriticalSection(&omr->msg_crst); diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index 2b0630b..daf73be 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -515,7 +515,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwi->hStartUpEvent, INFINITE); CloseHandle(wwi->hStartUpEvent); - wwi->hStartUpEvent = INVALID_HANDLE_VALUE; + wwi->hStartUpEvent = NULL; HeapFree( GetProcessHeap(), 0, hw_params ); HeapFree( GetProcessHeap(), 0, sw_params ); @@ -554,7 +554,7 @@ static DWORD widClose(WORD wDevID) WARN("buffers still playing !\n"); ret = WAVERR_STILLPLAYING; } else { - if (wwi->hThread != INVALID_HANDLE_VALUE) { + if (wwi->hThread) { ALSA_AddRingMessage(&wwi->msgRing, WINE_WM_CLOSING, 0, TRUE); } ALSA_DestroyRingMessage(&wwi->msgRing); diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 6ab1515..6dcd80f 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -782,18 +782,16 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwo->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwo->dwThreadID)); - if (wwo->hThread) - SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL); - else - { + if (!wwo->hThread) { ERR("Thread creation for the wodPlayer failed!\n"); CloseHandle(wwo->hStartUpEvent); retcode = MMSYSERR_NOMEM; goto errexit; } + SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwo->hStartUpEvent, INFINITE); CloseHandle(wwo->hStartUpEvent); - wwo->hStartUpEvent = INVALID_HANDLE_VALUE; + wwo->hStartUpEvent = NULL; TRACE("handle=%p\n", pcm); TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%u, nSamplesPerSec=%u, nChannels=%u nBlockAlign=%u!\n", @@ -856,7 +854,7 @@ static DWORD wodClose(WORD wDevID) WARN("buffers still playing !\n"); ret = WAVERR_STILLPLAYING; } else { - if (wwo->hThread != INVALID_HANDLE_VALUE) { + if (wwo->hThread) { ALSA_AddRingMessage(&wwo->msgRing, WINE_WM_CLOSING, 0, TRUE); } ALSA_DestroyRingMessage(&wwo->msgRing);
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
85
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
Results per page:
10
25
50
100
200