ilmcuts | 31 Jul 2008 15:27
Picon

Re-entrancy example

Hi,

Below is an interesting example of unexpected re-entrancy. This is 
something we'll have to keep an eye on.

 >       litestep.exe!TrayService::HandleNotification(_SHELLTRAYDATA * 
pstd=0x0007e190)  Line 1619       C++
         litestep.exe!TrayService::WindowTrayProc(HWND__ * 
hWnd=0x00250bee, unsigned int uMsg=74, unsigned int wParam=1181526, long 
lParam=1546736)  Line 531 + 0xf bytes        C++
         user32.dll!_InternalCallWinProc <at> 20()  + 0x23 bytes
         user32.dll!_UserCallWinProcCheckWow <at> 32()  + 0xb7 bytes
         user32.dll!_DispatchClientMessage <at> 24()  + 0x51 bytes
         user32.dll!___fnCOPYDATA <at> 4()  + 0x47 bytes
         ntdll.dll!_KiUserCallbackDispatcher <at> 12()  + 0x2e bytes
         user32.dll!_RealSystemParametersInfoA <at> 16()  + 0x71 bytes
         uxtheme.dll!_InternalSystemParametersInfo()  + 0x2b bytes
         uxtheme.dll!_ThemeSystemParametersInfoA <at> 16()  + 0x4f bytes
         user32.dll!_SystemParametersInfoA <at> 16()  + 0x40 bytes
         jdesk-0.73.dll!00e525a2()
         [Frames below may be incorrect and/or missing, no symbols 
loaded for jdesk-0.73.dll]
         jdesk-0.73.dll!00e52754()
         jdesk-0.73.dll!00e515ad()
         user32.dll!_DispatchClientMessage <at> 24()  + 0x5c bytes
         ntdll.dll!_KiUserCallbackDispatcher <at> 12()  + 0x2e bytes
         user32.dll!_VerNtUserCreateWindowEx <at> 52()  + 0x189 bytes

-ilmcuts

(Continue reading)

chris | 7 Aug 2008 19:26
Picon
Favicon

Re: Re-entrancy example

ilmcuts <ilmcuts <at> ...> writes:
> Below is an interesting example of unexpected re-entrancy. <snip>

Bleh, I didn't realize SystemsParametersInfo() was a function that allowed that.
:(

Any thought on how to handle this?  I draw a blank.

chris

ilmcuts | 14 Aug 2008 22:16
Picon

Re: Re: Re-entrancy example

chris wrote:
> ilmcuts <ilmcuts <at> ...> writes:
>> Below is an interesting example of unexpected re-entrancy. <snip>
> 
> Bleh, I didn't realize SystemsParametersInfo() was a function that allowed that.
> :(
> 
> Any thought on how to handle this?  I draw a blank.
> 
> chris

SendMessage allows re-entrancy, and SPIF_SENDCHANGE relies on that. It 
didn't cause any problems in this case, I just happened to have a 
breakpoint in TrayService::Whatever and noticed the odd callstack. We 
probably have loads of modules that do such things during initModuleEx.

As for handling (ie. avoiding) it, delay the broadcast? Do it on a 
separate thread? How much of an issue is it?

-ilmcuts


Gmane