Closed LinusU closed 2 months ago
(copy-paste of my review comment from before, just for history reasons)
By the way, I checked and I now believe that STARTUPINFOA has never changed in size, so my worries about callers passing in an undersized buffer or something like that are unfounded. And further I checked and at least win2k's kernel32.dll does exactly what you've done here, so I think this is correct.
As I've understand
GetStartupInfoA
, the caller always passes a pointer to uninitialized memory, and the function will then fill in the values. Before this change,GetStartupInfoA
read the value ofcb
as an input parameter to get the length of the struct. In my program that part of the memory was uninitialized and happened to be 0, so the rest of the values were never zeroed out, leading to garbage data being returned in the other field.This change make sure to zero out the entire struct, and then sets
cb
to the actual length of the struct.Lifted from #39