On Sun, 2007-08-05 at 23:23 +0200, Alexandre Julliard wrote:
Peter Dons Tychsen donpedro@tdcadsl.dk writes:
This piece of code, if inserted into the test system, could (on original Windows) show us which messages we are incorrectly posting or sending. I can probably also be used for other test purposes. I works by checking the call stack for the calls SendMessageA() and SendMessageW(). Works like charm on Windows-XP. Will need some work to also work inside Wine, but that is not important for now.
This is silly. It can't possibly work right since there is no reason that messages are sent using the exported functions, it won't work on anything not compiled with frame pointer, and there's absolutely no need for anything like that at all.
Hello again,
For the tests i am running there is always a frame pointer. You might be right that there are other (better) ways to solve this problem, but is still think this little function could come in handy when black-box testing original DLLs. You are of course right about the point of the exported functions. It slipped my mind... I am not sure the word "silly" applies however... :-).
A posted message doesn't call the window proc directly, it goes through the message queue, so it's completely trivial to check for it between GetMessage and DispatchMessage.
In this case we would need to use PeekMessage(), but yes, you are right. I scrapped this solution to begin with as it required too much many changes in the test suite (and probably also because i liked the more complicated version - should have stuck with the simple one :-))
I always try to follow the "keep it simple" rule-sets, but it is not always i succeed in doing it... :-(.
I will go back and redo the tests with this approach, now that you have torpedoed my idea, which i probably deserved.
Thanks,
/Pedro