CVS: seamlessrdp/ServerExe/HookDll hookdll.c,1.26,1.27

Pierre Ossman <[email protected]> Fri, 17 Mar 2006 08:34:48 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23512/ServerExe/HookDll

Modified Files:
	hookdll.c 
Log Message:
Also store hwnd when doing blocking to make things a bit more fool proof.


Index: hookdll.c
===================================================================
RCS file: /cvsroot/rdesktop/seamlessrdp/ServerExe/HookDll/hookdll.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** hookdll.c	17 Mar 2006 16:23:08 -0000	1.26
--- hookdll.c	17 Mar 2006 16:34:46 -0000	1.27
***************
*** 46,52 ****
--- 46,54 ----
  
  // blocks for locally generated events
+ HWND g_block_move_hwnd SHARED = NULL;
  RECT g_block_move SHARED = { 0, 0, 0, 0 };
  HWND g_blocked_zchange[2] SHARED = { NULL, NULL };
  HWND g_blocked_focus SHARED = NULL;
+ HWND g_blocked_state_hwnd SHARED = NULL;
  int g_blocked_state SHARED = -1;
  
***************
*** 70,73 ****
--- 72,76 ----
  {
  	RECT rect, blocked;
+ 	HWND blocked_hwnd;
  
  	if (!GetWindowRect(hwnd, &rect))
***************
*** 78,85 ****
  
  	WaitForSingleObject(g_mutex, INFINITE);
  	memcpy(&blocked, &g_block_move, sizeof(RECT));
  	ReleaseMutex(g_mutex);
  
! 	if ((rect.left == blocked.left) && (rect.top == blocked.top)
  	    && (rect.right == blocked.right) && (rect.bottom == blocked.bottom))
  		return;
--- 81,89 ----
  
  	WaitForSingleObject(g_mutex, INFINITE);
+ 	blocked_hwnd = hwnd;
  	memcpy(&blocked, &g_block_move, sizeof(RECT));
  	ReleaseMutex(g_mutex);
  
! 	if ((hwnd == blocked_hwnd) && (rect.left == blocked.left) && (rect.top == blocked.top)
  	    && (rect.right == blocked.right) && (rect.bottom == blocked.bottom))
  		return;
***************
*** 286,291 ****
--- 290,297 ----
  			{
  				int show, state, blocked;
+ 				HWND blocked_hwnd;
  
  				WaitForSingleObject(g_mutex, INFINITE);
+ 				blocked_hwnd = g_blocked_state_hwnd;
  				blocked = g_blocked_state;
  				ReleaseMutex(g_mutex);
***************
*** 306,310 ****
  				}
  
! 				if (blocked != state)
  					vchannel_write("STATE,0x%p,0x%x,0x%x", (HWND) wparam, state,
  						       0);
--- 312,316 ----
  				}
  
! 				if ((blocked_hwnd != (HWND) wparam) || (blocked != state))
  					vchannel_write("STATE,0x%p,0x%x,0x%x", (HWND) wparam, state,
  						       0);
***************
*** 352,355 ****
--- 358,362 ----
  {
  	WaitForSingleObject(g_mutex, INFINITE);
+ 	g_block_move_hwnd = hwnd;
  	g_block_move.left = x;
  	g_block_move.top = y;
***************
*** 361,364 ****
--- 368,372 ----
  
  	WaitForSingleObject(g_mutex, INFINITE);
+ 	g_block_move_hwnd = NULL;
  	memset(&g_block_move, 0, sizeof(RECT));
  	ReleaseMutex(g_mutex);
***************
*** 402,405 ****
--- 410,414 ----
  {
  	WaitForSingleObject(g_mutex, INFINITE);
+ 	g_blocked_state_hwnd = hwnd;
  	g_blocked_state = state;
  	ReleaseMutex(g_mutex);
***************
*** 415,418 ****
--- 424,428 ----
  
  	WaitForSingleObject(g_mutex, INFINITE);
+ 	g_blocked_state_hwnd = NULL;
  	g_blocked_state = -1;
  	ReleaseMutex(g_mutex);



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642