ReactOS 0.4.16-dev-319-g6cf4263
infsupp.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Setup Library
4 * FILE: base/setup/lib/infsupp.h
5 * PURPOSE: Interfacing with Setup* API .INF Files support functions
6 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7 */
8
9#pragma once
10
11#include "spapisup.h"
12
13// FIXME: Temporary measure until all the users of this header
14// (usetup...) use or define SetupAPI-conforming APIs.
15#if defined(_SETUPAPI_H_) || defined(_INC_SETUPAPI)
16
17#include <setupapi.h>
18
19#else
20
21typedef PVOID HINF;
22typedef struct _INFCONTEXT
23{
29
30#endif
31
32C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
33
34/* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */
35#undef MAX_INF_STRING_LENGTH
36#define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h
37
38#ifndef INF_STYLE_OLDNT
39#define INF_STYLE_OLDNT 0x00000001
40#endif
41
42#ifndef INF_STYLE_WIN4
43#define INF_STYLE_WIN4 0x00000002
44#endif
45
46
47/* FUNCTIONS *****************************************************************/
48
49// #define SetupCloseInfFile InfCloseFile
50typedef VOID
52 IN HINF InfHandle);
53
54// #define SetupFindFirstLineW InfpFindFirstLineW
55typedef BOOL
57 IN HINF InfHandle,
58 IN PCWSTR Section,
61
62// #define SetupFindNextLine InfFindNextLine
63typedef BOOL
65 IN PINFCONTEXT ContextIn,
66 OUT PINFCONTEXT ContextOut);
67
68// #define SetupGetFieldCount InfGetFieldCount
69typedef ULONG
72
73// #define SetupGetBinaryField InfGetBinaryField
74typedef BOOL
78 OUT PUCHAR ReturnBuffer,
81
82// #define SetupGetIntField InfGetIntField
83typedef BOOL
87 OUT INT *IntegerValue); // PINT
88
89// #define SetupGetMultiSzFieldW InfGetMultiSzField
90typedef BOOL
94 OUT PWSTR ReturnBuffer,
97
98// #define SetupGetStringFieldW InfGetStringField
99typedef BOOL
103 OUT PWSTR ReturnBuffer,
106
107// #define pSetupGetField
108typedef PCWSTR
112
113/* A version of SetupOpenInfFileW with support for a user-provided LCID */
114// #define SetupOpenInfFileExW InfpOpenInfFileW
115typedef HINF
118 IN PCWSTR InfClass,
119 IN DWORD InfStyle,
121 OUT PUINT ErrorLine);
122
123typedef struct _SPINF_EXPORTS
124{
136
137extern /*SPLIBAPI*/ SPINF_EXPORTS SpInfExports;
138
139#define SpInfCloseInfFile (SpInfExports.SpInfCloseInfFile)
140#define SpInfFindFirstLine (SpInfExports.SpInfFindFirstLine)
141#define SpInfFindNextLine (SpInfExports.SpInfFindNextLine)
142#define SpInfGetFieldCount (SpInfExports.SpInfGetFieldCount)
143#define SpInfGetBinaryField (SpInfExports.SpInfGetBinaryField)
144#define SpInfGetIntField (SpInfExports.SpInfGetIntField)
145#define SpInfGetMultiSzField (SpInfExports.SpInfGetMultiSzField)
146#define SpInfGetStringField (SpInfExports.SpInfGetStringField)
147#define SpInfGetField (SpInfExports.SpInfGetField)
148#define SpInfOpenInfFile (SpInfExports.SpInfOpenInfFile)
149
150/* HELPER FUNCTIONS **********************************************************/
151
153VOID
155 IN PCWSTR InfData)
156{
157#if 0
158 if (InfData)
159 RtlFreeHeap(ProcessHeap, 0, InfData);
160#else
161 UNREFERENCED_PARAMETER(InfData);
162#endif
163}
164
169 OUT PCWSTR* Data);
170
174 OUT PCWSTR* Key,
175 OUT PCWSTR* Data);
176
177/* EOF */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
HANDLE ProcessHeap
Definition: servman.c:15
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
struct _FileName FileName
Definition: fatprocs.h:897
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG(WINAPI * pSpInfGetFieldCount)(IN PINFCONTEXT Context)
Definition: infsupp.h:70
SPINF_EXPORTS SpInfExports
Definition: infsupp.c:24
HINF(WINAPI * pSpInfOpenInfFile)(IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
Definition: infsupp.h:116
BOOL(WINAPI * pSpInfGetStringField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:100
BOOL(WINAPI * pSpInfGetMultiSzField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:91
struct _SPINF_EXPORTS SPINF_EXPORTS
struct _INFCONTEXT * PINFCONTEXT
struct _INFCONTEXT INFCONTEXT
BOOL(WINAPI * pSpInfFindFirstLine)(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.h:56
BOOL(WINAPI * pSpInfGetIntField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.h:84
PVOID HINF
Definition: infsupp.h:21
VOID(WINAPI * pSpInfCloseInfFile)(IN HINF InfHandle)
Definition: infsupp.h:51
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:29
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:154
BOOLEAN INF_GetData(IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
Definition: infsupp.c:77
PCWSTR(WINAPI * pSpInfGetField)(IN PINFCONTEXT Context, IN ULONG FieldIndex)
Definition: infsupp.h:109
struct _SPINF_EXPORTS * PSPINF_EXPORTS
BOOL(WINAPI * pSpInfGetBinaryField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:75
BOOL(WINAPI * pSpInfFindNextLine)(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.h:64
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
DWORD LCID
Definition: nls.h:13
_In_ DWORD FieldIndex
Definition: setupapi.h:1895
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1897
HINF Inf
Definition: infsupp.h:24
UINT Line
Definition: infsupp.h:27
HINF CurrentInf
Definition: infsupp.h:25
UINT Section
Definition: infsupp.h:26
pSpInfFindFirstLine SpInfFindFirstLine
Definition: infsupp.h:126
pSpInfGetBinaryField SpInfGetBinaryField
Definition: infsupp.h:129
pSpInfGetField SpInfGetField
Definition: infsupp.h:133
pSpInfFindNextLine SpInfFindNextLine
Definition: infsupp.h:127
pSpInfGetStringField SpInfGetStringField
Definition: infsupp.h:132
pSpInfGetIntField SpInfGetIntField
Definition: infsupp.h:130
pSpInfOpenInfFile SpInfOpenInfFile
Definition: infsupp.h:134
pSpInfGetMultiSzField SpInfGetMultiSzField
Definition: infsupp.h:131
pSpInfGetFieldCount SpInfGetFieldCount
Definition: infsupp.h:128
pSpInfCloseInfFile SpInfCloseInfFile
Definition: infsupp.h:125
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
Definition: wdfpdo.h:437
#define FORCEINLINE
Definition: wdftypes.h:67
#define WINAPI
Definition: msvc.h:6