Author: hpoussin Date: Thu Aug 31 13:13:03 2006 New Revision: 23836
URL: http://svn.reactos.org/svn/reactos?rev=23836&view=rev Log: Cleanup in .inf file handling of usetup: - Equivalent setupapi functions have the same protoype as in Win32 API - Extra functions have the INF_* prefix
Added: trunk/reactos/base/setup/usetup/inffile.c trunk/reactos/base/setup/usetup/inffile.h Modified: trunk/reactos/base/setup/usetup/bootsup.c trunk/reactos/base/setup/usetup/cabinet.c trunk/reactos/base/setup/usetup/console.c trunk/reactos/base/setup/usetup/console.h trunk/reactos/base/setup/usetup/drivesup.c trunk/reactos/base/setup/usetup/filequeue.c trunk/reactos/base/setup/usetup/filesup.c trunk/reactos/base/setup/usetup/format.c trunk/reactos/base/setup/usetup/fslist.c trunk/reactos/base/setup/usetup/genlist.c trunk/reactos/base/setup/usetup/inicache.c trunk/reactos/base/setup/usetup/keytrans.c trunk/reactos/base/setup/usetup/partlist.c trunk/reactos/base/setup/usetup/progress.c trunk/reactos/base/setup/usetup/registry.c trunk/reactos/base/setup/usetup/settings.c trunk/reactos/base/setup/usetup/usetup.c trunk/reactos/base/setup/usetup/usetup.h trunk/reactos/base/setup/usetup/usetup.rbuild
Modified: trunk/reactos/base/setup/usetup/bootsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.c... ============================================================================== --- trunk/reactos/base/setup/usetup/bootsup.c (original) +++ trunk/reactos/base/setup/usetup/bootsup.c Thu Aug 31 13:13:03 2006 @@ -24,7 +24,7 @@ * PROGRAMMER: Eric Kohl */
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/cabinet.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/cabinet.c... ============================================================================== --- trunk/reactos/base/setup/usetup/cabinet.c (original) +++ trunk/reactos/base/setup/usetup/cabinet.c Thu Aug 31 13:13:03 2006 @@ -8,7 +8,7 @@ * CSH 15/08-2003 Created */
-#include <usetup.h> +#include "usetup.h" #include <zlib.h>
#define NDEBUG
Modified: trunk/reactos/base/setup/usetup/console.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/console.c... ============================================================================== --- trunk/reactos/base/setup/usetup/console.c (original) +++ trunk/reactos/base/setup/usetup/console.c Thu Aug 31 13:13:03 2006 @@ -26,15 +26,15 @@
/* INCLUDES ******************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
/* GLOBALS ******************************************************************/
-static HANDLE StdInput = INVALID_HANDLE_VALUE; -static HANDLE StdOutput = INVALID_HANDLE_VALUE; +HANDLE StdInput = INVALID_HANDLE_VALUE; +HANDLE StdOutput = INVALID_HANDLE_VALUE;
static SHORT xScreen = 0; static SHORT yScreen = 0; @@ -436,138 +436,133 @@ return NT_SUCCESS(Status); }
- - - -VOID -CONSOLE_ConInKey(PINPUT_RECORD Buffer) +VOID +CONSOLE_ConInKey( + OUT PINPUT_RECORD Buffer) { ULONG Read;
- while (TRUE) - { - ReadConsoleInput(StdInput, Buffer, 1, &Read); - - if ((Buffer->EventType == KEY_EVENT) && - (Buffer->Event.KeyEvent.bKeyDown == TRUE)) - break; - } -} - - -VOID -CONSOLE_ConOutChar(CHAR c) -{ - ULONG Written; - - WriteConsole(StdOutput, - &c, - 1, - &Written, - NULL); -} - - -VOID -CONSOLE_ConOutPuts(LPSTR szText) -{ - ULONG Written; - - WriteConsole(StdOutput, - szText, - strlen(szText), - &Written, - NULL); - WriteConsole(StdOutput, - "\n", - 1, - &Written, - NULL); -} - - -VOID -CONSOLE_ConOutPrintf(LPSTR szFormat, ...) -{ - CHAR szOut[256]; - DWORD dwWritten; - va_list arg_ptr; - - va_start(arg_ptr, szFormat); - vsprintf(szOut, szFormat, arg_ptr); - va_end(arg_ptr); - - WriteConsole(StdOutput, - szOut, - strlen(szOut), - &dwWritten, - NULL); -} - - - - + while (TRUE) + { + ReadConsoleInput(StdInput, Buffer, 1, &Read); + + if ((Buffer->EventType == KEY_EVENT) + && (Buffer->Event.KeyEvent.bKeyDown == TRUE)) + break; + } +} + +VOID +CONSOLE_ConOutChar( + IN CHAR c) +{ + ULONG Written; + + WriteConsole( + StdOutput, + &c, + 1, + &Written, + NULL); +} + +VOID +CONSOLE_ConOutPuts( + IN LPCSTR szText) +{ + ULONG Written; + + WriteConsole( + StdOutput, + szText, + strlen(szText), + &Written, + NULL); + WriteConsole( + StdOutput, + "\n", + 1, + &Written, + NULL); +} + +VOID +CONSOLE_ConOutPrintf( + IN LPCSTR szFormat, ...) +{ + CHAR szOut[256]; + DWORD dwWritten; + va_list arg_ptr; + + va_start(arg_ptr, szFormat); + vsprintf(szOut, szFormat, arg_ptr); + va_end(arg_ptr); + + WriteConsole( + StdOutput, + szOut, + strlen(szOut), + &dwWritten, + NULL); +}
SHORT CONSOLE_GetCursorX(VOID) { - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - return(csbi.dwCursorPosition.X); -} - + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + return csbi.dwCursorPosition.X; +}
SHORT CONSOLE_GetCursorY(VOID) { - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - return(csbi.dwCursorPosition.Y); -} - - -VOID -CONSOLE_GetScreenSize(SHORT *maxx, - SHORT *maxy) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - - GetConsoleScreenBufferInfo(StdOutput, &csbi); - - if (maxx) - *maxx = csbi.dwSize.X; - - if (maxy) - *maxy = csbi.dwSize.Y; -} - - -VOID -CONSOLE_SetCursorType(BOOL bInsert, - BOOL bVisible) -{ - CONSOLE_CURSOR_INFO cci; - - cci.dwSize = bInsert ? 10 : 99; - cci.bVisible = bVisible; - - SetConsoleCursorInfo(StdOutput, &cci); -} - - -VOID -CONSOLE_SetCursorXY(SHORT x, - SHORT y) -{ - COORD coPos; - - coPos.X = x; - coPos.Y = y; - SetConsoleCursorPosition(StdOutput, coPos); + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + return csbi.dwCursorPosition.Y; +} + +VOID +CONSOLE_GetScreenSize( + OUT SHORT *maxx, + OUT SHORT *maxy) +{ + CONSOLE_SCREEN_BUFFER_INFO csbi; + + GetConsoleScreenBufferInfo(StdOutput, &csbi); + + *maxx = csbi.dwSize.X; + + *maxy = csbi.dwSize.Y; +} + +VOID +CONSOLE_SetCursorType( + IN BOOL bInsert, + IN BOOL bVisible) +{ + CONSOLE_CURSOR_INFO cci; + + cci.dwSize = bInsert ? 10 : 99; + cci.bVisible = bVisible; + + SetConsoleCursorInfo(StdOutput, &cci); +} + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y) +{ + COORD coPos; + + coPos.X = x; + coPos.Y = y; + SetConsoleCursorPosition(StdOutput, coPos); }
VOID @@ -594,284 +589,321 @@ &Written); }
- -VOID -CONSOLE_SetStatusText(char* fmt, ...) -{ - char Buffer[128]; - va_list ap; - COORD coPos; - ULONG Written; - - va_start(ap, fmt); - vsprintf(Buffer, fmt, ap); - va_end(ap); - - coPos.X = 0; - coPos.Y = yScreen - 1; - - FillConsoleOutputAttribute(StdOutput, - BACKGROUND_WHITE, - xScreen, - coPos, - &Written); - - FillConsoleOutputCharacterA(StdOutput, - ' ', - xScreen, - coPos, - &Written); - - WriteConsoleOutputCharacterA(StdOutput, - Buffer, - strlen(Buffer), - coPos, - &Written); -} - - -VOID -CONSOLE_InvertTextXY(SHORT x, SHORT y, SHORT col, SHORT row) -{ - COORD coPos; - ULONG Written; - - for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) - { - coPos.X = x; - - FillConsoleOutputAttribute(StdOutput, - FOREGROUND_BLUE | BACKGROUND_WHITE, - col, - coPos, - &Written); - } -} - - -VOID -CONSOLE_NormalTextXY(SHORT x, SHORT y, SHORT col, SHORT row) -{ - COORD coPos; - ULONG Written; - - for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) - { - coPos.X = x; - - FillConsoleOutputAttribute(StdOutput, - FOREGROUND_BLUE | BACKGROUND_WHITE, - col, - coPos, - &Written); - } -} - - -VOID -CONSOLE_SetTextXY(SHORT x, SHORT y, PCHAR Text) -{ - COORD coPos; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - WriteConsoleOutputCharacterA(StdOutput, - Text, - strlen(Text), - coPos, - &Written); -} - - -VOID -CONSOLE_SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = wcslen(Text); - if (Length > (ULONG)len - 1) - { - Length = len - 1; - } - - FillConsoleOutputAttribute(StdOutput, - BACKGROUND_WHITE, - len, - coPos, - &Written); - - WriteConsoleOutputCharacterW(StdOutput, - Text, - Length, - coPos, - &Written); - - coPos.X += Length; - FillConsoleOutputCharacterA(StdOutput, - '_', - 1, - coPos, - &Written); - - if ((ULONG)len > Length + 1) - { - coPos.X++; - FillConsoleOutputCharacterA(StdOutput, - ' ', - len - Length - 1, - coPos, - &Written); - } -} - - -VOID -CONSOLE_SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - WriteConsoleOutputCharacterA(StdOutput, - Text, - Length, - coPos, - &Written); - - coPos.Y++; - FillConsoleOutputCharacterA(StdOutput, - 0xCD, - Length, - coPos, - &Written); -} - - -VOID -CONSOLE_SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - FillConsoleOutputAttribute(StdOutput, - FOREGROUND_BLUE | BACKGROUND_WHITE, - Length, - coPos, - &Written); - - WriteConsoleOutputCharacterA(StdOutput, - Text, - Length, - coPos, - &Written); -} - - -VOID -CONSOLE_SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text) -{ - COORD coPos; - ULONG Length; - ULONG Written; - - coPos.X = x; - coPos.Y = y; - - Length = strlen(Text); - - FillConsoleOutputAttribute(StdOutput, - FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE, - Length, - coPos, - &Written); - - WriteConsoleOutputCharacterA(StdOutput, - Text, - Length, - coPos, - &Written); -} - - -VOID -CONSOLE_PrintTextXY(SHORT x, SHORT y, char* fmt, ...) -{ - char buffer[512]; - va_list ap; - COORD coPos; - ULONG Written; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); - - coPos.X = x; - coPos.Y = y; - - WriteConsoleOutputCharacterA(StdOutput, - buffer, - strlen(buffer), - coPos, - &Written); -} - - -VOID -CONSOLE_PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...) -{ - char buffer[512]; - va_list ap; - COORD coPos; - ULONG Length; - ULONG Written; - - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); - - coPos.X = x; - coPos.Y = y; - - Length = strlen(buffer); - if (Length > (ULONG)len - 1) - { - Length = len - 1; - } - - WriteConsoleOutputCharacterA(StdOutput, - buffer, - Length, - coPos, - &Written); - - coPos.X += Length; - - if ((ULONG)len > Length) - { - FillConsoleOutputCharacterA(StdOutput, - ' ', - len - Length, - coPos, - &Written); - } +VOID +CONSOLE_SetStatusText( + IN LPCSTR fmt, ...) +{ + CHAR Buffer[128]; + va_list ap; + COORD coPos; + ULONG Written; + + va_start(ap, fmt); + vsprintf(Buffer, fmt, ap); + va_end(ap); + + coPos.X = 0; + coPos.Y = yScreen - 1; + + FillConsoleOutputAttribute( + StdOutput, + BACKGROUND_WHITE, + xScreen, + coPos, + &Written); + + FillConsoleOutputCharacterA( + StdOutput, + ' ', + xScreen, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Buffer, + strlen(Buffer), + coPos, + &Written); +} + +VOID +CONSOLE_InvertTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row) +{ + COORD coPos; + ULONG Written; + + for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) + { + coPos.X = x; + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_BLUE | BACKGROUND_WHITE, + col, + coPos, + &Written); + } +} + +VOID +CONSOLE_NormalTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row) +{ + COORD coPos; + ULONG Written; + + for (coPos.Y = y; coPos.Y < y + row; coPos.Y++) + { + coPos.X = x; + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_BLUE | BACKGROUND_WHITE, + col, + coPos, + &Written); + } +} + +VOID +CONSOLE_SetTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + strlen(Text), + coPos, + &Written); +} + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = wcslen(Text); + if (Length > (ULONG)len - 1) + Length = len - 1; + + FillConsoleOutputAttribute( + StdOutput, + BACKGROUND_WHITE, + len, + coPos, + &Written); + + WriteConsoleOutputCharacterW( + StdOutput, + Text, + Length, + coPos, + &Written); + + coPos.X += Length; + FillConsoleOutputCharacterA( + StdOutput, + '_', + 1, + coPos, + &Written); + + if ((ULONG)len > Length + 1) + { + coPos.X++; + FillConsoleOutputCharacterA( + StdOutput, + ' ', + len - Length - 1, + coPos, + &Written); + } +} + +VOID +CONSOLE_SetUnderlinedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); + + coPos.Y++; + FillConsoleOutputCharacterA( + StdOutput, + 0xCD, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_SetInvertedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_BLUE | BACKGROUND_WHITE, + Length, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_SetHighlightedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text) +{ + COORD coPos; + ULONG Length; + ULONG Written; + + coPos.X = x; + coPos.Y = y; + + Length = strlen(Text); + + FillConsoleOutputAttribute( + StdOutput, + FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE, + Length, + coPos, + &Written); + + WriteConsoleOutputCharacterA( + StdOutput, + Text, + Length, + coPos, + &Written); +} + +VOID +CONSOLE_PrintTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR fmt, ...) +{ + CHAR buffer[512]; + va_list ap; + COORD coPos; + ULONG Written; + + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); + + coPos.X = x; + coPos.Y = y; + + WriteConsoleOutputCharacterA( + StdOutput, + buffer, + strlen(buffer), + coPos, + &Written); +} + +VOID +CONSOLE_PrintTextXYN( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCSTR fmt, ...) +{ + CHAR buffer[512]; + va_list ap; + COORD coPos; + ULONG Length; + ULONG Written; + + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); + + coPos.X = x; + coPos.Y = y; + + Length = strlen(buffer); + if (Length > (ULONG)len - 1) + Length = len - 1; + + WriteConsoleOutputCharacterA( + StdOutput, + buffer, + Length, + coPos, + &Written); + + coPos.X += Length; + + if ((ULONG)len > Length) + { + FillConsoleOutputCharacterA( + StdOutput, + ' ', + len - Length, + coPos, + &Written); + } }
/* EOF */
Modified: trunk/reactos/base/setup/usetup/console.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/console.h... ============================================================================== --- trunk/reactos/base/setup/usetup/console.h (original) +++ trunk/reactos/base/setup/usetup/console.h Thu Aug 31 13:13:03 2006 @@ -48,6 +48,8 @@ #define FOREGROUND_YELLOW (FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN) #define BACKGROUND_WHITE (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)
+extern HANDLE StdInput, StdOutput; + BOOL WINAPI ConAllocConsole( IN DWORD dwProcessId); @@ -123,18 +125,24 @@ OUT LPDWORD lpNumberOfCharsWritten);
- -VOID -CONSOLE_ConInKey(PINPUT_RECORD Buffer); - -VOID -CONSOLE_ConOutChar(CHAR c); - -VOID -CONSOLE_ConOutPuts(LPSTR szText); - -VOID -CONSOLE_ConOutPrintf(LPSTR szFormat, ...); +VOID +CONSOLE_ClearScreen(VOID); + +VOID +CONSOLE_ConInKey( + OUT PINPUT_RECORD Buffer); + +VOID +CONSOLE_ConOutChar( + IN CHAR c); + +VOID +CONSOLE_ConOutPrintf( + IN LPCSTR szFormat, ...); + +VOID +CONSOLE_ConOutPuts( + IN LPCSTR szText);
SHORT CONSOLE_GetCursorX(VOID); @@ -143,49 +151,93 @@ CONSOLE_GetCursorY(VOID);
VOID -CONSOLE_GetScreenSize(SHORT *maxx, - SHORT *maxy); - -VOID -CONSOLE_SetCursorType(BOOL bInsert, - BOOL bVisible); - -VOID -CONSOLE_SetCursorXY(SHORT x, - SHORT y); - -VOID -CONSOLE_ClearScreen(VOID); - -VOID -CONSOLE_SetStatusText(char* fmt, ...); - -VOID -CONSOLE_InvertTextXY(SHORT x, SHORT y, SHORT col, SHORT row); - -VOID -CONSOLE_NormalTextXY(SHORT x, SHORT y, SHORT col, SHORT row); - -VOID -CONSOLE_SetTextXY(SHORT x, SHORT y, PCHAR Text); - -VOID -CONSOLE_SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text); - -VOID -CONSOLE_SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text); - -VOID -CONSOLE_SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text); - -VOID -CONSOLE_SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text); - -VOID -CONSOLE_PrintTextXY(SHORT x, SHORT y, char* fmt, ...); - -VOID -CONSOLE_PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...); +CONSOLE_GetScreenSize( + OUT SHORT *maxx, + OUT SHORT *maxy); + +VOID +CONSOLE_InvertTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row); + +VOID +CONSOLE_NormalTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT col, + IN SHORT row); + +VOID +CONSOLE_PrintTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR fmt, ...); + +VOID +CONSOLE_PrintTextXYN( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCSTR fmt, ...); + +VOID +CONSOLE_SetCursorType( + IN BOOL bInsert, + IN BOOL bVisible); + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y); + +VOID +CONSOLE_SetCursorXY( + IN SHORT x, + IN SHORT y); + +VOID +CONSOLE_SetHighlightedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text); + +VOID +CONSOLE_SetInputTextXY( + IN SHORT x, + IN SHORT y, + IN SHORT len, + IN LPCWSTR Text); + +VOID +CONSOLE_SetInvertedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetStatusText( + IN LPCSTR fmt, ...); + +VOID +CONSOLE_SetTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text); + +VOID +CONSOLE_SetUnderlinedTextXY( + IN SHORT x, + IN SHORT y, + IN LPCSTR Text);
#endif /* __CONSOLE_H__*/
Modified: trunk/reactos/base/setup/usetup/drivesup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/drivesup.... ============================================================================== --- trunk/reactos/base/setup/usetup/drivesup.c (original) +++ trunk/reactos/base/setup/usetup/drivesup.c Thu Aug 31 13:13:03 2006 @@ -26,7 +26,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/filequeue.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filequeue... ============================================================================== --- trunk/reactos/base/setup/usetup/filequeue.c (original) +++ trunk/reactos/base/setup/usetup/filequeue.c Thu Aug 31 13:13:03 2006 @@ -27,7 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/filesup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filesup.c... ============================================================================== --- trunk/reactos/base/setup/usetup/filesup.c (original) +++ trunk/reactos/base/setup/usetup/filesup.c Thu Aug 31 13:13:03 2006 @@ -27,7 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/format.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/format.c?... ============================================================================== --- trunk/reactos/base/setup/usetup/format.c (original) +++ trunk/reactos/base/setup/usetup/format.c Thu Aug 31 13:13:03 2006 @@ -26,7 +26,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/fslist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/fslist.c?... ============================================================================== --- trunk/reactos/base/setup/usetup/fslist.c (original) +++ trunk/reactos/base/setup/usetup/fslist.c Thu Aug 31 13:13:03 2006 @@ -25,7 +25,7 @@ * Casper S. Hornstrup (chorns@users.sourceforge.net) */
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/genlist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/genlist.c... ============================================================================== --- trunk/reactos/base/setup/usetup/genlist.c (original) +++ trunk/reactos/base/setup/usetup/genlist.c Thu Aug 31 13:13:03 2006 @@ -26,7 +26,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Added: trunk/reactos/base/setup/usetup/inffile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.c... ============================================================================== --- trunk/reactos/base/setup/usetup/inffile.c (added) +++ trunk/reactos/base/setup/usetup/inffile.c Thu Aug 31 13:13:03 2006 @@ -1,0 +1,197 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS text-mode setup + * FILE: subsys/system/usetup/inffile.c + * PURPOSE: .inf files support functions + * PROGRAMMER: Hervé Poussineau + */ + +/* INCLUDES ******************************************************************/ + +#include "usetup.h" +#include <infros.h> + +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS *****************************************************************/ + +VOID WINAPI +InfpCloseInfFile( + IN HINF InfHandle) +{ + InfCloseFile(InfHandle); +} + +BOOL WINAPI +InfpFindFirstLineW( + IN HINF InfHandle, + IN PCWSTR Section, + IN PCWSTR Key, + IN OUT PINFCONTEXT Context) +{ + PINFCONTEXT pContext; + BOOL ret; + + ret = InfFindFirstLine(InfHandle, Section, Key, &pContext); + if (!ret) + return FALSE; + + memcpy(Context, pContext, sizeof(INFCONTEXT)); + InfFreeContext(pContext); + return TRUE; +} + +BOOL WINAPI +InfpFindNextLine( + IN PINFCONTEXT ContextIn, + OUT PINFCONTEXT ContextOut) +{ + return InfFindNextLine(ContextIn, ContextOut); +} + +BOOL WINAPI +InfpGetBinaryField( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT BYTE* ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT LPDWORD RequiredSize) +{ + return InfGetBinaryField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); +} + +DWORD WINAPI +InfpGetFieldCount( + IN PINFCONTEXT Context) +{ + return (DWORD)InfGetFieldCount(Context); +} + +BOOL WINAPI +InfpGetIntField( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + OUT PINT IntegerValue) +{ + LONG IntegerValueL; + BOOL ret; + + ret = InfGetIntField(Context, FieldIndex, &IntegerValueL); + *IntegerValue = (INT)IntegerValueL; + return ret; +} + +BOOL WINAPI +InfpGetMultiSzFieldW( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT PWSTR ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT LPDWORD RequiredSize) +{ + return InfGetMultiSzField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); +} + +BOOL WINAPI +InfpGetStringFieldW( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT PWSTR ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT PDWORD RequiredSize) +{ + return InfGetStringField(Context, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize); +} + +HINF WINAPI +InfpOpenInfFileW( + IN PCWSTR FileName, + IN PCWSTR InfClass, + IN DWORD InfStyle, + OUT PUINT ErrorLine) +{ + HINF hInf = NULL; + UNICODE_STRING FileNameU; + ULONG ErrorLineUL; + NTSTATUS Status; + + RtlInitUnicodeString(&FileNameU, FileName); + Status = InfOpenFile( + &hInf, + &FileNameU, + &ErrorLineUL); + *ErrorLine = (UINT)ErrorLineUL; + if (!NT_SUCCESS(Status)) + return NULL; + + return hInf; +} + +BOOLEAN +INF_GetData( + IN PINFCONTEXT Context, + OUT PWCHAR *Key, + OUT PWCHAR *Data) +{ + return InfGetData(Context, Key, Data); +} + +BOOLEAN +INF_GetDataField( + IN PINFCONTEXT Context, + IN ULONG FieldIndex, + OUT PWCHAR *Data) +{ + return InfGetDataField(Context, FieldIndex, Data); +} + +HINF WINAPI +INF_OpenBufferedFileA( + IN PSTR FileBuffer, + IN ULONG FileSize, + IN PCSTR InfClass, + IN DWORD InfStyle, + OUT PUINT ErrorLine) +{ + HINF hInf = NULL; + ULONG ErrorLineUL; + NTSTATUS Status; + + Status = InfOpenBufferedFile( + &hInf, + FileBuffer, + FileSize, + &ErrorLineUL); + *ErrorLine = (UINT)ErrorLineUL; + if (!NT_SUCCESS(Status)) + return NULL; + + return hInf; +} + +VOID INF_SetHeap( + IN PVOID Heap) +{ + InfSetHeap(Heap); +} + +/* EOF */
Added: trunk/reactos/base/setup/usetup/inffile.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.h... ============================================================================== --- trunk/reactos/base/setup/usetup/inffile.h (added) +++ trunk/reactos/base/setup/usetup/inffile.h Thu Aug 31 13:13:03 2006 @@ -1,0 +1,135 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS text-mode setup + * FILE: subsys/system/usetup/inffile.h + * PURPOSE: .inf files support functions + * PROGRAMMER: Hervé Poussineau + */ + +#ifndef __INFFILE_H__ +#define __INFFILE_H__ + +#include <infcommon.h> + +#define SetupCloseInfFile InfpCloseInfFile +#define SetupFindFirstLineW InfpFindFirstLineW +#define SetupFindNextLine InfpFindNextLine +#define SetupGetBinaryField InfpGetBinaryField +#define SetupGetFieldCount InfpGetFieldCount +#define SetupGetIntField InfpGetIntField +#define SetupGetMultiSzFieldW InfpGetMultiSzFieldW +#define SetupGetStringFieldW InfpGetStringFieldW +#define SetupOpenInfFileW InfpOpenInfFileW + +#define INF_STYLE_WIN4 0x00000002 + +/* FIXME: this structure is the one used in inflib, not in setupapi + * Delete it once we don't use inflib anymore */ +typedef struct _INFCONTEXT +{ + PVOID Inf; + PVOID Section; + PVOID Line; +} INFCONTEXT; + +VOID WINAPI +InfpCloseInfFile( + IN HINF InfHandle); + +BOOL WINAPI +InfpFindFirstLineW( + IN HINF InfHandle, + IN PCWSTR Section, + IN PCWSTR Key, + IN OUT PINFCONTEXT Context); + +BOOL WINAPI +InfpFindNextLine( + IN PINFCONTEXT ContextIn, + OUT PINFCONTEXT ContextOut); + +BOOL WINAPI +InfpGetBinaryField( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT BYTE* ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT LPDWORD RequiredSize); + +DWORD WINAPI +InfpGetFieldCount( + IN PINFCONTEXT Context); + +BOOL WINAPI +InfpGetIntField( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + OUT PINT IntegerValue); + +BOOL WINAPI +InfpGetMultiSzFieldW( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT PWSTR ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT LPDWORD RequiredSize); + +BOOL WINAPI +InfpGetStringFieldW( + IN PINFCONTEXT Context, + IN DWORD FieldIndex, + IN OUT PWSTR ReturnBuffer, + IN DWORD ReturnBufferSize, + OUT PDWORD RequiredSize); + +HINF WINAPI +InfpOpenInfFileW( + IN PCWSTR FileName, + IN PCWSTR InfClass, + IN DWORD InfStyle, + OUT PUINT ErrorLine); + +BOOLEAN +INF_GetData( + IN PINFCONTEXT Context, + OUT PWCHAR *Key, + OUT PWCHAR *Data); + +BOOLEAN +INF_GetDataField( + IN PINFCONTEXT Context, + IN ULONG FieldIndex, + OUT PWCHAR *Data); + +HINF WINAPI +INF_OpenBufferedFileA( + IN PSTR FileBuffer, + IN ULONG FileSize, + IN PCSTR InfClass, + IN DWORD InfStyle, + OUT PUINT ErrorLine); + +VOID INF_SetHeap( + IN PVOID Heap); + +#endif /* __INFFILE_H__*/ + +/* EOF */
Modified: trunk/reactos/base/setup/usetup/inicache.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inicache.... ============================================================================== --- trunk/reactos/base/setup/usetup/inicache.c (original) +++ trunk/reactos/base/setup/usetup/inicache.c Thu Aug 31 13:13:03 2006 @@ -27,7 +27,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/keytrans.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/keytrans.... ============================================================================== --- trunk/reactos/base/setup/usetup/keytrans.c (original) +++ trunk/reactos/base/setup/usetup/keytrans.c Thu Aug 31 13:13:03 2006 @@ -25,7 +25,7 @@ * * NB: Hardcoded to US keyboard */ -#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/partlist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist.... ============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c (original) +++ trunk/reactos/base/setup/usetup/partlist.c Thu Aug 31 13:13:03 2006 @@ -25,7 +25,7 @@ * Casper S. Hornstrup (chorns@users.sourceforge.net) */
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h> @@ -1237,7 +1237,7 @@ ULONG Written; USHORT Width; USHORT Height; - ULONGLONG DiskSize; + ULARGE_INTEGER DiskSize; PCHAR Unit;
Width = List->Right - List->Left - 1; @@ -1250,35 +1250,35 @@ #if 0 if (DiskEntry->DiskSize >= 0x280000000ULL) /* 10 GB */ { - DiskSize = (DiskEntry->DiskSize + (1 << 29)) >> 30; + DiskSize.QuadPart = (DiskEntry->DiskSize + (1 << 29)) >> 30; Unit = "GB"; } else #endif { - DiskSize = (DiskEntry->DiskSize + (1 << 19)) >> 20; - if (DiskSize == 0) - DiskSize = 1; + DiskSize.QuadPart = (DiskEntry->DiskSize + (1 << 19)) >> 20; + if (DiskSize.QuadPart == 0) + DiskSize.QuadPart = 1; Unit = "MB"; }
if (DiskEntry->DriverName.Length > 0) { sprintf (LineBuffer, - "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %wZ", - DiskSize, + "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu) on %S", + DiskSize.u.LowPart, Unit, DiskEntry->DiskNumber, DiskEntry->Port, DiskEntry->Bus, DiskEntry->Id, - &DiskEntry->DriverName); + DiskEntry->DriverName.Buffer); } else { sprintf (LineBuffer, - "%6I64u %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)", - DiskSize, + "%6lu %s Harddisk %lu (Port=%hu, Bus=%hu, Id=%hu)", + DiskSize.u.LowPart, Unit, DiskEntry->DiskNumber, DiskEntry->Port,
Modified: trunk/reactos/base/setup/usetup/progress.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/progress.... ============================================================================== --- trunk/reactos/base/setup/usetup/progress.c (original) +++ trunk/reactos/base/setup/usetup/progress.c Thu Aug 31 13:13:03 2006 @@ -1,7 +1,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/base/setup/usetup/registry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry.... ============================================================================== --- trunk/reactos/base/setup/usetup/registry.c (original) +++ trunk/reactos/base/setup/usetup/registry.c Thu Aug 31 13:13:03 2006 @@ -26,7 +26,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h> @@ -257,13 +257,13 @@ }
if (!(Flags & FLG_ADDREG_BINVALUETYPE) || - (Type == REG_DWORD && InfGetFieldCount (Context) == 5)) + (Type == REG_DWORD && SetupGetFieldCount (Context) == 5)) { PWCHAR Str = NULL;
if (Type == REG_MULTI_SZ) { - if (!InfGetMultiSzField (Context, 5, NULL, 0, &Size)) + if (!SetupGetMultiSzFieldW (Context, 5, NULL, 0, &Size)) Size = 0;
if (Size) @@ -272,7 +272,7 @@ if (Str == NULL) return FALSE;
- InfGetMultiSzField (Context, 5, Str, Size, NULL); + SetupGetMultiSzFieldW (Context, 5, Str, Size, NULL); }
if (Flags & FLG_ADDREG_APPEND) @@ -289,7 +289,7 @@ } else { - if (!InfGetStringField (Context, 5, NULL, 0, &Size)) + if (!SetupGetStringFieldW (Context, 5, NULL, 0, &Size)) Size = 0;
if (Size) @@ -298,7 +298,7 @@ if (Str == NULL) return FALSE;
- InfGetStringField (Context, 5, Str, Size, NULL); + SetupGetStringFieldW (Context, 5, Str, Size, NULL); } }
@@ -344,7 +344,7 @@ { PUCHAR Data = NULL;
- if (!InfGetBinaryField (Context, 5, NULL, 0, &Size)) + if (!SetupGetBinaryField (Context, 5, NULL, 0, &Size)) Size = 0;
if (Size) @@ -354,7 +354,7 @@ return FALSE;
DPRINT("setting binary data %wZ len %lu\n", ValueName, Size); - InfGetBinaryField (Context, 5, Data, Size, NULL); + SetupGetBinaryField (Context, 5, Data, Size, NULL); }
NtSetValueKey (KeyHandle, @@ -481,35 +481,35 @@ UNICODE_STRING Value; PUNICODE_STRING ValuePtr; NTSTATUS Status; - ULONG Flags; + UINT Flags; ULONG Length;
- PINFCONTEXT Context; + INFCONTEXT Context; HANDLE KeyHandle; BOOLEAN Ok;
- Ok = InfFindFirstLine (hInf, Section, NULL, &Context); + Ok = SetupFindFirstLineW (hInf, Section, NULL, &Context);
if (Ok) { - for (;Ok; Ok = InfFindNextLine (Context, Context)) + for (;Ok; Ok = SetupFindNextLine (&Context, &Context)) { /* get root */ - if (!InfGetStringField (Context, 1, Buffer, MAX_INF_STRING_LENGTH, NULL)) + if (!SetupGetStringFieldW (&Context, 1, Buffer, MAX_INF_STRING_LENGTH, NULL)) continue; if (!GetRootKey (Buffer)) continue;
/* get key */ Length = wcslen (Buffer); - if (!InfGetStringField (Context, 2, Buffer + Length, MAX_INF_STRING_LENGTH - Length, NULL)) + if (!SetupGetStringFieldW (&Context, 2, Buffer + Length, MAX_INF_STRING_LENGTH - Length, NULL)) *Buffer = 0;
DPRINT("KeyName: <%S>\n", Buffer);
/* get flags */ - if (!InfGetIntField (Context, 4, (PLONG)&Flags)) + if (!SetupGetIntField (&Context, 4, (PINT)&Flags)) Flags = 0;
DPRINT("Flags: %lx\n", Flags); @@ -547,7 +547,7 @@ }
/* get value name */ - if (InfGetStringField (Context, 3, Buffer, MAX_INF_STRING_LENGTH, NULL)) + if (SetupGetStringFieldW (&Context, 3, Buffer, MAX_INF_STRING_LENGTH, NULL)) { RtlInitUnicodeString (&Value, Buffer); @@ -559,7 +559,7 @@ }
/* and now do it */ - if (!do_reg_operation (KeyHandle, ValuePtr, Context, Flags)) + if (!do_reg_operation (KeyHandle, ValuePtr, &Context, Flags)) { NtClose (KeyHandle); return FALSE; @@ -567,7 +567,6 @@
NtClose (KeyHandle); } - InfFreeContext(Context); }
return TRUE; @@ -580,25 +579,22 @@ BOOLEAN Delete) { WCHAR FileNameBuffer[MAX_PATH]; - UNICODE_STRING FileName; HINF hInf; - NTSTATUS Status; - ULONG ErrorLine; + UINT ErrorLine;
/* Load inf file from install media. */ wcscpy(FileNameBuffer, SourceRootPath.Buffer); wcscat(FileNameBuffer, L"\reactos\"); wcscat(FileNameBuffer, Filename);
- RtlInitUnicodeString(&FileName, - FileNameBuffer); - - Status = InfOpenFile(&hInf, - &FileName, + hInf = SetupOpenInfFileW( + FileNameBuffer, + NULL, + INF_STYLE_WIN4, &ErrorLine); - if (!NT_SUCCESS(Status)) - { - DPRINT1("InfOpenFile() failed (Status %lx)\n", Status); + if (hInf == INVALID_HANDLE_VALUE) + { + DPRINT1("SetupOpenInfFile() failed\n"); return FALSE; }
@@ -607,7 +603,7 @@ DPRINT1("registry_callback() failed\n"); }
- InfCloseFile (hInf); + SetupCloseInfFile (hInf);
return TRUE; }
Modified: trunk/reactos/base/setup/usetup/settings.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings.... ============================================================================== --- trunk/reactos/base/setup/usetup/settings.c (original) +++ trunk/reactos/base/setup/usetup/settings.c Thu Aug 31 13:13:03 2006 @@ -25,7 +25,7 @@
/* INCLUDES *****************************************************************/
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h> @@ -121,7 +121,7 @@ { CHAR Buffer[128]; PGENERIC_LIST List; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR KeyName; PWCHAR KeyValue; PWCHAR UserData; @@ -137,7 +137,7 @@ DPRINT("Computer identifier: '%S'\n", ComputerIdentifier);
/* Search for matching device identifier */ - if (!InfFindFirstLine(InfFile, L"Map.Computer", NULL, &Context)) + if (!SetupFindFirstLineW(InfFile, L"Map.Computer", NULL, &Context)) { /* FIXME: error message */ return NULL; @@ -145,20 +145,20 @@
do { - if (!InfGetDataField(Context, 1, &KeyValue)) + if (!INF_GetDataField(&Context, 1, &KeyValue)) { /* FIXME: Handle error! */ - DPRINT("InfGetDataField() failed\n"); + DPRINT("INF_GetDataField() failed\n"); return NULL; }
DPRINT("KeyValue: %S\n", KeyValue); if (wcsstr(ComputerIdentifier, KeyValue)) { - if (!InfGetDataField(Context, 0, &KeyName)) + if (!INF_GetDataField(&Context, 0, &KeyName)) { /* FIXME: Handle error! */ - DPRINT("InfGetDataField() failed\n"); + DPRINT("INF_GetDataField() failed\n"); return NULL; }
@@ -166,14 +166,13 @@ wcscpy(ComputerKey, KeyName); } } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList(); if (List == NULL) return NULL;
- if (!InfFindFirstLine (InfFile, L"Computer", NULL, &Context)) + if (!SetupFindFirstLineW (InfFile, L"Computer", NULL, &Context)) { DestroyGenericList(List, FALSE); return NULL; @@ -181,10 +180,10 @@
do { - if (!InfGetData (Context, &KeyName, &KeyValue)) + if (!INF_GetData (&Context, &KeyName, &KeyValue)) { /* FIXME: Handle error! */ - DPRINT("InfGetData() failed\n"); + DPRINT("INF_GetData() failed\n"); break; }
@@ -202,8 +201,7 @@ AppendGenericListEntry(List, Buffer, UserData, _wcsicmp(KeyName, ComputerKey) ? FALSE : TRUE); } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
return List; } @@ -373,7 +371,7 @@ { CHAR Buffer[128]; PGENERIC_LIST List; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR KeyName; PWCHAR KeyValue; PWCHAR UserData; @@ -389,7 +387,7 @@ DPRINT("Display identifier: '%S'\n", DisplayIdentifier);
/* Search for matching device identifier */ - if (!InfFindFirstLine(InfFile, L"Map.Display", NULL, &Context)) + if (!SetupFindFirstLineW(InfFile, L"Map.Display", NULL, &Context)) { /* FIXME: error message */ return NULL; @@ -397,20 +395,20 @@
do { - if (!InfGetDataField(Context, 1, &KeyValue)) + if (!INF_GetDataField(&Context, 1, &KeyValue)) { /* FIXME: Handle error! */ - DPRINT("InfGetDataField() failed\n"); + DPRINT("INF_GetDataField() failed\n"); return NULL; }
DPRINT("KeyValue: %S\n", KeyValue); if (wcsstr(DisplayIdentifier, KeyValue)) { - if (!InfGetDataField(Context, 0, &KeyName)) + if (!INF_GetDataField(&Context, 0, &KeyName)) { /* FIXME: Handle error! */ - DPRINT("InfGetDataField() failed\n"); + DPRINT("INF_GetDataField() failed\n"); return NULL; }
@@ -418,15 +416,14 @@ wcscpy(DisplayKey, KeyName); } } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
List = CreateGenericList(); if (List == NULL) return NULL;
- if (!InfFindFirstLine (InfFile, L"Display", NULL, &Context)) + if (!SetupFindFirstLineW (InfFile, L"Display", NULL, &Context)) { DestroyGenericList(List, FALSE); return NULL; @@ -434,15 +431,15 @@
do { - if (!InfGetDataField(Context, 0, &KeyName)) - { - DPRINT1("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 0, &KeyName)) + { + DPRINT1("INF_GetDataField() failed\n"); break; }
- if (!InfGetDataField(Context, 1, &KeyValue)) - { - DPRINT1("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 1, &KeyValue)) + { + DPRINT1("INF_GetDataField() failed\n"); break; }
@@ -464,8 +461,7 @@ UserData, _wcsicmp(KeyName, DisplayKey) ? FALSE : TRUE); } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
#if 0 AppendGenericListEntry(List, "Other display driver", NULL, TRUE); @@ -501,7 +497,7 @@ ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List) { PGENERIC_LIST_ENTRY Entry; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR ServiceName; ULONG StartValue; NTSTATUS Status; @@ -518,16 +514,16 @@ return FALSE; }
- if (!InfFindFirstLine(InfFile, L"Display", Entry->UserData, &Context)) - { - DPRINT("InfFindFirstLine() failed\n"); + if (!SetupFindFirstLineW(InfFile, L"Display", Entry->UserData, &Context)) + { + DPRINT("SetupFindFirstLineW() failed\n"); return FALSE; }
/* Enable the right driver */ - if (!InfGetDataField(Context, 3, &ServiceName)) - { - DPRINT("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 3, &ServiceName)) + { + DPRINT("INF_GetDataField() failed\n"); return FALSE; }
@@ -551,9 +547,9 @@ /* Set the resolution */ swprintf(RegPath, L"\Registry\Machine\System\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\%s\Device0", ServiceName);
- if (!InfGetDataField(Context, 4, &Buffer)) - { - DPRINT("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 4, &Buffer)) + { + DPRINT("INF_GetDataField() failed\n"); return FALSE; } Width = wcstoul(Buffer, NULL, 10); @@ -570,9 +566,9 @@ }
- if (!InfGetDataField(Context, 5, &Buffer)) - { - DPRINT("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 5, &Buffer)) + { + DPRINT("INF_GetDataField() failed\n"); return FALSE; } Hight = wcstoul(Buffer, 0, 0); @@ -588,9 +584,9 @@ return FALSE; }
- if (!InfGetDataField(Context, 6, &Buffer)) - { - DPRINT("InfGetDataField() failed\n"); + if (!INF_GetDataField(&Context, 6, &Buffer)) + { + DPRINT("INF_GetDataField() failed\n"); return FALSE; } Bpp = wcstoul(Buffer, 0, 0); @@ -606,8 +602,6 @@ return FALSE; }
- InfFreeContext(Context); - DPRINT("ProcessDisplayRegistry() done\n");
return TRUE; @@ -619,7 +613,7 @@ { CHAR Buffer[128]; PGENERIC_LIST List; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR KeyName; PWCHAR KeyValue; PWCHAR UserData; @@ -628,7 +622,7 @@ if (List == NULL) return NULL;
- if (!InfFindFirstLine (InfFile, L"Keyboard", NULL, &Context)) + if (!SetupFindFirstLineW (InfFile, L"Keyboard", NULL, &Context)) { DestroyGenericList(List, FALSE); return NULL; @@ -636,10 +630,10 @@
do { - if (!InfGetData (Context, &KeyName, &KeyValue)) + if (!INF_GetData (&Context, &KeyName, &KeyValue)) { /* FIXME: Handle error! */ - DPRINT("InfGetData() failed\n"); + DPRINT("INF_GetData() failed\n"); break; }
@@ -656,8 +650,7 @@ sprintf(Buffer, "%S", KeyValue); AppendGenericListEntry(List, Buffer, UserData, FALSE); } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
return List; } @@ -668,42 +661,37 @@ { CHAR Buffer[128]; PGENERIC_LIST List; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR KeyName; PWCHAR KeyValue; PWCHAR UserData; WCHAR DefaultLayout[20];
/* Get default layout id */ - if (!InfFindFirstLine (InfFile, L"NLS", L"DefaultLayout", &Context)) + if (!SetupFindFirstLineW (InfFile, L"NLS", L"DefaultLayout", &Context)) return NULL;
- if (!InfGetData (Context, NULL, &KeyValue)) - { - InfFreeContext(Context); - return NULL; - } + if (!INF_GetData (&Context, NULL, &KeyValue)) + return NULL;
wcscpy(DefaultLayout, KeyValue); - InfFreeContext(Context);
List = CreateGenericList(); if (List == NULL) return NULL;
- if (!InfFindFirstLine (InfFile, L"KeyboardLayout", NULL, &Context)) + if (!SetupFindFirstLineW (InfFile, L"KeyboardLayout", NULL, &Context)) { DestroyGenericList(List, FALSE); - InfFreeContext(Context); return NULL; }
do { - if (!InfGetData (Context, &KeyName, &KeyValue)) + if (!INF_GetData (&Context, &KeyName, &KeyValue)) { /* FIXME: Handle error! */ - DPRINT("InfGetData() failed\n"); + DPRINT("INF_GetData() failed\n"); break; }
@@ -723,8 +711,7 @@ UserData, _wcsicmp(KeyName, DefaultLayout) ? FALSE : TRUE); } - while (InfFindNextLine(Context, Context)); - InfFreeContext(Context); + while (SetupFindNextLine(&Context, &Context));
return List; }
Modified: trunk/reactos/base/setup/usetup/usetup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.c?... ============================================================================== --- trunk/reactos/base/setup/usetup/usetup.c (original) +++ trunk/reactos/base/setup/usetup/usetup.c Thu Aug 31 13:13:03 2006 @@ -25,7 +25,7 @@ * Casper S. Hornstrup (chorns@users.sourceforge.net) */
-#include <usetup.h> +#include "usetup.h"
#define NDEBUG #include <debug.h> @@ -411,12 +411,10 @@ CheckUnattendedSetup(VOID) { WCHAR UnattendInfPath[MAX_PATH]; - UNICODE_STRING FileName; - PINFCONTEXT Context; + INFCONTEXT Context; HINF UnattendInf; - ULONG ErrorLine; - NTSTATUS Status; - LONG IntValue; + UINT ErrorLine; + INT IntValue; PWCHAR Value;
if (DoesFileExist(SourcePath.Buffer, L"unattend.inf") == FALSE) @@ -429,34 +427,30 @@ wcscpy(UnattendInfPath, SourcePath.Buffer); wcscat(UnattendInfPath, L"\unattend.inf");
- RtlInitUnicodeString(&FileName, - UnattendInfPath); - /* Load 'unattend.inf' from install media. */ - Status = InfOpenFile(&UnattendInf, - &FileName, + UnattendInf = SetupOpenInfFileW(UnattendInfPath, + NULL, + INF_STYLE_WIN4, &ErrorLine); - if (!NT_SUCCESS(Status)) - { - DPRINT("InfOpenFile() failed with status 0x%x\n", Status); + if (UnattendInf == INVALID_HANDLE_VALUE) + { + DPRINT("SetupOpenInfFileW() failed\n"); return; }
/* Open 'Unattend' section */ - if (!InfFindFirstLine(UnattendInf, L"Unattend", L"Signature", &Context)) - { - DPRINT("InfFindFirstLine() failed for section 'Unattend'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"Signature", &Context)) + { + DPRINT("SetupFindFirstLineW() failed for section 'Unattend'\n"); + SetupCloseInfFile(&UnattendInf); return; }
/* Get pointer 'Signature' key */ - if (!InfGetData(Context, NULL, &Value)) - { - DPRINT("InfGetData() failed for key 'Signature'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!INF_GetData(&Context, NULL, &Value)) + { + DPRINT("INF_GetData() failed for key 'Signature'\n"); + SetupCloseInfFile(&UnattendInf); return; }
@@ -464,88 +458,75 @@ if (_wcsicmp(Value, L"$ReactOS$") != 0) { DPRINT("Signature not $ReactOS$\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + SetupCloseInfFile(&UnattendInf); return; }
/* Search for 'DestinationDiskNumber' in the 'Unattend' section */ - if (!InfFindFirstLine(UnattendInf, L"Unattend", L"DestinationDiskNumber", &Context)) - { - DPRINT("InfFindFirstLine() failed for key 'DestinationDiskNumber'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"DestinationDiskNumber", &Context)) + { + DPRINT("SetupFindFirstLine() failed for key 'DestinationDiskNumber'\n"); + SetupCloseInfFile(&UnattendInf); return; } - if (!InfGetIntField(Context, 0, &IntValue)) - { - DPRINT("InfGetIntField() failed for key 'DestinationDiskNumber'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupGetIntField(&Context, 0, &IntValue)) + { + DPRINT("SetupGetIntField() failed for key 'DestinationDiskNumber'\n"); + SetupCloseInfFile(&UnattendInf); return; } - UnattendDestinationDiskNumber = IntValue; - InfFreeContext(Context); + UnattendDestinationDiskNumber = (LONG)IntValue;
/* Search for 'DestinationPartitionNumber' in the 'Unattend' section */ - if (!InfFindFirstLine(UnattendInf, L"Unattend", L"DestinationPartitionNumber", &Context)) - { - DPRINT("InfFindFirstLine() failed for key 'DestinationPartitionNumber'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"DestinationPartitionNumber", &Context)) + { + DPRINT("SetupFindFirstLine() failed for key 'DestinationPartitionNumber'\n"); + SetupCloseInfFile(UnattendInf); return; } - if (!InfGetIntField(Context, 0, &IntValue)) - { - DPRINT("InfGetIntField() failed for key 'DestinationPartitionNumber'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupGetIntField(&Context, 0, &IntValue)) + { + DPRINT("SetupGetIntField() failed for key 'DestinationPartitionNumber'\n"); + SetupCloseInfFile(UnattendInf); return; } UnattendDestinationPartitionNumber = IntValue; - InfFreeContext(Context);
/* Search for 'DestinationPartitionNumber' in the 'Unattend' section */ - if (!InfFindFirstLine(UnattendInf, L"Unattend", L"DestinationPartitionNumber", &Context)) - { - DPRINT("InfFindFirstLine() failed for key 'DestinationPartitionNumber'\n"); - InfCloseFile(UnattendInf); + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"DestinationPartitionNumber", &Context)) + { + DPRINT("SetupFindFirstLine() failed for key 'DestinationPartitionNumber'\n"); + SetupCloseInfFile(UnattendInf); return; }
/* Get pointer 'InstallationDirectory' key */ - if (!InfGetData(Context, NULL, &Value)) - { - DPRINT("InfGetData() failed for key 'InstallationDirectory'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!INF_GetData(&Context, NULL, &Value)) + { + DPRINT("INF_GetData() failed for key 'InstallationDirectory'\n"); + SetupCloseInfFile(UnattendInf); return; } wcscpy(UnattendInstallationDirectory, Value);
- InfFreeContext(Context); - IsUnattendedSetup = TRUE;
/* Search for 'MBRInstallType' in the 'Unattend' section */ - if (!InfFindFirstLine(UnattendInf, L"Unattend", L"MBRInstallType", &Context)) - { - DPRINT("InfFindFirstLine() failed for key 'MBRInstallType'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"MBRInstallType", &Context)) + { + DPRINT("SetupFindFirstLine() failed for key 'MBRInstallType'\n"); + SetupCloseInfFile(UnattendInf); return; } - if (!InfGetIntField(Context, 0, &IntValue)) - { - DPRINT("InfGetIntField() failed for key 'MBRInstallType'\n"); - InfFreeContext(Context); - InfCloseFile(UnattendInf); + if (!SetupGetIntField(&Context, 0, &IntValue)) + { + DPRINT("SetupGetIntField() failed for key 'MBRInstallType'\n"); + SetupCloseInfFile(UnattendInf); return; } UnattendMBRInstallType = IntValue; - InfFreeContext(Context); - - InfCloseFile(UnattendInf); + + SetupCloseInfFile(UnattendInf);
DPRINT("Running unattended setup\n"); } @@ -562,10 +543,9 @@ SYSTEM_DEVICE_INFORMATION Sdi; NTSTATUS Status; WCHAR FileNameBuffer[MAX_PATH]; - UNICODE_STRING FileName; - PINFCONTEXT Context; + INFCONTEXT Context; PWCHAR Value; - ULONG ErrorLine; + UINT ErrorLine; ULONG ReturnSize;
CONSOLE_SetStatusText(" Please wait..."); @@ -636,13 +616,12 @@ /* Load txtsetup.sif from install media. */ wcscpy(FileNameBuffer, SourceRootPath.Buffer); wcscat(FileNameBuffer, L"\reactos\txtsetup.sif"); - RtlInitUnicodeString(&FileName, - FileNameBuffer); - - Status = InfOpenFile(&SetupInf, - &FileName, + + SetupInf = SetupOpenInfFileW(FileNameBuffer, + NULL, + INF_STYLE_WIN4, &ErrorLine); - if (!NT_SUCCESS(Status)) + if (SetupInf == INVALID_HANDLE_VALUE) { PopupError("Setup failed to load the file TXTSETUP.SIF.\n", "ENTER = Reboot computer"); @@ -659,7 +638,7 @@ }
/* Open 'Version' section */ - if (!InfFindFirstLine (SetupInf, L"Version", L"Signature", &Context)) + if (!SetupFindFirstLineW (SetupInf, L"Version", L"Signature", &Context)) { PopupError("Setup found a corrupt TXTSETUP.SIF.\n", "ENTER = Reboot computer"); @@ -677,9 +656,8 @@
/* Get pointer 'Signature' key */ - if (!InfGetData (Context, NULL, &Value)) - { - InfFreeContext(Context); + if (!INF_GetData (&Context, NULL, &Value)) + { PopupError("Setup found a corrupt TXTSETUP.SIF.\n", "ENTER = Reboot computer");
@@ -697,7 +675,6 @@ /* Check 'Signature' string */ if (_wcsicmp(Value, L"$ReactOS$") != 0) { - InfFreeContext(Context); PopupError("Setup found an invalid signature in TXTSETUP.SIF.\n", "ENTER = Reboot computer");
@@ -711,7 +688,6 @@ } } } - InfFreeContext(Context);
CheckUnattendedSetup();
@@ -2605,7 +2581,7 @@ PPARTENTRY PartEntry; WCHAR InstallDir[51]; PWCHAR DefaultPath; - PINFCONTEXT Context; + INFCONTEXT Context; ULONG Length;
if (PartitionList == NULL || @@ -2620,7 +2596,7 @@ PartEntry = PartitionList->CurrentPartition;
/* Search for 'DefaultPath' in the 'SetupData' section */ - if (!InfFindFirstLine (SetupInf, L"SetupData", L"DefaultPath", &Context)) + if (!SetupFindFirstLineW (SetupInf, L"SetupData", L"DefaultPath", &Context)) { PopupError("Setup failed to find the 'SetupData' section\n" "in TXTSETUP.SIF.\n", @@ -2638,7 +2614,7 @@ }
/* Read the 'DefaultPath' data */ - if (InfGetData (Context, NULL, &DefaultPath)) + if (INF_GetData (&Context, NULL, &DefaultPath)) { wcscpy(InstallDir, DefaultPath); } @@ -2646,7 +2622,6 @@ { wcscpy(InstallDir, L"\ReactOS"); } - InfFreeContext(Context); Length = wcslen(InstallDir);
CONSOLE_SetTextXY(6, 8, "Setup installs ReactOS files onto the selected partition. Choose a"); @@ -2711,15 +2686,15 @@ PWCHAR SourceCabinet, PINPUT_RECORD Ir) { - PINFCONTEXT FilesContext; - PINFCONTEXT DirContext; + INFCONTEXT FilesContext; + INFCONTEXT DirContext; PWCHAR FileKeyName; PWCHAR FileKeyValue; PWCHAR DirKeyValue; PWCHAR TargetFileName;
/* Search for the SectionName section */ - if (!InfFindFirstLine (InfFile, SectionName, NULL, &FilesContext)) + if (!SetupFindFirstLineW (InfFile, SectionName, NULL, &FilesContext)) { char Buffer[128]; sprintf(Buffer, "Setup failed to find the '%S' section\nin TXTSETUP.SIF.\n", SectionName); @@ -2743,32 +2718,31 @@ do { /* Get source file name and target directory id */ - if (!InfGetData (FilesContext, &FileKeyName, &FileKeyValue)) + if (!INF_GetData (&FilesContext, &FileKeyName, &FileKeyValue)) { /* FIXME: Handle error! */ - DPRINT1("InfGetData() failed\n"); + DPRINT1("INF_GetData() failed\n"); break; }
/* Get optional target file name */ - if (!InfGetDataField (FilesContext, 2, &TargetFileName)) + if (!INF_GetDataField (&FilesContext, 2, &TargetFileName)) TargetFileName = NULL;
DPRINT ("FileKeyName: '%S' FileKeyValue: '%S'\n", FileKeyName, FileKeyValue);
/* Lookup target directory */ - if (!InfFindFirstLine (InfFile, L"Directories", FileKeyValue, &DirContext)) + if (!SetupFindFirstLineW (InfFile, L"Directories", FileKeyValue, &DirContext)) { /* FIXME: Handle error! */ - DPRINT1("InfFindFirstLine() failed\n"); + DPRINT1("SetupFindFirstLine() failed\n"); break; }
- if (!InfGetData (DirContext, NULL, &DirKeyValue)) + if (!INF_GetData (&DirContext, NULL, &DirKeyValue)) { /* FIXME: Handle error! */ - InfFreeContext(DirContext); - DPRINT1("InfGetData() failed\n"); + DPRINT1("INF_GetData() failed\n"); break; }
@@ -2783,11 +2757,8 @@ /* FIXME: Handle error! */ DPRINT1("SetupQueueCopy() failed\n"); } - InfFreeContext(DirContext); - } - while (InfFindNextLine(FilesContext, FilesContext)); - - InfFreeContext(FilesContext); + } + while (SetupFindNextLine(&FilesContext, &FilesContext));
return TRUE; } @@ -2798,7 +2769,7 @@ PINPUT_RECORD Ir) { WCHAR PathBuffer[MAX_PATH]; - PINFCONTEXT DirContext; + INFCONTEXT DirContext; PWCHAR AdditionalSectionName = NULL; PWCHAR KeyValue; ULONG Length; @@ -2858,7 +2829,7 @@
/* Search for the 'Directories' section */ - if (!InfFindFirstLine(InfFile, L"Directories", NULL, &DirContext)) + if (!SetupFindFirstLineW(InfFile, L"Directories", NULL, &DirContext)) { if (SourceCabinet) { @@ -2885,7 +2856,7 @@ /* Enumerate the directory values and create the subdirectories */ do { - if (!InfGetData (DirContext, NULL, &KeyValue)) + if (!INF_GetData (&DirContext, NULL, &KeyValue)) { DPRINT1("break\n"); break; @@ -2928,9 +2899,7 @@ } } } - while (InfFindNextLine (DirContext, DirContext)); - - InfFreeContext(DirContext); + while (SetupFindNextLine (&DirContext, &DirContext));
return(TRUE); } @@ -2941,11 +2910,10 @@ { HINF InfHandle; WCHAR PathBuffer[MAX_PATH]; - PINFCONTEXT CabinetsContext; + INFCONTEXT CabinetsContext; ULONG InfFileSize; PWCHAR KeyValue; - NTSTATUS Status; - ULONG ErrorLine; + UINT ErrorLine; PVOID InfFileData;
CONSOLE_SetTextXY(6, 8, "Setup prepares your computer for copying the ReactOS files. "); @@ -2976,7 +2944,7 @@ }
/* Search for the 'Cabinets' section */ - if (!InfFindFirstLine (SetupInf, L"Cabinets", NULL, &CabinetsContext)) + if (!SetupFindFirstLineW (SetupInf, L"Cabinets", NULL, &CabinetsContext)) { return FILE_COPY_PAGE; } @@ -2987,7 +2955,7 @@ */ do { - if (!InfGetData (CabinetsContext, NULL, &KeyValue)) + if (!INF_GetData (&CabinetsContext, NULL, &KeyValue)) break;
wcscpy(PathBuffer, SourcePath.Buffer); @@ -3037,11 +3005,12 @@ } }
- Status = InfOpenBufferedFile(&InfHandle, - InfFileData, + InfHandle = INF_OpenBufferedFileA(InfFileData, InfFileSize, + NULL, + INF_STYLE_WIN4, &ErrorLine); - if (!NT_SUCCESS(Status)) + if (InfHandle == INVALID_HANDLE_VALUE) { PopupError("Cabinet has no valid inf file.\n", "ENTER = Reboot computer"); @@ -3064,9 +3033,7 @@ return QUIT_PAGE; } } - while (InfFindNextLine (CabinetsContext, CabinetsContext)); - - InfFreeContext(CabinetsContext); + while (SetupFindNextLine (&CabinetsContext, &CabinetsContext));
return FILE_COPY_PAGE; } @@ -3144,7 +3111,7 @@ static PAGE_NUMBER RegistryPage(PINPUT_RECORD Ir) { - PINFCONTEXT InfContext; + INFCONTEXT InfContext; PWSTR Action; PWSTR File; PWSTR Section; @@ -3194,9 +3161,9 @@ /* Update registry */ CONSOLE_SetStatusText(" Updating registry hives...");
- if (!InfFindFirstLine(SetupInf, L"HiveInfs.Install", NULL, &InfContext)) - { - DPRINT1("InfFindFirstLine() failed\n"); + if (!SetupFindFirstLineW(SetupInf, L"HiveInfs.Install", NULL, &InfContext)) + { + DPRINT1("SetupFindFirstLine() failed\n"); PopupError("Setup failed to find the registry data files.", "ENTER = Reboot computer");
@@ -3213,9 +3180,9 @@
do { - InfGetDataField (InfContext, 0, &Action); - InfGetDataField (InfContext, 1, &File); - InfGetDataField (InfContext, 2, &Section); + INF_GetDataField (&InfContext, 0, &Action); + INF_GetDataField (&InfContext, 1, &File); + INF_GetDataField (&InfContext, 2, &Section);
DPRINT("Action: %S File: %S Section %S\n", Action, File, Section);
@@ -3252,9 +3219,7 @@ } } } - while (InfFindNextLine (InfContext, InfContext)); - - InfFreeContext(InfContext); + while (SetupFindNextLine (&InfContext, &InfContext));
/* Update display registry settings */ CONSOLE_SetStatusText(" Updating display registry settings..."); @@ -3714,7 +3679,7 @@ RtlNormalizeProcessParams(Peb->ProcessParameters);
ProcessHeap = Peb->ProcessHeap; - InfSetHeap(ProcessHeap); + INF_SetHeap(ProcessHeap);
SignalInitEvent();
Modified: trunk/reactos/base/setup/usetup/usetup.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h?... ============================================================================== --- trunk/reactos/base/setup/usetup/usetup.h (original) +++ trunk/reactos/base/setup/usetup/usetup.h Thu Aug 31 13:13:03 2006 @@ -54,11 +54,10 @@ /* ReactOS Version */ #include <reactos/buildno.h>
-#include <infros.h> - /* Internal Headers */ #include "console.h" #include "partlist.h" +#include "inffile.h" #include "inicache.h" #include "filequeue.h" #include "progress.h"
Modified: trunk/reactos/base/setup/usetup/usetup.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.rb... ============================================================================== --- trunk/reactos/base/setup/usetup/usetup.rbuild (original) +++ trunk/reactos/base/setup/usetup/usetup.rbuild Thu Aug 31 13:13:03 2006 @@ -1,4 +1,4 @@ -<module name="usetup" type="nativecui" installbase="system32" installname="usetup.exe" allowwarnings="true"> +<module name="usetup" type="nativecui" installbase="system32" installname="usetup.exe" allowwarnings="false"> <bootstrap base="reactos/system32" nameoncd="smss.exe" /> <include base="usetup">.</include> <include base="zlib">.</include> @@ -13,7 +13,7 @@ <library>inflib</library> <library>vfatlib</library> <library>ntdll</library> - <pch>usetup.h</pch> + <!--pch>usetup.h</pch--> <compilationunit name="unit.c"> <file>bootsup.c</file> <file>cabinet.c</file> @@ -24,6 +24,7 @@ <file>format.c</file> <file>fslist.c</file> <file>genlist.c</file> + <file>inffile.c</file> <file>inicache.c</file> <file>keytrans.c</file> <file>partlist.c</file>