Commit 873799df authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

user32: Fix returned value of LB_DIR.

parent a4c9d96a
......@@ -1815,6 +1815,7 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
LRESULT ret = LB_OKAY;
WIN32_FIND_DATAW entry;
int pos;
LRESULT maxinsert = LB_ERR;
/* don't scan directory if we just want drives exclusively */
if (attrib != (DDL_DRIVES | DDL_EXCLUSIVE)) {
......@@ -1860,13 +1861,17 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
pos = LISTBOX_FindFileStrPos( descr, buffer );
if ((ret = LISTBOX_InsertString( descr, pos, buffer )) < 0)
break;
if (ret <= maxinsert) maxinsert++; else maxinsert = ret;
} while (FindNextFileW( handle, &entry ));
FindClose( handle );
}
}
if (ret >= 0)
{
ret = maxinsert;
/* scan drives */
if ((ret >= 0) && (attrib & DDL_DRIVES))
if (attrib & DDL_DRIVES)
{
WCHAR buffer[] = {'[','-','a','-',']',0};
WCHAR root[] = {'A',':','\\',0};
......@@ -1878,6 +1883,7 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
break;
}
}
}
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment