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
September 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
828 discussions
Start a n
N
ew thread
Matteo Bruni : d3dcompiler: Parse "for" loops with declarations.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 778e98c19e53fcc6409798c3d46f45e9784617b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=778e98c19e53fcc6409798c3d…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Sep 21 16:25:59 2012 +0200 d3dcompiler: Parse "for" loops with declarations. --- dlls/d3dcompiler_43/hlsl.y | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 11764e5..88689f7 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1391,6 +1391,17 @@ loop_statement: KW_WHILE '(' expr ')' statement $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc); pop_scope(&hlsl_ctx); } + | KW_FOR '(' scope_start declaration expr_statement expr_statement ')' statement + { + struct source_location loc; + + set_location(&loc, &@1); + if (!$4) + hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_WARNING, + "no expressions in for loop initializer"); + $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc); + pop_scope(&hlsl_ctx); + } expr_statement: ';' {
1
0
0
0
Matteo Bruni : d3dcompiler: Parse "for" loops without variable declarations .
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 6e4617c14a7f6e4ebee90c3e4b811b727ad06bf9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e4617c14a7f6e4ebee90c3e4…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Sep 21 16:25:58 2012 +0200 d3dcompiler: Parse "for" loops without variable declarations. --- dlls/d3dcompiler_43/hlsl.y | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 9bc9145..11764e5 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1383,6 +1383,14 @@ loop_statement: KW_WHILE '(' expr ')' statement set_location(&loc, &@1); $$ = create_loop(LOOP_DO_WHILE, NULL, cond, NULL, $2, &loc); } + | KW_FOR '(' scope_start expr_statement expr_statement expr_statement ')' statement + { + struct source_location loc; + + set_location(&loc, &@1); + $$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc); + pop_scope(&hlsl_ctx); + } expr_statement: ';' {
1
0
0
0
Matteo Bruni : d3dcompiler: Parse "do-while" loop.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 2b7ad731a4a44a38ae8bac97a7682fee2fee4ec8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2b7ad731a4a44a38ae8bac97a…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Sep 21 16:25:57 2012 +0200 d3dcompiler: Parse "do-while" loop. --- dlls/d3dcompiler_43/hlsl.y | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 491a826..9bc9145 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1368,6 +1368,21 @@ loop_statement: KW_WHILE '(' expr ')' statement set_location(&loc, &@1); $$ = create_loop(LOOP_WHILE, NULL, cond, NULL, $5, &loc); } + | KW_DO statement KW_WHILE '(' expr ')' ';' + { + struct source_location loc; + struct list *cond = d3dcompiler_alloc(sizeof(*cond)); + + if (!cond) + { + ERR("Out of memory.\n"); + return -1; + } + list_init(cond); + list_add_head(cond, &$5->entry); + set_location(&loc, &@1); + $$ = create_loop(LOOP_DO_WHILE, NULL, cond, NULL, $2, &loc); + } expr_statement: ';' {
1
0
0
0
Matteo Bruni : d3dcompiler: Parse "while" loops.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 5fc67931b809330d609236f102179d9e1a237127 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5fc67931b809330d609236f10…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Sep 21 16:25:56 2012 +0200 d3dcompiler: Parse "while" loops. --- dlls/d3dcompiler_43/d3dcompiler_private.h | 14 +++ dlls/d3dcompiler_43/hlsl.y | 142 +++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 22207c9..03fe66c 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -707,6 +707,7 @@ enum hlsl_ir_node_type HLSL_IR_EXPR, HLSL_IR_FUNCTION_DECL, HLSL_IR_IF, + HLSL_IR_LOOP, HLSL_IR_JUMP, HLSL_IR_SWIZZLE, }; @@ -768,6 +769,13 @@ struct hlsl_ir_if struct list *else_instrs; }; +struct hlsl_ir_loop +{ + struct hlsl_ir_node node; + /* loop condition is stored in the body (as "if (!condition) break;") */ + struct list *body; +}; + struct hlsl_ir_assignment { struct hlsl_ir_node node; @@ -1068,6 +1076,12 @@ static inline struct hlsl_ir_if *if_from_node(const struct hlsl_ir_node *node) return CONTAINING_RECORD(node, struct hlsl_ir_if, node); } +static inline struct hlsl_ir_loop *loop_from_node(const struct hlsl_ir_node *node) +{ + assert(node->type == HLSL_IR_LOOP); + return CONTAINING_RECORD(node, struct hlsl_ir_loop, node); +} + BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN; struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN; void free_declaration(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN; diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 7bce054..491a826 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -256,6 +256,130 @@ static void declare_predefined_types(struct hlsl_scope *scope) add_type_to_scope(scope, type); } +static struct hlsl_ir_if *loop_condition(struct list *cond_list) +{ + struct hlsl_ir_if *out_cond; + struct hlsl_ir_expr *not_cond; + struct hlsl_ir_node *cond, *operands[3]; + struct hlsl_ir_jump *jump; + unsigned int count = list_count(cond_list); + + if (!count) + return NULL; + if (count != 1) + ERR("Got multiple expressions in a for condition.\n"); + + cond = LIST_ENTRY(list_head(cond_list), struct hlsl_ir_node, entry); + out_cond = d3dcompiler_alloc(sizeof(*out_cond)); + if (!out_cond) + { + ERR("Out of memory.\n"); + return NULL; + } + out_cond->node.type = HLSL_IR_IF; + operands[0] = cond; + operands[1] = operands[2] = NULL; + not_cond = new_expr(HLSL_IR_UNOP_LOGIC_NOT, operands, &cond->loc); + if (!not_cond) + { + ERR("Out of memory.\n"); + d3dcompiler_free(out_cond); + return NULL; + } + out_cond->condition = ¬_cond->node; + jump = d3dcompiler_alloc(sizeof(*jump)); + if (!jump) + { + ERR("Out of memory.\n"); + d3dcompiler_free(out_cond); + d3dcompiler_free(not_cond); + return NULL; + } + jump->node.type = HLSL_IR_JUMP; + jump->type = HLSL_IR_JUMP_BREAK; + out_cond->then_instrs = d3dcompiler_alloc(sizeof(*out_cond->then_instrs)); + if (!out_cond->then_instrs) + { + ERR("Out of memory.\n"); + d3dcompiler_free(out_cond); + d3dcompiler_free(not_cond); + d3dcompiler_free(jump); + return NULL; + } + list_init(out_cond->then_instrs); + list_add_head(out_cond->then_instrs, &jump->node.entry); + + return out_cond; +} + +enum loop_type +{ + LOOP_FOR, + LOOP_WHILE, + LOOP_DO_WHILE +}; + +static struct list *create_loop(enum loop_type type, struct list *init, struct list *cond, + struct list *iter, struct list *body, struct source_location *loc) +{ + struct list *list = NULL; + struct hlsl_ir_loop *loop = NULL; + struct hlsl_ir_if *cond_jump = NULL; + + list = d3dcompiler_alloc(sizeof(*list)); + if (!list) + goto oom; + list_init(list); + + if (init) + list_move_head(list, init); + + loop = d3dcompiler_alloc(sizeof(*loop)); + if (!loop) + goto oom; + loop->node.type = HLSL_IR_LOOP; + loop->node.loc = *loc; + list_add_tail(list, &loop->node.entry); + loop->body = d3dcompiler_alloc(sizeof(*loop->body)); + if (!loop->body) + goto oom; + list_init(loop->body); + + cond_jump = loop_condition(cond); + if (!cond_jump) + goto oom; + + if (type != LOOP_DO_WHILE) + list_add_tail(loop->body, &cond_jump->node.entry); + + list_move_tail(loop->body, body); + + if (iter) + list_move_tail(loop->body, iter); + + if (type == LOOP_DO_WHILE) + list_add_tail(loop->body, &cond_jump->node.entry); + + d3dcompiler_free(init); + d3dcompiler_free(cond); + d3dcompiler_free(iter); + d3dcompiler_free(body); + return list; + +oom: + ERR("Out of memory.\n"); + if (loop) + d3dcompiler_free(loop->body); + d3dcompiler_free(loop); + d3dcompiler_free(cond_jump); + d3dcompiler_free(list); + free_instr_list(init); + free_instr_list(cond); + free_instr_list(iter); + free_instr_list(body); + return NULL; +} + static unsigned int initializer_size(struct list *initializer) { unsigned int count = 0; @@ -573,6 +697,7 @@ static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct lis %type <list> compound_statement %type <list> jump_statement %type <list> selection_statement +%type <list> loop_statement %type <function> func_declaration %type <function> func_prototype %type <parameter> parameter @@ -1167,6 +1292,7 @@ statement: declaration_statement | compound_statement | jump_statement | selection_statement + | loop_statement /* FIXME: add rule for return with no value */ jump_statement: KW_RETURN expr ';' @@ -1227,6 +1353,22 @@ if_body: statement $$.else_instrs = $3; } +loop_statement: KW_WHILE '(' expr ')' statement + { + struct source_location loc; + struct list *cond = d3dcompiler_alloc(sizeof(*cond)); + + if (!cond) + { + ERR("Out of memory.\n"); + return -1; + } + list_init(cond); + list_add_head(cond, &$3->entry); + set_location(&loc, &@1); + $$ = create_loop(LOOP_WHILE, NULL, cond, NULL, $5, &loc); + } + expr_statement: ';' { $$ = d3dcompiler_alloc(sizeof(*$$));
1
0
0
0
Matteo Bruni : d3dcompiler: Allow casts to arrays.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 76525af7f1ecdb8f295fc9a7f3b1afebbd68ed49 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76525af7f1ecdb8f295fc9a7f…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Sep 21 16:25:55 2012 +0200 d3dcompiler: Allow casts to arrays. --- dlls/d3dcompiler_43/hlsl.y | 5 ++++- dlls/d3dcompiler_43/utils.c | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index eea49be..7bce054 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1488,7 +1488,10 @@ unary_expr: postfix_expr return 1; } - dst_type = $3; + if ($4) + dst_type = new_array_type($3, $4); + else + dst_type = $3; if (!compatible_data_types(src_type, dst_type)) { diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 84443ae..cc35ce9 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -854,8 +854,15 @@ struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_clas struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size) { - FIXME("stub.\n"); - return NULL; + struct hlsl_type *type = new_hlsl_type(NULL, HLSL_CLASS_ARRAY, HLSL_TYPE_FLOAT, 1, 1); + + if (!type) + return NULL; + + type->modifiers = basic_type->modifiers; + type->e.array.elements_count = array_size; + type->e.array.type = basic_type; + return type; } struct hlsl_type *get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) @@ -1791,6 +1798,12 @@ const char *debug_hlsl_type(const struct hlsl_type *type) if (type->type == HLSL_CLASS_STRUCT) return "<anonymous struct>"; + if (type->type == HLSL_CLASS_ARRAY) + { + name = debug_base_type(type->e.array.type); + return wine_dbg_sprintf("%s[%u]", name, type->e.array.elements_count); + } + name = debug_base_type(type); if (type->type == HLSL_CLASS_SCALAR)
1
0
0
0
Christian Costa : dmime: Rename params in IDirectMusicPerformance8Impl_AssignPChannel & IDirectMusicPerformance8Impl_PChannelInfo .
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 1acf5a0401e48012104a6888d643668b8ded195d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1acf5a0401e48012104a6888d…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Fri Sep 21 16:02:10 2012 +0200 dmime: Rename params in IDirectMusicPerformance8Impl_AssignPChannel & IDirectMusicPerformance8Impl_PChannelInfo. --- dlls/dmime/performance.c | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 0f76e36..dfa1b77 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -684,34 +684,37 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock(IDirectMu } static HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannel(IDirectMusicPerformance8 *iface, - DWORD dwPChannel, IDirectMusicPort *pPort, DWORD dwGroup, DWORD dwMChannel) + DWORD PChannel, IDirectMusicPort *port, DWORD group, DWORD MChannel) { - IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface); + IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface); - TRACE("(%p, %d, %p, %d, %d)\n", This, dwPChannel, pPort, dwGroup, dwMChannel); - if (NULL == pPort) return E_POINTER; - This->PChannel[dwPChannel].port = pPort; - This->PChannel[dwPChannel].group = dwGroup; - This->PChannel[dwPChannel].channel = dwMChannel; + TRACE("(%p)->(%d, %p, %d, %d)\n", This, PChannel, port, group, MChannel); - return S_OK; + if (!port) + return E_POINTER; + + This->PChannel[PChannel].port = port; + This->PChannel[PChannel].group = group; + This->PChannel[PChannel].channel = MChannel; + + return S_OK; } static HRESULT WINAPI IDirectMusicPerformance8Impl_PChannelInfo(IDirectMusicPerformance8 *iface, - DWORD dwPChannel, IDirectMusicPort **ppPort, DWORD *pdwGroup, DWORD *pdwMChannel) + DWORD PChannel, IDirectMusicPort **port, DWORD *group, DWORD *MChannel) { - IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface); - DMUS_PORTPARAMS8 dmusportparams; - GUID def; + IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface); + DMUS_PORTPARAMS8 port_params; + GUID default_port; - FIXME("(%p, %d, %p, %p, %p): stub\n", This, dwPChannel, ppPort, pdwGroup, pdwMChannel); + FIXME("(%p)->(%d, %p, %p, %p): stub\n", This, PChannel, port, group, MChannel); - dmusportparams.dwSize = sizeof(DMUS_PORTPARAMS8); - dmusportparams.dwValidParams = 0; - IDirectMusic8_GetDefaultPort(This->pDirectMusic, &def); - IDirectMusic8_CreatePort(This->pDirectMusic, &def, &dmusportparams, ppPort, NULL); + port_params.dwSize = sizeof(DMUS_PORTPARAMS8); + port_params.dwValidParams = 0; + IDirectMusic8_GetDefaultPort(This->pDirectMusic, &default_port); + IDirectMusic8_CreatePort(This->pDirectMusic, &default_port, &port_params, port, NULL); - return S_OK; + return S_OK; } static HRESULT WINAPI IDirectMusicPerformance8Impl_DownloadInstrument(IDirectMusicPerformance8 *iface,
1
0
0
0
Christian Costa : dmsynth: Implement IKsControl_KsProperty for Synth and SynthSink objects.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: b3b7616f79c30b846e4ce7a30ceba88543eb6683 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b3b7616f79c30b846e4ce7a30…
Author: Christian Costa <titan.costa(a)gmail.com> Date: Fri Sep 21 15:44:37 2012 +0200 dmsynth: Implement IKsControl_KsProperty for Synth and SynthSink objects. --- dlls/dmsynth/synth.c | 48 ++++++++++++++++++++++++++++++++++++++++- dlls/dmsynth/synthsink.c | 28 ++++++++++++++++++++++- dlls/dmsynth/tests/dmsynth.c | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 4 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 29761d7..f34594d 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -2,6 +2,7 @@ * IDirectMusicSynth8 Implementation * * Copyright (C) 2003-2004 Rok Mandeljc + * Copyright (C) 2012 Christian Costa * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -415,9 +416,52 @@ static ULONG WINAPI DMSynthImpl_IKsControl_Release(IKsControl* iface) static HRESULT WINAPI DMSynthImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG* BytesReturned) { - FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); + TRACE("(%p)->(%p, %u, %p, %u, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); - return E_NOTIMPL; + TRACE("Property = %s - %u - %u\n", debugstr_guid(&Property->Set), Property->Id, Property->Flags); + + if (Property->Flags != KSPROPERTY_TYPE_GET) + { + FIXME("Property flags %u not yet supported\n", Property->Flags); + return S_FALSE; + } + + if (DataLength < sizeof(DWORD)) + return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + + if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_INSTRUMENT2)) + { + *(DWORD*)PropertyData = TRUE; + *BytesReturned = sizeof(DWORD); + } + else if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_DLS2)) + { + *(DWORD*)PropertyData = TRUE; + *BytesReturned = sizeof(DWORD); + } + else if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_GM_Hardware)) + { + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + } + else if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_GS_Hardware)) + { + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + } + else if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_XG_Hardware)) + { + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + } + else + { + FIXME("Unknown property %s\n", debugstr_guid(&Property->Set)); + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + } + + return S_OK; } static HRESULT WINAPI DMSynthImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index a63f36c..4d2001c 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -2,6 +2,7 @@ * IDirectMusicSynthSink Implementation * * Copyright (C) 2003-2004 Rok Mandeljc + * Copyright (C) 2012 Christian Costa * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -209,9 +210,32 @@ static ULONG WINAPI DMSynthSinkImpl_IKsControl_Release(IKsControl* iface) static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG* BytesReturned) { - FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); + TRACE("(%p)->(%p, %u, %p, %u, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); - return E_NOTIMPL; + TRACE("Property = %s - %u - %u\n", debugstr_guid(&Property->Set), Property->Id, Property->Flags); + + if (Property->Flags != KSPROPERTY_TYPE_GET) + { + FIXME("Property flags %u not yet supported\n", Property->Flags); + return S_FALSE; + } + + if (DataLength < sizeof(DWORD)) + return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + + if (IsEqualGUID(&Property->Set, &GUID_DMUS_PROP_SinkUsesDSound)) + { + *(DWORD*)PropertyData = TRUE; + *BytesReturned = sizeof(DWORD); + } + else + { + FIXME("Unknown property %s\n", debugstr_guid(&Property->Set)); + *(DWORD*)PropertyData = FALSE; + *BytesReturned = sizeof(DWORD); + } + + return S_OK; } static HRESULT WINAPI DMSynthSinkImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c index 4ffc90c..83a0bca 100644 --- a/dlls/dmsynth/tests/dmsynth.c +++ b/dlls/dmsynth/tests/dmsynth.c @@ -39,6 +39,9 @@ static void test_dmsynth(void) IKsControl* control_synth = NULL; IKsControl* control_sink = NULL; HRESULT hr; + KSPROPERTY property; + ULONG value; + ULONG bytes; hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth); if (hr != S_OK) @@ -52,9 +55,45 @@ static void test_dmsynth(void) hr = IDirectMusicSynth_QueryInterface(dmsynth, &IID_IKsControl, (LPVOID*)&control_synth); ok(hr == S_OK, "IDirectMusicSynth_QueryInterface returned: %x\n", hr); + + property.Id = 0; + property.Flags = KSPROPERTY_TYPE_GET; + + property.Set = GUID_DMUS_PROP_INSTRUMENT2; + hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == TRUE, "Return value: %u, should be 1\n", value); + property.Set = GUID_DMUS_PROP_DLS2; + hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == TRUE, "Return value: %u, should be 1\n", value); + property.Set = GUID_DMUS_PROP_GM_Hardware; + hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == FALSE, "Return value: %u, should be 0\n", value); + property.Set = GUID_DMUS_PROP_GS_Hardware; + hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == FALSE, "Return value: %u, should be 0\n", value); + property.Set = GUID_DMUS_PROP_XG_Hardware; + hr = IKsControl_KsProperty(control_synth, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == FALSE, "Return value: %u, should be 0\n", value); + hr = IDirectMusicSynthSink_QueryInterface(dmsynth_sink, &IID_IKsControl, (LPVOID*)&control_sink); ok(hr == S_OK, "IDirectMusicSynthSink_QueryInterface returned: %x\n", hr); + property.Set = GUID_DMUS_PROP_SinkUsesDSound; + hr = IKsControl_KsProperty(control_sink, &property, sizeof(property), &value, sizeof(value), &bytes); + ok(hr == S_OK, "IKsControl_KsProperty returned: %x\n", hr); + ok(bytes == sizeof(DWORD), "Returned bytes: %u, should be 4\n", bytes); + ok(value == TRUE, "Return value: %u, should be 1\n", value); + /* Synth has no default clock */ hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth); ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_GetLatencyClock returned: %x\n", hr);
1
0
0
0
Piotr Caban : wininet: Update used blocks count when block is allocated or freed.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 8bb1af84f465cbe5b802a7b0c98a712c3a1042d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8bb1af84f465cbe5b802a7b0c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Sep 21 14:54:15 2012 +0200 wininet: Update used blocks count when block is allocated or freed. --- dlls/wininet/urlcache.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index 8a221a8..87789fe 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -781,6 +781,9 @@ static inline BYTE URLCache_Allocation_BlockIsFree(BYTE * AllocationTable, DWORD * * Marks the specified block as free * + * CAUTION + * this function is not updating used blocks count + * * RETURNS * nothing * @@ -796,6 +799,9 @@ static inline void URLCache_Allocation_BlockFree(BYTE * AllocationTable, DWORD d * * Marks the specified block as allocated * + * CAUTION + * this function is not updating used blocks count + * * RETURNS * nothing * @@ -840,6 +846,7 @@ static DWORD URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBloc for (index = 0; index < dwBlocksNeeded * BLOCKSIZE / sizeof(DWORD); index++) ((DWORD*)*ppEntry)[index] = 0xdeadbeef; (*ppEntry)->dwBlocksUsed = dwBlocksNeeded; + pHeader->dwBlocksInUse += dwBlocksNeeded; return ERROR_SUCCESS; } } @@ -867,6 +874,7 @@ static BOOL URLCache_DeleteEntry(LPURLCACHE_HEADER pHeader, CACHEFILE_ENTRY * pE for (dwBlock = dwStartBlock; dwBlock < dwStartBlock + pEntry->dwBlocksUsed; dwBlock++) URLCache_Allocation_BlockFree(pHeader->allocation_table, dwBlock); + pHeader->dwBlocksInUse -= pEntry->dwBlocksUsed; return TRUE; }
1
0
0
0
Piotr Caban : wininet: Stop urlcache clearing when dll is being unloaded.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 34dc7964068a67d65cb71a15ec59c5b272069ad3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34dc7964068a67d65cb71a15e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Sep 21 14:53:57 2012 +0200 wininet: Stop urlcache clearing when dll is being unloaded. --- dlls/wininet/urlcache.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index 48a88a2..8a221a8 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2270,6 +2270,7 @@ static BOOL DeleteUrlCacheEntryInternal(const URLCACHECONTAINER * pContainer, } static HANDLE free_cache_running; +static HANDLE dll_unload_event; static DWORD WINAPI handle_full_cache_worker(void *param) { FreeUrlCacheSpaceW(NULL, 20, 0); @@ -2523,6 +2524,10 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter) /* Allow other threads to use cache while cleaning */ URLCacheContainer_UnlockIndex(container, header); + if(WaitForSingleObject(dll_unload_event, 0) == WAIT_OBJECT_0) { + TRACE("got dll_unload_event - finishing\n"); + return TRUE; + } Sleep(0); header = URLCacheContainer_LockIndex(container); } @@ -4342,9 +4347,15 @@ DWORD WINAPI RunOnceUrlCache(HWND hwnd, HINSTANCE hinst, LPSTR cmd, int cmdshow) BOOL init_urlcache(void) { + dll_unload_event = CreateEventW(NULL, FALSE, FALSE, NULL); + if(!dll_unload_event) + return FALSE; + free_cache_running = CreateSemaphoreW(NULL, 1, 1, NULL); - if(!free_cache_running) + if(!free_cache_running) { + CloseHandle(dll_unload_event); return FALSE; + } URLCacheContainers_CreateDefaults(); return TRUE; @@ -4352,9 +4363,11 @@ BOOL init_urlcache(void) void free_urlcache(void) { + SetEvent(dll_unload_event); WaitForSingleObject(free_cache_running, INFINITE); ReleaseSemaphore(free_cache_running, 1, NULL); CloseHandle(free_cache_running); + CloseHandle(dll_unload_event); URLCacheContainers_DeleteAll(); }
1
0
0
0
Piotr Caban : wininet: Improved FreeUrlCacheSpaceW implementation.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 66931e4d9fefa959d109807f71fec4967a0c4828 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66931e4d9fefa959d109807f7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Sep 21 14:53:47 2012 +0200 wininet: Improved FreeUrlCacheSpaceW implementation. --- dlls/wininet/urlcache.c | 374 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 292 insertions(+), 82 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=66931e4d9fefa959d1098…
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
83
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
Results per page:
10
25
50
100
200