mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/win32-vd_agent
synced 2026-01-02 22:07:32 +00:00
Initialize buffers before querying display config
The buffers and buffer sizes should be initialized and allocated. This patch fixes a possible case where vdagent can get stuck, as the function _pfnQueryDisplayConfig can return ERROR_INVALID_PARAMETER if the buffers aren't intialized. The call to free_config_buffers is superfluous because it is called inside get_config_buffers. Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
efcd07af8b
commit
3856b1147a
@ -356,7 +356,8 @@ CCD::~CCD()
|
||||
bool CCD::query_display_config()
|
||||
{
|
||||
LONG query_error(ERROR_SUCCESS);
|
||||
|
||||
if (!get_config_buffers())
|
||||
return false;
|
||||
//Until we get it or error != ERROR_INSUFFICIENT_BUFFER
|
||||
do {
|
||||
query_error = _pfnQueryDisplayConfig(QDC_ALL_PATHS, &_numPathElements, _pPathInfo,
|
||||
@ -367,7 +368,6 @@ bool CCD::query_display_config()
|
||||
//(see https://msdn.microsoft.com/en-us/library/windows/hardware/ff569215(v=vs.85).aspx )
|
||||
if (query_error) {
|
||||
if (query_error == ERROR_INSUFFICIENT_BUFFER) {
|
||||
free_config_buffers();
|
||||
if (!get_config_buffers())
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user