Merge from amd64 branch:
[reactos.git] / reactos / 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 #pragma once
28
29 #ifndef __REACTOS__
30
31 #include <setupapi.h>
32
33 #else /* __REACTOS__ */
34
35 #include <infcommon.h>
36
37 #define SetupCloseInfFile InfpCloseInfFile
38 #define SetupFindFirstLineW InfpFindFirstLineW
39 #define SetupFindNextLine InfpFindNextLine
40 #define SetupGetBinaryField InfpGetBinaryField
41 #define SetupGetFieldCount InfpGetFieldCount
42 #define SetupGetIntField InfpGetIntField
43 #define SetupGetMultiSzFieldW InfpGetMultiSzFieldW
44 #define SetupGetStringFieldW InfpGetStringFieldW
45 #define SetupOpenInfFileW InfpOpenInfFileW
46
47 #define INF_STYLE_WIN4 0x00000002
48
49 /* FIXME: this structure is the one used in inflib, not in setupapi
50 * Delete it once we don't use inflib anymore */
51 typedef struct _INFCONTEXT
52 {
53 PVOID Inf;
54 PVOID Section;
55 PVOID Line;
56 } INFCONTEXT;
57
58 VOID WINAPI
59 InfpCloseInfFile(
60 IN HINF InfHandle);
61
62 BOOL WINAPI
63 InfpFindFirstLineW(
64 IN HINF InfHandle,
65 IN PCWSTR Section,
66 IN PCWSTR Key,
67 IN OUT PINFCONTEXT Context);
68
69 BOOL WINAPI
70 InfpFindNextLine(
71 IN PINFCONTEXT ContextIn,
72 OUT PINFCONTEXT ContextOut);
73
74 BOOL WINAPI
75 InfpGetBinaryField(
76 IN PINFCONTEXT Context,
77 IN ULONG FieldIndex,
78 IN OUT BYTE* ReturnBuffer,
79 IN ULONG ReturnBufferSize,
80 OUT PULONG RequiredSize);
81
82 DWORD WINAPI
83 InfpGetFieldCount(
84 IN PINFCONTEXT Context);
85
86 BOOL WINAPI
87 InfpGetIntField(
88 IN PINFCONTEXT Context,
89 IN DWORD FieldIndex,
90 OUT PINT IntegerValue);
91
92 BOOL WINAPI
93 InfpGetMultiSzFieldW(
94 IN PINFCONTEXT Context,
95 IN ULONG FieldIndex,
96 IN OUT PWSTR ReturnBuffer,
97 IN ULONG ReturnBufferSize,
98 OUT PULONG RequiredSize);
99
100 BOOL WINAPI
101 InfpGetStringFieldW(
102 IN PINFCONTEXT Context,
103 IN ULONG FieldIndex,
104 IN OUT PWSTR ReturnBuffer,
105 IN ULONG ReturnBufferSize,
106 OUT PULONG RequiredSize);
107
108 HINF WINAPI
109 InfpOpenInfFileW(
110 IN PCWSTR FileName,
111 IN PCWSTR InfClass,
112 IN DWORD InfStyle,
113 OUT PUINT ErrorLine);
114
115 #endif /* __REACTOS__ */
116
117 BOOLEAN
118 INF_GetData(
119 IN PINFCONTEXT Context,
120 OUT PWCHAR *Key,
121 OUT PWCHAR *Data);
122
123 BOOLEAN
124 INF_GetDataField(
125 IN PINFCONTEXT Context,
126 IN ULONG FieldIndex,
127 OUT PWCHAR *Data);
128
129 HINF WINAPI
130 INF_OpenBufferedFileA(
131 IN PSTR FileBuffer,
132 IN ULONG FileSize,
133 IN PCSTR InfClass,
134 IN DWORD InfStyle,
135 OUT PUINT ErrorLine);
136
137 VOID INF_SetHeap(
138 IN PVOID Heap);
139
140 /* EOF */