[Nvda-dev] commit r2207 - trunk/source/NVDAHelper

Michael Curran michaeldamiencurran at gmail.com
Thu Jul 10 10:30:24 UTC 2008


Hi,

Thanks for noticing the typos. Yep, that definitly should be &&.

Mick


Lubos Pintes wrote:
> Hi Mick,
> - This line:
> +	
> if(isIA2Initialized&curProcessID!=initialProcessID&curProcessID!=desktopProcessID&curProcessID!=shellProcessID)
> I think that double&, "&&" could be there. Or I am wrong? Maybe, I am
> not C guru.
>
> - Simple typo here:
>    		fprintf(stderr,"Error registering foregorund winEvent hook\n");
> NVDA Subversion  wrote / napísal(a):
>> Author: mdcurran
>> Date: Wed Jul  9 21:43:02 2008
>> New Revision: 2207
>>
>> Log:
>> NVDAHelper: do not try and install IAccessible2 in to the process of the desktop, the shell, or NVDA. It is not needed in these specific processes, also this may help to make sure that IAccessible2Proxy.dll is freed sooner when NVDA exits.
>>
>> Modified:
>>     trunk/source/NVDAHelper/hookManager.c
>>
>> Modified: trunk/source/NVDAHelper/hookManager.c
>> ==============================================================================
>> --- trunk/source/NVDAHelper/hookManager.c	(original)
>> +++ trunk/source/NVDAHelper/hookManager.c	Wed Jul  9 21:43:02 2008
>> @@ -13,7 +13,10 @@
>>   #pragma data_seg(".hookManagerShared")
>>   HHOOK getMessageHookID=0;
>>   HHOOK callWndProcHookID=0;
>> -HWINEVENTHOOK foregroundWinEventHookID=0;
>> +HWINEVENTHOOK winEventHookID=0;
>> +int initialProcessID=0;
>> +int desktopProcessID=0;
>> +int shellProcessID=0;
>>   #pragma data_seg()
>>   #pragma comment(linker, "/section:.hookManagerShared,rws")
>>
>> @@ -50,10 +53,12 @@
>>   	return CallNextHookEx(callWndProcHookID,code,wParam,lParam);
>>   }
>>
>> -//Foreground winEvent callback
>> -void foregroundWinEventHook(HWINEVENTHOOK hookID, DWORD eventID, HWND hwnd, long objectID, long childID, DWORD threadID, DWORD time) {
>> +//winEvent callback
>> +void winEventHook(HWINEVENTHOOK hookID, DWORD eventID, HWND hwnd, long objectID, long childID, DWORD threadID, DWORD time) {
>> +	int curProcessID=0;
>>   	if(eventID==EVENT_SYSTEM_FOREGROUND||eventID==EVENT_OBJECT_FOCUS) {
>> -		if(isIA2Initialized) installIA2Support();
>> +		GetWindowThreadProcessId(hwnd,&curProcessID);
>> +		if(isIA2Initialized&&curProcessID!=initialProcessID&&curProcessID!=desktopProcessID&&curProcessID!=shellProcessID) installIA2Support();
>>   	}
>>   }
>>
>> @@ -62,6 +67,9 @@
>>   		fprintf(stderr,"Already initialized\n");
>>   		return -1;
>>   	}
>> +	initialProcessID=GetCurrentProcessId();
>> +	GetWindowThreadProcessId(GetDesktopWindow(),&desktopProcessID);
>> +	GetWindowThreadProcessId(GetShellWindow(),&shellProcessID);
>>   	IA2Support_initialize();
>>   	if((getMessageHookID=SetWindowsHookEx(WH_GETMESSAGE,(HOOKPROC)getMessageHook,moduleHandle,0))==0) {
>>   		fprintf(stderr,"Error registering window message hook\n");
>> @@ -71,7 +79,7 @@
>>   		fprintf(stderr,"Error registering window message hook\n");
>>   		return -1;
>>   	}
>> -	if((foregroundWinEventHookID=SetWinEventHook(0,0xFFFFFFFF,moduleHandle,(WINEVENTPROC)foregroundWinEventHook,0,0,WINEVENT_INCONTEXT|WINEVENT_SKIPOWNPROCESS))==0) {
>> +	if((winEventHookID=SetWinEventHook(0,0xFFFFFFFF,moduleHandle,(WINEVENTPROC)winEventHook,0,0,WINEVENT_INCONTEXT|WINEVENT_SKIPOWNPROCESS))==0) {
>>   		fprintf(stderr,"Error registering foregorund winEvent hook\n");
>>   		return -1;
>>   	}
>> @@ -92,7 +100,7 @@
>>   		fprintf(stderr,"Error unhooking callWndProc hook\n");
>>   		return -1;
>>   	}
>> -	if(UnhookWinEvent(foregroundWinEventHookID)==FALSE) {
>> +	if(UnhookWinEvent(winEventHookID)==FALSE) {
>>   		fprintf(stderr,"Error unregistering foreground winEvent\n");
>>   		return -1;
>>   	}
>>
>> _______________________________________________
>> Nvda-dev mailing list
>> Nvda-dev at lists.nvaccess.org
>> http://lists.nvaccess.org/listinfo/nvda-dev
>>
>
> _______________________________________________
> Nvda-dev mailing list
> Nvda-dev at lists.nvaccess.org
> http://lists.nvaccess.org/listinfo/nvda-dev



More information about the Nvda-dev mailing list