winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2018
----- 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
670 discussions
Start a n
N
ew thread
Alexandre Julliard : server: Move initial thread creation out of the create_process() function.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: af8f3ae3339336ff23acad5cdaf8d39812146e5d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=af8f3ae3339336ff23acad5c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 20 13:18:19 2018 +0200 server: Move initial thread creation out of the create_process() function. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/process.c | 55 +++++++++++++++++++------------------------------------ server/process.h | 2 +- server/request.c | 7 ++++++- server/thread.c | 18 ++++++++++++++++++ 4 files changed, 44 insertions(+), 38 deletions(-) diff --git a/server/process.c b/server/process.c index 8b808de..0698887 100644 --- a/server/process.c +++ b/server/process.c @@ -232,16 +232,6 @@ static void add_job_completion( struct job *job, apc_param_t msg, apc_param_t pi static void add_job_process( struct job *job, struct process *process ) { - if (!process->running_threads) - { - set_error( STATUS_PROCESS_IS_TERMINATING ); - return; - } - if (process->job) - { - set_error( STATUS_ACCESS_DENIED ); - return; - } process->job = (struct job *)grab_object( job ); list_add_tail( &job->process_list, &process->job_entry ); job->num_processes++; @@ -493,13 +483,11 @@ static void start_sigkill_timer( struct process *process ) process_died( process ); } -/* create a new process and its main thread */ +/* create a new process */ /* if the function fails the fd is closed */ -struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all ) +struct process *create_process( int fd, struct thread *parent_thread, int inherit_all ) { struct process *process; - struct thread *thread = NULL; - int request_pipe[2]; if (!(process = alloc_object( &process_ops ))) { @@ -577,24 +565,8 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit if (!token_assign_label( process->token, security_high_label_sid )) goto error; - /* create the main thread */ - if (pipe( request_pipe ) == -1) - { - file_set_error(); - goto error; - } - if (send_client_fd( process, request_pipe[1], SERVER_PROTOCOL_VERSION ) == -1) - { - close( request_pipe[0] ); - close( request_pipe[1] ); - goto error; - } - close( request_pipe[1] ); - if (!(thread = create_thread( request_pipe[0], process, NULL ))) goto error; - set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */ - release_object( process ); - return thread; + return process; error: if (process) release_object( process ); @@ -1090,7 +1062,7 @@ DECL_HANDLER(new_process) { struct startup_info *info; struct thread *thread; - struct process *process; + struct process *process = NULL; struct process *parent = current->process; int socket_fd = thread_get_inflight_fd( current, req->socket_fd ); @@ -1127,7 +1099,11 @@ DECL_HANDLER(new_process) if (!req->info_size) /* create an orphaned process */ { - create_process( socket_fd, NULL, 0 ); + if ((process = create_process( socket_fd, NULL, 0 ))) + { + create_thread( -1, process, NULL ); + release_object( process ); + } return; } @@ -1189,8 +1165,9 @@ DECL_HANDLER(new_process) #undef FIXUP_LEN } - if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done; - process = thread->process; + if (!(process = create_process( socket_fd, current, req->inherit_all ))) goto done; + if (!(thread = create_thread( -1, process, NULL ))) goto done; + process->startup_info = (struct startup_info *)grab_object( info ); if (parent->job @@ -1252,6 +1229,7 @@ DECL_HANDLER(new_process) reply->thandle = alloc_handle( parent, thread, req->thread_access, req->thread_attr ); done: + if (process) release_object( process ); release_object( info ); } @@ -1618,7 +1596,12 @@ DECL_HANDLER(assign_job) if ((process = get_process_from_handle( req->process, PROCESS_SET_QUOTA | PROCESS_TERMINATE ))) { - add_job_process( job, process ); + if (!process->running_threads) + set_error( STATUS_PROCESS_IS_TERMINATING ); + else if (process->job) + set_error( STATUS_ACCESS_DENIED ); + else + add_job_process( job, process ); release_object( process ); } release_object( job ); diff --git a/server/process.h b/server/process.h index f22c128..c9d00aa 100644 --- a/server/process.h +++ b/server/process.h @@ -114,7 +114,7 @@ struct process_snapshot extern unsigned int alloc_ptid( void *ptr ); extern void free_ptid( unsigned int id ); extern void *get_ptid_entry( unsigned int id ); -extern struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all ); +extern struct process *create_process( int fd, struct thread *parent_thread, int inherit_all ); extern data_size_t init_process( struct thread *thread ); extern struct thread *get_process_first_thread( struct process *process ); extern struct process *get_process_from_id( process_id_t id ); diff --git a/server/request.c b/server/request.c index 2dd84fb..40f532b8 100644 --- a/server/request.c +++ b/server/request.c @@ -571,12 +571,17 @@ static void master_socket_poll_event( struct fd *fd, int event ) } else if (event & POLLIN) { + struct process *process; struct sockaddr_un dummy; socklen_t len = sizeof(dummy); int client = accept( get_unix_fd( master_socket->fd ), (struct sockaddr *) &dummy, &len ); if (client == -1) return; fcntl( client, F_SETFL, O_NONBLOCK ); - create_process( client, NULL, 0 ); + if ((process = create_process( client, NULL, 0 ))) + { + create_thread( -1, process, NULL ); + release_object( process ); + } } } diff --git a/server/thread.c b/server/thread.c index 9ee846d..d671377 100644 --- a/server/thread.c +++ b/server/thread.c @@ -221,6 +221,24 @@ static inline int is_valid_address( client_ptr_t addr ) struct thread *create_thread( int fd, struct process *process, const struct security_descriptor *sd ) { struct thread *thread; + int request_pipe[2]; + + if (fd == -1) + { + if (pipe( request_pipe ) == -1) + { + file_set_error(); + return NULL; + } + if (send_client_fd( process, request_pipe[1], SERVER_PROTOCOL_VERSION ) == -1) + { + close( request_pipe[0] ); + close( request_pipe[1] ); + return NULL; + } + close( request_pipe[1] ); + fd = request_pipe[0]; + } if (process->is_terminating) {
1
0
0
0
Alexandre Julliard : server: Allow specifying the security descriptor for a new thread.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 4a328e08aca20a46ecbee634ffba873e0ab29b28 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4a328e08aca20a46ecbee634…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 20 13:06:12 2018 +0200 server: Allow specifying the security descriptor for a new thread. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/thread.c | 2 +- dlls/ntdll/thread.c | 20 +++++++++++++++++--- include/wine/server_protocol.h | 5 ++--- include/winternl.h | 2 +- server/process.c | 2 +- server/protocol.def | 2 +- server/request.h | 7 +++---- server/thread.c | 19 ++++++++++++++++--- server/thread.h | 3 ++- server/trace.c | 2 +- 10 files changed, 45 insertions(+), 19 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4a328e08aca20a46ecbe…
1
0
0
0
Alexandre Julliard : server: Align object attributes to a DWORD-boundary.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: be40b01c37fdda79bead85eb21ad3e8de961c55a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be40b01c37fdda79bead85eb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 20 12:59:32 2018 +0200 server: Align object attributes to a DWORD-boundary. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/sync.c | 2 ++ include/wine/server_protocol.h | 2 +- server/request.c | 9 ++++----- server/trace.c | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 8e406ce..bb462f2 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -114,6 +114,8 @@ NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_a } else if (attr->RootDirectory) return STATUS_OBJECT_NAME_INVALID; + len = (len + 3) & ~3; /* DWORD-align the entire structure */ + *ret = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); if (!*ret) return STATUS_NO_MEMORY; diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 0b61b91..24eb95b 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -6535,6 +6535,6 @@ union generic_reply struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 559 +#define SERVER_PROTOCOL_VERSION 560 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/request.c b/server/request.c index 77f4f71..2dd84fb 100644 --- a/server/request.c +++ b/server/request.c @@ -214,16 +214,15 @@ const struct object_attributes *get_req_object_attributes( const struct security /* return a pointer to the request data following an object attributes structure */ const void *get_req_data_after_objattr( const struct object_attributes *attr, data_size_t *len ) { - const void *ptr; + data_size_t size = (sizeof(*attr) + (attr->sd_len & ~1) + (attr->name_len & ~1) + 3) & ~3; - if (attr == &empty_attributes) + if (attr == &empty_attributes || size >= get_req_data_size()) { *len = 0; return NULL; } - ptr = (const WCHAR *)(attr + 1) + attr->sd_len / sizeof(WCHAR) + attr->name_len / sizeof(WCHAR); - *len = get_req_data_size() - ((const char *)ptr - (const char *)get_req_data()); - return ptr; + *len = get_req_data_size() - size; + return (const char *)get_req_data() + size; } /* write the remaining part of the reply */ diff --git a/server/trace.c b/server/trace.c index 3c0d592..1a28cac 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1119,8 +1119,7 @@ static void dump_varargs_object_attributes( const char *prefix, data_size_t size fprintf( stderr, ",name=L\"" ); dump_strW( str, objattr->name_len / sizeof(WCHAR), stderr, "\"\"" ); fputc( '\"', stderr ); - remove_data( ((sizeof(*objattr) + objattr->sd_len) / sizeof(WCHAR)) * sizeof(WCHAR) + - (objattr->name_len / sizeof(WCHAR)) * sizeof(WCHAR) ); + remove_data( (sizeof(*objattr) + (objattr->sd_len & ~1) + (objattr->name_len & ~1) + 3) & ~3 ); } fputc( '}', stderr ); }
1
0
0
0
Huw Davies : setupapi: For consistency use __x86_64__ instead of __x86_64.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: a6d89db61566b5dcccd66cb1cb5a51dfa0cc0f0a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6d89db61566b5dcccd66cb1…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu Sep 20 10:16:05 2018 +0100 setupapi: For consistency use __x86_64__ instead of __x86_64. Spotted by Ken Thomases. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/install.c | 2 +- dlls/setupapi/query.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c index 5b2d4b8..1453f52 100644 --- a/dlls/setupapi/install.c +++ b/dlls/setupapi/install.c @@ -1200,7 +1200,7 @@ void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle, LPCWSTR cmdline, I { #ifdef __i386__ static const WCHAR nt_platformW[] = {'.','n','t','x','8','6',0}; -#elif defined(__x86_64) +#elif defined(__x86_64__) static const WCHAR nt_platformW[] = {'.','n','t','a','m','d','6','4',0}; #else /* FIXME: other platforms */ static const WCHAR nt_platformW[] = {'.','n','t',0}; diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index 627c543..ba6d01d 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -38,7 +38,7 @@ static const WCHAR source_disks_names_platform[] = {'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s','.','x','8','6',0}; static const WCHAR source_disks_files_platform[] = {'S','o','u','r','c','e','D','i','s','k','s','F','i','l','e','s','.','x','8','6',0}; -#elif defined(__x86_64) +#elif defined(__x86_64__) static const WCHAR source_disks_names_platform[] = {'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s','.','a','m','d','6','4',0}; static const WCHAR source_disks_files_platform[] =
1
0
0
0
Nikolay Sivov : opcservices: Fix relationship stream names.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 1b55ac75097a436d460c17b20bf558ac0edd2460 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b55ac75097a436d460c17b2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Sep 20 10:09:15 2018 +0300 opcservices: Fix relationship stream names. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/package.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index 22bf793..d7467a5 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -1888,7 +1888,10 @@ static HRESULT opc_package_write_rels(struct zip_archive *archive, IOpcRelations if (SUCCEEDED(hr)) hr = IOpcPartUri_GetRawUri(rels_uri, &rels_part_uri); if (SUCCEEDED(hr)) - hr = compress_add_file(archive, rels_part_uri, content, OPC_COMPRESSION_NORMAL); + { + /* Relationship part names always start with root '/', skip it. */ + hr = compress_add_file(archive, rels_part_uri + 1, content, OPC_COMPRESSION_NORMAL); + } SysFreeString(rels_part_uri); IStream_Release(content);
1
0
0
0
Nikolay Sivov : opcservices: Initialize archive write position.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: f5156fd44412a5bb89c4e1393acbe7b713209f8b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f5156fd44412a5bb89c4e139…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Sep 20 10:09:14 2018 +0300 opcservices: Initialize archive write position. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/compress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/opcservices/compress.c b/dlls/opcservices/compress.c index 0f4555b..cf49f17 100644 --- a/dlls/opcservices/compress.c +++ b/dlls/opcservices/compress.c @@ -134,6 +134,7 @@ HRESULT compress_create_archive(IStream *output, struct zip_archive **out) archive->output = output; IStream_AddRef(archive->output); + archive->position = 0; GetSystemTimeAsFileTime(&ft); FileTimeToDosDateTime(&ft, &date, &time);
1
0
0
0
Nikolay Sivov : opcservices: Enforce unique relationship id.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 5efe50e4d9b75b12c3255bcb3f195aa33a8d9cfd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5efe50e4d9b75b12c3255bcb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Sep 20 10:09:13 2018 +0300 opcservices: Enforce unique relationship id. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/package.c | 44 ++++++++++++++++++++++-------------- dlls/opcservices/tests/opcservices.c | 12 +++++++--- include/opcbase.idl | 1 + 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index e526ebf..22bf793 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -1160,6 +1160,20 @@ static const IOpcRelationshipVtbl opc_relationship_vtbl = opc_relationship_GetTargetMode, }; +static struct opc_relationship *opc_relationshipset_get_rel(struct opc_relationship_set *relationship_set, + const WCHAR *id) +{ + size_t i; + + for (i = 0; i < relationship_set->count; i++) + { + if (!strcmpW(id, relationship_set->relationships[i]->id)) + return relationship_set->relationships[i]; + } + + return NULL; +} + static HRESULT opc_relationship_create(struct opc_relationship_set *set, const WCHAR *id, const WCHAR *type, IUri *target_uri, OPC_URI_TARGET_MODE target_mode, IOpcRelationship **out) { @@ -1179,7 +1193,6 @@ static HRESULT opc_relationship_create(struct opc_relationship_set *set, const W relationship->source_uri = set->source_uri; IOpcUri_AddRef(relationship->source_uri); - /* FIXME: test that id is unique */ if (id) relationship->id = opc_strdupW(id); else @@ -1190,8 +1203,16 @@ static HRESULT opc_relationship_create(struct opc_relationship_set *set, const W static const WCHAR fmtW[] = {'R','%','0','8','X',0}; DWORD generated; + /* FIXME: test that generated id is unique */ RtlGenRandom(&generated, sizeof(generated)); sprintfW(relationship->id, fmtW, generated); + + if (opc_relationshipset_get_rel(set, relationship->id)) + { + WARN("Newly generated id %s already exists.\n", debugstr_w(relationship->id)); + IOpcRelationship_Release(&relationship->IOpcRelationship_iface); + return E_FAIL; + } } } @@ -1258,20 +1279,6 @@ static ULONG WINAPI opc_relationship_set_Release(IOpcRelationshipSet *iface) return refcount; } -static struct opc_relationship *opc_relationshipset_get_item(struct opc_relationship_set *relationship_set, - const WCHAR *id) -{ - size_t i; - - for (i = 0; i < relationship_set->count; i++) - { - if (!strcmpW(id, relationship_set->relationships[i]->id)) - return relationship_set->relationships[i]; - } - - return NULL; -} - static HRESULT WINAPI opc_relationship_set_GetRelationship(IOpcRelationshipSet *iface, const WCHAR *id, IOpcRelationship **relationship) { @@ -1288,7 +1295,7 @@ static HRESULT WINAPI opc_relationship_set_GetRelationship(IOpcRelationshipSet * if (!id) return E_POINTER; - if ((ret = opc_relationshipset_get_item(relationship_set, id))) + if ((ret = opc_relationshipset_get_rel(relationship_set, id))) { *relationship = &ret->IOpcRelationship_iface; IOpcRelationship_AddRef(*relationship); @@ -1314,6 +1321,9 @@ static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSe if (!type || !target_uri) return E_POINTER; + if (id && opc_relationshipset_get_rel(relationship_set, id)) + return OPC_E_DUPLICATE_RELATIONSHIP; + if (IUri_GetPropertyLength(target_uri, Uri_PROPERTY_SCHEME_NAME, &length, 0) == S_OK && length != 0 && target_mode == OPC_URI_TARGET_MODE_INTERNAL) return OPC_E_INVALID_RELATIONSHIP_TARGET; @@ -1337,7 +1347,7 @@ static HRESULT WINAPI opc_relationship_set_RelationshipExists(IOpcRelationshipSe if (!id || !exists) return E_POINTER; - *exists = opc_relationshipset_get_item(relationship_set, id) != NULL; + *exists = opc_relationshipset_get_rel(relationship_set, id) != NULL; return S_OK; } diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index c5c8ee2..2ef5677 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -384,14 +384,20 @@ static void test_relationship(void) hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); - hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel2); - ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); - /* Autogenerated relationship id */ hr = IOpcRelationship_GetId(rel, &id); ok(SUCCEEDED(hr), "Failed to get id, hr %#x.\n", hr); ok(lstrlenW(id) == 9 && *id == 'R', "Unexpected relationship id %s.\n", wine_dbgstr_w(id)); + hr = IOpcRelationshipSet_CreateRelationship(rels, id, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(hr == OPC_E_DUPLICATE_RELATIONSHIP, "Failed to create relationship, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(rels, id, typeW, target_uri2, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(hr == OPC_E_DUPLICATE_RELATIONSHIP, "Failed to create relationship, hr %#x.\n", hr); + + hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel2); + ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr); + ret = 123; hr = IOpcRelationshipSet_RelationshipExists(rels, NULL, &ret); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); diff --git a/include/opcbase.idl b/include/opcbase.idl index d850753..3df2df8 100644 --- a/include/opcbase.idl +++ b/include/opcbase.idl @@ -45,6 +45,7 @@ cpp_quote("#define OPC_E_NONCONFORMING_URI MAKE_HRESULT(SEVERITY_ERROR, FACILITY cpp_quote("#define OPC_E_RELATIONSHIP_URI_REQUIRED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x3)") cpp_quote("#define OPC_E_DUPLICATE_PART MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0xb)") cpp_quote("#define OPC_E_INVALID_RELATIONSHIP_TARGET MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x12)") +cpp_quote("#define OPC_E_DUPLICATE_RELATIONSHIP MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x13)") cpp_quote("#define OPC_E_NO_SUCH_PART MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x18)") cpp_quote("#define OPC_E_NO_SUCH_RELATIONSHIP MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x48)") cpp_quote("#define OPC_E_ENUM_COLLECTION_CHANGED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_OPC, 0x50)")
1
0
0
0
Nikolay Sivov : opcservices: Improve parameter validation in CreateRelationship().
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 65aa7242d27081becc47add43072a023c8c972ae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65aa7242d27081becc47add4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Sep 20 10:09:12 2018 +0300 opcservices: Improve parameter validation in CreateRelationship(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/opcservices/package.c | 10 ++++++++++ dlls/opcservices/tests/opcservices.c | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index 074f3c8..e526ebf 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -1301,13 +1301,23 @@ static HRESULT WINAPI opc_relationship_set_CreateRelationship(IOpcRelationshipSe const WCHAR *type, IUri *target_uri, OPC_URI_TARGET_MODE target_mode, IOpcRelationship **relationship) { struct opc_relationship_set *relationship_set = impl_from_IOpcRelationshipSet(iface); + DWORD length; TRACE("iface %p, id %s, type %s, target_uri %p, target_mode %d, relationship %p.\n", iface, debugstr_w(id), debugstr_w(type), target_uri, target_mode, relationship); + if (!relationship) + return E_POINTER; + + *relationship = NULL; + if (!type || !target_uri) return E_POINTER; + if (IUri_GetPropertyLength(target_uri, Uri_PROPERTY_SCHEME_NAME, &length, 0) == S_OK && length != 0 + && target_mode == OPC_URI_TARGET_MODE_INTERNAL) + return OPC_E_INVALID_RELATIONSHIP_TARGET; + return opc_relationship_create(relationship_set, id, type, target_uri, target_mode, relationship); } diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index 764dca1..c5c8ee2 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -362,21 +362,24 @@ static void test_relationship(void) hr = IOpcPackage_GetRelationshipSet(package, &rels); ok(SUCCEEDED(hr), "Failed to get part set, hr %#x.\n", hr); + rel = (void *)0xdeadbeef; hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, NULL, NULL, OPC_URI_TARGET_MODE_INTERNAL, &rel); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(rel == NULL, "Unexpected instance %p.\n", rel); + rel = (void *)0xdeadbeef; hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, NULL, OPC_URI_TARGET_MODE_INTERNAL, &rel); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(rel == NULL, "Unexpected instance %p.\n", rel); hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, NULL, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); /* Absolute target uri with internal mode */ + rel = (void *)0xdeadbeef; hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri2, OPC_URI_TARGET_MODE_INTERNAL, &rel); -todo_wine ok(hr == OPC_E_INVALID_RELATIONSHIP_TARGET, "Unexpected hr %#x.\n", hr); - if (hr == S_OK) - IOpcRelationship_Release(rel); + ok(rel == NULL, "Unexpected instance %p.\n", rel); hr = IOpcRelationshipSet_CreateRelationship(rels, NULL, typeW, target_uri, OPC_URI_TARGET_MODE_INTERNAL, &rel); ok(SUCCEEDED(hr), "Failed to create relationship, hr %#x.\n", hr);
1
0
0
0
Alex Henrie : wmp/tests: Destroy the window before calling CoUninitialize.
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 6878cbf51ce032657801f21558e7b8df4bd886ef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6878cbf51ce032657801f215…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 19 22:17:00 2018 -0600 wmp/tests: Destroy the window before calling CoUninitialize. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmp/tests/oleobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index 2250b75..deac5cd 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -1379,11 +1379,11 @@ static void create_container_window(void) START_TEST(oleobj) { - create_container_window(); CoInitialize(NULL); + create_container_window(); test_wmp(); - CoUninitialize(); DestroyWindow(container_hwnd); + CoUninitialize(); }
1
0
0
0
Henri Verbeet : wined3d: Disallow creating devices without adapters in wined3d_device_create().
by Alexandre Julliard
20 Sep '18
20 Sep '18
Module: wine Branch: master Commit: 859c1d26ce5ee52373ee3f0af63d65a4fff33b3b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=859c1d26ce5ee52373ee3f0a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Sep 20 02:48:47 2018 +0430 wined3d: Disallow creating devices without adapters in wined3d_device_create(). These days, we have an adapter even with WINED3D_NO3D. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index d1d80b8..b6c6ecb 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2438,12 +2438,11 @@ HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx, e struct wined3d_device *object; HRESULT hr; - TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, surface_alignment %u, device_parent %p, device %p.\n", + TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, " + "flags %#x, surface_alignment %u, device_parent %p, device %p.\n", wined3d, adapter_idx, device_type, focus_window, flags, surface_alignment, device_parent, device); - /* Validate the adapter number. If no adapters are available(no GL), ignore the adapter - * number and create a device without a 3D adapter for 2D only operation. */ - if (wined3d->adapter_count && adapter_idx >= wined3d->adapter_count) + if (adapter_idx >= wined3d->adapter_count) return WINED3DERR_INVALIDCALL; if (!(object = heap_alloc_zero(sizeof(*object))))
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
67
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
Results per page:
10
25
50
100
200