Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Setup Library * FILE: base/setup/lib/infsupp.h * PURPOSE: Interfacing with Setup* API .INF Files support functions * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr) */
#pragma once
#include "spapisup.h"
// FIXME: Temporary measure until all the users of this header// (usetup...) use or define SetupAPI-conforming APIs.#if defined(_SETUPAPI_H_) || defined(_INC_SETUPAPI)
#include <setupapi.h>
#else
typedef PVOID HINF;typedef struct _INFCONTEXT{ HINF Inf; HINF CurrentInf; UINT Section; UINT Line;} INFCONTEXT, *PINFCONTEXT;
#endif
C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
/* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */#undef MAX_INF_STRING_LENGTH#define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h
#ifndef INF_STYLE_OLDNT#define INF_STYLE_OLDNT 0x00000001#endif
#ifndef INF_STYLE_WIN4#define INF_STYLE_WIN4 0x00000002#endif
/* FUNCTIONS *****************************************************************/
// #define SetupCloseInfFile InfCloseFiletypedef VOID(WINAPI* pSpInfCloseInfFile)( IN HINF InfHandle);
// #define SetupFindFirstLineW InfpFindFirstLineWtypedef BOOL(WINAPI* pSpInfFindFirstLine)( IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context);
// #define SetupFindNextLine InfFindNextLinetypedef BOOL(WINAPI* pSpInfFindNextLine)( IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut);
// #define SetupGetFieldCount InfGetFieldCounttypedef ULONG(WINAPI* pSpInfGetFieldCount)( IN PINFCONTEXT Context);
// #define SetupGetBinaryField InfGetBinaryFieldtypedef BOOL(WINAPI* pSpInfGetBinaryField)( IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize);
// #define SetupGetIntField InfGetIntFieldtypedef BOOL(WINAPI* pSpInfGetIntField)( IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue); // PINT
// #define SetupGetMultiSzFieldW InfGetMultiSzFieldtypedef BOOL(WINAPI* pSpInfGetMultiSzField)( IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize);
// #define SetupGetStringFieldW InfGetStringFieldtypedef BOOL(WINAPI* pSpInfGetStringField)( IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize);
// #define pSetupGetFieldtypedef PCWSTR(WINAPI* pSpInfGetField)( IN PINFCONTEXT Context, IN ULONG FieldIndex);
/* A version of SetupOpenInfFileW with support for a user-provided LCID */// #define SetupOpenInfFileExW InfpOpenInfFileWtypedef HINF(WINAPI* pSpInfOpenInfFile)( IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine);
typedef struct _SPINF_EXPORTS{ pSpInfCloseInfFile SpInfCloseInfFile; pSpInfFindFirstLine SpInfFindFirstLine; pSpInfFindNextLine SpInfFindNextLine; pSpInfGetFieldCount SpInfGetFieldCount; pSpInfGetBinaryField SpInfGetBinaryField; pSpInfGetIntField SpInfGetIntField; pSpInfGetMultiSzField SpInfGetMultiSzField; pSpInfGetStringField SpInfGetStringField; pSpInfGetField SpInfGetField; pSpInfOpenInfFile SpInfOpenInfFile;} SPINF_EXPORTS, *PSPINF_EXPORTS;
extern /*SPLIBAPI*/ SPINF_EXPORTS SpInfExports;
#define SpInfCloseInfFile (SpInfExports.SpInfCloseInfFile)#define SpInfFindFirstLine (SpInfExports.SpInfFindFirstLine)#define SpInfFindNextLine (SpInfExports.SpInfFindNextLine)#define SpInfGetFieldCount (SpInfExports.SpInfGetFieldCount)#define SpInfGetBinaryField (SpInfExports.SpInfGetBinaryField)#define SpInfGetIntField (SpInfExports.SpInfGetIntField)#define SpInfGetMultiSzField (SpInfExports.SpInfGetMultiSzField)#define SpInfGetStringField (SpInfExports.SpInfGetStringField)#define SpInfGetField (SpInfExports.SpInfGetField)#define SpInfOpenInfFile (SpInfExports.SpInfOpenInfFile)
/* HELPER FUNCTIONS **********************************************************/
FORCEINLINEVOIDINF_FreeData( IN PCWSTR InfData){#if 0 if (InfData) RtlFreeHeap(ProcessHeap, 0, InfData);#else UNREFERENCED_PARAMETER(InfData);#endif}
BOOLEANINF_GetDataField( IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR* Data);
BOOLEANINF_GetData( IN PINFCONTEXT Context, OUT PCWSTR* Key, OUT PCWSTR* Data);
/* EOF */