Skip to content

user32/tests: Improve the GetWindowModuleFileName() checks.

Francois Gouget requested to merge win into master

Check that NULL has no special meaning. Check GetLastError() for systray windows. Trace the module filename in case of unexpected success and enclose it in quotes in case there are leading or trailing spaces. Fix the filename buffer initialization.

The buf2[0] = 0 line at the top of the patch was introduced in 914cb228 but buf2 was not used after that. So clearly it is buf1 that should have been initialized there. That said I'm not sure initializing buf1 & buf2 is really necessary as they are only used in case of success. I guess the fear was that GetWindowModuleFileName() would sometimes return success without touching the buffer but I'm not convinced that fear is justified. Still I decided to be conservative and preserve the initializations. I'm fine with removing them though (maybe the buf2 case is a bit special). Finally this is meant to help figure out the reason for the failure decribed in bug 55777.

Merge request reports

Loading