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 * PROGRAMMER: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
11 /* Make setupapi.h to not define the API as exports to the DLL */
16 // FIXME: Temporary measure until all the users of this header
17 // (usetup...) use or define SetupAPI-conforming APIs.
18 #if defined(_SETUPAPI_H_) || defined(_INC_SETUPAPI)
25 typedef struct _INFCONTEXT
31 } INFCONTEXT
, *PINFCONTEXT
;
33 // #define SetupCloseInfFile InfCloseFile
36 SetupCloseInfFile(HINF InfHandle
);
38 // #define SetupFindFirstLineW InfpFindFirstLineW
45 IN OUT PINFCONTEXT Context
);
47 // #define SetupFindNextLine InfFindNextLine
50 SetupFindNextLine(PINFCONTEXT ContextIn
,
51 PINFCONTEXT ContextOut
);
53 // #define SetupGetFieldCount InfGetFieldCount
56 SetupGetFieldCount(PINFCONTEXT Context
);
58 // #define SetupGetBinaryField InfGetBinaryField
61 SetupGetBinaryField(PINFCONTEXT Context
,
64 ULONG ReturnBufferSize
,
67 // #define SetupGetIntField InfGetIntField
70 SetupGetIntField(PINFCONTEXT Context
,
72 INT
*IntegerValue
); // PINT
74 // #define SetupGetMultiSzFieldW InfGetMultiSzField
77 SetupGetMultiSzFieldW(PINFCONTEXT Context
,
80 ULONG ReturnBufferSize
,
83 // #define SetupGetStringFieldW InfGetStringField
86 SetupGetStringFieldW(PINFCONTEXT Context
,
89 ULONG ReturnBufferSize
,
94 /* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */
95 #undef MAX_INF_STRING_LENGTH
96 #define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h
98 #ifndef INF_STYLE_OLDNT
99 #define INF_STYLE_OLDNT 0x00000001
102 #ifndef INF_STYLE_WIN4
103 #define INF_STYLE_WIN4 0x00000002
108 typedef struct _INFCONTEXT
114 } INFCONTEXT
, *PINFCONTEXT
;
117 C_ASSERT(sizeof(INFCONTEXT
) == 2 * sizeof(HINF
) + 2 * sizeof(UINT
));
121 * This function corresponds to an undocumented but exported SetupAPI function
122 * that exists since WinNT4 and is still present in Win10.
123 * The returned string pointer is a read-only pointer to a string in the
124 * maintained INF cache, and is always in UNICODE (on NT systems).
128 pSetupGetField(PINFCONTEXT Context
,
131 /* A version of SetupOpenInfFileW with support for a user-provided LCID */
132 // #define SetupOpenInfFileExW InfpOpenInfFileW
140 OUT PUINT ErrorLine
);
143 /* HELPER FUNCTIONS **********************************************************/
146 INF_FreeData(IN PWCHAR InfData
)
150 RtlFreeHeap(ProcessHeap
, 0, InfData
);
152 UNREFERENCED_PARAMETER(InfData
);
158 IN PINFCONTEXT Context
,
164 IN PINFCONTEXT Context
,