setupapi: Avoid passing a NULL source root path to SetupQueueDefaultCopy() and SetupQueueCopySection().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5d1febc909
commit
cedbdf4387
|
@ -155,11 +155,20 @@ static WCHAR *dup_section_line_field( HINF hinf, const WCHAR *section, const WCH
|
||||||
static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg )
|
static BOOL copy_files_callback( HINF hinf, PCWSTR field, void *arg )
|
||||||
{
|
{
|
||||||
struct files_callback_info *info = arg;
|
struct files_callback_info *info = arg;
|
||||||
|
WCHAR src_root[MAX_PATH], *p;
|
||||||
|
|
||||||
|
if (!info->src_root)
|
||||||
|
{
|
||||||
|
strcpyW( src_root, PARSER_get_inf_filename( hinf ) );
|
||||||
|
if ((p = strrchrW( src_root, '\\' ))) *p = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (field[0] == '@') /* special case: copy single file */
|
if (field[0] == '@') /* special case: copy single file */
|
||||||
SetupQueueDefaultCopyW( info->queue, info->layout ? info->layout : hinf, info->src_root, NULL, field+1, info->copy_flags );
|
SetupQueueDefaultCopyW( info->queue, info->layout ? info->layout : hinf,
|
||||||
|
info->src_root ? info->src_root : src_root, NULL, field+1, info->copy_flags );
|
||||||
else
|
else
|
||||||
SetupQueueCopySectionW( info->queue, info->src_root, info->layout ? info->layout : hinf, hinf, field, info->copy_flags );
|
SetupQueueCopySectionW( info->queue, info->src_root ? info->src_root : src_root,
|
||||||
|
info->layout ? info->layout : hinf, hinf, field, info->copy_flags );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue