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
October 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1032 discussions
Start a n
N
ew thread
Mikołaj Zalewski : user32: Send a WM_MOUSELEAVE even if another window calls TrackMouseEvent before the timer proc is called .
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: a82b96f1b557c92b32a6b82bbe5ccaab70792236 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a82b96f1b557c92b32a6b82bb…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Mon Oct 16 17:37:40 2006 +0200 user32: Send a WM_MOUSELEAVE even if another window calls TrackMouseEvent before the timer proc is called. --- dlls/user/input.c | 73 ++++++++++++++++++++++++++++++----------------------- 1 files changed, 42 insertions(+), 31 deletions(-) diff --git a/dlls/user/input.c b/dlls/user/input.c index 28930ee..2c3d38c 100644 --- a/dlls/user/input.c +++ b/dlls/user/input.c @@ -758,6 +758,41 @@ typedef struct __TRACKINGLIST { static _TRACKINGLIST tracking_info; static UINT_PTR timer; +static void check_mouse_leave(HWND hwnd, int hittest) +{ + if (tracking_info.tme.hwndTrack != hwnd) + { + if (tracking_info.tme.dwFlags & TME_NONCLIENT) + PostMessageW(tracking_info.tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0); + else + PostMessageW(tracking_info.tme.hwndTrack, WM_MOUSELEAVE, 0, 0); + + /* remove the TME_LEAVE flag */ + tracking_info.tme.dwFlags &= ~TME_LEAVE; + } + else + { + if (hittest == HTCLIENT) + { + if (tracking_info.tme.dwFlags & TME_NONCLIENT) + { + PostMessageW(tracking_info.tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0); + /* remove the TME_LEAVE flag */ + tracking_info.tme.dwFlags &= ~TME_LEAVE; + } + } + else + { + if (!(tracking_info.tme.dwFlags & TME_NONCLIENT)) + { + PostMessageW(tracking_info.tme.hwndTrack, WM_MOUSELEAVE, 0, 0); + /* remove the TME_LEAVE flag */ + tracking_info.tme.dwFlags &= ~TME_LEAVE; + } + } + } +} + static void CALLBACK TrackMouseEventProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { @@ -782,37 +817,7 @@ static void CALLBACK TrackMouseEventProc /* mouse has left the window */ if (tracking_info.tme.dwFlags & TME_LEAVE) { - if (tracking_info.tme.hwndTrack != hwnd) - { - if (tracking_info.tme.dwFlags & TME_NONCLIENT) - PostMessageW(tracking_info.tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0); - else - PostMessageW(tracking_info.tme.hwndTrack, WM_MOUSELEAVE, 0, 0); - - /* remove the TME_LEAVE flag */ - tracking_info.tme.dwFlags &= ~TME_LEAVE; - } - else - { - if (hittest == HTCLIENT) - { - if (tracking_info.tme.dwFlags & TME_NONCLIENT) - { - PostMessageW(tracking_info.tme.hwndTrack, WM_NCMOUSELEAVE, 0, 0); - /* remove the TME_LEAVE flag */ - tracking_info.tme.dwFlags &= ~TME_LEAVE; - } - } - else - { - if (!(tracking_info.tme.dwFlags & TME_NONCLIENT)) - { - PostMessageW(tracking_info.tme.hwndTrack, WM_MOUSELEAVE, 0, 0); - /* remove the TME_LEAVE flag */ - tracking_info.tme.dwFlags &= ~TME_LEAVE; - } - } - } + check_mouse_leave(hwnd, hittest); } if (tracking_info.tme.hwndTrack != hwnd) @@ -950,6 +955,12 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) } } } else { + /* In our implementation it's possible that another window will receive a + * WM_MOUSEMOVE and call TrackMouseEvent before TrackMouseEventProc is + * called. In such a situation post the WM_MOUSELEAVE now */ + if (tracking_info.tme.dwFlags & TME_LEAVE && tracking_info.tme.hwndTrack != NULL) + check_mouse_leave(hwnd, hittest); + if (timer) { KillSystemTimer(tracking_info.tme.hwndTrack, timer);
1
0
0
0
Robert Shearman : kernel32: Add support for detecting the user locale preference from the system on Mac OS X .
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: ed263ae48ebecf280314f3d5163829a2fbbb386a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ed263ae48ebecf280314f3d51…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 16:46:46 2006 +0100 kernel32: Add support for detecting the user locale preference from the system on Mac OS X. --- dlls/kernel32/locale.c | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 9864427..0d68edc 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -31,6 +31,11 @@ #include <stdio.h> #include <ctype.h> #include <stdlib.h> +#ifdef __APPLE__ +# include <CoreFoundation/CFLocale.h> +# include <CoreFoundation/CFString.h> +#endif + #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" @@ -505,10 +510,20 @@ static LCID get_env_lcid( UINT *unix_cp, { char *buf, *lang,*country,*charset,*dialect,*next; LCID ret = 0; + char user_locale[50] = { 0 }; +#ifdef __APPLE__ + CFLocaleRef user_locale_ref = CFLocaleCopyCurrent(); + CFStringRef user_locale_string_ref = CFLocaleGetIdentifier(user_locale_ref); + + CFStringGetCString(user_locale_string_ref, user_locale, + sizeof(user_locale), kCFStringEncodingUTF8); + CFRelease(user_locale_ref); +#endif if (((lang = getenv( "LC_ALL" )) && *lang) || (env_str && (lang = getenv( env_str )) && *lang) || - ((lang = getenv( "LANG" )) && *lang)) + ((lang = getenv( "LANG" )) && *lang) || + ((lang = user_locale) && *lang)) { if (!strcmp(lang,"POSIX") || !strcmp(lang,"C")) goto done; @@ -545,6 +560,10 @@ static LCID get_env_lcid( UINT *unix_cp, else FIXME("charset %s was not recognized\n", charset); } +#ifdef __APPLE__ + /* charset on Mac OS X is always UTF8 */ + else if (unix_cp) *unix_cp = CP_UTF8; +#endif lang=next; } while (lang && !ret);
1
0
0
0
Robert Shearman : rpcrt4: Add a critical section to protect the connection list in each
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 2f6e643d567d2d16f0334cf42597d6027fa893a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f6e643d567d2d16f0334cf42…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 17:01:27 2006 +0100 rpcrt4: Add a critical section to protect the connection list in each protseq to avoid taking the process-wide server_cs in the hot path for each protocol. --- dlls/rpcrt4/rpc_server.c | 21 +++++++++++++++------ dlls/rpcrt4/rpc_server.h | 14 ++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index da71ab6..54e270b 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -374,6 +374,8 @@ static void *rpcrt4_protseq_np_get_wait_ RpcConnection* conn; RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); + EnterCriticalSection(&protseq->cs); + /* open and count connections */ *count = 1; conn = protseq->conn; @@ -392,6 +394,7 @@ static void *rpcrt4_protseq_np_get_wait_ if (!objs) { ERR("couldn't allocate objs\n"); + LeaveCriticalSection(&protseq->cs); return NULL; } @@ -403,6 +406,7 @@ static void *rpcrt4_protseq_np_get_wait_ (*count)++; conn = conn->Next; } + LeaveCriticalSection(&protseq->cs); return objs; } @@ -434,7 +438,7 @@ static int rpcrt4_protseq_np_wait_for_ne { b_handle = objs[res - WAIT_OBJECT_0]; /* find which connection got a RPC */ - EnterCriticalSection(&server_cs); + EnterCriticalSection(&protseq->cs); conn = protseq->conn; while (conn) { if (b_handle == rpcrt4_conn_get_wait_object(conn)) break; @@ -445,7 +449,7 @@ static int rpcrt4_protseq_np_wait_for_ne RPCRT4_SpawnConnection(&cconn, conn); else ERR("failed to locate connection for handle %p\n", b_handle); - LeaveCriticalSection(&server_cs); + LeaveCriticalSection(&protseq->cs); if (cconn) { RPCRT4_new_client(cconn); @@ -504,9 +508,7 @@ static DWORD CALLBACK RPCRT4_server_thre TRACE("(the_arg == ^%p)\n", the_arg); for (;;) { - EnterCriticalSection(&server_cs); objs = cps->ops->get_wait_array(cps, objs, &count); - LeaveCriticalSection(&server_cs); if (set_ready_event) { @@ -530,14 +532,14 @@ static DWORD CALLBACK RPCRT4_server_thre } } cps->ops->free_wait_array(cps, objs); - EnterCriticalSection(&server_cs); + EnterCriticalSection(&cps->cs); /* close connections */ conn = cps->conn; while (conn) { RPCRT4_CloseConnection(conn); conn = conn->Next; } - LeaveCriticalSection(&server_cs); + LeaveCriticalSection(&cps->cs); return 0; } @@ -600,6 +602,7 @@ static RPC_STATUS RPCRT4_start_listen(BO if (std_listen) { + EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) { status = RPCRT4_start_listen_protseq(cps, TRUE); @@ -610,6 +613,7 @@ static RPC_STATUS RPCRT4_start_listen(BO * returning */ RPCRT4_sync_with_server_thread(cps); } + LeaveCriticalSection(&server_cs); } return status; @@ -678,11 +682,13 @@ RPC_STATUS WINAPI RpcServerInqBindings( /* count connections */ count = 0; LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { + EnterCriticalSection(&ps->cs); conn = ps->conn; while (conn) { count++; conn = conn->Next; } + LeaveCriticalSection(&ps->cs); } if (count) { /* export bindings */ @@ -692,6 +698,7 @@ RPC_STATUS WINAPI RpcServerInqBindings( (*BindingVector)->Count = count; count = 0; LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { + EnterCriticalSection(&ps->cs); conn = ps->conn; while (conn) { RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count], @@ -699,6 +706,7 @@ RPC_STATUS WINAPI RpcServerInqBindings( count++; conn = conn->Next; } + LeaveCriticalSection(&ps->cs); } status = RPC_S_OK; } else { @@ -763,6 +771,7 @@ static RpcServerProtseq *alloc_serverpro ps->ops = ops; ps->MaxCalls = 0; ps->conn = NULL; + InitializeCriticalSection(&ps->cs); ps->is_listening = FALSE; ps->mgr_mutex = NULL; ps->server_ready_event = NULL; diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index b2ad8f8..a93bcd1 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -28,15 +28,17 @@ struct protseq_ops; typedef struct _RpcServerProtseq { - const struct protseq_ops *ops; - struct list entry; - LPSTR Protseq; - LPSTR Endpoint; + const struct protseq_ops *ops; /* RO */ + struct list entry; /* CS ::server_cs */ + LPSTR Protseq; /* RO */ + LPSTR Endpoint; /* RO */ UINT MaxCalls; - RpcConnection* conn; + /* list of listening connections */ + RpcConnection* conn; /* CS cs */ + CRITICAL_SECTION cs; /* is the server currently listening? */ - BOOL is_listening; + BOOL is_listening; /* CS ::listen_cs */ /* mutex for ensuring only one thread can change state at a time */ HANDLE mgr_mutex; /* set when server thread has finished opening connections */
1
0
0
0
Robert Shearman : rpcrt4: Convert the protseq list into a standard Wine list.
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 9ea03d70775bc08eecf5fb397a2eb258b17261c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ea03d70775bc08eecf5fb397…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 16:49:29 2006 +0100 rpcrt4: Convert the protseq list into a standard Wine list. --- dlls/rpcrt4/rpc_server.c | 33 +++++++++++++-------------------- dlls/rpcrt4/rpc_server.h | 3 ++- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index b613def..da71ab6 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -66,7 +66,8 @@ typedef struct _RpcObjTypeMap static RpcObjTypeMap *RpcObjTypeMaps; -static RpcServerProtseq* protseqs; +/* list of type RpcServerProtseq */ +static struct list protseqs = LIST_INIT(protseqs); static RpcServerInterface* ifs; static CRITICAL_SECTION server_cs; @@ -599,16 +600,15 @@ static RPC_STATUS RPCRT4_start_listen(BO if (std_listen) { - cps = protseqs; - while (cps && status == RPC_S_OK) + LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) { status = RPCRT4_start_listen_protseq(cps, TRUE); + if (status != RPC_S_OK) + break; /* make sure server is actually listening on the interface before - * returning */ - if (status == RPC_S_OK) - RPCRT4_sync_with_server_thread(cps); - cps = cps->Next; + * returning */ + RPCRT4_sync_with_server_thread(cps); } } @@ -626,11 +626,9 @@ static void RPCRT4_stop_listen(BOOL auto std_listen = FALSE; LeaveCriticalSection(&listen_cs); - cps = protseqs; - while (cps) { + LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) RPCRT4_sync_with_server_thread(cps); - cps = cps->Next; - } + return; } assert(listen_count >= 0); @@ -648,8 +646,7 @@ static RPC_STATUS RPCRT4_use_protseq(Rpc return status; EnterCriticalSection(&server_cs); - ps->Next = protseqs; - protseqs = ps; + list_add_head(&protseqs, &ps->entry); LeaveCriticalSection(&server_cs); if (std_listen) @@ -680,14 +677,12 @@ RPC_STATUS WINAPI RpcServerInqBindings( EnterCriticalSection(&server_cs); /* count connections */ count = 0; - ps = protseqs; - while (ps) { + LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { conn = ps->conn; while (conn) { count++; conn = conn->Next; } - ps = ps->Next; } if (count) { /* export bindings */ @@ -696,8 +691,7 @@ RPC_STATUS WINAPI RpcServerInqBindings( sizeof(RPC_BINDING_HANDLE)*(count-1)); (*BindingVector)->Count = count; count = 0; - ps = protseqs; - while (ps) { + LIST_FOR_EACH_ENTRY(ps, &protseqs, RpcServerProtseq, entry) { conn = ps->conn; while (conn) { RPCRT4_MakeBinding((RpcBinding**)&(*BindingVector)->BindingH[count], @@ -705,7 +699,6 @@ RPC_STATUS WINAPI RpcServerInqBindings( count++; conn = conn->Next; } - ps = ps->Next; } status = RPC_S_OK; } else { @@ -1022,7 +1015,7 @@ RPC_STATUS WINAPI RpcServerListen( UINT TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait); - if (!protseqs) + if (list_empty(&protseqs)) return RPC_S_NO_PROTSEQS_REGISTERED; status = RPCRT4_start_listen(FALSE); diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index 9452ace..b2ad8f8 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -22,13 +22,14 @@ #ifndef __WINE_RPC_SERVER_H #define __WINE_RPC_SERVER_H #include "rpc_binding.h" +#include "wine/list.h" struct protseq_ops; typedef struct _RpcServerProtseq { const struct protseq_ops *ops; - struct _RpcServerProtseq* Next; + struct list entry; LPSTR Protseq; LPSTR Endpoint; UINT MaxCalls;
1
0
0
0
Robert Shearman : rpcrt4: Abstract out the way incoming connections are waited for so that we no longer need to wait on Win32 handles .
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 1ceeb058e37ee6e3aeb7e6d37c7a68aa8d92e9a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ceeb058e37ee6e3aeb7e6d37…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 16:48:57 2006 +0100 rpcrt4: Abstract out the way incoming connections are waited for so that we no longer need to wait on Win32 handles. --- dlls/rpcrt4/rpc_server.c | 220 +++++++++++++++++++++++++++++++++++----------- dlls/rpcrt4/rpc_server.h | 18 +++- 2 files changed, 183 insertions(+), 55 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 4d034ba..b613def 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -347,45 +347,164 @@ static void RPCRT4_new_client(RpcConnect CloseHandle( thread ); } -static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) +typedef struct _RpcServerProtseq_np { - HANDLE m_event, b_handle; - HANDLE *objs = NULL; - DWORD count, res; - RpcServerProtseq* cps = the_arg; - RpcConnection* conn; - RpcConnection* cconn; - BOOL set_ready_event = FALSE; + RpcServerProtseq common; + HANDLE mgr_event; +} RpcServerProtseq_np; - TRACE("(the_arg == ^%p)\n", the_arg); +static RpcServerProtseq *rpcrt4_protseq_np_alloc(void) +{ + RpcServerProtseq_np *ps = HeapAlloc(GetProcessHeap(), 0, sizeof(*ps)); + if (ps) + ps->mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); + return &ps->common; +} + +static void rpcrt4_protseq_np_signal_state_changed(RpcServerProtseq *protseq) +{ + RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); + SetEvent(npps->mgr_event); +} - m_event = cps->mgr_event; +static void *rpcrt4_protseq_np_get_wait_array(RpcServerProtseq *protseq, void *prev_array, unsigned int *count) +{ + HANDLE *objs = prev_array; + RpcConnection* conn; + RpcServerProtseq_np *npps = CONTAINING_RECORD(protseq, RpcServerProtseq_np, common); - for (;;) { - EnterCriticalSection(&server_cs); /* open and count connections */ - count = 1; - conn = cps->conn; + *count = 1; + conn = protseq->conn; while (conn) { - RPCRT4_OpenConnection(conn); - if (rpcrt4_conn_get_wait_object(conn)) - count++; - conn = conn->Next; + RPCRT4_OpenConnection(conn); + if (rpcrt4_conn_get_wait_object(conn)) + (*count)++; + conn = conn->Next; } + /* make array of connections */ if (objs) - objs = HeapReAlloc(GetProcessHeap(), 0, objs, count*sizeof(HANDLE)); + objs = HeapReAlloc(GetProcessHeap(), 0, objs, *count*sizeof(HANDLE)); else - objs = HeapAlloc(GetProcessHeap(), 0, count*sizeof(HANDLE)); - - objs[0] = m_event; - count = 1; - conn = cps->conn; + objs = HeapAlloc(GetProcessHeap(), 0, *count*sizeof(HANDLE)); + if (!objs) + { + ERR("couldn't allocate objs\n"); + return NULL; + } + + objs[0] = npps->mgr_event; + *count = 1; + conn = protseq->conn; while (conn) { - if ((objs[count] = rpcrt4_conn_get_wait_object(conn))) - count++; - conn = conn->Next; + if ((objs[*count] = rpcrt4_conn_get_wait_object(conn))) + (*count)++; + conn = conn->Next; } + return objs; +} + +static void rpcrt4_protseq_np_free_wait_array(RpcServerProtseq *protseq, void *array) +{ + HeapFree(GetProcessHeap(), 0, array); +} + +static int rpcrt4_protseq_np_wait_for_new_connection(RpcServerProtseq *protseq, unsigned int count, void *wait_array) +{ + HANDLE b_handle; + HANDLE *objs = wait_array; + DWORD res; + RpcConnection* cconn; + RpcConnection* conn; + + if (!objs) + return -1; + + res = WaitForMultipleObjects(count, objs, FALSE, INFINITE); + if (res == WAIT_OBJECT_0) + return 0; + else if (res == WAIT_FAILED) + { + ERR("wait failed with error %ld\n", GetLastError()); + return -1; + } + else + { + b_handle = objs[res - WAIT_OBJECT_0]; + /* find which connection got a RPC */ + EnterCriticalSection(&server_cs); + conn = protseq->conn; + while (conn) { + if (b_handle == rpcrt4_conn_get_wait_object(conn)) break; + conn = conn->Next; + } + cconn = NULL; + if (conn) + RPCRT4_SpawnConnection(&cconn, conn); + else + ERR("failed to locate connection for handle %p\n", b_handle); + LeaveCriticalSection(&server_cs); + if (cconn) + { + RPCRT4_new_client(cconn); + return 1; + } + else return -1; + } +} + +static const struct protseq_ops protseq_list[] = +{ + { + "ncacn_np", + rpcrt4_protseq_np_alloc, + rpcrt4_protseq_np_signal_state_changed, + rpcrt4_protseq_np_get_wait_array, + rpcrt4_protseq_np_free_wait_array, + rpcrt4_protseq_np_wait_for_new_connection, + }, + { + "ncalrpc", + rpcrt4_protseq_np_alloc, + rpcrt4_protseq_np_signal_state_changed, + rpcrt4_protseq_np_get_wait_array, + rpcrt4_protseq_np_free_wait_array, + rpcrt4_protseq_np_wait_for_new_connection, + }, + { + "ncacn_ip_tcp", + rpcrt4_protseq_np_alloc, + rpcrt4_protseq_np_signal_state_changed, + rpcrt4_protseq_np_get_wait_array, + rpcrt4_protseq_np_free_wait_array, + rpcrt4_protseq_np_wait_for_new_connection, + }, +}; + +static const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq) +{ + int i; + for(i=0; i < sizeof(protseq_list)/sizeof(protseq_list[0]); i++) + if (!strcmp(protseq_list[i].name, protseq)) + return &protseq_list[i]; + return NULL; +} + +static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) +{ + int res; + unsigned int count; + void *objs = NULL; + RpcServerProtseq* cps = the_arg; + RpcConnection* conn; + BOOL set_ready_event = FALSE; + + TRACE("(the_arg == ^%p)\n", the_arg); + + for (;;) { + EnterCriticalSection(&server_cs); + objs = cps->ops->get_wait_array(cps, objs, &count); LeaveCriticalSection(&server_cs); if (set_ready_event) @@ -396,8 +515,11 @@ static DWORD CALLBACK RPCRT4_server_thre } /* start waiting */ - res = WaitForMultipleObjects(count, objs, FALSE, INFINITE); - if (res == WAIT_OBJECT_0) { + res = cps->ops->wait_for_new_connection(cps, count, objs); + if (res == -1) + break; + else if (res == 0) + { if (!std_listen) { SetEvent(cps->server_ready_event); @@ -405,28 +527,8 @@ static DWORD CALLBACK RPCRT4_server_thre } set_ready_event = TRUE; } - else if (res == WAIT_FAILED) { - ERR("wait failed\n"); - } - else { - b_handle = objs[res - WAIT_OBJECT_0]; - /* find which connection got a RPC */ - EnterCriticalSection(&server_cs); - conn = cps->conn; - while (conn) { - if (b_handle == rpcrt4_conn_get_wait_object(conn)) break; - conn = conn->Next; - } - cconn = NULL; - if (conn) - RPCRT4_SpawnConnection(&cconn, conn); - else - ERR("failed to locate connection for handle %p\n", b_handle); - LeaveCriticalSection(&server_cs); - if (cconn) RPCRT4_new_client(cconn); - } } - HeapFree(GetProcessHeap(), 0, objs); + cps->ops->free_wait_array(cps, objs); EnterCriticalSection(&server_cs); /* close connections */ conn = cps->conn; @@ -447,7 +549,8 @@ static void RPCRT4_sync_with_server_thre * the server_ready_event when the new state hasn't yet been applied */ WaitForSingleObject(ps->mgr_mutex, INFINITE); - SetEvent(ps->mgr_event); + ps->ops->signal_state_changed(ps); + /* wait for server thread to make the requested changes before returning */ WaitForSingleObject(ps->server_ready_event, INFINITE); @@ -463,7 +566,6 @@ static RPC_STATUS RPCRT4_start_listen_pr if (ps->is_listening) goto done; if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); - if (!ps->mgr_event) ps->mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); if (!server_thread) @@ -654,11 +756,23 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpW static RpcServerProtseq *alloc_serverprotoseq(UINT MaxCalls, char *Protseq, char *Endpoint) { RpcServerProtseq* ps; + const struct protseq_ops *ops = rpcrt4_get_protseq_ops(Protseq); + + if (!ops) + return NULL; - ps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerProtseq)); + ps = ops->alloc(); + if (!ps) + return NULL; ps->MaxCalls = MaxCalls; ps->Protseq = Protseq; ps->Endpoint = Endpoint; + ps->ops = ops; + ps->MaxCalls = 0; + ps->conn = NULL; + ps->is_listening = FALSE; + ps->mgr_mutex = NULL; + ps->server_ready_event = NULL; return ps; } diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index 3a24112..9452ace 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -23,8 +23,11 @@ #define __WINE_RPC_SERVER_H #include "rpc_binding.h" +struct protseq_ops; + typedef struct _RpcServerProtseq { + const struct protseq_ops *ops; struct _RpcServerProtseq* Next; LPSTR Protseq; LPSTR Endpoint; @@ -33,14 +36,25 @@ typedef struct _RpcServerProtseq /* is the server currently listening? */ BOOL is_listening; - /* set on change of configuration (e.g. listening on new protseq) */ - HANDLE mgr_event; /* mutex for ensuring only one thread can change state at a time */ HANDLE mgr_mutex; /* set when server thread has finished opening connections */ HANDLE server_ready_event; } RpcServerProtseq; +struct protseq_ops +{ + const char *name; + RpcServerProtseq *(*alloc)(void); + void (*signal_state_changed)(RpcServerProtseq *protseq); + /* previous array is passed in to allow reuse of memory */ + void *(*get_wait_array)(RpcServerProtseq *protseq, void *prev_array, unsigned int *count); + void (*free_wait_array)(RpcServerProtseq *protseq, void *array); + /* returns -1 for failure, 0 for server state changed and 1 to indicate a + * new connection was established */ + int (*wait_for_new_connection)(RpcServerProtseq *protseq, unsigned int count, void *wait_array); +}; + typedef struct _RpcServerInterface { struct _RpcServerInterface* Next;
1
0
0
0
Robert Shearman : rpcrt4: Rename protseq_ops to connection_ops to reflect the fact that
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 92c3979433ca668f1212964b500bd2dc496d3d9e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=92c3979433ca668f1212964b5…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 16:47:39 2006 +0100 rpcrt4: Rename protseq_ops to connection_ops to reflect the fact that the functions operate on an RpcConnection object, not an RpcServerProtseq object. --- dlls/rpcrt4/rpc_binding.h | 6 +++--- dlls/rpcrt4/rpc_transport.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index bf089a6..221918d 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -36,7 +36,7 @@ typedef struct _RpcAuthInfo TimeStamp exp; } RpcAuthInfo; -struct protseq_ops; +struct connection_ops; typedef struct _RpcConnection { @@ -45,7 +45,7 @@ typedef struct _RpcConnection BOOL server; LPSTR NetworkAddr; LPSTR Endpoint; - const struct protseq_ops *ops; + const struct connection_ops *ops; USHORT MaxTransmissionSize; /* The active interface bound to server. */ RPC_SYNTAX_IDENTIFIER ActiveInterface; @@ -61,7 +61,7 @@ typedef struct _RpcConnection struct list conn_pool_entry; } RpcConnection; -struct protseq_ops { +struct connection_ops { const char *name; unsigned char epm_protocols[2]; /* only floors 3 and 4. see
http://www.opengroup.org/onlinepubs/9629399/apdxl.htm
*/ RpcConnection *(*alloc)(void); diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index a84e2c5..0f11bfa 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -709,7 +709,7 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_pa return RPC_S_OK; } -static const struct protseq_ops protseq_list[] = { +static const struct connection_ops protseq_list[] = { { "ncacn_np", { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB }, rpcrt4_conn_np_alloc, @@ -750,7 +750,7 @@ static const struct protseq_ops protseq_ #define MAX_PROTSEQ (sizeof protseq_list / sizeof protseq_list[0]) -static const struct protseq_ops *rpcrt4_get_protseq_ops(const char *protseq) +static const struct connection_ops *rpcrt4_get_protseq_ops(const char *protseq) { int i; for(i=0; i<MAX_PROTSEQ; i++) @@ -779,7 +779,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcCo LPCSTR Protseq, LPCSTR NetworkAddr, LPCSTR Endpoint, LPCSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcBinding* Binding) { - const struct protseq_ops *ops; + const struct connection_ops *ops; RpcConnection* NewConnection; ops = rpcrt4_get_protseq_ops(Protseq); @@ -875,7 +875,7 @@ RPC_STATUS RpcTransport_GetTopOfTower(un const char *endpoint) { twr_empty_floor_t *protocol_floor; - const struct protseq_ops *protseq_ops = rpcrt4_get_protseq_ops(protseq); + const struct connection_ops *protseq_ops = rpcrt4_get_protseq_ops(protseq); *tower_size = 0; @@ -913,7 +913,7 @@ RPC_STATUS RpcTransport_ParseTopOfTower( { const twr_empty_floor_t *protocol_floor; const twr_empty_floor_t *floor4; - const struct protseq_ops *protseq_ops = NULL; + const struct connection_ops *protseq_ops = NULL; RPC_STATUS status; int i;
1
0
0
0
Robert Shearman : rpcrt4: Create a server thread for each protseq.
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: e906424178fb0a59f4ae2865b58048ec80dce91f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e906424178fb0a59f4ae2865b…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Oct 16 16:47:22 2006 +0100 rpcrt4: Create a server thread for each protseq. --- dlls/rpcrt4/rpc_server.c | 173 ++++++++++++++++++++++++++-------------------- dlls/rpcrt4/rpc_server.h | 9 ++ 2 files changed, 105 insertions(+), 77 deletions(-) diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 041139d..4d034ba 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -93,12 +93,6 @@ static BOOL std_listen; static LONG manual_listen_count; /* total listeners including auto listeners */ static LONG listen_count; -/* set on change of configuration (e.g. listening on new protseq) */ -static HANDLE mgr_event; -/* mutex for ensuring only one thread can change state at a time */ -static HANDLE mgr_mutex; -/* set when server thread has finished opening connections */ -static HANDLE server_ready_event; static UUID uuid_nil; @@ -355,30 +349,28 @@ static void RPCRT4_new_client(RpcConnect static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) { - HANDLE m_event = mgr_event, b_handle; + HANDLE m_event, b_handle; HANDLE *objs = NULL; DWORD count, res; - RpcServerProtseq* cps; + RpcServerProtseq* cps = the_arg; RpcConnection* conn; RpcConnection* cconn; BOOL set_ready_event = FALSE; TRACE("(the_arg == ^%p)\n", the_arg); + m_event = cps->mgr_event; + for (;;) { EnterCriticalSection(&server_cs); /* open and count connections */ count = 1; - cps = protseqs; - while (cps) { - conn = cps->conn; - while (conn) { - RPCRT4_OpenConnection(conn); - if (rpcrt4_conn_get_wait_object(conn)) - count++; - conn = conn->Next; - } - cps = cps->Next; + conn = cps->conn; + while (conn) { + RPCRT4_OpenConnection(conn); + if (rpcrt4_conn_get_wait_object(conn)) + count++; + conn = conn->Next; } /* make array of connections */ if (objs) @@ -388,22 +380,18 @@ static DWORD CALLBACK RPCRT4_server_thre objs[0] = m_event; count = 1; - cps = protseqs; - while (cps) { - conn = cps->conn; - while (conn) { - if ((objs[count] = rpcrt4_conn_get_wait_object(conn))) - count++; - conn = conn->Next; - } - cps = cps->Next; + conn = cps->conn; + while (conn) { + if ((objs[count] = rpcrt4_conn_get_wait_object(conn))) + count++; + conn = conn->Next; } LeaveCriticalSection(&server_cs); if (set_ready_event) { /* signal to function that changed state that we are now sync'ed */ - SetEvent(server_ready_event); + SetEvent(cps->server_ready_event); set_ready_event = FALSE; } @@ -412,7 +400,7 @@ static DWORD CALLBACK RPCRT4_server_thre if (res == WAIT_OBJECT_0) { if (!std_listen) { - SetEvent(server_ready_event); + SetEvent(cps->server_ready_event); break; } set_ready_event = TRUE; @@ -424,16 +412,10 @@ static DWORD CALLBACK RPCRT4_server_thre b_handle = objs[res - WAIT_OBJECT_0]; /* find which connection got a RPC */ EnterCriticalSection(&server_cs); - conn = NULL; - cps = protseqs; - while (cps) { - conn = cps->conn; - while (conn) { - if (b_handle == rpcrt4_conn_get_wait_object(conn)) break; - conn = conn->Next; - } - if (conn) break; - cps = cps->Next; + conn = cps->conn; + while (conn) { + if (b_handle == rpcrt4_conn_get_wait_object(conn)) break; + conn = conn->Next; } cconn = NULL; if (conn) @@ -447,14 +429,10 @@ static DWORD CALLBACK RPCRT4_server_thre HeapFree(GetProcessHeap(), 0, objs); EnterCriticalSection(&server_cs); /* close connections */ - cps = protseqs; - while (cps) { - conn = cps->conn; - while (conn) { - RPCRT4_CloseConnection(conn); - conn = conn->Next; - } - cps = cps->Next; + conn = cps->conn; + while (conn) { + RPCRT4_CloseConnection(conn); + conn = conn->Next; } LeaveCriticalSection(&server_cs); return 0; @@ -462,23 +440,49 @@ static DWORD CALLBACK RPCRT4_server_thre /* tells the server thread that the state has changed and waits for it to * make the changes */ -static void RPCRT4_sync_with_server_thread(void) +static void RPCRT4_sync_with_server_thread(RpcServerProtseq *ps) { /* make sure we are the only thread sync'ing the server state, otherwise * there is a race with the server thread setting an older state and setting * the server_ready_event when the new state hasn't yet been applied */ - WaitForSingleObject(mgr_mutex, INFINITE); + WaitForSingleObject(ps->mgr_mutex, INFINITE); - SetEvent(mgr_event); + SetEvent(ps->mgr_event); /* wait for server thread to make the requested changes before returning */ - WaitForSingleObject(server_ready_event, INFINITE); + WaitForSingleObject(ps->server_ready_event, INFINITE); - ReleaseMutex(mgr_mutex); + ReleaseMutex(ps->mgr_mutex); +} + +static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen) +{ + RPC_STATUS status = RPC_S_OK; + HANDLE server_thread; + + EnterCriticalSection(&listen_cs); + if (ps->is_listening) goto done; + + if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); + if (!ps->mgr_event) ps->mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); + if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); + server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); + if (!server_thread) + { + status = RPC_S_OUT_OF_RESOURCES; + goto done; + } + ps->is_listening = TRUE; + CloseHandle(server_thread); + +done: + LeaveCriticalSection(&listen_cs); + return status; } static RPC_STATUS RPCRT4_start_listen(BOOL auto_listen) { RPC_STATUS status = RPC_S_ALREADY_LISTENING; + RpcServerProtseq *cps; TRACE("\n"); @@ -486,19 +490,26 @@ static RPC_STATUS RPCRT4_start_listen(BO if (auto_listen || (manual_listen_count++ == 0)) { status = RPC_S_OK; - if (++listen_count == 1) { - HANDLE server_thread; - /* first listener creates server thread */ - if (!mgr_mutex) mgr_mutex = CreateMutexW(NULL, FALSE, NULL); - if (!mgr_event) mgr_event = CreateEventW(NULL, FALSE, FALSE, NULL); - if (!server_ready_event) server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); + if (++listen_count == 1) std_listen = TRUE; - server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, NULL, 0, NULL); - CloseHandle(server_thread); - } } LeaveCriticalSection(&listen_cs); + if (std_listen) + { + cps = protseqs; + while (cps && status == RPC_S_OK) + { + status = RPCRT4_start_listen_protseq(cps, TRUE); + + /* make sure server is actually listening on the interface before + * returning */ + if (status == RPC_S_OK) + RPCRT4_sync_with_server_thread(cps); + cps = cps->Next; + } + } + return status; } @@ -508,9 +519,16 @@ static void RPCRT4_stop_listen(BOOL auto if (auto_listen || (--manual_listen_count == 0)) { if (listen_count != 0 && --listen_count == 0) { + RpcServerProtseq *cps; + std_listen = FALSE; LeaveCriticalSection(&listen_cs); - RPCRT4_sync_with_server_thread(); + + cps = protseqs; + while (cps) { + RPCRT4_sync_with_server_thread(cps); + cps = cps->Next; + } return; } assert(listen_count >= 0); @@ -520,17 +538,26 @@ static void RPCRT4_stop_listen(BOOL auto static RPC_STATUS RPCRT4_use_protseq(RpcServerProtseq* ps) { - RPCRT4_CreateConnection(&ps->conn, TRUE, ps->Protseq, NULL, ps->Endpoint, - NULL, NULL, NULL); + RPC_STATUS status; + + status = RPCRT4_CreateConnection(&ps->conn, TRUE, ps->Protseq, NULL, + ps->Endpoint, NULL, NULL, NULL); + if (status != RPC_S_OK) + return status; EnterCriticalSection(&server_cs); ps->Next = protseqs; protseqs = ps; LeaveCriticalSection(&server_cs); - if (std_listen) RPCRT4_sync_with_server_thread(); + if (std_listen) + { + status = RPCRT4_start_listen_protseq(ps, FALSE); + if (status == RPC_S_OK) + RPCRT4_sync_with_server_thread(ps); + } - return RPC_S_OK; + return status; } /*********************************************************************** @@ -758,13 +785,8 @@ RPC_STATUS WINAPI RpcServerRegisterIf2( ifs = sif; LeaveCriticalSection(&server_cs); - if (sif->Flags & RPC_IF_AUTOLISTEN) { - RPCRT4_start_listen(TRUE); - - /* make sure server is actually listening on the interface before - * returning */ - RPCRT4_sync_with_server_thread(); - } + if (sif->Flags & RPC_IF_AUTOLISTEN) + RPCRT4_start_listen(TRUE); return RPC_S_OK; } @@ -882,7 +904,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthI */ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait ) { - RPC_STATUS status; + RPC_STATUS status = RPC_S_OK; TRACE("(%u,%u,%u)\n", MinimumCallThreads, MaxCalls, DontWait); @@ -891,9 +913,6 @@ RPC_STATUS WINAPI RpcServerListen( UINT status = RPCRT4_start_listen(FALSE); - if (status == RPC_S_OK) - RPCRT4_sync_with_server_thread(); - if (DontWait || (status != RPC_S_OK)) return status; return RpcMgmtWaitServerListen(); diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index 67a7ac7..3a24112 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -30,6 +30,15 @@ typedef struct _RpcServerProtseq LPSTR Endpoint; UINT MaxCalls; RpcConnection* conn; + + /* is the server currently listening? */ + BOOL is_listening; + /* set on change of configuration (e.g. listening on new protseq) */ + HANDLE mgr_event; + /* mutex for ensuring only one thread can change state at a time */ + HANDLE mgr_mutex; + /* set when server thread has finished opening connections */ + HANDLE server_ready_event; } RpcServerProtseq; typedef struct _RpcServerInterface
1
0
0
0
Alexandre Julliard : Make.rules: Added support for building IDL client/ proxy/server/iid files.
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 12c196203c0c60d6647ab655043d913e14d2e611 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12c196203c0c60d6647ab6550…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 16 17:20:37 2006 +0200 Make.rules: Added support for building IDL client/proxy/server/iid files. --- Make.rules.in | 16 +++++----------- configure | 3 ++- configure.ac | 6 ++++-- dlls/atl/Makefile.in | 2 +- dlls/mshtml/Makefile.in | 2 +- dlls/ole32/Makefile.in | 2 +- include/Makefile.in | 4 ++-- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Make.rules.in b/Make.rules.in index 9e7ec07..86a40ba 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -111,7 +111,8 @@ conf_manext = 5 CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \ *.flc *.res *.mc.rc *.tab.[ch] *.yy.c core -OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(EXTRA_OBJS) +IDL_GEN_C_SRCS = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c) +OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) $(EXTRA_OBJS) RCOBJS = $(RC_SRCS:.rc=.res.o) LINTS = $(C_SRCS:.c=.ln) @@ -215,7 +216,7 @@ winapi_check:: dummy # Rules for dependencies -DEPEND_SRCS = $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS) +DEPEND_SRCS = $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_H_SRCS) $(IDL_GEN_C_SRCS) $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS) $(SUBDIRS:%=%/__depend__): dummy @cd `dirname $@` && $(MAKE) depend @@ -234,7 +235,7 @@ # Rules for cleaning -cd `dirname $@` && $(RM) $(CLEAN_FILES) clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__) - $(RM) $(CLEAN_FILES) $(IDL_SRCS:.idl=.h) $(IDL_SRCS:.idl=_c.c) $(IDL_SRCS:.idl=_i.c) $(IDL_SRCS:.idl=_p.c) $(IDL_SRCS:.idl=_s.c) $(IDL_TLB_SRCS:.idl=.tlb) $(PROGRAMS) $(RC_BINARIES) $(MANPAGES) + $(RM) $(CLEAN_FILES) $(IDL_H_SRCS:.idl=.h) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) $(PROGRAMS) $(RC_BINARIES) $(MANPAGES) .PHONY: clean $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__) @@ -303,14 +304,7 @@ # Misc. rules $(MC_SRCS:.mc=.mc.rc): $(WMC) -$(IDL_SRCS:.idl=.h): $(WIDL) - -$(IDL_SRCS:.idl=_c.c): $(WIDL) -$(IDL_SRCS:.idl=_i.c): $(WIDL) -$(IDL_SRCS:.idl=_p.c): $(WIDL) -$(IDL_SRCS:.idl=_s.c): $(WIDL) - -$(IDL_TLB_SRCS:.idl=.tlb): $(WIDL) +$(IDL_H_SRCS:.idl=.h) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb): $(WIDL) $(SUBDIRS): dummy @cd $@ && $(MAKE) diff --git a/configure b/configure index 3ea21f2..431e36b 100755 --- a/configure +++ b/configure @@ -23666,7 +23666,8 @@ DEPENDENCIES="### Dependencies: Makefile: dummy -\$(MAKEDEP) -C\$(SRCDIR) -S\$(TOPSRCDIR) -T\$(TOPOBJDIR) \$(EXTRAINCL) \$(DEPEND_SRCS) -\$(ALL_OBJS): \$(IDL_SRCS:.idl=.h) +\$(ALL_OBJS): \$(IDL_H_SRCS:.idl=.h) +\$(IDL_GEN_C_SRCS:.c=.o): \$(IDL_GEN_C_SRCS) \$(LEX_SRCS:.l=.yy.o): \$(LEX_SRCS:.l=.yy.c) \$(BISON_SRCS:.y=.tab.o): \$(BISON_SRCS:.y=.tab.c)" diff --git a/configure.ac b/configure.ac index 84fdf0d..b9a5b24 100644 --- a/configure.ac +++ b/configure.ac @@ -1453,7 +1453,8 @@ AC_SUBST(DEPENDENCIES,m4_if(m4_version_c Makefile: dummy\\ -\$(MAKEDEP) -C\$(SRCDIR) -S\$(TOPSRCDIR) -T\$(TOPOBJDIR) \$(EXTRAINCL) \$(DEPEND_SRCS)\\ \\ -\$(ALL_OBJS): \$(IDL_SRCS:.idl=.h)\\ +\$(ALL_OBJS): \$(IDL_H_SRCS:.idl=.h)\\ +\$(IDL_GEN_C_SRCS:.c=.o): \$(IDL_GEN_C_SRCS)\\ \$(LEX_SRCS:.l=.yy.o): \$(LEX_SRCS:.l=.yy.c)\\ \$(BISON_SRCS:.y=.tab.o): \$(BISON_SRCS:.y=.tab.c)"], ["### Dependencies: @@ -1463,7 +1464,8 @@ Makefile: dummy\\ Makefile: dummy -\$(MAKEDEP) -C\$(SRCDIR) -S\$(TOPSRCDIR) -T\$(TOPOBJDIR) \$(EXTRAINCL) \$(DEPEND_SRCS) -\$(ALL_OBJS): \$(IDL_SRCS:.idl=.h) +\$(ALL_OBJS): \$(IDL_H_SRCS:.idl=.h) +\$(IDL_GEN_C_SRCS:.c=.o): \$(IDL_GEN_C_SRCS) \$(LEX_SRCS:.l=.yy.o): \$(LEX_SRCS:.l=.yy.c) \$(BISON_SRCS:.y=.tab.o): \$(BISON_SRCS:.y=.tab.c)"])) diff --git a/dlls/atl/Makefile.in b/dlls/atl/Makefile.in index cd4de31..e54cf64 100644 --- a/dlls/atl/Makefile.in +++ b/dlls/atl/Makefile.in @@ -13,7 +13,7 @@ C_SRCS = \ RC_SRCS = rsrc.rc -IDL_SRCS = \ +IDL_H_SRCS = \ atliface.idl @MAKE_DLL_RULES@ diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index b3009b1..de649e0 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -41,7 +41,7 @@ C_SRCS = \ RC_SRCS = rsrc.rc -IDL_SRCS = nsiface.idl +IDL_H_SRCS = nsiface.idl @MAKE_DLL_RULES@ diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index 511ee49..6779695 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -68,7 +68,7 @@ RC_BINARIES = \ drag_move.cur \ nodrop.cur -IDL_SRCS = \ +IDL_H_SRCS = \ dcom.idl @MAKE_DLL_RULES@ diff --git a/include/Makefile.in b/include/Makefile.in index 4b959bc..f0f3d52 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -377,7 +377,7 @@ WINE_INCLUDES = \ library.h \ unicode.h -IDL_SRCS = $(WINDOWS_IDL_SRCS) $(WINE_IDL_SRCS:%=wine/%) +IDL_H_SRCS = $(WINDOWS_IDL_SRCS) $(WINE_IDL_SRCS:%=wine/%) EXTRASUBDIRS = ddk msvcrt msvcrt/sys wine @@ -392,7 +392,7 @@ INSTALLDIRS = \ WINDOWS_IDL_HEADERS = $(WINDOWS_IDL_SRCS:.idl=.h) WINE_IDL_HEADERS = $(WINE_IDL_SRCS:.idl=.h) -IDL_HEADERS = $(IDL_SRCS:.idl=.h) +IDL_HEADERS = $(IDL_H_SRCS:.idl=.h) IDL_TLBS = $(IDL_TLB_SRCS:.idl=.tlb) all: $(IDL_HEADERS) $(IDL_TLBS)
1
0
0
0
Alexandre Julliard : makedep: Added support for generating dependencies of IDL client/proxy/server/ iid files.
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 8f31f92a73fdddf4fc79fa165cb668fb2977b67a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f31f92a73fdddf4fc79fa165…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 16 17:19:07 2006 +0200 makedep: Added support for generating dependencies of IDL client/proxy/server/iid files. --- tools/makedep.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 80 insertions(+), 4 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 300ed8d..759d3bd 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -229,6 +229,17 @@ static void add_include_path( const char path->name = name; } +/******************************************************************* + * find_src_file + */ +static INCL_FILE *find_src_file( const char *name ) +{ + INCL_FILE *file; + + LIST_FOR_EACH_ENTRY( file, &sources, INCL_FILE, entry ) + if (!strcmp( name, file->name )) return file; + return NULL; +} /******************************************************************* * add_src_file @@ -237,7 +248,10 @@ static void add_include_path( const char */ static INCL_FILE *add_src_file( const char *name ) { - INCL_FILE *file = xmalloc( sizeof(*file) ); + INCL_FILE *file; + + if (find_src_file( name )) return NULL; /* we already have it */ + file = xmalloc( sizeof(*file) ); memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); list_add_tail( &sources, &file->entry ); @@ -615,12 +629,58 @@ static void parse_c_file( INCL_FILE *pFi /******************************************************************* + * parse_generated_idl + */ +static void parse_generated_idl( INCL_FILE *source ) +{ + char *header, *basename; + + basename = xstrdup( source->name ); + basename[strlen(basename) - 4] = 0; + header = strmake( "%s.h", basename ); + source->filename = xstrdup( source->name ); + + if (strendswith( source->name, "_c.c" )) + { + add_include( source, header, 0, 0 ); + } + else if (strendswith( source->name, "_i.c" )) + { + add_include( source, "rpc.h", 0, 1 ); + add_include( source, "rpcndr.h", 0, 1 ); + add_include( source, "guiddef.h", 0, 1 ); + } + else if (strendswith( source->name, "_p.c" )) + { + add_include( source, "rpcproxy.h", 0, 1 ); + add_include( source, header, 0, 0 ); + } + else if (strendswith( source->name, "_s.c" )) + { + add_include( source, header, 0, 0 ); + } + + free( header ); + free( basename ); +} + +/******************************************************************* * parse_file */ static void parse_file( INCL_FILE *pFile, int src ) { FILE *file; + /* special case for source files generated from idl */ + if (strendswith( pFile->name, "_c.c" ) || + strendswith( pFile->name, "_i.c" ) || + strendswith( pFile->name, "_p.c" ) || + strendswith( pFile->name, "_s.c" )) + { + parse_generated_idl( pFile ); + return; + } + file = src ? open_src_file( pFile ) : open_include_file( pFile ); if (!file) return; @@ -686,7 +746,24 @@ static void output_src( FILE *file, INCL } else if (!strcmp( ext, "idl" )) /* IDL file */ { - *column += fprintf( file, "%s.h: %s", obj, pFile->filename ); + char *name; + + *column += fprintf( file, "%s.h", obj ); + + name = strmake( "%s_c.c", obj ); + if (find_src_file( name )) *column += fprintf( file, " %s", name ); + free( name ); + name = strmake( "%s_i.c", obj ); + if (find_src_file( name )) *column += fprintf( file, " %s", name ); + free( name ); + name = strmake( "%s_p.c", obj ); + if (find_src_file( name )) *column += fprintf( file, " %s", name ); + free( name ); + name = strmake( "%s_s.c", obj ); + if (find_src_file( name )) *column += fprintf( file, " %s", name ); + free( name ); + + *column += fprintf( file, ": %s", pFile->filename ); } else { @@ -814,8 +891,7 @@ int main( int argc, char *argv[] ) for (i = 1; i < argc; i++) { - pFile = add_src_file( argv[i] ); - parse_file( pFile, 1 ); + if ((pFile = add_src_file( argv[i] ))) parse_file( pFile, 1 ); } LIST_FOR_EACH_ENTRY( pFile, &includes, INCL_FILE, entry ) parse_file( pFile, 0 ); output_dependencies();
1
0
0
0
Mikołaj Zalewski : comctl32: listview: Update the scroll bars after resizing the last column.
by Alexandre Julliard
16 Oct '06
16 Oct '06
Module: wine Branch: master Commit: 1e9acccefda4558ab4bb4f3432673f6b06607975 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e9acccefda4558ab4bb4f343…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Mon Oct 16 11:21:16 2006 +0200 comctl32: listview: Update the scroll bars after resizing the last column. --- dlls/comctl32/listview.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 427e8bc..e7df207 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8584,6 +8584,12 @@ static LRESULT LISTVIEW_HeaderNotificati lpColumnInfo->rcHeader.right += dx; if (lpnmh->iItem + 1 < DPA_GetPtrCount(infoPtr->hdpaColumns)) LISTVIEW_ScrollColumns(infoPtr, lpnmh->iItem + 1, dx); + else + { + /* only needs to update the scrolls */ + infoPtr->nItemWidth += dx; + LISTVIEW_UpdateScroll(infoPtr); + } LISTVIEW_UpdateItemSize(infoPtr); if (uView == LVS_REPORT && is_redrawing(infoPtr)) {
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
104
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Results per page:
10
25
50
100
200