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
June 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
809 discussions
Start a n
N
ew thread
Alexandre Julliard : msvcp60: Synchronize the spec file.
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: f137ffdfb51ac91266db29e41df678d96b9a90c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f137ffdfb51ac91266db29e41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jun 2 10:42:28 2011 +0200 msvcp60: Synchronize the spec file. --- dlls/msvcp60/msvcp60.spec | 208 ++++++++++++++++++++++---------------------- 1 files changed, 104 insertions(+), 104 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f137ffdfb51ac91266db2…
1
0
0
0
Alexandre Julliard : include: Make CLIENT_CALL_RETURN definition platform-specific to handle the return type incompatibility in NdrClientCall .
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: f061917296b9dda6d441e6d34e9a90a08370627b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f061917296b9dda6d441e6d34…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 22:10:58 2011 +0200 include: Make CLIENT_CALL_RETURN definition platform-specific to handle the return type incompatibility in NdrClientCall. --- dlls/rpcrt4/cproxy.c | 2 +- dlls/rpcrt4/ndr_stubless.c | 20 ++++++++++---------- include/rpcndr.h | 16 ++++++++++------ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c index d0c56c7..8352ba3 100644 --- a/dlls/rpcrt4/cproxy.c +++ b/dlls/rpcrt4/cproxy.c @@ -95,7 +95,7 @@ __ASM_GLOBAL_FUNC(call_stubless_func, "addl %edx,%esp\n\t" "jmp *%ecx" ); -HRESULT WINAPI ObjectStubless(DWORD *args) +CLIENT_CALL_RETURN WINAPI ObjectStubless(DWORD *args) { DWORD index = args[0]; void **iface = (void **)args[2]; diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 9edebf8..3fd4cf8 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -548,10 +548,7 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg, } } -/* the return type should be CLIENT_CALL_RETURN, but this is incompatible - * with the way gcc returns structures. "void *" should be the largest type - * that MIDL should allow you to return anyway */ -LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, ...) +CLIENT_CALL_RETURN WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, ...) { /* pointer to start of stack where arguments start */ RPC_MESSAGE rpcMsg; @@ -629,7 +626,7 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma if (!(pProcHeader->Oi_flags & RPC_FC_PROC_OIF_OBJECT)) { pFormat = client_get_handle(&stubMsg, pProcHeader, pHandleFormat, &hBinding); - if (!pFormat) return 0; + if (!pFormat) goto done; } bV2Format = (pStubDesc->Version >= 0x20000); @@ -899,9 +896,9 @@ LONG_PTR WINAPIV NdrClientCall2(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pForma client_free_handle(&stubMsg, pProcHeader, pHandleFormat, hBinding); } +done: TRACE("RetVal = 0x%lx\n", RetVal); - - return RetVal; + return *(CLIENT_CALL_RETURN *)&RetVal; } /* Calls a function with the specified arguments, restoring the stack @@ -1638,7 +1635,7 @@ struct async_call_data ULONG_PTR NdrCorrCache[256]; }; -LONG_PTR WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, +CLIENT_CALL_RETURN WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, ...) { /* pointer to start of stack where arguments start */ @@ -1658,6 +1655,7 @@ LONG_PTR WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, const NDR_PROC_HEADER * pProcHeader = (const NDR_PROC_HEADER *)&pFormat[0]; /* -Oif or -Oicf generated format */ BOOL bV2Format = FALSE; + LONG_PTR RetVal; __ms_va_list args; TRACE("pStubDesc %p, pFormat %p, ...\n", pStubDesc, pFormat); @@ -1720,7 +1718,7 @@ LONG_PTR WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, async_call_data->pHandleFormat = pFormat; pFormat = client_get_handle(pStubMsg, pProcHeader, async_call_data->pHandleFormat, &async_call_data->hBinding); - if (!pFormat) return 0; + if (!pFormat) goto done; bV2Format = (pStubDesc->Version >= 0x20000); @@ -1846,8 +1844,10 @@ LONG_PTR WINAPIV NdrAsyncClientCall(PMIDL_STUB_DESC pStubDesc, } } +done: TRACE("returning 0\n"); - return 0; + RetVal = 0; + return *(CLIENT_CALL_RETURN *)&RetVal; } RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) diff --git a/include/rpcndr.h b/include/rpcndr.h index 1754f5e..eb65192 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -414,11 +414,17 @@ typedef struct _MIDL_STUBLESS_PROXY_INFO PMIDL_SYNTAX_INFO pSyntaxInfo; } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO; + +#if defined(__i386__) && !defined(__MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) +/* Calling convention for returning structures/unions is different between Windows and gcc on i386 */ +typedef LONG_PTR CLIENT_CALL_RETURN; +#else typedef union _CLIENT_CALL_RETURN { void *Pointer; LONG_PTR Simple; } CLIENT_CALL_RETURN; +#endif typedef enum { STUB_UNMARSHAL, @@ -645,15 +651,13 @@ RPCRTAPI void RPC_ENTRY RPCRTAPI unsigned char* RPC_ENTRY NdrUserMarshalSimpleTypeConvert( ULONG *pFlags, unsigned char *pBuffer, unsigned char FormatChar ); -/* Note: this should return a CLIENT_CALL_RETURN, but calling convention for - * returning structures/unions is different between Windows and gcc on i386. */ -LONG_PTR RPC_VAR_ENTRY +CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall2( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); -LONG_PTR RPC_VAR_ENTRY +CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); -LONG_PTR RPC_VAR_ENTRY +CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); -LONG_PTR RPC_VAR_ENTRY +CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrDcomAsyncClientCall( PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, ... ); RPCRTAPI void RPC_ENTRY
1
0
0
0
Alexandre Julliard : widl: Use the pointer offset for arrays declared as pointer in the proc format strings of interpreted functions .
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 9128dea410e0421b31cbc8a3f6e01ac513c59b77 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9128dea410e0421b31cbc8a3f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 21:27:56 2011 +0200 widl: Use the pointer offset for arrays declared as pointer in the proc format strings of interpreted functions. --- tools/widl/typegen.c | 26 +++++++++++++++++--------- tools/widl/widltypes.h | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index aabf25b..3349e25 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -887,7 +887,7 @@ int decl_indirect(const type_t *t) static unsigned int write_procformatstring_type(FILE *file, int indent, const type_t *type, const attr_list_t *attrs, - int is_return) + int is_return, int is_interpreted) { unsigned int size; @@ -924,6 +924,11 @@ static unsigned int write_procformatstring_type(FILE *file, int indent, } else { + unsigned short offset = type->typestring_offset; + + if (is_interpreted && is_array(type) && type_array_is_decl_as_ptr(type)) + offset = type->details.array.ptr_tfsoff; + if (is_return) print_file(file, indent, "0x52, /* FC_RETURN_PARAM */\n"); else if (is_in && is_out) @@ -935,8 +940,7 @@ static unsigned int write_procformatstring_type(FILE *file, int indent, size = get_stack_size( type, attrs, NULL ); print_file(file, indent, "0x%02x,\n", size / pointer_size ); - print_file(file, indent, "NdrFcShort(0x%x), /* type offset = %u */\n", - type->typestring_offset, type->typestring_offset); + print_file(file, indent, "NdrFcShort(0x%x), /* type offset = %u */\n", offset, offset); size = 4; /* includes param type prefix */ } return size; @@ -1060,8 +1064,9 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i const var_t *func, unsigned int *offset, unsigned short num_proc ) { - if (is_interpreted_func( iface, func )) - write_proc_func_header( file, indent, iface, func, offset, num_proc ); + int is_interpreted = is_interpreted_func( iface, func ); + + if (is_interpreted) write_proc_func_header( file, indent, iface, func, offset, num_proc ); /* emit argument data */ if (type_get_function_args(func->type)) @@ -1070,7 +1075,8 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) { print_file( file, 0, "/* %u (parameter %s) */\n", *offset, var->name ); - *offset += write_procformatstring_type(file, indent, var->type, var->attrs, FALSE); + *offset += write_procformatstring_type(file, indent, var->type, var->attrs, + FALSE, is_interpreted); } } @@ -1085,7 +1091,8 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i else { print_file( file, 0, "/* %u (return value) */\n", *offset ); - *offset += write_procformatstring_type(file, indent, type_function_get_rettype(func->type), NULL, TRUE); + *offset += write_procformatstring_type(file, indent, type_function_get_rettype(func->type), + NULL, TRUE, is_interpreted); } } @@ -3192,7 +3199,7 @@ static unsigned int write_type_tfs(FILE *file, int indent, int ptr_type; ptr_type = get_pointer_fc(type, attrs, context == TYPE_CONTEXT_TOPLEVELPARAM); - if (ptr_type != RPC_FC_RP) + if (ptr_type != RPC_FC_RP || type_array_is_decl_as_ptr(type)) { unsigned int absoff = type->typestring_offset; short reloff = absoff - (*typeformat_offset + 2); @@ -3202,9 +3209,10 @@ static unsigned int write_type_tfs(FILE *file, int indent, string_of_type(ptr_type)); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", reloff, reloff, absoff); - update_tfsoff( type, off, file ); + if (ptr_type != RPC_FC_RP) update_tfsoff( type, off, file ); *typeformat_offset += 4; } + type->details.array.ptr_tfsoff = off; } return off; } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 1f3c275..b2ac116 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -354,6 +354,7 @@ struct array_details unsigned int dim; unsigned char ptr_def_fc; unsigned char declptr; /* if declared as a pointer */ + unsigned short ptr_tfsoff; /* offset of pointer definition for declptr */ }; struct coclass_details
1
0
0
0
Alexandre Julliard : widl: Generate function headers in the proc format string for interpreted functions .
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 11416a20c903dcaa0bb31c52bf3d4b885ff604ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=11416a20c903dcaa0bb31c52b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 21:06:14 2011 +0200 widl: Generate function headers in the proc format string for interpreted functions. --- tools/widl/client.c | 2 +- tools/widl/header.c | 20 ++++++++ tools/widl/header.h | 1 + tools/widl/proxy.c | 2 +- tools/widl/server.c | 2 +- tools/widl/typegen.c | 118 +++++++++++++++++++++++++++++++++++++++++++++---- tools/widl/typegen.h | 2 +- 7 files changed, 133 insertions(+), 14 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=11416a20c903dcaa0bb31…
1
0
0
0
Alexandre Julliard : widl: Add a -O option to specify stub style.
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 6ae510050b88fcd8d6637eb376b000cd5bff1b10 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ae510050b88fcd8d6637eb37…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 21:00:56 2011 +0200 widl: Add a -O option to specify stub style. --- tools/widl/typegen.c | 2 +- tools/widl/widl.c | 13 +++++++++++-- tools/widl/widl.h | 8 ++++++++ tools/widl/widl.man.in | 6 ++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 6dcdf36..50a047d 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -962,7 +962,7 @@ int is_interpreted_func( const type_t *iface, const var_t *func ) if ((str = get_attrp( func->attrs, ATTR_OPTIMIZE ))) return !strcmp( str, "i" ); if ((str = get_attrp( iface->attrs, ATTR_OPTIMIZE ))) return !strcmp( str, "i" ); - return 0; + return (stub_mode != MODE_Os); } static void write_procformatstring_func( FILE *file, int indent, diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 5046d65..62c1008 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -46,7 +46,6 @@ /* future options to reserve characters for: */ /* A = ACF input filename */ /* J = do not search standard include path */ -/* O = generate interpreted stubs */ /* w = select win16/win32 output (?) */ static const char usage[] = @@ -65,6 +64,7 @@ static const char usage[] = " -N Do not preprocess input\n" " --oldnames Use old naming conventions\n" " -o, --output=NAME Set the output file name\n" +" -Otype Type of stubs to generate (-Os, -Oi, -Oif)\n" " -p Generate proxy\n" " --prefix-all=p Prefix names of client stubs / server functions with 'p'\n" " --prefix-client=p Prefix names of client stubs with 'p'\n" @@ -111,6 +111,7 @@ int do_win32 = 1; int do_win64 = 1; int win32_packing = 8; int win64_packing = 8; +enum stub_mode stub_mode = MODE_Os; char *input_name; char *header_name; @@ -156,7 +157,7 @@ enum { }; static const char short_options[] = - "b:cC:d:D:EhH:I:m:No:pP:rsS:tT:uU:VW"; + "b:cC:d:D:EhH:I:m:No:O:pP:rsS:tT:uU:VW"; static const struct option long_options[] = { { "dlldata", 1, NULL, DLLDATA_OPTION }, { "dlldata-only", 0, NULL, DLLDATA_ONLY_OPTION }, @@ -582,6 +583,14 @@ int main(int argc,char *argv[]) case 'o': output_name = xstrdup(optarg); break; + case 'O': + if (!strcmp( optarg, "s" )) stub_mode = MODE_Os; + else if (!strcmp( optarg, "i" )) stub_mode = MODE_Oi; + else if (!strcmp( optarg, "ic" )) stub_mode = MODE_Oif; + else if (!strcmp( optarg, "if" )) stub_mode = MODE_Oif; + else if (!strcmp( optarg, "icf" )) stub_mode = MODE_Oif; + else error( "Invalid argument '-O%s'\n", optarg ); + break; case 'p': do_everything = 0; do_proxies = 1; diff --git a/tools/widl/widl.h b/tools/widl/widl.h index fcd479d..a793bfc 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -72,6 +72,14 @@ extern time_t now; extern int line_number; extern int char_number; +enum stub_mode +{ + MODE_Os, /* inline stubs */ + MODE_Oi, /* old-style interpreted stubs */ + MODE_Oif /* new-style fully interpreted stubs */ +}; +extern enum stub_mode stub_mode; + extern void write_header(const statement_list_t *stmts); extern void write_id_data(const statement_list_t *stmts); extern void write_proxies(const statement_list_t *stmts); diff --git a/tools/widl/widl.man.in b/tools/widl/widl.man.in index 3bbc1cf..4988ee9 100644 --- a/tools/widl/widl.man.in +++ b/tools/widl/widl.man.in @@ -59,6 +59,12 @@ Generate a UUID file. The default output filename is \fIinfile\fB_i.c\fR. .B Proxy/stub generation options: .IP "\fB-c\fR" Generate a client stub file. The default output filename is \fIinfile\fB_c.c\fR. +.IP "\fB-Os\fR" +Generate inline stubs. +.IP "\fB-Oi\fR" +Generate old-style interpreted stubs. +.IP "\fB-Oif, -Oic, -Oicf\fR" +Generate new-style fully interpreted stubs. .IP "\fB-p\fR" Generate a proxy. The default output filename is \fIinfile\fB_p.c\fR. .IP "\fB--prefix-all=\fIprefix\fR"
1
0
0
0
Alexandre Julliard : widl: Don' t allow unions passed by value or floating point returns for interpreted functions .
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 2db27725bfa57f2aa92372df0d29cfeb3c8dc7bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2db27725bfa57f2aa92372df0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 20:46:50 2011 +0200 widl: Don't allow unions passed by value or floating point returns for interpreted functions. --- tools/widl/typegen.c | 28 +++++++++++++++++++++++++--- 1 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 4413713..6dcdf36 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -933,11 +933,33 @@ static unsigned int write_procformatstring_type(FILE *file, int indent, int is_interpreted_func( const type_t *iface, const var_t *func ) { const char *str; + const var_t *var; + const var_list_t *args = type_get_function_args( func->type ); const type_t *ret_type = type_function_get_rettype( func->type ); - /* return value must fit in a long_ptr for interpreted functions */ - if (type_get_type( ret_type ) == TYPE_BASIC && type_memsize( ret_type ) > pointer_size) - return 0; + if (type_get_type( ret_type ) == TYPE_BASIC) + { + switch (type_basic_get_type( ret_type )) + { + case TYPE_BASIC_INT64: + case TYPE_BASIC_HYPER: + /* return value must fit in a long_ptr */ + if (pointer_size < 8) return 0; + break; + case TYPE_BASIC_FLOAT: + case TYPE_BASIC_DOUBLE: + /* floating point values can't be returned */ + return 0; + default: + break; + } + } + /* unions passed by value are not supported */ + if (args) LIST_FOR_EACH_ENTRY( var, args, const var_t, entry ) + if (type_get_type( var->type ) == TYPE_UNION || + type_get_type( var->type ) == TYPE_ENCAPSULATED_UNION) + return 0; + if ((str = get_attrp( func->attrs, ATTR_OPTIMIZE ))) return !strcmp( str, "i" ); if ((str = get_attrp( iface->attrs, ATTR_OPTIMIZE ))) return !strcmp( str, "i" ); return 0;
1
0
0
0
Alexandre Julliard : widl: Always update the type format offset in write_type_tfs and not in callers.
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 82d3ea86cf14b8aa589a33f5e3fe210e28b62e53 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82d3ea86cf14b8aa589a33f5e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 20:45:37 2011 +0200 widl: Always update the type format offset in write_type_tfs and not in callers. --- tools/widl/typegen.c | 33 +++++++++++++-------------------- 1 files changed, 13 insertions(+), 20 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 2e763be..4413713 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2926,6 +2926,7 @@ static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *t if (!iid && processed(type)) return type->typestring_offset; print_start_tfs_comment(file, type, start_offset); + update_tfsoff(type, start_offset, file); if (iid) { @@ -2942,7 +2943,6 @@ static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *t if (! uuid) error("%s: interface %s missing UUID\n", __FUNCTION__, base->name); - update_tfsoff(type, start_offset, file); print_file(file, 2, "0x2f,\t/* FC_IP */\n"); print_file(file, 2, "0x5a,\t/* FC_CONSTANT_IID */\n"); print_file(file, 2, "NdrFcLong(0x%08x),\n", uuid->Data1); @@ -3004,6 +3004,7 @@ static unsigned int write_contexthandle_tfs(FILE *file, print_file(file, 2, "0, /* FIXME: param num */\n"); *typeformat_offset += 4; + update_tfsoff( type, start_offset, file ); return start_offset; } @@ -3029,6 +3030,7 @@ static unsigned int write_range_tfs(FILE *file, const attr_list_t *attrs, print_file(file, 2, "0x%x,\t/* %s */\n", fc, string_of_type(fc)); print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", range_min->cval, range_min->cval); print_file(file, 2, "NdrFcLong(0x%x),\t/* %u */\n", range_max->cval, range_max->cval); + update_tfsoff( type, start_offset, file ); *typeformat_offset += 10; return start_offset; @@ -3080,6 +3082,7 @@ static unsigned int write_type_tfs(FILE *file, int indent, string_of_type(ptr_type)); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", reloff, reloff, absoff); + update_tfsoff( type, off, file ); *typeformat_offset += 4; } } @@ -3162,26 +3165,16 @@ static unsigned int process_tfs_stmts(FILE *file, const statement_list_t *stmts, current_func = func; if (is_local(func->attrs)) continue; - if (!is_void(type_function_get_rettype(func->type))) - { - update_tfsoff(type_function_get_rettype(func->type), - write_type_tfs( - file, 2, func->attrs, - type_function_get_rettype(func->type), - func->name, TYPE_CONTEXT_PARAM, - typeformat_offset), - file); - } + if (!is_void(type_function_get_rettype(func->type))) + { + write_type_tfs( file, 2, func->attrs, type_function_get_rettype(func->type), + func->name, TYPE_CONTEXT_PARAM, typeformat_offset); + } - if (type_get_function_args(func->type)) - LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) - update_tfsoff( - var->type, - write_type_tfs( - file, 2, var->attrs, var->type, var->name, - TYPE_CONTEXT_TOPLEVELPARAM, - typeformat_offset), - file); + if (type_get_function_args(func->type)) + LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) + write_type_tfs( file, 2, var->attrs, var->type, var->name, + TYPE_CONTEXT_TOPLEVELPARAM, typeformat_offset ); } }
1
0
0
0
Alexandre Julliard : widl: Fix representation of context handles in the format string.
by Alexandre Julliard
02 Jun '11
02 Jun '11
Module: wine Branch: master Commit: 5e67dcd10f2ae33f5ad26aa23aa59a52cb792bf0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e67dcd10f2ae33f5ad26aa23…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jun 1 20:21:37 2011 +0200 widl: Fix representation of context handles in the format string. --- tools/widl/header.c | 20 +++++++++++++++++++ tools/widl/header.h | 1 + tools/widl/typegen.c | 52 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 574f723..1a71cef 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -439,6 +439,26 @@ static int generic_handle_registered(const char *name) return 0; } +unsigned int get_context_handle_offset( const type_t *type ) +{ + context_handle_t *ch; + unsigned int index = 0; + + while (!is_attr( type->attrs, ATTR_CONTEXTHANDLE )) + { + if (type_is_alias( type )) type = type_alias_get_aliasee( type ); + else if (is_ptr( type )) type = type_pointer_get_ref( type ); + else error( "internal error: %s is not a context handle\n", type->name ); + } + LIST_FOR_EACH_ENTRY( ch, &context_handle_list, context_handle_t, entry ) + { + if (!strcmp( type->name, ch->name )) return index; + index++; + } + error( "internal error: %s is not registered as a context handle\n", type->name ); + return index; +} + /* check for types which require additional prototypes to be generated in the * header */ void check_for_additional_prototype_types(const var_list_t *list) diff --git a/tools/widl/header.h b/tools/widl/header.h index c844850..ba28229 100644 --- a/tools/widl/header.h +++ b/tools/widl/header.h @@ -36,6 +36,7 @@ extern void write_type_left(FILE *h, type_t *t, int declonly); extern void write_type_right(FILE *h, type_t *t, int is_field); extern void write_type_decl(FILE *f, type_t *t, const char *name); extern void write_type_decl_left(FILE *f, type_t *t); +extern unsigned int get_context_handle_offset( const type_t *type ); extern int needs_space_after(type_t *t); extern int is_object(const type_t *iface); extern int is_local(const attr_list_t *list); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 8d93b331a..2e763be 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -370,6 +370,28 @@ static unsigned int get_stack_size( const type_t *type, const attr_list_t *attrs return ROUND_SIZE( stack_size, pointer_size ); } +static unsigned char get_contexthandle_flags( const type_t *iface, const attr_list_t *attrs, + const type_t *type ) +{ + unsigned char flags = 0; + + if (is_attr(iface->attrs, ATTR_STRICTCONTEXTHANDLE)) flags |= NDR_STRICT_CONTEXT_HANDLE; + + if (is_ptr(type) && + !is_attr( type->attrs, ATTR_CONTEXTHANDLE ) && + !is_attr( attrs, ATTR_CONTEXTHANDLE )) + flags |= 0x80; + + if (is_attr(attrs, ATTR_IN)) + { + flags |= 0x40; + if (!is_attr(attrs, ATTR_OUT)) flags |= NDR_CONTEXT_HANDLE_CANNOT_BE_NULL; + } + if (is_attr(attrs, ATTR_OUT)) flags |= 0x20; + + return flags; +} + unsigned char get_struct_fc(const type_t *type) { int has_pointer = 0; @@ -2939,27 +2961,26 @@ static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *t static unsigned int write_contexthandle_tfs(FILE *file, const attr_list_t *attrs, - const type_t *type, + type_t *type, + int toplevel_param, unsigned int *typeformat_offset) { unsigned int start_offset = *typeformat_offset; - unsigned char flags = 0; + unsigned char flags = get_contexthandle_flags( current_iface, attrs, type ); - if (is_attr(current_iface->attrs, ATTR_STRICTCONTEXTHANDLE)) - flags |= NDR_STRICT_CONTEXT_HANDLE; + print_start_tfs_comment(file, type, start_offset); - if (is_ptr(type)) - flags |= 0x80; - if (is_attr(attrs, ATTR_IN)) + if (flags & 0x80) /* via ptr */ { - flags |= 0x40; - if (!is_attr(attrs, ATTR_OUT)) - flags |= NDR_CONTEXT_HANDLE_CANNOT_BE_NULL; + int pointer_type = get_pointer_fc( type, attrs, toplevel_param ); + if (!pointer_type) pointer_type = RPC_FC_RP; + *typeformat_offset += 4; + print_file(file, 2,"0x%x, 0x0,\t/* %s */\n", pointer_type, string_of_type(pointer_type) ); + print_file(file, 2, "NdrFcShort(0x2),\t /* Offset= 2 (%u) */\n", *typeformat_offset); + print_file(file, 0, "/* %2u */\n", *typeformat_offset); } - if (is_attr(attrs, ATTR_OUT)) - flags |= 0x20; - WRITE_FCTYPE(file, FC_BIND_CONTEXT, *typeformat_offset); + print_file(file, 2, "0x%02x,\t/* FC_BIND_CONTEXT */\n", RPC_FC_BIND_CONTEXT); print_file(file, 2, "0x%x,\t/* Context flags: ", flags); /* return and can't be null values overlap */ if (((flags & 0x21) != 0x21) && (flags & NDR_CONTEXT_HANDLE_CANNOT_BE_NULL)) @@ -2979,7 +3000,7 @@ static unsigned int write_contexthandle_tfs(FILE *file, if (flags & 0x80) print_file(file, 0, "via ptr, "); print_file(file, 0, "*/\n"); - print_file(file, 2, "0, /* FIXME: rundown routine index*/\n"); + print_file(file, 2, "0x%x,\t/* rundown routine */\n", get_context_handle_offset( type )); print_file(file, 2, "0, /* FIXME: param num */\n"); *typeformat_offset += 4; @@ -3025,7 +3046,8 @@ static unsigned int write_type_tfs(FILE *file, int indent, { case TGT_CTXT_HANDLE: case TGT_CTXT_HANDLE_POINTER: - return write_contexthandle_tfs(file, attrs, type, typeformat_offset); + return write_contexthandle_tfs(file, attrs, type, + context == TYPE_CONTEXT_TOPLEVELPARAM, typeformat_offset); case TGT_USER_TYPE: return write_user_tfs(file, type, typeformat_offset); case TGT_STRING:
1
0
0
0
Alasdair Sinclair : comctl32/tab: Fully initialize itemData to fix x64 test failure.
by Alexandre Julliard
01 Jun '11
01 Jun '11
Module: wine Branch: master Commit: b6484ccbebb67d107934f9b6d4a142eb70ac946d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6484ccbebb67d107934f9b6d…
Author: Alasdair Sinclair <alasdairsinc(a)gmail.com> Date: Wed Jun 1 03:24:30 2011 +0100 comctl32/tab: Fully initialize itemData to fix x64 test failure. --- dlls/comctl32/tab.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 0424f7f..1ad8c53 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -1770,6 +1770,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect { /* this could be considered broken on 64 bit, but that's how it works - only first 4 bytes are copied */ + dis.itemData = 0; memcpy(&dis.itemData, (ULONG_PTR*)TAB_GetItem(infoPtr, iItem)->extra, 4); }
1
0
0
0
Andrew Nguyen : dbghelp: Implement SymEnumSourceFilesW.
by Alexandre Julliard
01 Jun '11
01 Jun '11
Module: wine Branch: master Commit: 6ee16099a3b541c656b2146821fc6787aca6112b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ee16099a3b541c656b214682…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Tue May 31 06:12:44 2011 -0500 dbghelp: Implement SymEnumSourceFilesW. --- dlls/dbghelp/dbghelp.spec | 2 +- dlls/dbghelp/dbghelp_private.h | 3 + dlls/dbghelp/module.c | 6 +- dlls/dbghelp/source.c | 122 +++++++++++++++++++++++++++++++++++++--- 4 files changed, 121 insertions(+), 12 deletions(-) diff --git a/dlls/dbghelp/dbghelp.spec b/dlls/dbghelp/dbghelp.spec index c50ab22..ddb9d33 100644 --- a/dlls/dbghelp/dbghelp.spec +++ b/dlls/dbghelp/dbghelp.spec @@ -45,7 +45,7 @@ @ stub SymEnumProcesses @ stub SymEnumSourceFileTokens @ stdcall SymEnumSourceFiles(ptr int64 str ptr ptr) -@ stub SymEnumSourceFilesW +@ stdcall SymEnumSourceFilesW(ptr int64 wstr ptr ptr) @ stub SymEnumSourceLines @ stub SymEnumSourceLinesW @ stub SymEnumSym diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 4a64253..43aca49 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -538,6 +538,9 @@ extern struct module* module_find_by_addr(const struct process* pcs, unsigned long addr, enum module_type type) DECLSPEC_HIDDEN; extern struct module* + module_find_by_nameW(const struct process* pcs, + const WCHAR* name) DECLSPEC_HIDDEN; +extern struct module* module_find_by_nameA(const struct process* pcs, const char* name) DECLSPEC_HIDDEN; extern struct module* diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 7f75cc2..2a1471f 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -234,10 +234,10 @@ struct module* module_new(struct process* pcs, const WCHAR* name, } /*********************************************************************** - * module_find_by_name + * module_find_by_nameW * */ -static struct module* module_find_by_name(const struct process* pcs, const WCHAR* name) +struct module* module_find_by_nameW(const struct process* pcs, const WCHAR* name) { struct module* module; @@ -254,7 +254,7 @@ struct module* module_find_by_nameA(const struct process* pcs, const char* name) WCHAR wname[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, name, -1, wname, sizeof(wname) / sizeof(WCHAR)); - return module_find_by_name(pcs, wname); + return module_find_by_nameW(pcs, wname); } /*********************************************************************** diff --git a/dlls/dbghelp/source.c b/dlls/dbghelp/source.c index 5f12b9f..3bed023 100644 --- a/dlls/dbghelp/source.c +++ b/dlls/dbghelp/source.c @@ -157,17 +157,19 @@ const char* source_get(const struct module* module, unsigned idx) } /****************************************************************** - * SymEnumSourceFiles (DBGHELP.@) + * SymEnumSourceFilesW (DBGHELP.@) * */ -BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask, - PSYM_ENUMSOURCEFILES_CALLBACK cbSrcFiles, - PVOID UserContext) +BOOL WINAPI SymEnumSourceFilesW(HANDLE hProcess, ULONG64 ModBase, PCWSTR Mask, + PSYM_ENUMSOURCEFILES_CALLBACKW cbSrcFiles, + PVOID UserContext) { struct module_pair pair; - SOURCEFILE sf; + SOURCEFILEW sf; char* ptr; - + WCHAR* conversion_buffer = NULL; + DWORD conversion_buffer_len = 0; + if (!cbSrcFiles) return FALSE; pair.pcs = process_find_by_handle(hProcess); if (!pair.pcs) return FALSE; @@ -181,7 +183,7 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask, { if (Mask[0] == '!') { - pair.requested = module_find_by_nameA(pair.pcs, Mask + 1); + pair.requested = module_find_by_nameW(pair.pcs, Mask + 1); if (!module_get_debug(&pair)) return FALSE; } else @@ -193,15 +195,119 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask, if (!pair.effective->sources) return FALSE; for (ptr = pair.effective->sources; *ptr; ptr += strlen(ptr) + 1) { + DWORD len = MultiByteToWideChar(CP_ACP, 0, ptr, -1, NULL, 0); + + if (len > conversion_buffer_len) + { + HeapFree(GetProcessHeap(), 0, conversion_buffer); + conversion_buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!conversion_buffer) return FALSE; + conversion_buffer_len = len; + } + + MultiByteToWideChar(CP_ACP, 0, ptr, -1, conversion_buffer, len); + /* FIXME: not using Mask */ sf.ModBase = ModBase; - sf.FileName = ptr; + sf.FileName = conversion_buffer; if (!cbSrcFiles(&sf, UserContext)) break; } + HeapFree(GetProcessHeap(), 0, conversion_buffer); return TRUE; } +struct enum_sources_files_context +{ + PSYM_ENUMSOURCEFILES_CALLBACK callbackA; + PVOID caller_context; + char *conversion_buffer; + DWORD conversion_buffer_len; + DWORD callback_error; +}; + +static BOOL CALLBACK enum_source_files_W_to_A(PSOURCEFILEW source_file, PVOID context) +{ + struct enum_sources_files_context *ctx = context; + SOURCEFILE source_fileA; + DWORD len; + + len = WideCharToMultiByte(CP_ACP, 0, source_file->FileName, -1, NULL, 0, NULL, NULL); + if (len > ctx->conversion_buffer_len) + { + char *ptr = ctx->conversion_buffer ? HeapReAlloc(GetProcessHeap(), 0, ctx->conversion_buffer, len) : + HeapAlloc(GetProcessHeap(), 0, len); + + if (!ptr) + { + ctx->callback_error = ERROR_OUTOFMEMORY; + return FALSE; + } + + ctx->conversion_buffer = ptr; + ctx->conversion_buffer_len = len; + } + + WideCharToMultiByte(CP_ACP, 0, source_file->FileName, -1, ctx->conversion_buffer, len, NULL, NULL); + + source_fileA.ModBase = source_file->ModBase; + source_fileA.FileName = ctx->conversion_buffer; + return ctx->callbackA(&source_fileA, ctx->caller_context); +} + +/****************************************************************** + * SymEnumSourceFiles (DBGHELP.@) + * + */ +BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask, + PSYM_ENUMSOURCEFILES_CALLBACK cbSrcFiles, + PVOID UserContext) +{ + WCHAR *maskW = NULL; + PSYM_ENUMSOURCEFILES_CALLBACKW callbackW; + PVOID context; + struct enum_sources_files_context callback_context = {cbSrcFiles, UserContext}; + BOOL ret; + + if (Mask) + { + DWORD len = MultiByteToWideChar(CP_ACP, 0, Mask, -1, NULL, 0); + + maskW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!maskW) + { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + + MultiByteToWideChar(CP_ACP, 0, Mask, -1, maskW, len); + } + + if (cbSrcFiles) + { + callbackW = enum_source_files_W_to_A; + context = &callback_context; + } + else + { + callbackW = NULL; + context = UserContext; + } + + ret = SymEnumSourceFilesW(hProcess, ModBase, maskW, callbackW, context); + + if (callback_context.callback_error) + { + SetLastError(callback_context.callback_error); + ret = FALSE; + } + + HeapFree(GetProcessHeap(), 0, callback_context.conversion_buffer); + HeapFree(GetProcessHeap(), 0, maskW); + + return ret; +} + /****************************************************************** * SymGetSourceFileToken (DBGHELP.@) *
1
0
0
0
← Newer
1
...
75
76
77
78
79
80
81
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
Results per page:
10
25
50
100
200