It took a while but I found the culprit. The crash is most likely because the window is (about to be) destroyed.
The only thing left to do is to fix the 211 test failures on NT4.
I fixed a typo while at it and used a define instead of a magic value.
Are you sure this is the right fix? Is this crash not caused by the loop, and not the actual call to the menu?
Other test-cases call the same API without this problem.
/pedro
On 01/21/2010 03:07 PM, Peter Dons Tychsen wrote:
It took a while but I found the culprit. The crash is most likely because the window is (about to be) destroyed. The only thing left to do is to fix the 211 test failures on NT4. I fixed a typo while at it and used a define instead of a magic value.
Are you sure this is the right fix? Is this crash not caused by the loop, and not the actual call to the menu?
Yes, I'm a 100% sure it's this call. I commented several pieces of code to get to this conclusion.
Other test-cases call the same API without this problem.
But maybe not with a window that's in the process (or already) of being destroyed (in the callback).
But maybe not with a window that's in the process (or already) of being
destroyed (in the callback).
OK, but in the the first run of the "loop" we are not in the process of destroying the window, as DestroyWindow has not been called yet. Am i missing something? Are there other things that cause the window to destroy?
Yes, I'm a 100% sure it's this call. I commented several pieces of code to
get to this conclusion. And you are also sure this happens the first time the API is called, and not the second time (because of the loop)?
/p
On 01/21/2010 04:48 PM, Peter Dons Tychsen wrote:
But maybe not with a window that's in the process (or already) of
being destroyed (in the callback).
OK, but in the the first run of the "loop" we are not in the process of destroying the window, as DestroyWindow has not been called yet. Am i missing something? Are there other things that cause the window to destroy?
The window is destroyed at the first WM_CAPTURECHANGED message.
Yes, I'm a 100% sure it's this call. I commented several pieces of
code to get to this conclusion. And you are also sure this happens the first time the API is called, and not the second time (because of the loop)?
I'm lost here as TrackPopupMenu() is not called in a loop. It's only called once. So which API function are you referring to?
I did also see the SetCapture(hwnd) (just before the Win9x check) has a return value of NULL.
The DestroyWindow(hwnd) (at the end) is called when the window is already destroyed but that doesn't do any harm.