qga/vss-win32: evaluate err_set() macro argument only once

The err_set macro expands its 'err' parameter three times. When
callers pass GetLastError(), the Win32 error code is fetched on
each expansion and may change between evaluations, since the
intervening function calls can reset the thread's last-error value.

Capture the argument in a local DWORD once and reference that
throughout the macro body.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260907-qga-v1-12-86456ad356e2@redhat.com
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
1 file changed