reactos/base/setup/usetup/inffile.h
Hermès Bélusca-Maïto 397faf62bf
[USETUP] Moving around some code.
- As GetSourcePaths() is used once in USETUP to initialize global
  UNICODE_STRING path strings once, move it out of drivesup.c and
  put it in usetup.c. Then remove drivesup.c : 1 file less!

- Move some INF file prototype declarations out of usetup.h and
  inside inffile.h where they should better be, as inffile.h and .c
  is the glue code for the INF library, defining similar functions
  as the ones in setupapi.dll.

- I rename our local SetupOpenInfFileW() into SetupOpenInfFileExW()
  because the latter one takes an extra user-provided LCID parameter,
  and this is this one that we use in USETUP.

- Make 'UNICODE_STRING SourcePath;' visible only inside usetup.c
  (not used elsewhere).

- Implement installation path validity check in case we are either
  in repair/update, or unattended setup mode. If the path is detected
  as invalid, then we fall back into manual path specification
  (for now...; note that we could instead fail the installation too).

svn path=/branches/setup_improvements/; revision=75246
2018-10-26 02:16:04 +02:00

117 lines
3.5 KiB
C

/*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: base/setup/usetup/inffile.h
* PURPOSE: .inf files support functions
* PROGRAMMER: Hervé Poussineau
*/
#pragma once
#include <infcommon.h>
extern VOID InfSetHeap(PVOID Heap);
extern VOID InfCloseFile(HINF InfHandle);
extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn,
PINFCONTEXT ContextOut);
extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context,
ULONG FieldIndex,
PUCHAR ReturnBuffer,
ULONG ReturnBufferSize,
PULONG RequiredSize);
extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context,
ULONG FieldIndex,
PWSTR ReturnBuffer,
ULONG ReturnBufferSize,
PULONG RequiredSize);
extern BOOLEAN InfGetStringField(PINFCONTEXT Context,
ULONG FieldIndex,
PWSTR ReturnBuffer,
ULONG ReturnBufferSize,
PULONG RequiredSize);
#define SetupCloseInfFile InfCloseFile
#define SetupFindNextLine InfFindNextLine
#define SetupGetBinaryField InfGetBinaryField
#define SetupGetMultiSzFieldW InfGetMultiSzField
#define SetupGetStringFieldW InfGetStringField
#define SetupFindFirstLineW InfpFindFirstLineW
#define SetupGetFieldCount InfGetFieldCount
#define SetupGetIntField InfGetIntField
// SetupOpenInfFileW with support for a user-provided LCID
#define SetupOpenInfFileExW 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
{
HINF Inf;
HINF CurrentInf;
UINT Section;
UINT Line;
} INFCONTEXT;
C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(PVOID) + 2 * sizeof(UINT));
BOOL
WINAPI
InfpFindFirstLineW(
IN HINF InfHandle,
IN PCWSTR Section,
IN PCWSTR Key,
IN OUT PINFCONTEXT Context);
HINF
WINAPI
InfpOpenInfFileW(
IN PCWSTR FileName,
IN PCWSTR InfClass,
IN DWORD InfStyle,
IN LCID LocaleId,
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,
IN LCID LocaleId,
OUT PUINT ErrorLine);
/* EOF */