I have a go program that executes a WMI query then converts the data back into go-land data structures (using the method here). Every so often, go's GC comes along and nukes some seemingly random parts of memory to 0
s, causing horrible breakage.
I am trying to figure out what exactly is causing this problem, and the next step, I believe, is to understand what happens during the COM call. My current understanding is:
- call into COM with the WMI query from a process
- the OS executes the query and writes the results into some memory location owned by the process
- that location is returned from the COM call, which I can then access and serialize
Is this about what happens? How does Windows choose that memory location such that it doesn't overwrite existing data?