ReactOS  0.4.14-dev-49-gfb4591c
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 
21 typedef PVOID HINF;
22 typedef 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
45 typedef PVOID HINF;
46 typedef struct _INFCONTEXT
47 {
48  HINF Inf;
50  UINT Section;
51  UINT Line;
53 #endif
54 
55 C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
56 
57 
58 // #define SetupCloseInfFile InfCloseFile
59 typedef VOID
61  IN HINF InfHandle);
62 
64 
65 // #define SetupFindFirstLineW InfpFindFirstLineW
66 typedef BOOL
68  IN HINF InfHandle,
69  IN PCWSTR Section,
70  IN PCWSTR Key,
72 
74 
75 // #define SetupFindNextLine InfFindNextLine
76 typedef BOOL
78  IN PINFCONTEXT ContextIn,
79  OUT PINFCONTEXT ContextOut);
80 
82 
83 // #define SetupGetFieldCount InfGetFieldCount
84 typedef ULONG
87 
89 
90 // #define SetupGetBinaryField InfGetBinaryField
91 typedef BOOL
95  OUT PUCHAR ReturnBuffer,
98 
100 
101 // #define SetupGetIntField InfGetIntField
102 typedef BOOL
106  OUT INT *IntegerValue); // PINT
107 
109 
110 // #define SetupGetMultiSzFieldW InfGetMultiSzField
111 typedef BOOL
115  OUT PWSTR ReturnBuffer,
118 
120 
121 // #define SetupGetStringFieldW InfGetStringField
122 typedef BOOL
126  OUT PWSTR ReturnBuffer,
129 
131 
132 // #define pSetupGetField
133 typedef PCWSTR
137 
139 
140 /* A version of SetupOpenInfFileW with support for a user-provided LCID */
141 // #define SetupOpenInfFileExW InfpOpenInfFileW
142 typedef HINF
145  IN PCWSTR InfClass,
146  IN DWORD InfStyle,
147  IN LCID LocaleId,
148  OUT PUINT ErrorLine);
149 
151 
152 
153 /* HELPER FUNCTIONS **********************************************************/
154 
156 VOID
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 
168 BOOLEAN
172  OUT PCWSTR* Data);
173 
174 BOOLEAN
177  OUT PCWSTR* Key,
178  OUT PCWSTR* Data);
179 
180 /* EOF */
PCWSTR(WINAPI * pSpInfGetField)(IN PINFCONTEXT Context, IN ULONG FieldIndex)
Definition: infsupp.h:134
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
BOOL(WINAPI * pSpInfGetMultiSzField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:112
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG Key
Definition: fatprocs.h:2697
struct _INFCONTEXT INFCONTEXT
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
HINF(WINAPI * pSpInfOpenInfFile)(IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
Definition: infsupp.h:143
uint16_t * PWSTR
Definition: typedefs.h:54
unsigned char * PUCHAR
Definition: retypes.h:3
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
ULONG(WINAPI * pSpInfGetFieldCount)(IN PINFCONTEXT Context)
Definition: infsupp.h:85
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:42
_In_ DWORD _In_ DWORD ReturnBufferSize
Definition: setupapi.h:1892
pSpInfFindFirstLine SpInfFindFirstLine
Definition: infsupp.c:87
DWORD LCID
Definition: nls.h:13
PVOID HINF
Definition: infsupp.h:21
HINF CurrentInf
Definition: infsupp.h:25
#define BOOL
Definition: nt_native.h:43
int32_t INT
Definition: typedefs.h:56
BOOL(WINAPI * pSpInfFindFirstLine)(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.h:67
BOOL(WINAPI * pSpInfFindNextLine)(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.h:77
pSpInfGetField SpInfGetField
Definition: infsupp.c:94
C_ASSERT(sizeof(INFCONTEXT)==2 *sizeof(HINF)+2 *sizeof(UINT))
unsigned char BOOLEAN
#define FORCEINLINE
Definition: ntbasedef.h:221
pSpInfCloseInfFile SpInfCloseInfFile
Definition: infsupp.c:86
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
pSpInfGetBinaryField SpInfGetBinaryField
Definition: infsupp.c:90
BOOLEAN INF_GetData(IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
Definition: infsupp.c:90
pSpInfGetStringField SpInfGetStringField
Definition: infsupp.c:93
_In_ DWORD FieldIndex
Definition: setupapi.h:1890
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:157
#define VOID
Definition: acefi.h:82
pSpInfOpenInfFile SpInfOpenInfFile
Definition: infsupp.c:95
pSpInfGetFieldCount SpInfGetFieldCount
Definition: infsupp.c:89
BOOL(WINAPI * pSpInfGetBinaryField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:92
HANDLE ProcessHeap
Definition: servman.c:15
pSpInfGetMultiSzField SpInfGetMultiSzField
Definition: infsupp.c:92
struct _FileName FileName
Definition: fatprocs.h:884
pSpInfGetIntField SpInfGetIntField
Definition: infsupp.c:91
pSpInfFindNextLine SpInfFindNextLine
Definition: infsupp.c:88
UINT Section
Definition: infsupp.h:26
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
struct _INFCONTEXT * PINFCONTEXT
VOID(WINAPI * pSpInfCloseInfFile)(IN HINF InfHandle)
Definition: infsupp.h:60
#define OUT
Definition: typedefs.h:39
struct tagContext Context
Definition: acpixf.h:1024
unsigned int ULONG
Definition: retypes.h:1
HINF Inf
Definition: infsupp.h:24
UINT Line
Definition: infsupp.h:27
unsigned int * PUINT
Definition: ndis.h:50
BOOL(WINAPI * pSpInfGetStringField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.h:123
BOOL(WINAPI * pSpInfGetIntField)(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.h:103