In my project I use a third-party DLL, that creates some threads, which in turn call my function. The threads in the third-party DLL are created with _beginthreadex(), the DLL i