- Create another branch for networking fixes
[reactos.git] / base / setup / usetup / inffile.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/inffile.h
23 * PURPOSE: .inf files support functions
24 * PROGRAMMER: Hervé Poussineau
25 */
26
27 #ifndef __INFFILE_H__
28 #define __INFFILE_H__
29
30 #ifndef __REACTOS__
31
32 #include <setupapi.h>
33
34 #else /* __REACTOS__ */
35
36 #include <infcommon.h>
37
38 #define SetupCloseInfFile InfpCloseInfFile
39 #define SetupFindFirstLineW InfpFindFirstLineW
40 #define SetupFindNextLine InfpFindNextLine
41 #define SetupGetBinaryField InfpGetBinaryField
42 #define SetupGetFieldCount InfpGetFieldCount
43 #define SetupGetIntField InfpGetIntField
44 #define SetupGetMultiSzFieldW InfpGetMultiSzFieldW
45 #define SetupGetStringFieldW InfpGetStringFieldW
46 #define SetupOpenInfFileW InfpOpenInfFileW
47
48 #define INF_STYLE_WIN4 0x00000002
49
50 /* FIXME: this structure is the one used in inflib, not in setupapi
51 * Delete it once we don't use inflib anymore */
52 typedef struct _INFCONTEXT
53 {
54 PVOID Inf;
55 PVOID Section;
56 PVOID Line;
57 } INFCONTEXT;
58
59 VOID WINAPI
60 InfpCloseInfFile(
61 IN HINF InfHandle);
62
63 BOOL WINAPI
64 InfpFindFirstLineW(
65 IN HINF InfHandle,
66 IN PCWSTR Section,
67 IN PCWSTR Key,
68 IN OUT PINFCONTEXT Context);
69
70 BOOL WINAPI
71 InfpFindNextLine(
72 IN PINFCONTEXT ContextIn,
73 OUT PINFCONTEXT ContextOut);
74
75 BOOL WINAPI
76 InfpGetBinaryField(
77 IN PINFCONTEXT Context,
78 IN ULONG FieldIndex,
79 IN OUT BYTE* ReturnBuffer,
80 IN ULONG ReturnBufferSize,
81 OUT PULONG RequiredSize);
82
83 DWORD WINAPI
84 InfpGetFieldCount(
85 IN PINFCONTEXT Context);
86
87 BOOL WINAPI
88 InfpGetIntField(
89 IN PINFCONTEXT Context,
90 IN DWORD FieldIndex,
91 OUT PINT IntegerValue);
92
93 BOOL WINAPI
94 InfpGetMultiSzFieldW(
95 IN PINFCONTEXT Context,
96 IN ULONG FieldIndex,
97 IN OUT PWSTR ReturnBuffer,
98 IN ULONG ReturnBufferSize,
99 OUT PULONG RequiredSize);
100
101 BOOL WINAPI
102 InfpGetStringFieldW(
103 IN PINFCONTEXT Context,
104 IN ULONG FieldIndex,
105 IN OUT PWSTR ReturnBuffer,
106 IN ULONG ReturnBufferSize,
107 OUT PULONG RequiredSize);
108
109 HINF WINAPI
110 InfpOpenInfFileW(
111 IN PCWSTR FileName,
112 IN PCWSTR InfClass,
113 IN DWORD InfStyle,
114 OUT PUINT ErrorLine);
115
116 #endif /* __REACTOS__ */
117
118 BOOLEAN
119 INF_GetData(
120 IN PINFCONTEXT Context,
121 OUT PWCHAR *Key,
122 OUT PWCHAR *Data);
123
124 BOOLEAN
125 INF_GetDataField(
126 IN PINFCONTEXT Context,
127 IN ULONG FieldIndex,
128 OUT PWCHAR *Data);
129
130 HINF WINAPI
131 INF_OpenBufferedFileA(
132 IN PSTR FileBuffer,
133 IN ULONG FileSize,
134 IN PCSTR InfClass,
135 IN DWORD InfStyle,
136 OUT PUINT ErrorLine);
137
138 VOID INF_SetHeap(
139 IN PVOID Heap);
140
141 #endif /* __INFFILE_H__*/
142
143 /* EOF */