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
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-devel
November 2018
----- 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-devel@winehq.org
75 participants
771 discussions
Start a n
N
ew thread
[PATCH 5/8] winhttp: Get rid of object_header_t and object_vtbl_t.
by Hans Leidekker
15 Nov '18
15 Nov '18
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/winhttp/handle.c | 18 +++++++++--------- dlls/winhttp/session.c | 40 ++++++++++++++++++++-------------------- dlls/winhttp/winhttp_private.h | 33 ++++++++++++++++----------------- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/dlls/winhttp/handle.c b/dlls/winhttp/handle.c index d08e72079f..b76d8fe8d1 100644 --- a/dlls/winhttp/handle.c +++ b/dlls/winhttp/handle.c @@ -42,20 +42,20 @@
…
[View More]
static CRITICAL_SECTION_DEBUG handle_cs_debug = }; static CRITICAL_SECTION handle_cs = { &handle_cs_debug, -1, 0, 0, 0, 0 }; -static object_header_t **handles; +static struct object_header **handles; static ULONG_PTR next_handle; static ULONG_PTR max_handles; -object_header_t *addref_object( object_header_t *hdr ) +struct object_header *addref_object( struct object_header *hdr ) { ULONG refs = InterlockedIncrement( &hdr->refs ); TRACE("%p -> refcount = %d\n", hdr, refs); return hdr; } -object_header_t *grab_object( HINTERNET hinternet ) +struct object_header *grab_object( HINTERNET hinternet ) { - object_header_t *hdr = NULL; + struct object_header *hdr = NULL; ULONG_PTR handle = (ULONG_PTR)hinternet; EnterCriticalSection( &handle_cs ); @@ -69,7 +69,7 @@ object_header_t *grab_object( HINTERNET hinternet ) return hdr; } -void release_object( object_header_t *hdr ) +void release_object( struct object_header *hdr ) { ULONG refs = InterlockedDecrement( &hdr->refs ); TRACE("object %p refcount = %d\n", hdr, refs); @@ -85,9 +85,9 @@ void release_object( object_header_t *hdr ) } } -HINTERNET alloc_handle( object_header_t *hdr ) +HINTERNET alloc_handle( struct object_header *hdr ) { - object_header_t **p; + struct object_header **p; ULONG_PTR handle, num; list_init( &hdr->children ); @@ -124,7 +124,7 @@ BOOL free_handle( HINTERNET hinternet ) { BOOL ret = FALSE; ULONG_PTR handle = (ULONG_PTR)hinternet; - object_header_t *hdr = NULL, *child, *next; + struct object_header *hdr = NULL, *child, *next; EnterCriticalSection( &handle_cs ); @@ -144,7 +144,7 @@ BOOL free_handle( HINTERNET hinternet ) if (hdr) { - LIST_FOR_EACH_ENTRY_SAFE( child, next, &hdr->children, object_header_t, entry ) + LIST_FOR_EACH_ENTRY_SAFE( child, next, &hdr->children, struct object_header, entry ) { TRACE("freeing child handle %p for parent handle 0x%lx\n", child->handle, handle + 1); free_handle( child->handle ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 93c10e0679..88043462af 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -64,7 +64,7 @@ DWORD get_last_error( void ) return GetLastError(); } -void send_callback( object_header_t *hdr, DWORD status, LPVOID info, DWORD buflen ) +void send_callback( struct object_header *hdr, DWORD status, void *info, DWORD buflen ) { if (hdr->callback && (hdr->notify_mask & status)) { @@ -86,7 +86,7 @@ BOOL WINAPI WinHttpCheckPlatform( void ) /*********************************************************************** * session_destroy (internal) */ -static void session_destroy( object_header_t *hdr ) +static void session_destroy( struct object_header *hdr ) { session_t *session = (session_t *)hdr; @@ -106,7 +106,7 @@ static void session_destroy( object_header_t *hdr ) heap_free( session ); } -static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) +static BOOL session_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen ) { session_t *session = (session_t *)hdr; @@ -157,7 +157,7 @@ static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buf } } -static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD buflen ) +static BOOL session_set_option( struct object_header *hdr, DWORD option, void *buffer, DWORD buflen ) { session_t *session = (session_t *)hdr; @@ -246,7 +246,7 @@ static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffe } } -static const object_vtbl_t session_vtbl = +static const struct object_vtbl session_vtbl = { session_destroy, session_query_option, @@ -320,7 +320,7 @@ end: /*********************************************************************** * connect_destroy (internal) */ -static void connect_destroy( object_header_t *hdr ) +static void connect_destroy( struct object_header *hdr ) { connect_t *connect = (connect_t *)hdr; @@ -335,7 +335,7 @@ static void connect_destroy( object_header_t *hdr ) heap_free( connect ); } -static BOOL connect_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) +static BOOL connect_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen ) { connect_t *connect = (connect_t *)hdr; @@ -350,7 +350,7 @@ static BOOL connect_query_option( object_header_t *hdr, DWORD option, LPVOID buf return FALSE; } - *(HINTERNET *)buffer = ((object_header_t *)connect->session)->handle; + *(HINTERNET *)buffer = ((struct object_header *)connect->session)->handle; *buflen = sizeof(HINTERNET); return TRUE; } @@ -386,7 +386,7 @@ static BOOL connect_query_option( object_header_t *hdr, DWORD option, LPVOID buf } } -static const object_vtbl_t connect_vtbl = +static const struct object_vtbl connect_vtbl = { connect_destroy, connect_query_option, @@ -606,7 +606,7 @@ end: /*********************************************************************** * request_destroy (internal) */ -static void request_destroy( object_header_t *hdr ) +static void request_destroy( struct object_header *hdr ) { request_t *request = (request_t *)hdr; unsigned int i, j; @@ -704,7 +704,7 @@ static BOOL copy_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_s } } -static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) +static BOOL request_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen ) { request_t *request = (request_t *)hdr; @@ -885,7 +885,7 @@ static WCHAR *buffer_to_str( WCHAR *buffer, DWORD buflen ) return NULL; } -static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD buflen ) +static BOOL request_set_option( struct object_header *hdr, DWORD option, void *buffer, DWORD buflen ) { request_t *request = (request_t *)hdr; @@ -1050,7 +1050,7 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe } } -static const object_vtbl_t request_vtbl = +static const struct object_vtbl request_vtbl = { request_destroy, request_query_option, @@ -1186,7 +1186,7 @@ end: */ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) { - object_header_t *hdr; + struct object_header *hdr; TRACE("%p\n", handle); @@ -1201,7 +1201,7 @@ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle ) return TRUE; } -static BOOL query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) +static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen ) { BOOL ret = FALSE; @@ -1245,7 +1245,7 @@ static BOOL query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPD BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, LPVOID buffer, LPDWORD buflen ) { BOOL ret = FALSE; - object_header_t *hdr; + struct object_header *hdr; TRACE("%p, %u, %p, %p\n", handle, option, buffer, buflen); @@ -1262,7 +1262,7 @@ BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, LPVOID buffer, L return ret; } -static BOOL set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD buflen ) +static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, DWORD buflen ) { BOOL ret = TRUE; @@ -1304,7 +1304,7 @@ static BOOL set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD BOOL WINAPI WinHttpSetOption( HINTERNET handle, DWORD option, LPVOID buffer, DWORD buflen ) { BOOL ret = FALSE; - object_header_t *hdr; + struct object_header *hdr; TRACE("%p, %u, %p, %u\n", handle, option, buffer, buflen); @@ -2048,7 +2048,7 @@ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info ) WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHTTP_STATUS_CALLBACK callback, DWORD flags, DWORD_PTR reserved ) { - object_header_t *hdr; + struct object_header *hdr; WINHTTP_STATUS_CALLBACK ret; TRACE("%p, %p, 0x%08x, 0x%lx\n", handle, callback, flags, reserved); @@ -2073,7 +2073,7 @@ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHT BOOL WINAPI WinHttpSetTimeouts( HINTERNET handle, int resolve, int connect, int send, int receive ) { BOOL ret = TRUE; - object_header_t *hdr; + struct object_header *hdr; TRACE("%p, %d, %d, %d, %d\n", handle, resolve, connect, send, receive); diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 7c41351ef1..c2f10e3ccf 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -39,20 +39,19 @@ static const WCHAR http1_0[] = {'H','T','T','P','/','1','.','0',0}; static const WCHAR http1_1[] = {'H','T','T','P','/','1','.','1',0}; static const WCHAR chunkedW[] = {'c','h','u','n','k','e','d',0}; -typedef struct _object_header_t object_header_t; - -typedef struct +struct object_header; +struct object_vtbl { - void (*destroy)( object_header_t * ); - BOOL (*query_option)( object_header_t *, DWORD, void *, DWORD * ); - BOOL (*set_option)( object_header_t *, DWORD, void *, DWORD ); -} object_vtbl_t; + void (*destroy)( struct object_header * ); + BOOL (*query_option)( struct object_header *, DWORD, void *, DWORD * ); + BOOL (*set_option)( struct object_header *, DWORD, void *, DWORD ); +}; -struct _object_header_t +struct object_header { DWORD type; HINTERNET handle; - const object_vtbl_t *vtbl; + const struct object_vtbl *vtbl; DWORD flags; DWORD disable_flags; DWORD logon_policy; @@ -77,7 +76,7 @@ typedef struct { typedef struct { - object_header_t hdr; + struct object_header hdr; CRITICAL_SECTION cs; LPWSTR agent; DWORD access; @@ -99,7 +98,7 @@ typedef struct typedef struct { - object_header_t hdr; + struct object_header hdr; session_t *session; LPWSTR hostname; /* final destination of the request */ LPWSTR servername; /* name of the server we directly connect to */ @@ -170,7 +169,7 @@ struct authinfo typedef struct { - object_header_t hdr; + struct object_header hdr; connect_t *connect; LPWSTR verb; LPWSTR path; @@ -259,15 +258,15 @@ struct write_data DWORD *written; }; -object_header_t *addref_object( object_header_t * ) DECLSPEC_HIDDEN; -object_header_t *grab_object( HINTERNET ) DECLSPEC_HIDDEN; -void release_object( object_header_t * ) DECLSPEC_HIDDEN; -HINTERNET alloc_handle( object_header_t * ) DECLSPEC_HIDDEN; +struct object_header *addref_object( struct object_header * ) DECLSPEC_HIDDEN; +struct object_header *grab_object( HINTERNET ) DECLSPEC_HIDDEN; +void release_object( struct object_header * ) DECLSPEC_HIDDEN; +HINTERNET alloc_handle( struct object_header * ) DECLSPEC_HIDDEN; BOOL free_handle( HINTERNET ) DECLSPEC_HIDDEN; void set_last_error( DWORD ) DECLSPEC_HIDDEN; DWORD get_last_error( void ) DECLSPEC_HIDDEN; -void send_callback( object_header_t *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN; +void send_callback( struct object_header *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN; void close_connection( request_t * ) DECLSPEC_HIDDEN; void netconn_close( netconn_t * ) DECLSPEC_HIDDEN; -- 2.11.0
[View Less]
1
0
0
0
[PATCH 4/8] winhttp: Get rid of write_data_t.
by Hans Leidekker
15 Nov '18
15 Nov '18
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/winhttp/request.c | 6 +++--- dlls/winhttp/winhttp_private.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 158cb13d01..9a2c0ef096 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3030,7 +3030,7 @@ static BOOL write_data( request_t *request, LPCVOID buffer, DWORD to_write, LPDW static void task_write_data(
…
[View More]
struct task_header *task ) { - write_data_t *w = (write_data_t *)task; + struct write_data *w = (struct write_data *)task; write_data( w->hdr.request, w->buffer, w->to_write, w->written, TRUE ); } @@ -3058,9 +3058,9 @@ BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write if (request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { - write_data_t *w; + struct write_data *w; - if (!(w = heap_alloc( sizeof(write_data_t) ))) return FALSE; + if (!(w = heap_alloc( sizeof(struct write_data) ))) return FALSE; w->hdr.request = request; w->hdr.proc = task_write_data; w->buffer = buffer; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index b29cddfa78..7c41351ef1 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -251,13 +251,13 @@ struct read_data DWORD *read; }; -typedef struct +struct write_data { struct task_header hdr; - LPCVOID buffer; + const void *buffer; DWORD to_write; - LPDWORD written; -} write_data_t; + DWORD *written; +}; object_header_t *addref_object( object_header_t * ) DECLSPEC_HIDDEN; object_header_t *grab_object( HINTERNET ) DECLSPEC_HIDDEN; -- 2.11.0
[View Less]
1
0
0
0
[PATCH 3/8] winhttp: Get rid of read_data_t.
by Hans Leidekker
15 Nov '18
15 Nov '18
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/winhttp/request.c | 6 +++--- dlls/winhttp/winhttp_private.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 7b47ed9349..158cb13d01 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2958,7 +2958,7 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) static void task_read_data( struct
…
[View More]
task_header *task ) { - read_data_t *r = (read_data_t *)task; + struct read_data *r = (struct read_data *)task; read_data( r->hdr.request, r->buffer, r->to_read, r->read, TRUE ); } @@ -2986,9 +2986,9 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, LPVOID buffer, DWORD to_read, L if (request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { - read_data_t *r; + struct read_data *r; - if (!(r = heap_alloc( sizeof(read_data_t) ))) return FALSE; + if (!(r = heap_alloc( sizeof(struct read_data) ))) return FALSE; r->hdr.request = request; r->hdr.proc = task_read_data; r->buffer = buffer; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index 1f33ea48d7..b29cddfa78 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -243,13 +243,13 @@ struct query_data DWORD *available; }; -typedef struct +struct read_data { struct task_header hdr; - LPVOID buffer; + void *buffer; DWORD to_read; - LPDWORD read; -} read_data_t; + DWORD *read; +}; typedef struct { -- 2.11.0
[View Less]
1
0
0
0
[PATCH 2/8] winhttp: Get rid of query_data_t.
by Hans Leidekker
15 Nov '18
15 Nov '18
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/winhttp/request.c | 6 +++--- dlls/winhttp/winhttp_private.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index f51f34bf5b..7b47ed9349 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2910,7 +2910,7 @@ done: static void task_query_data_available( struct task_header *task ) { - query_data_t *q = (query_data_t *)
…
[View More]
task; + struct query_data *q = (struct query_data *)task; query_data_available( q->hdr.request, q->available, TRUE ); } @@ -2938,9 +2938,9 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) if (request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { - query_data_t *q; + struct query_data *q; - if (!(q = heap_alloc( sizeof(query_data_t) ))) return FALSE; + if (!(q = heap_alloc( sizeof(struct query_data) ))) return FALSE; q->hdr.request = request; q->hdr.proc = task_query_data_available; q->available = available; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index a27241b36d..1f33ea48d7 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -237,11 +237,11 @@ struct receive_response struct task_header hdr; }; -typedef struct +struct query_data { struct task_header hdr; - LPDWORD available; -} query_data_t; + DWORD *available; +}; typedef struct { -- 2.11.0
[View Less]
1
0
0
0
[PATCH 1/8] winhttp: Get rid of receive_response_t.
by Hans Leidekker
15 Nov '18
15 Nov '18
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/winhttp/request.c | 6 +++--- dlls/winhttp/winhttp_private.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 77d5315862..f51f34bf5b 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -2839,7 +2839,7 @@ static BOOL receive_response( request_t *request, BOOL async ) static void task_receive_response( struct task_header *
…
[View More]
task ) { - receive_response_t *r = (receive_response_t *)task; + struct receive_response *r = (struct receive_response *)task; receive_response( r->hdr.request, TRUE ); } @@ -2867,9 +2867,9 @@ BOOL WINAPI WinHttpReceiveResponse( HINTERNET hrequest, LPVOID reserved ) if (request->connect->hdr.flags & WINHTTP_FLAG_ASYNC) { - receive_response_t *r; + struct receive_response *r; - if (!(r = heap_alloc( sizeof(receive_response_t) ))) return FALSE; + if (!(r = heap_alloc( sizeof(struct receive_response) ))) return FALSE; r->hdr.request = request; r->hdr.proc = task_receive_response; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index cbf9a36599..a27241b36d 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -232,10 +232,10 @@ struct send_request DWORD_PTR context; }; -typedef struct +struct receive_response { struct task_header hdr; -} receive_response_t; +}; typedef struct { -- 2.11.0
[View Less]
1
0
0
0
[PATCH] ntdll: Add stubs for RtlAddFunctionTable and RtlDeleteFunctionTable on ARM64
by André Hentschel
15 Nov '18
15 Nov '18
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46143
Signed-off-by: Andr� Hentschel <nerv(a)dawncrow.de> --- .../api-ms-win-core-rtlsupport-l1-1-0.spec | 4 ++-- dlls/kernel32/kernel32.spec | 4 ++-- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/signal_arm64.c | 19 +++++++++++++++++++ include/winnt.h | 3 +++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/api-ms-win-
…
[View More]
core-rtlsupport-l1-1-0/api-ms-win-core-rtlsupport-l1-1-0.spec b/dlls/api-ms-win-core-rtlsupport-l1-1-0/api-ms-win-core-rtlsupport-l1-1-0.spec index 428fd06bb7..1c5744d7f0 100644 --- a/dlls/api-ms-win-core-rtlsupport-l1-1-0/api-ms-win-core-rtlsupport-l1-1-0.spec +++ b/dlls/api-ms-win-core-rtlsupport-l1-1-0/api-ms-win-core-rtlsupport-l1-1-0.spec @@ -1,9 +1,9 @@ -@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable +@ cdecl -arch=arm,arm64,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable @ stdcall -norelay RtlCaptureContext(ptr) ntdll.RtlCaptureContext @ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace @ stdcall RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory @ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory -@ cdecl -arch=arm,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable +@ cdecl -arch=arm,arm64,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) ntdll.RtlInstallFunctionTableCallback @ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 5c2e426130..85fce3725a 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1284,12 +1284,12 @@ @ stdcall ResolveLocaleName(wstr ptr long) @ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error @ stdcall ResumeThread(long) -@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable +@ cdecl -arch=arm,arm64,x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable @ stdcall -norelay RtlCaptureContext(ptr) ntdll.RtlCaptureContext @ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace @ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory @ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr long) ntdll.RtlCopyMemory -@ cdecl -arch=arm,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable +@ cdecl -arch=arm,arm64,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr ptr) ntdll.RtlInstallFunctionTableCallback @ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 3486a78fe3..1b0bd7f53f 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -433,7 +433,7 @@ # @ stub RtlAddCompoundAce @ stdcall RtlAddMandatoryAce(ptr long long long long ptr) # @ stub RtlAddRange -@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long) +@ cdecl -arch=arm,arm64,x86_64 RtlAddFunctionTable(ptr long long) @ stdcall RtlAddRefActivationContext(ptr) # @ stub RtlAddRefMemoryStream @ stdcall RtlAddVectoredContinueHandler(long ptr) @@ -543,7 +543,7 @@ @ stdcall RtlDeleteCriticalSection(ptr) @ stub RtlDeleteElementGenericTable @ stub RtlDeleteElementGenericTableAvl -@ cdecl -arch=arm,x86_64 RtlDeleteFunctionTable(ptr) +@ cdecl -arch=arm,arm64,x86_64 RtlDeleteFunctionTable(ptr) @ stub RtlDeleteNoSplay @ stub RtlDeleteOwnersRanges @ stub RtlDeleteRange diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 91a7e3beec..0ab402ef70 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -947,6 +947,25 @@ void signal_init_process(void) } +/********************************************************************** + * RtlAddFunctionTable (NTDLL.@) + */ +BOOLEAN CDECL RtlAddFunctionTable( RUNTIME_FUNCTION *table, DWORD count, ULONG_PTR addr ) +{ + FIXME( "%p %u %lx: stub\n", table, count, addr ); + return TRUE; +} + + +/********************************************************************** + * RtlDeleteFunctionTable (NTDLL.@) + */ +BOOLEAN CDECL RtlDeleteFunctionTable( RUNTIME_FUNCTION *table ) +{ + FIXME( "%p: stub\n", table ); + return TRUE; +} + /*********************************************************************** * RtlUnwind (NTDLL.@) */ diff --git a/include/winnt.h b/include/winnt.h index 035d5bd097..742b47bfb2 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1875,6 +1875,9 @@ typedef struct _CONTEXT DWORD64 Wvr[ARM64_MAX_WATCHPOINTS]; /* 380 */ } CONTEXT; +BOOLEAN CDECL RtlAddFunctionTable(RUNTIME_FUNCTION*,DWORD,ULONG_PTR); +BOOLEAN CDECL RtlDeleteFunctionTable(RUNTIME_FUNCTION*); + #endif /* __aarch64__ */ -- 2.17.1
[View Less]
2
1
0
0
[PATCH] find: First tests
by Fabian Maurer
14 Nov '18
14 Nov '18
Since the implementation is dependent on these, I figured I'd send tests first. Most important are the unicode tests. The program seems to do a lot of conversion, dependent on the local codepage. It doesn't seem to detect anything else but utf16le, for anything else it just treats it like its current codepage - which is enough to find ANSI strings. Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> --- programs/find/tests/Makefile.in | 5 + programs/find/tests/find.c | 321 +++++
…
[View More]
+++++++++++++++++++++++++++ 2 files changed, 326 insertions(+) create mode 100644 programs/find/tests/Makefile.in create mode 100644 programs/find/tests/find.c diff --git a/programs/find/tests/Makefile.in b/programs/find/tests/Makefile.in new file mode 100644 index 0000000000..c5b359bd98 --- /dev/null +++ b/programs/find/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = find.exe +IMPORTS = user32 + +C_SRCS = \ + find.c diff --git a/programs/find/tests/find.c b/programs/find/tests/find.c new file mode 100644 index 0000000000..0e3929df51 --- /dev/null +++ b/programs/find/tests/find.c @@ -0,0 +1,321 @@ +/* + * Copyright 2018 Fabian Maurer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include <stdio.h> + +#include "wine/heap.h" +#include "wine/test.h" + +void read_all_from_handle(HANDLE handle, BYTE **str, int *len) +{ + char buffer[4096]; + DWORD bytes_read; + DWORD length = 0; + BOOL success; + BYTE *ret = heap_alloc_zero(1); + + for (;;) + { + success = ReadFile(handle, buffer, sizeof(buffer), &bytes_read, NULL); + if (!success || !bytes_read) + break; + ret = heap_realloc(ret, length + bytes_read); + memcpy((char *)ret + length, buffer, bytes_read); + length += bytes_read; + } + + *str = ret; + *len = length; +} + +void write_to_handle(HANDLE handle, const BYTE *str, int len) +{ + DWORD bytes_written_sum = 0; + + do + { + DWORD bytes_written; + WriteFile(handle, str, len, &bytes_written, NULL); + bytes_written_sum += bytes_written; + } while (bytes_written_sum < len); +} + +void check_find_output(const BYTE *child_output, int child_output_len, const BYTE *out_expected, int out_expected_len, const char *file, int line) +{ + BOOL strings_are_equal; + char *child_output_copy; + char *out_expected_copy; + int i, pos; + + if (child_output_len != out_expected_len) + strings_are_equal = FALSE; + else + { + strings_are_equal = memcmp(child_output, out_expected, out_expected_len) == 0; + } + + /* Format strings for debug printing */ + child_output_copy = heap_alloc_zero(child_output_len * 4 + 1); + out_expected_copy = heap_alloc_zero(out_expected_len * 4 + 1); + + for (i = 0, pos = 0; i < child_output_len; i++) + { + if (child_output[i] && child_output[i] != '\r' && child_output[i] < 128) + child_output_copy[pos++] = child_output[i]; + else + { + sprintf(&child_output_copy[pos], "\\x%02x", child_output[i]); + pos += 4; + } + } + + for (i = 0, pos = 0; i < out_expected_len; i++) + { + if (out_expected[i] && out_expected[i] != '\r' && out_expected[i] < 128) + out_expected_copy[pos++] = out_expected[i]; + else + { + sprintf(&out_expected_copy[pos], "\\x%02x", out_expected[i]); + pos += 4; + } + + } + + ok_(file, line)(strings_are_equal, "\n#################### Expected:\n" + "%s\n" + "#################### But got:\n" + "%s\n" + "####################\n", + out_expected_copy, child_output_copy); + + heap_free(child_output_copy); + heap_free(out_expected_copy); +} + +#define run_find_stdin_bytes(commandline, input, out_expected, exitcode_expected) \ + run_find_stdin_(commandline, input, sizeof(input), out_expected, sizeof(out_expected), exitcode_expected, __FILE__, __LINE__) + +static void run_find_stdin_(const WCHAR *commandline, const BYTE *input, int input_len, const BYTE *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line) +{ + static const WCHAR find_exe[] = { 'f','i','n','d','.','e','x','e',' ','%','s' }; + HANDLE child_stdin_read; + HANDLE child_stdout_write; + HANDLE parent_stdin_write; + HANDLE parent_stdout_read; + STARTUPINFOW startup_info = {0}; + SECURITY_ATTRIBUTES security_attributes; + PROCESS_INFORMATION process_info = {0}; + BYTE *child_output = NULL; + int child_output_len; + WCHAR cmd[4096]; + DWORD exitcode; + + security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); + security_attributes.bInheritHandle = TRUE; + security_attributes.lpSecurityDescriptor = NULL; + + CreatePipe(&parent_stdout_read, &child_stdout_write, &security_attributes, 0); + CreatePipe(&child_stdin_read, &parent_stdin_write, &security_attributes, 0); + + SetHandleInformation(parent_stdout_read, HANDLE_FLAG_INHERIT, 0); + SetHandleInformation(parent_stdin_write, HANDLE_FLAG_INHERIT, 0); + + startup_info.cb = sizeof(STARTUPINFOW); + startup_info.hStdInput = child_stdin_read; + startup_info.hStdOutput = child_stdout_write; + startup_info.hStdError = NULL; + startup_info.dwFlags |= STARTF_USESTDHANDLES; + + wsprintfW(cmd, find_exe, commandline); + + CreateProcessW(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info); + CloseHandle(child_stdin_read); + CloseHandle(child_stdout_write); + + write_to_handle(parent_stdin_write, input, input_len); + CloseHandle(parent_stdin_write); + + read_all_from_handle(parent_stdout_read, &child_output, &child_output_len); + CloseHandle(parent_stdout_read); + + GetExitCodeProcess(process_info.hProcess, &exitcode); + CloseHandle(process_info.hProcess); + CloseHandle(process_info.hThread); + + check_find_output(child_output, child_output_len, out_expected, out_expected_len, file, line); + + ok_(file, line)(exitcode == exitcode_expected, "Expected exitcode %d, got %d\n", exitcode_expected, exitcode); + + heap_free(child_output); +} + +#define run_find_stdin_str(commandline, input, out_expected, exitcode_expected) \ + run_find_stdin_str_(commandline, input, lstrlenA(input), out_expected, lstrlenA(out_expected), exitcode_expected, __FILE__, __LINE__) + +static void run_find_stdin_str_(const char *commandline, const char *input, int input_len, const char *out_expected, int out_expected_len, int exitcode_expected, const char *file, int line) +{ + WCHAR *commandlineW; + int len_commandlineW; + + len_commandlineW = MultiByteToWideChar(CP_UTF8, 0, commandline, -1, 0, 0); + commandlineW = heap_alloc(len_commandlineW * sizeof(WCHAR)); + MultiByteToWideChar(CP_UTF8, 0, commandline, -1, commandlineW, len_commandlineW); + + run_find_stdin_(commandlineW, (BYTE *)input, lstrlenA(input), (BYTE *)out_expected, lstrlenA(out_expected), exitcode_expected, file, line); + + heap_free(commandlineW); +} + +#define run_find_unicode(commandline, input, exitcode_expected) \ + run_find_unicode_(commandline, input, sizeof(input), exitcode_expected, __FILE__, __LINE__) + +static void run_find_unicode_(const WCHAR *commandline, const BYTE *input, int input_len, int exitcode_expected, const char* file, int line) +{ + WCHAR buffer[200]; + BYTE expected[200]; + int count_wchar; + int count_expected; + + count_wchar = MultiByteToWideChar(GetConsoleCP(), 0, (char *)input, input_len, buffer, ARRAY_SIZE(expected)); + count_expected = WideCharToMultiByte(GetConsoleCP(), 0, buffer, count_wchar, (char *)expected, ARRAY_SIZE(expected), NULL, NULL); + + run_find_stdin_(commandline, input, input_len, expected, count_expected, exitcode_expected, file, line); +} + +#define run_find_unicode16(commandline, input) \ + run_find_unicode16_(commandline, input, sizeof(input), __FILE__, __LINE__) + +static void run_find_unicode16_(const WCHAR *commandline, const BYTE *input, int input_len, const char* file, int line) +{ + BYTE expected[200]; + WCHAR buffer[200]; + int count_expected; + int buffer_count = 0; + int i; + + /* Copy utf16le into a WCHAR array, stripping the BOM */ + for (i = 2; i < input_len; i += 2) + { + buffer[buffer_count++] = input[i] + (input[i + 1] << 8); + } + + count_expected = WideCharToMultiByte(GetConsoleCP(), 0, buffer, buffer_count, (char *)expected, ARRAY_SIZE(expected), NULL, NULL); + run_find_stdin_(commandline, input, input_len, expected, count_expected, 0, file, line); +} + +static void test_errors(void) +{ + run_find_stdin_str("", "", "FIND: Parameter format not correct\r\n", 2); + run_find_stdin_str("test", "", "FIND: Parameter format not correct\r\n", 2); + run_find_stdin_str("\"test", "", "FIND: Parameter format not correct\r\n", 2); + run_find_stdin_str("\"test\" /XYZ", "", "FIND: Invalid switch\r\n", 2); +} + +static void test_singleline_without_switches(void) +{ + run_find_stdin_str("\"\"", "test", "", 1); + run_find_stdin_str("\"test\"", "", "", 1); + run_find_stdin_str("\"test\"", "test", "test\r\n", 0); + run_find_stdin_str("\"test\"", "test2", "test2\r\n", 0); + run_find_stdin_str("\"test2\"", "test", "", 1); +} + +static void test_multiline(void) +{ + /* Newline in input shouldn't work */ + run_find_stdin_str("\"t1\r\nt1\"", "t1\r\nt1", "", 1); + run_find_stdin_str("\"t1\nt1\"", "t1\nt1", "", 1); + + /* Newline should always be displayed as \r\n */ + run_find_stdin_str("\"test1\"", "test1\ntest2", "test1\r\n", 0); + run_find_stdin_str("\"test1\"", "test1\r\ntest2", "test1\r\n", 0); + + /* Test with empty line */ + run_find_stdin_str("\"test1\"", "test1\n\ntest2", "test1\r\n", 0); + + /* Two strings to be found */ + run_find_stdin_str("\"test\"", "junk1\ntest1\ntest2\r\njunk", "test1\r\ntest2\r\n", 0); +} + +static const BYTE str_empty[] = {}; +static const BYTE str_jap_shiftjis[] = { 0x8E,0x84,0x82,0xCD,'t','e','s','t','!','\r','\n' }; +static const BYTE str_jap_utf8_bom[] = { 0xEF,0xBB,0xBF,0xE7,0xA7,0x81,0xE3,0x81,0xAF,'j','a','p','t','e','s','t','!','\r','\n' }; +static const BYTE str_jap_utf8_nobom[] = { 0xE7,0xA7,0x81,0xE3,0x81,0xAF,'j','a','p','t','e','s','t','!','\r','\n' }; +static const BYTE str_jap_utf16le_bom[] = { 0xFF,0xFE,0xC1,0x79,0x6F,0x30,'t',0,'e',0,'s',0,'t',0,'!',0,'\r',0,'\n',0 }; +static const BYTE str_jap_utf16le_nobom[] = { 0xC1,0x79,0x6F,0x30,'t',0,'e',0,'s',0,'t',0,'!',0 }; +static const BYTE str_jap_utf16be_bom[] = { 0xFE,0xFF,0x79,0xC1,0x30,0x6F,0,'t',0,'e',0,'s',0,'t',0,'!' }; +static const BYTE str_jap_utf16be_nobom[] = { 0x79,0xC1,0x30,0x6F,0,'t',0,'e',0,'s',0,'t',0,'!' }; +static const BYTE str_rus_utf8_bom[] = { 0xEF,0xBB,0xBF,0xD0,0xBF,0xD1,0x80,0xD0,0xB8,0xD0,0xB2,0xD0,0xB5,0xD1,0x82,0x20,'t','e','s','t','!','\r','\n' }; +static const BYTE str_rus_utf8_nobom[] = { 0xD0,0xBF,0xD1,0x80,0xD0,0xB8,0xD0,0xB2,0xD0,0xB5,0xD1,0x82,0x20,'t','e','s','t','!','\r','\n' }; +static const BYTE str_en_utf8_bom[] = { 0xEF,0xBB,0xBF,'e','n','t','e','s','t','\r','\n' }; +static const BYTE str_en_utf8_nobom[] = { 't','e','s','t','\r','\n' }; + +static const WCHAR wstr_quoted_test[] = { '"','t', 'e', 's', 't','"',0 }; +static const WCHAR wstr_quoted_watashi_utf8[] = {'"',0xE7,0xA7,0x81,'"' }; + + +static void test_unicode_support(void) +{ + /* Test unicode support on STDIN */ + + /* Test UTF-8 BOM */ + run_find_unicode(wstr_quoted_test, str_en_utf8_nobom, 0); + run_find_unicode(wstr_quoted_test, str_en_utf8_bom, 0); + + /* Test russian character */ + run_find_unicode(wstr_quoted_test, str_rus_utf8_bom, 0); + run_find_unicode(wstr_quoted_test, str_rus_utf8_nobom, 0); + + /* Test japanese characters */ + run_find_unicode(wstr_quoted_test, str_jap_utf8_nobom, 0); + run_find_unicode(wstr_quoted_test, str_jap_utf8_bom, 0); + run_find_unicode(wstr_quoted_test, str_jap_shiftjis, 0); + + /* Test unsupported encodings */ + run_find_stdin_bytes(wstr_quoted_test, str_jap_utf16le_nobom, str_empty, 1); + run_find_stdin_bytes(wstr_quoted_test, str_jap_utf16be_bom, str_empty, 1); + run_find_stdin_bytes(wstr_quoted_test, str_jap_utf16be_nobom, str_empty, 1); + + /* Test utf16le */ + run_find_unicode16(wstr_quoted_test, str_jap_utf16le_bom); + + /* Test unicode search parameter */ + run_find_unicode(wstr_quoted_watashi_utf8, str_empty, 1); + run_find_unicode(wstr_quoted_watashi_utf8, str_empty, 1); + run_find_unicode(wstr_quoted_watashi_utf8, str_empty, 1); +} + +START_TEST(find) +{ + if (PRIMARYLANGID(GetUserDefaultUILanguage()) != LANG_ENGLISH) + { + skip("Error tests only work with english locale.\n"); + } + else + { + todo_wine + test_errors(); + } + todo_wine + test_singleline_without_switches(); + todo_wine + test_multiline(); + todo_wine + test_unicode_support(); +} -- 2.19.1
[View Less]
2
1
0
0
[PATCH] kernel32: Use the ARRAY_SIZE() macro
by Michael Stefaniuc
14 Nov '18
14 Nov '18
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/kernel32/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 53b1b2d933..abf33df2a2 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -2553,7 +2553,7 @@ static BOOL create_cmd_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES if (!GetEnvironmentVariableW( comspecW, comspec, ARRAY_SIZE( comspec ))) { -
…
[View More]
GetSystemDirectoryW( comspec, (sizeof(comspec) - sizeof(cmdW))/sizeof(WCHAR) ); + GetSystemDirectoryW( comspec, ARRAY_SIZE( comspec ) - ARRAY_SIZE( cmdW )); strcatW( comspec, cmdW ); } if (!(newcmdline = HeapAlloc( GetProcessHeap(), 0, -- 2.14.5
[View Less]
1
0
0
0
[RFC v2] widl: Add option to generate classfactory
by Fabian Maurer
14 Nov '18
14 Nov '18
Since the com simplification with the macros is probably not feasible, here an approach that reuses an old idea - using widl to generate a classfactory. Feedback appreciated! --- dlls/uiribbon/main.c | 141 ---------------- dlls/uiribbon/uiribbon.c | 8 +- dlls/uiribbon/uiribbon_classes.idl | 1 + tools/makedep.c | 11 +- tools/widl/Makefile.in | 1 + tools/widl/factory.c | 250 +++++++++++++++++++++++++++++ tools/
…
[View More]
widl/parser.y | 1 + tools/widl/widl.c | 23 ++- tools/widl/widl.h | 3 + 9 files changed, 293 insertions(+), 146 deletions(-) create mode 100644 tools/widl/factory.c diff --git a/dlls/uiribbon/main.c b/dlls/uiribbon/main.c index a76c349ad9..b54644599f 100644 --- a/dlls/uiribbon/main.c +++ b/dlls/uiribbon/main.c @@ -56,147 +56,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } -typedef struct { - IClassFactory IClassFactory_iface; - - LONG ref; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, void **ppObj); -} IClassFactoryImpl; - -static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) -{ - return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); -} - -struct object_creation_info -{ - const CLSID *clsid; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, void **ppObj); -}; - -static const struct object_creation_info object_creation[] = -{ - { &CLSID_UIRibbonFramework, UIRibbonFrameworkImpl_Create }, -}; - -static HRESULT WINAPI XFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, void **ppobj) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IClassFactory)) - { - IClassFactory_AddRef(iface); - *ppobj = &This->IClassFactory_iface; - return S_OK; - } - - WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; -} - -static ULONG WINAPI XFCF_AddRef(LPCLASSFACTORY iface) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - return InterlockedIncrement(&This->ref); -} - -static ULONG WINAPI XFCF_Release(LPCLASSFACTORY iface) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - - ULONG ref = InterlockedDecrement(&This->ref); - - if (ref == 0) - HeapFree(GetProcessHeap(), 0, This); - - return ref; -} - -static HRESULT WINAPI XFCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, void **ppobj) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - HRESULT hres; - LPUNKNOWN punk; - - TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); - - *ppobj = NULL; - hres = This->pfnCreateInstance(pOuter, (void **) &punk); - if (SUCCEEDED(hres)) { - hres = IUnknown_QueryInterface(punk, riid, ppobj); - IUnknown_Release(punk); - } - return hres; -} - -static HRESULT WINAPI XFCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) -{ - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - FIXME("(%p)->(%d), stub!\n",This,dolock); - return S_OK; -} - -static const IClassFactoryVtbl XFCF_Vtbl = -{ - XFCF_QueryInterface, - XFCF_AddRef, - XFCF_Release, - XFCF_CreateInstance, - XFCF_LockServer -}; - -/******************************************************************************* - * Retrieves class object from a DLL object - * - * NOTES - * Docs say returns STDAPI - * - * PARAMS - * rclsid [I] CLSID for the class object - * riid [I] Reference to identifier of interface for class object - * ppv [O] Address of variable to receive interface pointer for riid - * - * RETURNS - * Success: S_OK - * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG, - * E_UNEXPECTED - */ -HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) -{ - unsigned int i; - IClassFactoryImpl *factory; - - TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - - if ( !IsEqualGUID( &IID_IClassFactory, riid ) - && ! IsEqualGUID( &IID_IUnknown, riid) ) - return E_NOINTERFACE; - - for (i = 0; i < ARRAY_SIZE(object_creation); i++) - { - if (IsEqualGUID(object_creation[i].clsid, rclsid)) - break; - } - - if (i == ARRAY_SIZE(object_creation)) - { - FIXME("%s: no class found.\n", debugstr_guid(rclsid)); - return CLASS_E_CLASSNOTAVAILABLE; - } - - factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory)); - if (factory == NULL) return E_OUTOFMEMORY; - - factory->IClassFactory_iface.lpVtbl = &XFCF_Vtbl; - factory->ref = 1; - - factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; - - *ppv = &(factory->IClassFactory_iface); - return S_OK; -} - HRESULT WINAPI DllCanUnloadNow(void) { return S_FALSE; diff --git a/dlls/uiribbon/uiribbon.c b/dlls/uiribbon/uiribbon.c index 58ac51aece..5385af5430 100644 --- a/dlls/uiribbon/uiribbon.c +++ b/dlls/uiribbon/uiribbon.c @@ -156,7 +156,7 @@ static const IUIFrameworkVtbl IUIFramework_Vtbl = UIRibbonFrameworkImpl_SetModes }; -HRESULT UIRibbonFrameworkImpl_Create(IUnknown *pUnkOuter, void **ppObj) +HRESULT UIRibbonFramework_Create(IUnknown *pUnkOuter, void **ppObj) { UIRibbonFrameworkImpl *object; @@ -173,3 +173,9 @@ HRESULT UIRibbonFrameworkImpl_Create(IUnknown *pUnkOuter, void **ppObj) return S_OK; } + +HRESULT UIRibbonImageFromBitmapFactory_Create(IUnknown *unk_outer, void **obj) +{ + FIXME("(%p, %p) - stub!\n", unk_outer, obj); + return E_FAIL; +} diff --git a/dlls/uiribbon/uiribbon_classes.idl b/dlls/uiribbon/uiribbon_classes.idl index bd8bdde6b6..78d79a13fc 100644 --- a/dlls/uiribbon/uiribbon_classes.idl +++ b/dlls/uiribbon/uiribbon_classes.idl @@ -17,5 +17,6 @@ */ #pragma makedep register +#pragma makedep factory #include "uiribbon.idl" diff --git a/tools/makedep.c b/tools/makedep.c index e3bb04ae82..8aa4d9e2fc 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -100,6 +100,7 @@ struct incl_file #define FLAG_RC_PO 0x010000 /* rc file contains translations */ #define FLAG_C_IMPLIB 0x020000 /* file is part of an import library */ #define FLAG_SFD_FONTS 0x040000 /* sfd file generated bitmap fonts */ +#define FLAG_IDL_FACTORY 0x080000 /* generates a factory (_f.c) file */ static const struct { @@ -114,7 +115,8 @@ static const struct { FLAG_IDL_PROXY, "_p.c" }, { FLAG_IDL_SERVER, "_s.c" }, { FLAG_IDL_REGISTER, "_r.res" }, - { FLAG_IDL_HEADER, ".h" } + { FLAG_IDL_HEADER, ".h" }, + { FLAG_IDL_FACTORY, "_f.c" } }; #define HASH_SIZE 997 @@ -996,6 +998,7 @@ static void parse_pragma_directive( struct file *source, char *str ) else if (!strcmp( flag, "typelib" )) source->flags |= FLAG_IDL_TYPELIB; else if (!strcmp( flag, "register" )) source->flags |= FLAG_IDL_REGISTER; else if (!strcmp( flag, "regtypelib" )) source->flags |= FLAG_IDL_REGTYPELIB; + else if (!strcmp( flag, "factory" )) source->flags |= FLAG_IDL_FACTORY; } else if (strendswith( source->name, ".rc" )) { @@ -1821,6 +1824,12 @@ static void add_generated_sources( struct makefile *make ) add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); add_all_includes( make, file, file->file ); } + if (source->file->flags & FLAG_IDL_FACTORY) + { + file = add_generated_source( make, replace_extension( source->name, ".idl", "_f.c" ), NULL ); + add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); + add_all_includes( make, file, file->file ); + } if (source->file->flags & FLAG_IDL_IDENT) { file = add_generated_source( make, replace_extension( source->name, ".idl", "_i.c" ), NULL ); diff --git a/tools/widl/Makefile.in b/tools/widl/Makefile.in index e06d6cc5b3..3e725a1c69 100644 --- a/tools/widl/Makefile.in +++ b/tools/widl/Makefile.in @@ -4,6 +4,7 @@ MANPAGES = widl.man.in C_SRCS = \ client.c \ expr.c \ + factory.c \ hash.c \ header.c \ proxy.c \ diff --git a/tools/widl/factory.c b/tools/widl/factory.c new file mode 100644 index 0000000000..4ed0459b20 --- /dev/null +++ b/tools/widl/factory.c @@ -0,0 +1,250 @@ +/* + * IDL Compiler + * + * Copyright 2018 Fabian Maurer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include <stdio.h> +#include <stdlib.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <string.h> +#include <ctype.h> + +#include "widl.h" +#include "utils.h" +#include "parser.h" +#include "header.h" + +#include "widltypes.h" +#include "typegen.h" +#include "expr.h" + +static FILE* factory; +static int indent = 0; + +static void print_factory( const char *format, ... ) __attribute__((format (printf, 1, 2))); +static void print_factory( const char *format, ... ) +{ + va_list va; + va_start(va, format); + print(factory, indent, format, va); + va_end(va); +} + +static void init_factory(void) +{ + if (factory) return; + if (!(factory = fopen(factory_name, "w"))) + error("Could not open %s for output\n", factory_name); + + print_factory("/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name); + print_factory("#define COBJMACROS\n"); + print_factory("#include \"%s\"\n", header_name); + print_factory("#include \"wine/debug.h\"\n"); + print_factory("\n"); + print_factory("WINE_DEFAULT_DEBUG_CHANNEL(classfactory);\n"); + print_factory("const char *source = \"%s\";", dup_basename(input_name, ".idl")); + print_factory("\n"); + print_factory("\n"); + +} + +static void write_class_array(const statement_list_t *stmts) +{ + const statement_t *stmt; + + /* Declare all functions which need to be provided for the factory */ + LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) + { + if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_COCLASS) + { + type_t *object = stmt->u.type; + print_factory("HRESULT %s_Create(IUnknown *unk_outer, void **obj);\n", object->name); + } + } + print_factory("\n"); + + + print_factory("struct object_creation_info\n"); + print_factory("{\n"); + print_factory(" const CLSID *clsid;\n"); + print_factory(" HRESULT (*pfnCreateInstance)(IUnknown *unk_outer, void **obj);\n"); + print_factory("};\n"); + print_factory("\n"); + + print_factory("static const struct object_creation_info object_creation[] =\n"); + print_factory("{\n"); + + LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) + { + if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_COCLASS) + { + type_t *object = stmt->u.type; + print_factory(" {&CLSID_%s, &%s_Create },\n", object->name, object->name); + } + } + print_factory("};\n"); +} + +void write_factory_methods(void) +{ + print_factory("typedef struct {\n"); + print_factory(" IClassFactory IClassFactory_iface;\n"); + print_factory(" LONG ref;\n"); + print_factory(" HRESULT (*pfnCreateInstance)(IUnknown *unk_outer, void **obj);\n"); + print_factory("} IClassFactoryImpl;\n"); + print_factory("\n"); + + print_factory("static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)\n"); + print_factory("{\n"); + print_factory(" return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static HRESULT WINAPI classfactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)\n"); + print_factory("{\n"); + print_factory(" IClassFactoryImpl *impl = impl_from_IClassFactory(iface);\n"); + print_factory("\n"); + print_factory(" if (IsEqualGUID(riid, &IID_IUnknown)\n"); + print_factory(" || IsEqualGUID(riid, &IID_IClassFactory))\n"); + print_factory(" {\n"); + print_factory(" IClassFactory_AddRef(iface);\n"); + print_factory(" *ppobj = &impl->IClassFactory_iface;\n"); + print_factory(" return S_OK;\n"); + print_factory(" }\n"); + print_factory("\n"); + print_factory(" WARN(\"%%s - (%%p)->(%%s,%%p),not found\\n\", source, impl, debugstr_guid(riid), ppobj);\n"); + print_factory(" return E_NOINTERFACE;\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static ULONG WINAPI classfactory_AddRef(IClassFactory *iface)\n"); + print_factory("{\n"); + print_factory(" IClassFactoryImpl *This = impl_from_IClassFactory(iface);\n"); + print_factory(" return InterlockedIncrement(&This->ref);\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static ULONG WINAPI classfactory_Release(IClassFactory *iface)\n"); + print_factory("{\n"); + print_factory(" IClassFactoryImpl *impl = impl_from_IClassFactory(iface);\n"); + print_factory(" ULONG ref = InterlockedDecrement(&impl->ref);\n"); + print_factory("\n"); + print_factory(" if (ref == 0)\n"); + print_factory(" HeapFree(GetProcessHeap(), 0, impl);\n"); + print_factory("\n"); + print_factory(" return ref;\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static HRESULT WINAPI classfactory_CreateInstance(IClassFactory *iface, IUnknown *outer_unk, REFIID riid, void **ppobj)\n"); + print_factory("{\n"); + print_factory(" IClassFactoryImpl *impl = impl_from_IClassFactory(iface);\n"); + print_factory(" HRESULT hres;\n"); + print_factory(" IUnknown *unk;\n"); + print_factory("\n"); + print_factory(" TRACE(\"%%s - (%%p)->(%%p,%%s,%%p)\\n\", source, impl, outer_unk, debugstr_guid(riid), ppobj);\n"); + print_factory("\n"); + print_factory(" *ppobj = NULL;\n"); + print_factory(" hres = impl->pfnCreateInstance(outer_unk, (void **) &unk);\n"); + print_factory(" if (SUCCEEDED(hres))\n"); + print_factory(" {\n"); + print_factory(" hres = IUnknown_QueryInterface(unk, riid, ppobj);\n"); + print_factory(" IUnknown_Release(unk);\n"); + print_factory(" }\n"); + print_factory(" return hres;\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static HRESULT WINAPI classfactory_LockServer(IClassFactory *iface, BOOL dolock)\n"); + print_factory("{\n"); + print_factory(" IClassFactoryImpl *impl = impl_from_IClassFactory(iface);\n"); + print_factory(" FIXME(\"%%s - (%%p)->(%%d), stub!\\n\", source, impl, dolock);\n"); + print_factory(" return S_OK;\n"); + print_factory("}\n"); + print_factory("\n"); + + print_factory("static const IClassFactoryVtbl classfactory_Vtbl =\n"); + print_factory("{\n"); + print_factory(" classfactory_QueryInterface,\n"); + print_factory(" classfactory_AddRef,\n"); + print_factory(" classfactory_Release,\n"); + print_factory(" classfactory_CreateInstance,\n"); + print_factory(" classfactory_LockServer\n"); + print_factory("};\n"); + print_factory("\n"); + + print_factory("HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)\n"); + print_factory("{\n"); + print_factory(" unsigned int i;\n"); + print_factory(" IClassFactoryImpl *factory;\n"); + print_factory("\n"); + print_factory(" TRACE(\"(%%s - %%s,%%s,%%p)\\n\", source, debugstr_guid(rclsid), debugstr_guid(riid), ppv);\n"); + print_factory("\n"); + print_factory(" if (!IsEqualGUID(&IID_IClassFactory, riid)\n"); + print_factory(" && !IsEqualGUID( &IID_IUnknown, riid))\n"); + print_factory(" return E_NOINTERFACE;\n"); + print_factory("\n"); + print_factory(" for (i = 0; i < ARRAY_SIZE(object_creation); i++)\n"); + print_factory(" {\n"); + print_factory(" if (IsEqualGUID(object_creation[i].clsid, rclsid))\n"); + print_factory(" break;\n"); + print_factory(" }\n"); + print_factory("\n"); + print_factory(" if (i == ARRAY_SIZE(object_creation))\n"); + print_factory(" {\n"); + print_factory(" FIXME(\"%%s - %%s: no class found.\\n\", source, debugstr_guid(rclsid));\n"); + print_factory(" return CLASS_E_CLASSNOTAVAILABLE;\n"); + print_factory(" }\n"); + print_factory("\n"); + print_factory(" factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory));\n"); + print_factory(" if (factory == NULL)\n"); + print_factory(" return E_OUTOFMEMORY;\n"); + print_factory("\n"); + print_factory(" factory->IClassFactory_iface.lpVtbl = &classfactory_Vtbl;\n"); + print_factory(" factory->ref = 1;\n"); + print_factory("\n"); + print_factory(" factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;\n"); + print_factory("\n"); + print_factory(" *ppv = &factory->IClassFactory_iface;\n"); + print_factory(" return S_OK;\n"); + print_factory("}\n"); +} + +void write_factory(const statement_list_t *stmts) +{ + + if (!do_factory) + return; + + if (!stmts) + return; + + init_factory(); + if (!factory) + return; + + write_class_array(stmts); + write_factory_methods(); + + fclose(factory); +} diff --git a/tools/widl/parser.y b/tools/widl/parser.y index d979394182..ed46b216d0 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -334,6 +334,7 @@ input: gbl_statements m_acf { fix_incomplete(); write_typelib_regscript($1); write_dlldata($1); write_local_stubs($1); + write_factory($1); } ; diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 410efb4c4c..6e10a5d092 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -58,6 +58,7 @@ static const char usage[] = " -d n Set debug level to 'n'\n" " -D id[=val] Define preprocessor identifier id=val\n" " -E Preprocess only\n" +" -f Generate class factory\n" " --help Display this help and exit\n" " -h Generate headers\n" " -H file Name of header file (default is infile.h)\n" @@ -111,6 +112,7 @@ int do_server = 0; int do_regscript = 0; int do_idfile = 0; int do_dlldata = 0; +int do_factory = 0; static int no_preprocess = 0; int old_names = 0; int do_win32 = 1; @@ -137,6 +139,7 @@ char *server_name; char *server_token; char *regscript_name; char *regscript_token; +char *factory_name; static char *idfile_name; char *temp_name; const char *prefix_client = ""; @@ -172,7 +175,7 @@ enum { }; static const char short_options[] = - "b:cC:d:D:EhH:I:m:No:O:pP:rsS:tT:uU:VW"; + "b:cC:d:D:EfhH:I:m:No:O:pP:rsS:tT:uU:VW"; static const struct option long_options[] = { { "acf", 1, NULL, ACF_OPTION }, { "app_config", 0, NULL, APP_CONFIG_OPTION }, @@ -319,6 +322,7 @@ static void set_everything(int x) do_regscript = x; do_idfile = x; do_dlldata = x; + do_factory = x; } void start_cplusplus_guard(FILE *fp) @@ -647,6 +651,10 @@ int main(int argc,char *argv[]) do_everything = 0; preprocess_only = 1; break; + case 'f': + do_everything = 0; + do_factory = 1; + break; case 'h': do_everything = 0; do_header = 1; @@ -725,7 +733,7 @@ int main(int argc,char *argv[]) /* if nothing specified, try to guess output type from the output file name */ if (output_name && do_everything && !do_header && !do_typelib && !do_proxies && - !do_client && !do_server && !do_regscript && !do_idfile && !do_dlldata) + !do_client && !do_server && !do_regscript && !do_idfile && !do_dlldata && !do_factory) { do_everything = 0; if (strendswith( output_name, ".h" )) do_header = 1; @@ -737,6 +745,7 @@ int main(int argc,char *argv[]) else if (strendswith( output_name, "_r.res" )) do_regscript = 1; else if (strendswith( output_name, "_t.res" )) do_typelib = 1; else if (strendswith( output_name, "dlldata.c" )) do_dlldata = 1; + else if (strendswith( output_name, "_f.c" )) do_factory = 1; else do_everything = 1; } @@ -747,7 +756,7 @@ int main(int argc,char *argv[]) if (!output_name) output_name = dup_basename(input_name, ".idl"); if (do_header + do_typelib + do_proxies + do_client + - do_server + do_regscript + do_idfile + do_dlldata == 1) + do_server + do_regscript + do_idfile + do_dlldata + do_factory == 1) { if (do_header) header_name = output_name; else if (do_typelib) typelib_name = output_name; @@ -757,6 +766,7 @@ int main(int argc,char *argv[]) else if (do_regscript) regscript_name = output_name; else if (do_idfile) idfile_name = output_name; else if (do_dlldata) dlldata_name = output_name; + else if (do_factory) factory_name = output_name; } if (!dlldata_name && do_dlldata) @@ -832,6 +842,11 @@ int main(int argc,char *argv[]) strcat(idfile_name, "_i.c"); } + if (!factory_name && do_factory) { + factory_name = dup_basename(input_name, ".idl"); + strcat(factory_name, "_f.c"); + } + if (do_proxies) proxy_token = dup_basename_token(proxy_name,"_p.c"); if (do_client) client_token = dup_basename_token(client_name,"_c.c"); if (do_server) server_token = dup_basename_token(server_name,"_s.c"); @@ -922,4 +937,6 @@ static void rm_tempfile(void) unlink(proxy_name); if (do_typelib) unlink(typelib_name); + if (do_factory) + unlink(factory_name); } diff --git a/tools/widl/widl.h b/tools/widl/widl.h index 118e2245c2..759a7b818e 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -44,6 +44,7 @@ extern int do_server; extern int do_regscript; extern int do_idfile; extern int do_dlldata; +extern int do_factory; extern int old_names; extern int do_win32; extern int do_win64; @@ -66,6 +67,7 @@ extern char *client_name; extern char *client_token; extern char *server_name; extern char *server_token; +extern char *factory_name; extern char *regscript_name; extern char *regscript_token; extern const char *prefix_client; @@ -94,6 +96,7 @@ extern void write_typelib_regscript(const statement_list_t *stmts); extern void output_typelib_regscript( const typelib_t *typelib ); extern void write_local_stubs(const statement_list_t *stmts); extern void write_dlldata(const statement_list_t *stmts); +extern void write_factory(const statement_list_t *stmts); extern void start_cplusplus_guard(FILE *fp); extern void end_cplusplus_guard(FILE *fp); -- 2.19.1
[View Less]
2
1
0
0
[PATCH] kernel32: Export RtlPcToFileHeader on ARM64
by André Hentschel
14 Nov '18
14 Nov '18
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46144
Signed-off-by: Andr� Hentschel <nerv(a)dawncrow.de> --- dlls/kernel32/kernel32.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 5490b07d8e..5c2e426130 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1294,7 +1294,7 @@ @ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr ptr) ntdll.
…
[View More]
RtlInstallFunctionTableCallback @ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry @ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory -@ stdcall -arch=x86_64,arm RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader +@ stdcall -arch=x86_64,arm,arm64 RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader @ stdcall -arch=arm -norelay RtlRaiseException(ptr) ntdll.RtlRaiseException @ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext @ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind -- 2.17.1
[View Less]
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
78
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
Results per page:
10
25
50
100
200