In GetEnumeratorName() you create a char array variable "buffer" on the stack.
What you put on the stack is only guaranteed to be there during the scope of the function.
At the end of the function you return a pointer to said variable.
That does not look quite right...
Suggest you let your functions return std::string instead of "char *"
https://github.com/balena-io-modules/drivelist/blob/master/src/windows/list.cpp#L71
In GetEnumeratorName() you create a char array variable "buffer" on the stack. What you put on the stack is only guaranteed to be there during the scope of the function. At the end of the function you return a pointer to said variable.
That does not look quite right... Suggest you let your functions return std::string instead of "char *"