[ros-kernel] Suggested implementation ideas for the various WndProc, CallWndProc etc fixes

Frank D. Engel, Jr. fde101 at yahoo.com
Mon Nov 10 04:00:27 CET 2003


Why can't the kernel/executive simply free them when the process
terminates, regardless of whether normal termination occurs or not?

--- Jonathan Wilson <jonwil at tpgi.com.au> wrote:
> One problem with this is that we need to free these structures at
> some point.
>  From further analysis (and from reading MSDN), the best time to
> delete 
> these structures from their storage in win32k is when the app that
> called 
> the function that created the structure, i.e. SetWindowLong,
> SetClassLong 
> or RegisterClassEx terminates, since this is when the handle would
> become 
> invalid due to the WNDPROC disappearing from memory when the app
> terminates 
> and the code is unloaded from memory (because a Window Procedure
> handle).
> 
> Given that the pointer passed to SetClassLong, SetWindowLong and 
> RegisterClassEx and so on is a pointer thats relative to the local
> address 
> space of the app, when the app disappears, the code will disappear
> and the 
> pointer we store in the structure is now pointing to god knows what.
> MSDN explicitly says that you can only subclass a window if you are
> the 
> owner of that window and that you can only superclass a window class
> if it 
> is a system class or if it is a class you registered.
> 
> So, we need to store the "process ID" (whatever ROS/windows has that
> passes 
> for one) in the structure. And we need to implement clean-up code
> when the 
> module is unloaded and/or the app terminates to remove all the "owned
> by 
> this process" structures. Of course, should the process terminate
> wierdly 
> and not call the usual cleanups, it will leak. However, my experience
> shows 
> that even a dead simple program will leak memory on real windows if 
> teminated unexpectedly so we should be fine here. (unless someone
> wants to 
> suggest a work-around)
> 
> Lets get these implementation details (like figuring out how to store
> the 
> data and when to delete the memory we are storing the data in) worked
> out 
> ASAP so that someone (probobly me unless someone else gets to it
> first) can 
> get this thing coded.
> 
> 
> _______________________________________________
> Ros-kernel mailing list
> Ros-kernel at reactos.com
> http://reactos.geldorp.nl:8080/mailman/listinfo/ros-kernel


=====
=======
Frank D. Engel, Jr.

Modify the equilibrium of the vertically-oriented particle decelerator to result in the reestablishment of its resistance to counterproductive atmospheric penetration.

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


More information about the Ros-kernel mailing list