Reviewed-by: Kostiantyn Kostiuk <[email protected]>

On Mon, Sep 7, 2026 at 1:50 PM Marc-André Lureau <
[email protected]> wrote:

> qga_debug() uses vsnprintf, snprintf and fputs while DllMain holds the
> loader lock. CRT I/O can deadlock under the loader lock. Replace with
> direct OutputDebugStringA calls, which are safe to call from DllMain.
>
> Fixes: 61df91b33caf ("QGA VSS: Add log in functions begin/end")
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  qga/vss-win32/provider.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
> index 44c3c74bd2f2..1c8eb236e57f 100644
> --- a/qga/vss-win32/provider.cpp
> +++ b/qga/vss-win32/provider.cpp
> @@ -536,11 +536,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD
> dwReason, LPVOID lpReserved);
>  EXTERN_C
>  BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD dwReason, LPVOID lpReserved)
>  {
> -    qga_debug("begin, reason = %lu", dwReason);
> +    OutputDebugStringA(QGA_PROVIDER_NAME ": DllMain begin\n");
>      if (dwReason == DLL_PROCESS_ATTACH) {
>          g_hinstDll = hinstDll;
>          DisableThreadLibraryCalls(hinstDll);
>      }
> -    qga_debug_end;
> +    OutputDebugStringA(QGA_PROVIDER_NAME ": DllMain end\n");
>      return TRUE;
>  }
>
> --
> 2.55.0.543.g5ebe2ebe4ea8
>
>

Reply via email to