mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:32:18 +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
|
@ -52,9 +52,9 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT
|
||||||
list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
|
list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
|
||||||
|
|
||||||
list->dwDriveCount = 0;
|
list->dwDriveCount = 0;
|
||||||
|
|
||||||
ptr = drives;
|
ptr = drives;
|
||||||
|
|
||||||
while (*ptr)
|
while (*ptr)
|
||||||
{
|
{
|
||||||
DWORD type = GetDriveTypeW(ptr);
|
DWORD type = GetDriveTypeW(ptr);
|
||||||
|
@ -89,8 +89,8 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListA(PVOID Reserved1, DWORD Reserved2, UINT
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetupAddInstallSectionToDiskSpaceListA (SETUPAPI.@)
|
* SetupAddInstallSectionToDiskSpaceListA (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
|
BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
|
||||||
HINF InfHandle, HINF LayoutInfHandle,
|
HINF InfHandle, HINF LayoutInfHandle,
|
||||||
LPCSTR SectionName, PVOID Reserved1, UINT Reserved2)
|
LPCSTR SectionName, PVOID Reserved1, UINT Reserved2)
|
||||||
{
|
{
|
||||||
FIXME ("Stub\n");
|
FIXME ("Stub\n");
|
||||||
|
@ -100,8 +100,8 @@ BOOL WINAPI SetupAddInstallSectionToDiskSpaceListA(HDSKSPC DiskSpace,
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetupQuerySpaceRequiredOnDriveA (SETUPAPI.@)
|
* SetupQuerySpaceRequiredOnDriveA (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
|
BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
|
||||||
LPCSTR DriveSpec, LONGLONG* SpaceRequired,
|
LPCSTR DriveSpec, LONGLONG* SpaceRequired,
|
||||||
PVOID Reserved1, UINT Reserved2)
|
PVOID Reserved1, UINT Reserved2)
|
||||||
{
|
{
|
||||||
WCHAR driveW[20];
|
WCHAR driveW[20];
|
||||||
|
@ -115,7 +115,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
|
||||||
lstrcatW(driveW,bkslsh);
|
lstrcatW(driveW,bkslsh);
|
||||||
|
|
||||||
TRACE("Looking for drive %s\n",debugstr_w(driveW));
|
TRACE("Looking for drive %s\n",debugstr_w(driveW));
|
||||||
|
|
||||||
for (i = 0; i < list->dwDriveCount; i++)
|
for (i = 0; i < list->dwDriveCount; i++)
|
||||||
{
|
{
|
||||||
TRACE("checking drive %s\n",debugstr_w(list->Drives[i].lpzName));
|
TRACE("checking drive %s\n",debugstr_w(list->Drives[i].lpzName));
|
||||||
|
@ -137,5 +137,5 @@ BOOL WINAPI SetupDestroyDiskSpaceList(HDSKSPC DiskSpace)
|
||||||
{
|
{
|
||||||
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
|
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
|
||||||
HeapFree(GetProcessHeap(),0,list);
|
HeapFree(GetProcessHeap(),0,list);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl,
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetupGetInfInformationW (SETUPAPI.@)
|
* SetupGetInfInformationW (SETUPAPI.@)
|
||||||
*
|
*
|
||||||
* BUGS
|
* BUGS
|
||||||
* Only handles the case when InfSpec is an INF handle.
|
* Only handles the case when InfSpec is an INF handle.
|
||||||
*/
|
*/
|
||||||
|
@ -242,7 +242,7 @@ BOOL WINAPI SetupQueryInfFileInformationA(PSP_INF_INFORMATION InfInformation,
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation,
|
BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation,
|
||||||
UINT InfIndex, PWSTR ReturnBuffer,
|
UINT InfIndex, PWSTR ReturnBuffer,
|
||||||
DWORD ReturnBufferSize, PDWORD RequiredSize)
|
DWORD ReturnBufferSize, PDWORD RequiredSize)
|
||||||
{
|
{
|
||||||
DWORD len;
|
DWORD len;
|
||||||
LPWSTR ptr;
|
LPWSTR ptr;
|
||||||
|
|
|
@ -938,43 +938,43 @@ 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);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
|
static BOOL do_file_copyW( LPCWSTR source, LPCWSTR target, DWORD style,
|
||||||
PSP_FILE_CALLBACK_W handler, PVOID context )
|
PSP_FILE_CALLBACK_W handler, PVOID context )
|
||||||
{
|
{
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
|
@ -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 */
|
||||||
|
@ -1721,10 +1721,10 @@ UINT WINAPI SetupRenameErrorW( HWND parent, PCWSTR dialogTitle, PCWSTR source,
|
||||||
* SetupCopyErrorA (SETUPAPI.@)
|
* SetupCopyErrorA (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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));
|
||||||
|
@ -1735,10 +1735,10 @@ UINT WINAPI SetupCopyErrorA( HWND parent, PCSTR dialogTitle, PCSTR diskname,
|
||||||
* SetupCopyErrorW (SETUPAPI.@)
|
* SetupCopyErrorW (SETUPAPI.@)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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