Commit 705d3eed authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

setupapi: Fill out all source file parameters in SetupQueueDefaultCopy().

parent f9f25ee2
...@@ -392,7 +392,7 @@ static WCHAR *get_destination_dir( HINF hinf, const WCHAR *section ) ...@@ -392,7 +392,7 @@ static WCHAR *get_destination_dir( HINF hinf, const WCHAR *section )
WCHAR systemdir[MAX_PATH], *dir; WCHAR systemdir[MAX_PATH], *dir;
BOOL ret; BOOL ret;
if (!(ret = SetupFindFirstLineW( hinf, Dest, section, &context ))) if (!section || !(ret = SetupFindFirstLineW( hinf, Dest, section, &context )))
ret = SetupFindFirstLineW( hinf, Dest, Def, &context ); ret = SetupFindFirstLineW( hinf, Dest, Def, &context );
if (ret && (dir = PARSER_get_dest_dir( &context ))) if (ret && (dir = PARSER_get_dest_dir( &context )))
...@@ -626,24 +626,21 @@ BOOL WINAPI SetupQueueCopyW( HSPFILEQ queue, PCWSTR src_root, PCWSTR src_path, P ...@@ -626,24 +626,21 @@ BOOL WINAPI SetupQueueCopyW( HSPFILEQ queue, PCWSTR src_root, PCWSTR src_path, P
/*********************************************************************** /***********************************************************************
* SetupQueueDefaultCopyA (SETUPAPI.@) * SetupQueueDefaultCopyA (SETUPAPI.@)
*/ */
BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, PCSTR src_root, PCSTR src_file, BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, const char *src_rootA,
PCSTR dst_file, DWORD style ) const char *src_fileA, const char *dst_fileA, DWORD style )
{ {
SP_FILE_COPY_PARAMS_A params; WCHAR src_rootW[MAX_PATH], src_fileW[MAX_PATH], dst_fileW[MAX_PATH];
params.cbSize = sizeof(params); if (!src_rootA || !src_fileA || !dst_fileA)
params.QueueHandle = queue; {
params.SourceRootPath = src_root; SetLastError(ERROR_INVALID_PARAMETER);
params.SourcePath = NULL; return FALSE;
params.SourceFilename = src_file; }
params.SourceDescription = NULL;
params.SourceTagfile = NULL; MultiByteToWideChar( CP_ACP, 0, src_rootA, -1, src_rootW, ARRAY_SIZE(src_rootW) );
params.TargetDirectory = NULL; MultiByteToWideChar( CP_ACP, 0, src_fileA, -1, src_fileW, ARRAY_SIZE(src_fileW) );
params.TargetFilename = dst_file; MultiByteToWideChar( CP_ACP, 0, dst_fileA, -1, dst_fileW, ARRAY_SIZE(dst_fileW) );
params.CopyStyle = style; return SetupQueueDefaultCopyW( queue, hinf, src_rootW, src_fileW, dst_fileW, style );
params.LayoutInf = hinf;
params.SecurityDescriptor = NULL;
return SetupQueueCopyIndirectA( &params );
} }
...@@ -653,21 +650,39 @@ BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, PCSTR src_root, P ...@@ -653,21 +650,39 @@ BOOL WINAPI SetupQueueDefaultCopyA( HSPFILEQ queue, HINF hinf, PCSTR src_root, P
BOOL WINAPI SetupQueueDefaultCopyW( HSPFILEQ queue, HINF hinf, PCWSTR src_root, PCWSTR src_file, BOOL WINAPI SetupQueueDefaultCopyW( HSPFILEQ queue, HINF hinf, PCWSTR src_root, PCWSTR src_file,
PCWSTR dst_file, DWORD style ) PCWSTR dst_file, DWORD style )
{ {
WCHAR src_root_buffer[MAX_PATH], src_path[MAX_PATH];
SP_FILE_COPY_PARAMS_W params; SP_FILE_COPY_PARAMS_W params;
BOOL ret;
if (!src_root || !src_file || !dst_file)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
params.cbSize = sizeof(params); params.cbSize = sizeof(params);
params.QueueHandle = queue; params.QueueHandle = queue;
params.SourceRootPath = src_root; params.SourceRootPath = src_root_buffer;
params.SourcePath = NULL; params.SourcePath = NULL;
params.SourceFilename = src_file; params.SourceFilename = src_file;
params.SourceDescription = NULL; params.SourceDescription = NULL;
params.SourceTagfile = NULL; params.SourceTagfile = NULL;
params.TargetDirectory = NULL;
params.TargetFilename = dst_file; params.TargetFilename = dst_file;
params.CopyStyle = style; params.CopyStyle = style;
params.LayoutInf = hinf; params.LayoutInf = NULL;
params.SecurityDescriptor = NULL; params.SecurityDescriptor = NULL;
return SetupQueueCopyIndirectW( &params );
strcpyW( src_root_buffer, src_root );
src_path[0] = 0;
if (!(params.TargetDirectory = get_destination_dir( hinf, NULL ))) return FALSE;
get_source_info( hinf, src_file, &params, src_root_buffer, src_path );
ret = SetupQueueCopyIndirectW( &params );
heap_free( (WCHAR *)params.TargetDirectory );
heap_free( (WCHAR *)params.SourceDescription );
heap_free( (WCHAR *)params.SourceTagfile );
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