I am writing software in C++ using the Win32 API, however the following function running in a thread is presenting a strange issue that I have no idea about its source.
T