sync to trunk revision 36100
[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
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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 InfFindNextLine
41 #define SetupGetBinaryField InfGetBinaryField
42 #define SetupGetFieldCount InfGetFieldCount
43 #define SetupGetIntField InfGetIntField
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 InfpGetMultiSzFieldW(
72 IN PINFCONTEXT Context,
73 IN ULONG FieldIndex,
74 IN OUT PWSTR ReturnBuffer,
75 IN ULONG ReturnBufferSize,
76 OUT PULONG RequiredSize);
77
78 BOOL WINAPI
79 InfpGetStringFieldW(
80 IN PINFCONTEXT Context,
81 IN ULONG FieldIndex,
82 IN OUT PWSTR ReturnBuffer,
83 IN ULONG ReturnBufferSize,
84 OUT PULONG RequiredSize);
85
86 HINF WINAPI
87 InfpOpenInfFileW(
88 IN PCWSTR FileName,
89 IN PCWSTR InfClass,
90 IN DWORD InfStyle,
91 OUT PUINT ErrorLine);
92
93 #endif /* __REACTOS__ */
94
95 BOOLEAN
96 INF_GetData(
97 IN PINFCONTEXT Context,
98 OUT PWCHAR *Key,
99 OUT PWCHAR *Data);
100
101 BOOLEAN
102 INF_GetDataField(
103 IN PINFCONTEXT Context,
104 IN ULONG FieldIndex,
105 OUT PWCHAR *Data);
106
107 HINF WINAPI
108 INF_OpenBufferedFileA(
109 IN PSTR FileBuffer,
110 IN ULONG FileSize,
111 IN PCSTR InfClass,
112 IN DWORD InfStyle,
113 OUT PUINT ErrorLine);
114
115 VOID INF_SetHeap(
116 IN PVOID Heap);
117
118 #endif /* __INFFILE_H__*/
119
120 /* EOF */