win32 vout: factorize code