mirror of
https://github.com/reactos/reactos.git
synced 2025-07-10 01:17:58 +00:00
[SETUPAPI/FORMATTING]
- Try to fix some indentation nightmares. No code changes svn path=/trunk/; revision=53897
This commit is contained in:
parent
761d041617
commit
a20f6e3513
5 changed files with 489 additions and 495 deletions
File diff suppressed because it is too large
Load diff
|
@ -149,9 +149,9 @@ static void *grow_array( void *array, unsigned int *count, size_t elem )
|
||||||
if (new_count < 32) new_count = 32;
|
if (new_count < 32) new_count = 32;
|
||||||
|
|
||||||
if (array)
|
if (array)
|
||||||
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem );
|
||||||
else
|
else
|
||||||
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
new_array = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, new_count * elem );
|
||||||
|
|
||||||
if (new_array)
|
if (new_array)
|
||||||
*count = new_count;
|
*count = new_count;
|
||||||
|
@ -327,35 +327,35 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR *
|
||||||
strings_section = file->sections[file->strings_section];
|
strings_section = file->sections[file->strings_section];
|
||||||
for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++)
|
for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++)
|
||||||
{
|
{
|
||||||
if (line->key_field == -1) continue;
|
if (line->key_field == -1) continue;
|
||||||
if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue;
|
if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue;
|
||||||
if (!file->fields[line->key_field].text[*len]) break;
|
if (!file->fields[line->key_field].text[*len]) break;
|
||||||
}
|
}
|
||||||
if (j == strings_section->nb_lines || !line->nb_fields) goto not_found;
|
if (j == strings_section->nb_lines || !line->nb_fields) goto not_found;
|
||||||
field = &file->fields[line->first_field];
|
field = &file->fields[line->first_field];
|
||||||
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, Lang, sizeof(Lang)/sizeof(TCHAR)); // get the current system locale for translated strings
|
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, Lang, sizeof(Lang)/sizeof(TCHAR)); // get the current system locale for translated strings
|
||||||
strcatW(StringLangId, Lang); // append the Language identifier from GetLocaleInfo
|
strcatW(StringLangId, Lang); // append the Language identifier from GetLocaleInfo
|
||||||
// now you have e.g. Strings.0407 for german translations
|
// now you have e.g. Strings.0407 for german translations
|
||||||
for (i = 0; i < file->nb_sections; i++) // search in all sections
|
for (i = 0; i < file->nb_sections; i++) // search in all sections
|
||||||
{
|
{
|
||||||
if (!strcmpiW(file->sections[i]->name,StringLangId)) // if the section is a Strings.* section
|
if (!strcmpiW(file->sections[i]->name,StringLangId)) // if the section is a Strings.* section
|
||||||
{
|
{
|
||||||
strings_section = file->sections[i]; // select this section for further use
|
strings_section = file->sections[i]; // select this section for further use
|
||||||
for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++) // process all lines in this section
|
for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++) // process all lines in this section
|
||||||
{
|
{
|
||||||
if (line->key_field == -1) continue; // if no key then skip
|
if (line->key_field == -1) continue; // if no key then skip
|
||||||
if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip
|
if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip
|
||||||
if (!file->fields[line->key_field].text[*len]) // if value exist
|
if (!file->fields[line->key_field].text[*len]) // if value exist
|
||||||
{
|
{
|
||||||
field = &file->fields[line->first_field]; // then extract value and
|
field = &file->fields[line->first_field]; // then extract value and
|
||||||
break; // no more search necessary
|
break; // no more search necessary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*len = strlenW( field->text ); // set length
|
*len = strlenW( field->text ); // set length
|
||||||
ret = field->text; // return the english or translated string
|
ret = field->text; // return the english or translated string
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
not_found: /* check for integer id */
|
not_found: /* check for integer id */
|
||||||
|
@ -1511,7 +1511,7 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
|
||||||
index -= file->sections[section_index]->nb_lines;
|
index -= file->sections[section_index]->nb_lines;
|
||||||
}
|
}
|
||||||
TRACE( "(%p,%s) not found\n", hinf, debugstr_w(section) );
|
TRACE( "(%p,%s) not found\n", hinf, debugstr_w(section) );
|
||||||
SetLastError( ERROR_LINE_NOT_FOUND );
|
SetLastError( ERROR_LINE_NOT_FOUND );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1578,7 +1578,7 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE( "(%p,%s,%s): not found\n", hinf, debugstr_w(section), debugstr_w(key) );
|
TRACE( "(%p,%s,%s): not found\n", hinf, debugstr_w(section), debugstr_w(key) );
|
||||||
SetLastError( ERROR_LINE_NOT_FOUND );
|
SetLastError( ERROR_LINE_NOT_FOUND );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -938,36 +938,36 @@ static BOOL create_full_pathW(const WCHAR *path)
|
||||||
strcpyW(new_path, path);
|
strcpyW(new_path, path);
|
||||||
|
|
||||||
while((len = strlenW(new_path)) && new_path[len - 1] == '\\')
|
while((len = strlenW(new_path)) && new_path[len - 1] == '\\')
|
||||||
new_path[len - 1] = 0;
|
new_path[len - 1] = 0;
|
||||||
|
|
||||||
while(!CreateDirectoryW(new_path, NULL))
|
while(!CreateDirectoryW(new_path, NULL))
|
||||||
{
|
{
|
||||||
WCHAR *slash;
|
WCHAR *slash;
|
||||||
DWORD last_error = GetLastError();
|
DWORD last_error = GetLastError();
|
||||||
|
|
||||||
if(last_error == ERROR_ALREADY_EXISTS)
|
if(last_error == ERROR_ALREADY_EXISTS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(last_error != ERROR_PATH_NOT_FOUND)
|
if(last_error != ERROR_PATH_NOT_FOUND)
|
||||||
{
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(slash = strrchrW(new_path, '\\')))
|
if(!(slash = strrchrW(new_path, '\\')))
|
||||||
{
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = slash - new_path;
|
len = slash - new_path;
|
||||||
new_path[len] = 0;
|
new_path[len] = 0;
|
||||||
if(!create_full_pathW(new_path))
|
if(!create_full_pathW(new_path))
|
||||||
{
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
new_path[len] = '\\';
|
new_path[len] = '\\';
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, new_path);
|
HeapFree(GetProcessHeap(), 0, new_path);
|
||||||
|
@ -1311,15 +1311,15 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC
|
||||||
debugstr_w( op_result == FILEOP_NEWPATH ? newpath : paths.Source ),
|
debugstr_w( op_result == FILEOP_NEWPATH ? newpath : paths.Source ),
|
||||||
debugstr_w(paths.Target) );
|
debugstr_w(paths.Target) );
|
||||||
if (op->dst_path)
|
if (op->dst_path)
|
||||||
{
|
{
|
||||||
if (!create_full_pathW( op->dst_path ))
|
if (!create_full_pathW( op->dst_path ))
|
||||||
{
|
{
|
||||||
paths.Win32Error = GetLastError();
|
paths.Win32Error = GetLastError();
|
||||||
op_result = handler( context, SPFILENOTIFY_COPYERROR,
|
op_result = handler( context, SPFILENOTIFY_COPYERROR,
|
||||||
(UINT_PTR)&paths, (UINT_PTR)newpath );
|
(UINT_PTR)&paths, (UINT_PTR)newpath );
|
||||||
if (op_result == FILEOP_ABORT) goto done;
|
if (op_result == FILEOP_ABORT) goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (do_file_copyW( op_result == FILEOP_NEWPATH ? newpath : paths.Source,
|
if (do_file_copyW( op_result == FILEOP_NEWPATH ? newpath : paths.Source,
|
||||||
paths.Target, op->style, handler, context )) break; /* success */
|
paths.Target, op->style, handler, context )) break; /* success */
|
||||||
/* try to extract it from the cabinet file */
|
/* try to extract it from the cabinet file */
|
||||||
|
@ -1724,7 +1724,7 @@ UINT WINAPI SetupRenameErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR source,
|
||||||
UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
|
UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
|
||||||
PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath,
|
PCSTR sourcepath, PCSTR sourcefile, PCSTR targetpath,
|
||||||
UINT w32error, DWORD style, PSTR pathbuffer,
|
UINT w32error, DWORD style, PSTR pathbuffer,
|
||||||
DWORD buffersize, PDWORD requiredsize)
|
DWORD buffersize, PDWORD requiredsize)
|
||||||
{
|
{
|
||||||
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
|
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
|
||||||
w32error, debugstr_a(sourcefile), debugstr_a(sourcepath) ,debugstr_a(targetpath));
|
w32error, debugstr_a(sourcefile), debugstr_a(sourcepath) ,debugstr_a(targetpath));
|
||||||
|
@ -1738,7 +1738,7 @@ UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
|
||||||
UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname,
|
UINT WINAPI SetupCopyErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR diskname,
|
||||||
PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath,
|
PCWSTR sourcepath, PCWSTR sourcefile, PCWSTR targetpath,
|
||||||
UINT w32error, DWORD style, PWSTR pathbuffer,
|
UINT w32error, DWORD style, PWSTR pathbuffer,
|
||||||
DWORD buffersize, PDWORD requiredsize)
|
DWORD buffersize, PDWORD requiredsize)
|
||||||
{
|
{
|
||||||
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
|
FIXME( "stub: (Error Number %d when attempting to copy file %s from %s to %s)\n",
|
||||||
w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath));
|
w32error, debugstr_w(sourcefile), debugstr_w(sourcepath) ,debugstr_w(targetpath));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue