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
July
June
May
April
March
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 2006
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
3 participants
651 discussions
Start a n
N
ew thread
Alexandre Julliard : widl: Change the prefix on bison-generated names to avoid the name-prefix directive .
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: 86bb809e5b65e566151747d38f96d69ee1abd8ef URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=86bb809e5b65e566151747d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 12 09:05:07 2006 +0200 widl: Change the prefix on bison-generated names to avoid the name-prefix directive. --- tools/widl/header.c | 4 ++-- tools/widl/parser.h | 10 +++++----- tools/widl/parser.l | 30 +++++++++++++++--------------- tools/widl/parser.y | 2 -- tools/widl/proxy.c | 2 +- tools/widl/utils.c | 8 ++++---- tools/widl/utils.h | 4 ++-- tools/widl/widl.c | 12 ++++++------ 8 files changed, 35 insertions(+), 37 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 168f4c6..5415785 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -716,7 +716,7 @@ static void write_method_proto(const typ fprintf(header, ");\n"); } else { - yywarning("invalid call_as attribute (%s -> %s)\n", get_name(def), cas->name); + parser_warning("invalid call_as attribute (%s -> %s)\n", get_name(def), cas->name); } } @@ -802,7 +802,7 @@ static void write_coclass_guid(type_t *c static void write_com_interface(type_t *iface) { if (!iface->funcs && !iface->ref) { - yywarning("%s has no methods", iface->name); + parser_warning("%s has no methods", iface->name); return; } diff --git a/tools/widl/parser.h b/tools/widl/parser.h index 2217dbf..5baf655 100644 --- a/tools/widl/parser.h +++ b/tools/widl/parser.h @@ -21,14 +21,14 @@ #ifndef __WIDL_PARSER_H #define __WIDL_PARSER_H -int yyparse(void); +int parser_parse(void); -extern FILE *yyin; -extern char *yytext; -extern int yydebug; +extern FILE *parser_in; +extern char *parser_text; +extern int parser_debug; extern int yy_flex_debug; -int yylex(void); +int parser_lex(void); extern int import_stack_ptr; int do_import(char *fname); diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 4fedd34..21faf7b 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -20,7 +20,7 @@ %option stack %option nounput noyy_top_state -%option 8bit never-interactive +%option 8bit never-interactive prefix="parser_" nl \r?\n ws [ \f\t\r] @@ -110,14 +110,14 @@ static UUID* parse_uuid(const char*u) yy_pop_state(); lineno = (int)strtol(yytext, &cptr, 10); if(!lineno) - yyerror("Malformed '#...' line-directive; invalid linenumber"); + parser_error("Malformed '#...' line-directive; invalid linenumber"); fname = strchr(cptr, '"'); if(!fname) - yyerror("Malformed '#...' line-directive; missing filename"); + parser_error("Malformed '#...' line-directive; missing filename"); fname++; cptr = strchr(fname, '"'); if(!cptr) - yyerror("Malformed '#...' line-directive; missing terminating \""); + parser_error("Malformed '#...' line-directive; missing terminating \""); *cptr = '\0'; line_number = lineno - 1; /* We didn't read the newline */ free( input_name ); @@ -126,7 +126,7 @@ static UUID* parse_uuid(const char*u) \" yy_push_state(QUOTE); cbufidx = 0; <QUOTE>\" { yy_pop_state(); - yylval.str = get_buffered_cstring(); + parser_lval.str = get_buffered_cstring(); return aSTRING; } <QUOTE>\\\\ | @@ -134,15 +134,15 @@ static UUID* parse_uuid(const char*u) <QUOTE>\\. addcchar('\\'); addcchar(yytext[1]); <QUOTE>. addcchar(yytext[0]); {uuid} { - yylval.uuid = parse_uuid(yytext); + parser_lval.uuid = parse_uuid(yytext); return aUUID; } {hex} { - yylval.num = strtoul(yytext, NULL, 0); + parser_lval.num = strtoul(yytext, NULL, 0); return aHEXNUM; } {int} { - yylval.num = strtoul(yytext, NULL, 0); + parser_lval.num = strtoul(yytext, NULL, 0); return aNUM; } SAFEARRAY{ws}*/\( return tSAFEARRAY; @@ -161,8 +161,8 @@ SAFEARRAY{ws}*/\( return tSAFEARRAY; } %% -#ifndef yywrap -int yywrap(void) +#ifndef parser_wrap +int parser_wrap(void) { return 1; } @@ -338,10 +338,10 @@ #else } #endif if (kwp) { - yylval.str = (char*)kwp->kw; + parser_lval.str = (char*)kwp->kw; return kwp->token; } - yylval.str = xstrdup(kw); + parser_lval.str = xstrdup(kw); return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; } @@ -352,7 +352,7 @@ static void addcchar(char c) cbufalloc += 1024; cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0])); if(cbufalloc > 65536) - yywarning("Reallocating string buffer larger than 64kB"); + parser_warning("Reallocating string buffer larger than 64kB"); } cbuffer[cbufidx++] = c; } @@ -414,7 +414,7 @@ int do_import(char *fname) first_import = import; if (!(path = wpp_find_include( fname, input_name ))) - yyerror("Unable to open include file %s", fname); + parser_error("Unable to open include file %s", fname); import_stack[ptr].temp_name = temp_name; import_stack[ptr].input_name = input_name; @@ -427,7 +427,7 @@ int do_import(char *fname) if (ret) exit(1); if((f = fopen(temp_name, "r")) == NULL) - yyerror("Unable to open %s", temp_name); + parser_error("Unable to open %s", temp_name); import_stack[ptr].state = YY_CURRENT_BUFFER; yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE)); diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 922df4d..63e4c6d 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -126,8 +126,6 @@ #define tsUNION 3 unsigned int num; } -%name-prefix="yy" - %token <str> aIDENTIFIER %token <str> aKNOWNTYPE %token <num> aNUM aHEXNUM diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 8d4d467..3480b7d 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -936,7 +936,7 @@ static void write_proxy(type_t *iface) gen_proxy(iface, cur, idx); gen_stub(iface, cur, cname); if (midx == -1) midx = idx; - else if (midx != idx) yyerror("method index mismatch in write_proxy"); + else if (midx != idx) parser_error("method index mismatch in write_proxy"); midx++; } cur = PREV_LINK(cur); diff --git a/tools/widl/utils.c b/tools/widl/utils.c index fea0540..98a66dd 100644 --- a/tools/widl/utils.c +++ b/tools/widl/utils.c @@ -68,21 +68,21 @@ #endif } -int yyerror(const char *s, ...) +int parser_error(const char *s, ...) { va_list ap; va_start(ap, s); - generic_msg(s, "Error", yytext, ap); + generic_msg(s, "Error", parser_text, ap); va_end(ap); exit(1); return 1; } -int yywarning(const char *s, ...) +int parser_warning(const char *s, ...) { va_list ap; va_start(ap, s); - generic_msg(s, "Warning", yytext, ap); + generic_msg(s, "Warning", parser_text, ap); va_end(ap); return 0; } diff --git a/tools/widl/utils.h b/tools/widl/utils.h index 089607d..3641aae 100644 --- a/tools/widl/utils.h +++ b/tools/widl/utils.h @@ -33,8 +33,8 @@ #ifndef __GNUC__ #define __attribute__(X) #endif -int yyerror(const char *s, ...) __attribute__((format (printf, 1, 2))); -int yywarning(const char *s, ...) __attribute__((format (printf, 1, 2))); +int parser_error(const char *s, ...) __attribute__((format (printf, 1, 2))); +int parser_warning(const char *s, ...) __attribute__((format (printf, 1, 2))); void internal_error(const char *file, int line, const char *s, ...) __attribute__((format (printf, 3, 4))); void error(const char *s, ...) __attribute__((format (printf, 1, 2))); void warning(const char *s, ...) __attribute__((format (printf, 1, 2))); diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 39cd9be..c04d07f 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -84,7 +84,7 @@ static const char version_string[] = "Wi int win32 = 1; int debuglevel = DEBUGLEVEL_NONE; -int yydebug, yy_flex_debug; +int parser_debug, yy_flex_debug; int pedantic = 0; static int do_everything = 1; @@ -271,7 +271,7 @@ #endif setbuf(stderr,0); } - yydebug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; + parser_debug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; yy_flex_debug = debuglevel & DEBUGLEVEL_TRACE ? 1 : 0; wpp_set_debug( (debuglevel & DEBUGLEVEL_PPLEX) != 0, @@ -330,13 +330,13 @@ #endif if(ret) exit(1); if(preprocess_only) exit(0); - if(!(yyin = fopen(temp_name, "r"))) { + if(!(parser_in = fopen(temp_name, "r"))) { fprintf(stderr, "Could not open %s for input\n", temp_name); return 1; } } else { - if(!(yyin = fopen(input_name, "r"))) { + if(!(parser_in = fopen(input_name, "r"))) { fprintf(stderr, "Could not open %s for input\n", input_name); return 1; } @@ -380,7 +380,7 @@ #endif } init_types(); - ret = yyparse(); + ret = parser_parse(); if(do_header) { fprintf(header, "/* Begin additional prototypes for all interfaces */\n"); @@ -405,7 +405,7 @@ #endif fclose(idfile); } - fclose(yyin); + fclose(parser_in); if(ret) { exit(1);
1
0
0
0
Alexandre Julliard : wpp: Change the prefix on bison-generated names to avoid the name-prefix directive .
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: 2d778c5eea99a6bc18195955ce65c3bc08bd02b0 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2d778c5eea99a6bc1819595…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 12 09:04:55 2006 +0200 wpp: Change the prefix on bison-generated names to avoid the name-prefix directive. --- libs/wpp/ppl.l | 212 ++++++++++++++++++++++++------------------------ libs/wpp/ppy.y | 28 +++--- libs/wpp/preproc.c | 16 ++-- libs/wpp/wpp.c | 16 ++-- libs/wpp/wpp_private.h | 16 ++-- 5 files changed, 143 insertions(+), 145 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=2d778c5eea99a6bc181…
1
0
0
0
Alexandre Julliard : winedbg: Change the prefix on bison-generated names to avoid the name-prefix directive .
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: 1be6e9a6b1dc3007a66e4fe69b693774e9859298 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=1be6e9a6b1dc3007a66e4fe…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Sep 12 09:04:43 2006 +0200 winedbg: Change the prefix on bison-generated names to avoid the name-prefix directive. --- programs/winedbg/dbg.y | 10 ++++------ programs/winedbg/debug.l | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index 56efb94..ea28b54 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -35,13 +35,11 @@ #include "debugger.h" #include "wine/exception.h" #include "expr.h" -int yylex(void); -int yyerror(const char*); +int dbg_lex(void); +static int dbg_error(const char*); %} -%name-prefix="yy" - %union { struct dbg_lvalue lvalue; @@ -530,7 +528,7 @@ void parser_handle(HANDLE input) __TRY { ret_ok = TRUE; - yyparse(); + dbg_parse(); } __EXCEPT(wine_dbg_cmd) { @@ -554,7 +552,7 @@ void parser(const char* filename) } } -int yyerror(const char* s) +int dbg_error(const char* s) { dbg_printf("%s\n", s); return 0; diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l index 9fef183..451c96d 100644 --- a/programs/winedbg/debug.l +++ b/programs/winedbg/debug.l @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -%option nounput interactive 8bit +%option nounput interactive 8bit prefix="dbg_" %{ #include <stdlib.h> @@ -104,7 +104,7 @@ STRING \"[^\n"]+\" /* This rule must precede the ones below, */ /* otherwise paths like '/' or '0x9' would */ /* get parsed as an operator or tNUM */ -<PATH_EXPECTED>{PATHNAME} { yylval.string = lexeme_alloc(yytext); return tPATH; } +<PATH_EXPECTED>{PATHNAME} { dbg_lval.string = lexeme_alloc(yytext); return tPATH; } "||" { return OP_LOR; } "&&" { return OP_LAND; } @@ -120,19 +120,19 @@ STRING \"[^\n"]+\" "[" { return *yytext; } "]" { return *yytext; } -"0x"{HEXDIGIT}+ { sscanf(yytext, "%x", &yylval.integer); return tNUM; } -{DIGIT}+ { sscanf(yytext, "%d", &yylval.integer); return tNUM; } +"0x"{HEXDIGIT}+ { sscanf(yytext, "%x", &dbg_lval.integer); return tNUM; } +{DIGIT}+ { sscanf(yytext, "%d", &dbg_lval.integer); return tNUM; } <FORMAT_EXPECTED>"/"{DIGIT}+{FORMAT} { char* last; - yylval.integer = strtol(yytext+1, &last, 0) << 8; - yylval.integer |= *last; + dbg_lval.integer = strtol(yytext+1, &last, 0) << 8; + dbg_lval.integer |= *last; return tFORMAT; } -<FORMAT_EXPECTED>"/"{FORMAT} { yylval.integer = (1 << 8) | yytext[1]; return tFORMAT; } +<FORMAT_EXPECTED>"/"{FORMAT} { dbg_lval.integer = (1 << 8) | yytext[1]; return tFORMAT; } -{STRING} { yylval.string = lexeme_alloc(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; return tSTRING; } +{STRING} { dbg_lval.string = lexeme_alloc(yytext + 1); dbg_lval.string[strlen(dbg_lval.string) - 1] = '\0'; return tSTRING; } <ASTRING_EXPECTED>[^\n]+ { char* p = yytext; while (*p == ' ' || *p == '\t') p++; - yylval.string = lexeme_alloc(p); return tSTRING; } + dbg_lval.string = lexeme_alloc(p); return tSTRING; } <INITIAL,NOPROCESS>info|inf|in { BEGIN(INFO_CMD); return tINFO; } <INITIAL>up { BEGIN(NOCMD); return tUP; } @@ -214,8 +214,8 @@ union { return tUNION; } enum { return tENUM; } all { return tALL; } -{IDENTIFIER} { yylval.string = lexeme_alloc(yytext); return tIDENTIFIER; } -"$"{IDENTIFIER} { yylval.string = lexeme_alloc(yytext+1); return tINTVAR; } +{IDENTIFIER} { dbg_lval.string = lexeme_alloc(yytext); return tIDENTIFIER; } +"$"{IDENTIFIER} { dbg_lval.string = lexeme_alloc(yytext+1); return tINTVAR; } <*>[ \t\r]+ /* Eat up whitespace and DOS LF */ @@ -223,8 +223,8 @@ all <*>. { if (syntax_error == 0) { syntax_error++; dbg_printf("Syntax Error (%s)\n", yytext); } } %% -#ifndef yywrap -int yywrap(void) { return 1; } +#ifndef dbg_wrap +int dbg_wrap(void) { return 1; } #endif static char** local_lexemes /* = NULL */;
1
0
0
0
Alexandre Julliard : msi: Change the prefix on bison-generated names to avoid the name-prefix directive .
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: 2d1b6182aff44a1ba3a4cc4acb939e54b73975a7 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2d1b6182aff44a1ba3a4cc4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 11 21:53:04 2006 +0200 msi: Change the prefix on bison-generated names to avoid the name-prefix directive. --- dlls/msi/cond.y | 11 +++++------ dlls/msi/sql.y | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y index 26d0ecb..dd8252a 100644 --- a/dlls/msi/cond.y +++ b/dlls/msi/cond.y @@ -40,7 +40,7 @@ #include "action.h" #define YYLEX_PARAM info #define YYPARSE_PARAM info -static int COND_error(const char *str); +static int cond_error(const char *str); WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -59,7 +59,7 @@ struct cond_str { static LPWSTR COND_GetString( struct cond_str *str ); static LPWSTR COND_GetLiteral( struct cond_str *str ); -static int COND_lex( void *COND_lval, COND_input *info); +static int cond_lex( void *COND_lval, COND_input *info); static const WCHAR szEmpty[] = { 0 }; static INT compare_int( INT a, INT operator, INT b ); @@ -102,7 +102,6 @@ static BOOL num_from_prop( LPCWSTR p, IN %} %pure-parser -%name-prefix="COND_" %union { @@ -668,7 +667,7 @@ static int COND_GetOne( struct cond_str return rc; } -static int COND_lex( void *COND_lval, COND_input *cond ) +static int cond_lex( void *COND_lval, COND_input *cond ) { int rc; struct cond_str *str = COND_lval; @@ -708,7 +707,7 @@ static LPWSTR COND_GetLiteral( struct co return ret; } -static int COND_error(const char *str) +static int cond_error(const char *str) { TRACE("%s\n", str ); return 0; @@ -729,7 +728,7 @@ MSICONDITION MSI_EvaluateConditionW( MSI cond.n = 0; cond.result = MSICONDITION_ERROR; - if ( !COND_parse( &cond ) ) + if ( !cond_parse( &cond ) ) r = cond.result; else r = MSICONDITION_ERROR; diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y index 5d5a904..abffb2f 100644 --- a/dlls/msi/sql.y +++ b/dlls/msi/sql.y @@ -36,7 +36,7 @@ #include "wine/debug.h" #define YYLEX_PARAM info #define YYPARSE_PARAM info -extern int SQL_error(const char *str); +static int sql_error(const char *str); WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -51,7 +51,7 @@ typedef struct tag_SQL_input static LPWSTR SQL_getstring( void *info, struct sql_str *str ); static INT SQL_getint( void *info ); -static int SQL_lex( void *SQL_lval, SQL_input *info ); +static int sql_lex( void *SQL_lval, SQL_input *info ); static void *parser_alloc( void *info, unsigned int sz ); static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR column ); @@ -67,7 +67,6 @@ static struct expr * EXPR_wildcard( void %} %pure-parser -%name-prefix="SQL_" %union { @@ -687,7 +686,7 @@ static column_info *parser_alloc_column( return col; } -int SQL_lex( void *SQL_lval, SQL_input *sql ) +static int sql_lex( void *SQL_lval, SQL_input *sql ) { int token; struct sql_str * str = SQL_lval; @@ -753,7 +752,7 @@ INT SQL_getint( void *info ) return r; } -int SQL_error( const char *str ) +static int sql_error( const char *str ) { return 0; } @@ -852,7 +851,7 @@ UINT MSI_ParseSQL( MSIDATABASE *db, LPCW sql.view = phview; sql.mem = mem; - r = SQL_parse(&sql); + r = sql_parse(&sql); TRACE("Parse returned %d\n", r); if( r )
1
0
0
0
Alexandre Julliard : Make.rules: Set the default prefix for bison files from the file basename.
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: bcdc5fb55f51e6708185b1e0d223c6b5a41c2138 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=bcdc5fb55f51e6708185b1e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 11 21:47:49 2006 +0200 Make.rules: Set the default prefix for bison files from the file basename. --- Make.rules.in | 4 ++-- programs/winedbg/dbg.y | 2 ++ tools/widl/parser.y | 2 ++ tools/wmc/mcy.y | 1 + tools/wrc/parser.y | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Make.rules.in b/Make.rules.in index cc6d13c..894c377 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -127,10 +127,10 @@ # Implicit rules $(AS) -o $@ $< .y.tab.c: - $(BISON) $(BISONFLAGS) -o $@ $< + $(BISON) $(BISONFLAGS) -p $*_ -o $@ $< .y.tab.h: - $(BISON) $(BISONFLAGS) -o $*.tab.c -d $< + $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $< .l.yy.c: $(LEX) $(LEXFLAGS) -t $< >$@ || ($(RM) $@ && exit 1) diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index b7d83d8..56efb94 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -40,6 +40,8 @@ int yyerror(const char*); %} +%name-prefix="yy" + %union { struct dbg_lvalue lvalue; diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 63e4c6d..922df4d 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -126,6 +126,8 @@ #define tsUNION 3 unsigned int num; } +%name-prefix="yy" + %token <str> aIDENTIFIER %token <str> aKNOWNTYPE %token <num> aNUM aHEXNUM diff --git a/tools/wmc/mcy.y b/tools/wmc/mcy.y index 32458be..abe5d02 100644 --- a/tools/wmc/mcy.y +++ b/tools/wmc/mcy.y @@ -95,6 +95,7 @@ static cp_xlat_t *find_cpxlat(int lan); %} +%name-prefix="yy" %union { WCHAR *str; diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y index bc7409e..4297a19 100644 --- a/tools/wrc/parser.y +++ b/tools/wrc/parser.y @@ -282,6 +282,8 @@ static int rsrcid_to_token(int lookahead ani_any_t *ani; } +%name-prefix="yy" + %token tNL %token <num> tNUMBER tLNUMBER %token <str> tSTRING tIDENT tFILENAME
1
0
0
0
Alexandre Julliard : makefiles: List bison dependencies explicitly for parallel makes, since older bisons don't support --defines.
by Alexandre Julliard
12 Sep '06
12 Sep '06
Module: wine Branch: master Commit: 145a0ba508487905fcc36ade66175908d615bb75 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=145a0ba508487905fcc36ad…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 11 21:43:11 2006 +0200 makefiles: List bison dependencies explicitly for parallel makes, since older bisons don't support --defines. --- Make.rules.in | 2 +- dlls/msi/Makefile.in | 2 ++ libs/wpp/Makefile.in | 2 ++ programs/winedbg/Makefile.in | 2 ++ tools/widl/Makefile.in | 2 ++ tools/wmc/Makefile.in | 2 ++ tools/wrc/Makefile.in | 2 ++ 7 files changed, 13 insertions(+), 1 deletions(-) diff --git a/Make.rules.in b/Make.rules.in index 2cba40f..cc6d13c 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -130,7 +130,7 @@ # Implicit rules $(BISON) $(BISONFLAGS) -o $@ $< .y.tab.h: - $(BISON) $(BISONFLAGS) --defines=$@ -o /dev/null $< + $(BISON) $(BISONFLAGS) -o $*.tab.c -d $< .l.yy.c: $(LEX) $(LEXFLAGS) -t $< >$@ || ($(RM) $@ && exit 1) diff --git a/dlls/msi/Makefile.in b/dlls/msi/Makefile.in index 3bd3783..3d8db09 100644 --- a/dlls/msi/Makefile.in +++ b/dlls/msi/Makefile.in @@ -58,6 +58,8 @@ RC_BINARIES = \ @MAKE_DLL_RULES@ +sql.tab.c: sql.tab.h # for parallel makes + ### Dependencies: cond.tab.o: cond.tab.c diff --git a/libs/wpp/Makefile.in b/libs/wpp/Makefile.in index ff6744c..246fb36 100644 --- a/libs/wpp/Makefile.in +++ b/libs/wpp/Makefile.in @@ -20,6 +20,8 @@ all: $(MODULE) $(AR) $@ $(OBJS) $(RANLIB) $@ +ppy.tab.c: ppy.tab.h # for parallel makes + ### Dependencies: ppy.tab.o: ppy.tab.c diff --git a/programs/winedbg/Makefile.in b/programs/winedbg/Makefile.in index 35a96d0..45829ad 100644 --- a/programs/winedbg/Makefile.in +++ b/programs/winedbg/Makefile.in @@ -43,6 +43,8 @@ install:: $(MANPAGES) $(DESTDIR)$(mandir uninstall:: $(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/winedbg.$(prog_manext) +dbg.tab.c: dbg.tab.h # for parallel makes + ### Dependencies: dbg.tab.o: dbg.tab.c diff --git a/tools/widl/Makefile.in b/tools/widl/Makefile.in index a2afefc..86fa6fb 100644 --- a/tools/widl/Makefile.in +++ b/tools/widl/Makefile.in @@ -39,6 +39,8 @@ install:: $(PROGRAMS) $(MANPAGES) $(INST uninstall:: $(RM) $(DESTDIR)$(bindir)/widl$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/widl.$(prog_manext) +parser.tab.c: parser.tab.h # for parallel makes + ### Dependencies: parser.tab.o: parser.tab.c diff --git a/tools/wmc/Makefile.in b/tools/wmc/Makefile.in index a9b05b8..e762742 100644 --- a/tools/wmc/Makefile.in +++ b/tools/wmc/Makefile.in @@ -33,6 +33,8 @@ install:: $(PROGRAMS) $(MANPAGES) $(INST uninstall:: $(RM) $(DESTDIR)$(bindir)/wmc$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/wmc.$(prog_manext) +mcy.tab.c: mcy.tab.h # for parallel makes + ### Dependencies: mcy.tab.o: mcy.tab.c diff --git a/tools/wrc/Makefile.in b/tools/wrc/Makefile.in index 382f089..1133840 100644 --- a/tools/wrc/Makefile.in +++ b/tools/wrc/Makefile.in @@ -38,6 +38,8 @@ install:: $(PROGRAMS) $(MANPAGES) $(INST uninstall:: $(RM) $(DESTDIR)$(bindir)/wrc$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/wrc.$(prog_manext) +parser.tab.c: parser.tab.h # for parallel makes + ### Dependencies: parser.tab.o: parser.tab.c
1
0
0
0
Byeong-Sik Jeon : gdi32: Fix logical error of italic, bold determination.
by Alexandre Julliard
11 Sep '06
11 Sep '06
Module: wine Branch: master Commit: 4d619723a1b4ab7bc64d9b5c0da05105228a3290 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=4d619723a1b4ab7bc64d9b5…
Author: Byeong-Sik Jeon <wjsqudtlr(a)gmail.com> Date: Tue Aug 29 15:21:52 2006 +0900 gdi32: Fix logical error of italic, bold determination. --- dlls/gdi/freetype.c | 79 +++++++++++++++++++++------------------------------ 1 files changed, 32 insertions(+), 47 deletions(-) diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 1278b6a..a664db9 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -2242,10 +2242,11 @@ static BOOL create_child_font_list(GdiFo GdiFont WineEngCreateFontInstance(DC *dc, HFONT hfont) { GdiFont ret; - Face *face, *best; + Face *face, *best, *best_bitmap; Family *family, *last_resort_family; struct list *family_elem_ptr, *face_elem_ptr; INT height, width = 0; + unsigned int score = 0, new_score; signed int diff = 0, newdiff; BOOL bd, it, can_use_bitmap; LOGFONTW lf; @@ -2432,57 +2433,41 @@ found: height = GDI_ROUND( (FLOAT)lf.lfHeight * dc->xformWorld2Vport.eM22 ); height = lf.lfHeight < 0 ? -abs(height) : abs(height); - face = best = NULL; - LIST_FOR_EACH(face_elem_ptr, &family->faces) { - face = LIST_ENTRY(face_elem_ptr, Face, entry); - if(!(face->Italic ^ it) && !(face->Bold ^ bd) && - ((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0])) { - if(face->scalable) - break; - if(height > 0) - newdiff = height - (signed int)(face->size.height); - else - newdiff = -height - ((signed int)(face->size.height) - face->size.internal_leading); - if(!best || (diff > 0 && newdiff < diff && newdiff >= 0) || - (diff < 0 && newdiff > diff)) { - TRACE("%d is better for %d diff was %d\n", face->size.height, height, diff); - diff = newdiff; + face = best = best_bitmap = NULL; + LIST_FOR_EACH_ENTRY(face, &family->faces, Face, entry) + { + if((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0]) + { + new_score = (face->Italic ^ it) + (face->Bold ^ bd); + if(!best || new_score <= score) + { + TRACE("(it=%d, bd=%d) is selected for (it=%d, bd=%d)\n", + face->Italic, face->Bold, it, bd); + score = new_score; best = face; - if(diff == 0) - break; - } - } - face = NULL; - } - if(!face && best) - face = best; - else if(!face) { - best = NULL; - LIST_FOR_EACH(face_elem_ptr, &family->faces) { - face = LIST_ENTRY(face_elem_ptr, Face, entry); - if((csi.fs.fsCsb[0] & (face->fs.fsCsb[0] | face->fs_links.fsCsb[0])) || !csi.fs.fsCsb[0]) { - if(face->scalable) - break; - if(height > 0) - newdiff = height - (signed int)(face->size.height); - else - newdiff = -height - ((signed int)(face->size.height) - face->size.internal_leading); - if(!best || (diff > 0 && newdiff < diff && newdiff >= 0) || - (diff < 0 && newdiff > diff)) { - TRACE("%d is better for %d diff was %d\n", face->size.height, height, diff); - diff = newdiff; - best = face; - if(diff == 0) - break; + if(best->scalable && score == 0) break; + if(!best->scalable) + { + if(height > 0) + newdiff = height - (signed int)(best->size.height); + else + newdiff = -height - ((signed int)(best->size.height) - best->size.internal_leading); + if(!best_bitmap || new_score < score || + (diff > 0 && newdiff < diff && newdiff >= 0) || (diff < 0 && newdiff > diff)) + { + TRACE("%d is better for %d diff was %d\n", best->size.height, height, diff); + diff = newdiff; + best_bitmap = best; + if(score == 0 && diff == 0) break; + } } } - face = NULL; } - if(!face && best) - face = best; - if(it && !face->Italic) ret->fake_italic = TRUE; - if(bd && !face->Bold) ret->fake_bold = TRUE; } + if(best) + face = best->scalable ? best : best_bitmap; + ret->fake_italic = (it && !face->Italic); + ret->fake_bold = (bd && !face->Bold); memcpy(&ret->fs, &face->fs, sizeof(FONTSIGNATURE));
1
0
0
0
Byeong-Sik Jeon : gdi32: Fix DefaultGuiFont name string for Korean Charset.
by Alexandre Julliard
11 Sep '06
11 Sep '06
Module: wine Branch: master Commit: 95226bf25ddab61d58b5ca205c54bb036648671e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=95226bf25ddab61d58b5ca2…
Author: Byeong-Sik Jeon <wjsqudtlr(a)gmail.com> Date: Tue Aug 29 15:21:48 2006 +0900 gdi32: Fix DefaultGuiFont name string for Korean Charset. --- dlls/gdi/gdiobj.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdi/gdiobj.c b/dlls/gdi/gdiobj.c index 24c20fc..3d5450d 100644 --- a/dlls/gdi/gdiobj.c +++ b/dlls/gdi/gdiobj.c @@ -393,7 +393,7 @@ static const struct DefaultFontInfo defa { /* DefaultGuiFont */ 9, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET, 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, - {'G','u','l','i','m','\0'}, + {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'} }, }, { CHINESEBIG5_CHARSET, @@ -437,7 +437,7 @@ static const struct DefaultFontInfo defa { /* DefaultGuiFont */ 8, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, JOHAB_CHARSET, 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, - {'M','S',' ','M','i','n','g','l','i','u','\0'} /* FIXME: Is this correct? */ + {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'} }, }, };
1
0
0
0
Detlef Riekenberg : localspl: Add minimal localspl.dll.
by Alexandre Julliard
11 Sep '06
11 Sep '06
Module: wine Branch: master Commit: 2198d83622a529495097d8e7b0a9458d295ea0a3 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2198d83622a529495097d8e…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Mon Sep 11 00:28:36 2006 +0200 localspl: Add minimal localspl.dll. --- configure | 3 +- configure.ac | 1 + dlls/Makefile.in | 1 + dlls/localspl/Makefile.in | 13 ++++++++ dlls/localspl/localspl.spec | 64 +++++++++++++++++++++++++++++++++++++ dlls/localspl/localspl_main.c | 71 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 152 insertions(+), 1 deletions(-) create mode 100644 dlls/localspl/Makefile.in create mode 100644 dlls/localspl/localspl.spec create mode 100644 dlls/localspl/localspl_main.c Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=2198d83622a52949509…
1
0
0
0
Vitaliy Margolen : dinput: Move hook_thread from device to DirectInput.
by Alexandre Julliard
11 Sep '06
11 Sep '06
Module: wine Branch: master Commit: 722a686d66cc7f3e04a86e1cc167cb3e0154c70a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=722a686d66cc7f3e04a86e1…
Author: Vitaliy Margolen <wine-patch(a)kievinfo.com> Date: Sun Sep 10 16:47:39 2006 -0600 dinput: Move hook_thread from device to DirectInput. --- dlls/dinput/device.c | 136 ------------------------------------------ dlls/dinput/device_private.h | 2 - dlls/dinput/dinput_main.c | 136 ++++++++++++++++++++++++++++++++++++++++++ dlls/dinput/dinput_private.h | 2 + 4 files changed, 138 insertions(+), 138 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 13141c2..0c5564c 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -901,139 +901,3 @@ HRESULT WINAPI IDirectInputDevice8WImpl_ return DI_OK; } - -/****************************************************************************** - * DInput hook thread - */ - -static LRESULT CALLBACK dinput_hook_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - static HHOOK kbd_hook, mouse_hook; - BOOL res; - - TRACE("got message %x %p %p\n", message, (LPVOID)wParam, (LPVOID)lParam); - switch (message) - { - case WM_USER+0x10: - if (wParam == WH_KEYBOARD_LL) - { - if (lParam) - { - if (kbd_hook) return 0; - kbd_hook = SetWindowsHookExW(WH_KEYBOARD_LL, (LPVOID)lParam, DINPUT_instance, 0); - return (LRESULT)kbd_hook; - } - else - { - if (!kbd_hook) return 0; - res = UnhookWindowsHookEx(kbd_hook); - kbd_hook = NULL; - return res; - } - } - else if (wParam == WH_MOUSE_LL) - { - if (lParam) - { - if (mouse_hook) return 0; - mouse_hook = SetWindowsHookExW(WH_MOUSE_LL, (LPVOID)lParam, DINPUT_instance, 0); - return (LRESULT)mouse_hook; - } - else - { - if (!mouse_hook) return 0; - res = UnhookWindowsHookEx(mouse_hook); - mouse_hook = NULL; - return res; - } - } - return 0; - - case WM_DESTROY: - PostQuitMessage(0); - } - return DefWindowProcW(hWnd, message, wParam, lParam); -} - -static HANDLE signal_event; - -static DWORD WINAPI hook_thread_proc(void *param) -{ - static const WCHAR classW[]={'H','o','o','k','_','L','L','_','C','L',0}; - MSG msg; - WNDCLASSEXW wcex; - HWND hwnd; - - memset(&wcex, 0, sizeof(wcex)); - wcex.cbSize = sizeof(wcex); - wcex.lpfnWndProc = dinput_hook_WndProc; - wcex.lpszClassName = classW; - wcex.hInstance = GetModuleHandleW(0); - - if (!RegisterClassExW(&wcex)) ERR("Error registering window class\n"); - hwnd = CreateWindowExW(0, classW, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, 0); - *(HWND*)param = hwnd; - - SetEvent(signal_event); - if (hwnd) - { - while (GetMessageW(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessageW(&msg); - } - } - else ERR("Error creating message window\n"); - - DestroyWindow(hwnd); - UnregisterClassW(wcex.lpszClassName, wcex.hInstance); - return 0; -} - -static CRITICAL_SECTION dinput_hook_crit; -static CRITICAL_SECTION_DEBUG dinput_critsect_debug = -{ - 0, 0, &dinput_hook_crit, - { &dinput_critsect_debug.ProcessLocksList, &dinput_critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": dinput_hook_crit") } -}; -static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 }; - -static HWND get_thread_hwnd(void) -{ - static HANDLE hook_thread; - static HWND hook_thread_hwnd; - - EnterCriticalSection(&dinput_hook_crit); - if (!hook_thread) - { - DWORD tid; - HWND hwnd; - - signal_event = CreateEventW(NULL, FALSE, FALSE, NULL); - hook_thread = CreateThread(NULL, 0, hook_thread_proc, &hwnd, 0, &tid); - if (signal_event && hook_thread) - { - HANDLE handles[2]; - handles[0] = signal_event; - handles[1] = hook_thread; - WaitForMultipleObjects(2, handles, FALSE, INFINITE); - } - CloseHandle(signal_event); - - if (!(hook_thread_hwnd = hwnd)) - { - /* Thread failed to create window - reset things so we could try again later */ - CloseHandle(hook_thread); - hook_thread = 0; - } - } - LeaveCriticalSection(&dinput_hook_crit); - - return hook_thread_hwnd; -} - -HHOOK set_dinput_hook(int hook_id, LPVOID proc) -{ - return (HHOOK)SendMessageW(get_thread_hwnd(), WM_USER+0x10, (WPARAM)hook_id, (LPARAM)proc); -} diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 8ccd0ab..a2777c2 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -52,8 +52,6 @@ extern void fill_DataFormat(void *out, c extern DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) ; extern void release_DataFormat(DataFormat *df) ; -extern HHOOK set_dinput_hook(int hook_id, LPVOID proc); - /* Used to fill events in the queue */ #define GEN_EVENT(offset,data,xtime,seq) \ { \ diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index cef61b7..2a05347 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -686,3 +686,139 @@ HRESULT WINAPI DllGetClassObject(REFCLSI FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; } + +/****************************************************************************** + * DInput hook thread + */ + +static LRESULT CALLBACK dinput_hook_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + static HHOOK kbd_hook, mouse_hook; + BOOL res; + + TRACE("got message %x %p %p\n", message, (LPVOID)wParam, (LPVOID)lParam); + switch (message) + { + case WM_USER+0x10: + if (wParam == WH_KEYBOARD_LL) + { + if (lParam) + { + if (kbd_hook) return 0; + kbd_hook = SetWindowsHookExW(WH_KEYBOARD_LL, (LPVOID)lParam, DINPUT_instance, 0); + return (LRESULT)kbd_hook; + } + else + { + if (!kbd_hook) return 0; + res = UnhookWindowsHookEx(kbd_hook); + kbd_hook = NULL; + return res; + } + } + else if (wParam == WH_MOUSE_LL) + { + if (lParam) + { + if (mouse_hook) return 0; + mouse_hook = SetWindowsHookExW(WH_MOUSE_LL, (LPVOID)lParam, DINPUT_instance, 0); + return (LRESULT)mouse_hook; + } + else + { + if (!mouse_hook) return 0; + res = UnhookWindowsHookEx(mouse_hook); + mouse_hook = NULL; + return res; + } + } + return 0; + + case WM_DESTROY: + PostQuitMessage(0); + } + return DefWindowProcW(hWnd, message, wParam, lParam); +} + +static HANDLE signal_event; + +static DWORD WINAPI hook_thread_proc(void *param) +{ + static const WCHAR classW[]={'H','o','o','k','_','L','L','_','C','L',0}; + MSG msg; + WNDCLASSEXW wcex; + HWND hwnd; + + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(wcex); + wcex.lpfnWndProc = dinput_hook_WndProc; + wcex.lpszClassName = classW; + wcex.hInstance = GetModuleHandleW(0); + + if (!RegisterClassExW(&wcex)) ERR("Error registering window class\n"); + hwnd = CreateWindowExW(0, classW, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, 0); + *(HWND*)param = hwnd; + + SetEvent(signal_event); + if (hwnd) + { + while (GetMessageW(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + else ERR("Error creating message window\n"); + + DestroyWindow(hwnd); + UnregisterClassW(wcex.lpszClassName, wcex.hInstance); + return 0; +} + +static CRITICAL_SECTION dinput_hook_crit; +static CRITICAL_SECTION_DEBUG dinput_critsect_debug = +{ + 0, 0, &dinput_hook_crit, + { &dinput_critsect_debug.ProcessLocksList, &dinput_critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": dinput_hook_crit") } +}; +static CRITICAL_SECTION dinput_hook_crit = { &dinput_critsect_debug, -1, 0, 0, 0, 0 }; + +static HWND get_thread_hwnd(void) +{ + static HANDLE hook_thread; + static HWND hook_thread_hwnd; + + EnterCriticalSection(&dinput_hook_crit); + if (!hook_thread) + { + DWORD tid; + HWND hwnd; + + signal_event = CreateEventW(NULL, FALSE, FALSE, NULL); + hook_thread = CreateThread(NULL, 0, hook_thread_proc, &hwnd, 0, &tid); + if (signal_event && hook_thread) + { + HANDLE handles[2]; + handles[0] = signal_event; + handles[1] = hook_thread; + WaitForMultipleObjects(2, handles, FALSE, INFINITE); + } + CloseHandle(signal_event); + + if (!(hook_thread_hwnd = hwnd)) + { + /* Thread failed to create window - reset things so we could try again later */ + CloseHandle(hook_thread); + hook_thread = 0; + } + } + LeaveCriticalSection(&dinput_hook_crit); + + return hook_thread_hwnd; +} + +HHOOK set_dinput_hook(int hook_id, LPVOID proc) +{ + return (HHOOK)SendMessageW(get_thread_hwnd(), WM_USER+0x10, (WPARAM)hook_id, (LPARAM)proc); +} diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h index c23b048..d3f58a3 100644 --- a/dlls/dinput/dinput_private.h +++ b/dlls/dinput/dinput_private.h @@ -54,4 +54,6 @@ extern const struct dinput_device joysti extern HINSTANCE DINPUT_instance; +extern HHOOK set_dinput_hook(int hook_id, LPVOID proc); + #endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
66
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
Results per page:
10
25
50
100
200