ReactOS 0.4.15-dev-7196-g0fe0b40
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
32/* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */
33#undef MAX_INF_STRING_LENGTH
34#define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h
35
36#ifndef INF_STYLE_OLDNT
37#define INF_STYLE_OLDNT 0x00000001
38#endif
39
40#ifndef INF_STYLE_WIN4
41#define INF_STYLE_WIN4 0x00000002
42#endif
43
44#if 0
45typedef PVOID HINF;
46typedef struct _INFCONTEXT
47{
48 HINF Inf;
51 UINT Line;
53#endif
54
55C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
56
57
58// #define SetupCloseInfFile InfCloseFile
59typedef VOID
61 IN HINF InfHandle);
62
64
65// #define SetupFindFirstLineW InfpFindFirstLineW
66typedef BOOL
68 IN HINF InfHandle,
69 IN PCWSTR Section,
72
74
75// #define SetupFindNextLine InfFindNextLine
76typedef BOOL
78 IN PINFCONTEXT ContextIn,
79 OUT PINFCONTEXT ContextOut);
80
82
83// #define SetupGetFieldCount InfGetFieldCount
84typedef ULONG
87
89
90// #define SetupGetBinaryField InfGetBinaryField
91typedef BOOL
95 OUT PUCHAR ReturnBuffer,
98
100
101// #define SetupGetIntField InfGetIntField
102typedef BOOL
106 OUT INT *IntegerValue); // PINT
107
109
110// #define SetupGetMultiSzFieldW InfGetMultiSzField
111typedef BOOL
115 OUT PWSTR ReturnBuffer,
118
120
121// #define SetupGetStringFieldW InfGetStringField
122typedef BOOL
126 OUT PWSTR ReturnBuffer,
129
131
132// #define pSetupGetField
133typedef PCWSTR
137
139
140/* A version of SetupOpenInfFileW with support for a user-provided LCID */
141// #define SetupOpenInfFileExW InfpOpenInfFileW
142typedef HINF
145 IN PCWSTR InfClass,
146 IN DWORD InfStyle,
148 OUT PUINT ErrorLine);
149
151
152
153/* HELPER FUNCTIONS **********************************************************/
154
156VOID
158 IN PCWSTR InfData)
159{
160#if 0
161 if (InfData)
162 RtlFreeHeap(ProcessHeap, 0, InfData);
163#else
164 UNREFERENCED_PARAMETER(InfData);
165#endif
166}
167
172 OUT PCWSTR* Data);
173
177 OUT PCWSTR* Key,
178 OUT PCWSTR* Data);
179
180/* 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:606
struct _FileName FileName
Definition: fatprocs.h:896
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG(WINAPI * pSpInfGetFieldCount)(IN PINFCONTEXT Context)
Definition: infsupp.h:85
pSpInfGetBinaryField SpInfGetBinaryField
Definition: infsupp.c:90
HINF(WINAPI * pSpInfOpenInfFile)(IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
Definition: infsupp.h:143
pSpInfGetMultiSzField SpInfGetMultiSzField
Definition: infsupp.c:92
BOOL(WINAPI * pSpInfGetStringField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:123
BOOL(WINAPI * pSpInfGetMultiSzField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:112
struct _INFCONTEXT * PINFCONTEXT
struct _INFCONTEXT INFCONTEXT
pSpInfGetStringField SpInfGetStringField
Definition: infsupp.c:93
BOOL(WINAPI * pSpInfFindFirstLine)(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.h:67
BOOL(WINAPI * pSpInfGetIntField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.h:103
PVOID HINF
Definition: infsupp.h:21
pSpInfGetFieldCount SpInfGetFieldCount
Definition: infsupp.c:89
pSpInfFindNextLine SpInfFindNextLine
Definition: infsupp.c:88
pSpInfGetIntField SpInfGetIntField
Definition: infsupp.c:91
pSpInfFindFirstLine SpInfFindFirstLine
Definition: infsupp.c:87
VOID(WINAPI * pSpInfCloseInfFile)(IN HINF InfHandle)
Definition: infsupp.h:60
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:42
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:157
pSpInfOpenInfFile SpInfOpenInfFile
Definition: infsupp.c:95
pSpInfCloseInfFile SpInfCloseInfFile
Definition: infsupp.c:86
pSpInfGetField SpInfGetField
Definition: infsupp.c:94
BOOLEAN INF_GetData(IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
Definition: infsupp.c:90
PCWSTR(WINAPI * pSpInfGetField)(IN PINFCONTEXT Context, IN ULONG FieldIndex)
Definition: infsupp.h:134
BOOL(WINAPI * pSpInfGetBinaryField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:92
BOOL(WINAPI * pSpInfFindNextLine)(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.h:77
#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:317
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
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