mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 00:13:57 +00:00
sync SetupGetTargetPathW with wine
fixes all setupapi query winetests svn path=/trunk/; revision=40603
This commit is contained in:
parent
3103b957bf
commit
03fef42adf
|
@ -563,19 +563,25 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
|
||||||
{'D','e','f','a','u','l','t','D','e','s','t','D','i','r',0};
|
{'D','e','f','a','u','l','t','D','e','s','t','D','i','r',0};
|
||||||
|
|
||||||
INFCONTEXT ctx;
|
INFCONTEXT ctx;
|
||||||
WCHAR *dir;
|
WCHAR *dir, systemdir[MAX_PATH];
|
||||||
INT size;
|
unsigned int size;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
|
TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer,
|
||||||
buffer_size, required_size);
|
buffer_size, required_size);
|
||||||
|
|
||||||
if (context && !SetupFindFirstLineW( hinf, destination_dirs, NULL, context )) return FALSE;
|
if (context) ret = SetupFindFirstLineW( hinf, destination_dirs, NULL, context );
|
||||||
else if (section && !SetupFindFirstLineW( hinf, section, NULL, &ctx )) return FALSE;
|
else if (section)
|
||||||
else if (!SetupFindFirstLineW( hinf, destination_dirs, default_dest_dir, &ctx )) return FALSE;
|
{
|
||||||
|
if (!(ret = SetupFindFirstLineW( hinf, destination_dirs, section, &ctx )))
|
||||||
if (!(dir = PARSER_get_dest_dir( context ? context : &ctx ))) return FALSE;
|
ret = SetupFindFirstLineW( hinf, destination_dirs, default_dest_dir, &ctx );
|
||||||
|
}
|
||||||
size = lstrlenW( dir ) + 1;
|
if (!ret || !(dir = PARSER_get_dest_dir( context ? context : &ctx )))
|
||||||
|
{
|
||||||
|
GetSystemDirectoryW( systemdir, MAX_PATH );
|
||||||
|
dir = systemdir;
|
||||||
|
}
|
||||||
|
size = strlenW( dir ) + 1;
|
||||||
if (required_size) *required_size = size;
|
if (required_size) *required_size = size;
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
|
@ -589,7 +595,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, dir );
|
if (dir != systemdir) HeapFree( GetProcessHeap(), 0, dir );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue