3 * Copyright (C) 2002 ReactOS Team
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.
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.
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.
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS text-mode setup
22 * FILE: subsys/system/usetup/inffile.c
23 * PURPOSE: .inf files support functions
24 * PROGRAMMER: Hervé Poussineau
27 /* INCLUDES ******************************************************************/
34 /* FUNCTIONS *****************************************************************/
43 IN OUT PINFCONTEXT Context
)
48 ret
= InfFindFirstLine(InfHandle
, Section
, Key
, &pContext
);
52 memcpy(Context
, pContext
, sizeof(INFCONTEXT
));
53 InfFreeContext(pContext
);
66 UNICODE_STRING FileNameU
;
70 RtlInitUnicodeString(&FileNameU
, FileName
);
74 LANGIDFROMLCID(LocaleId
),
76 *ErrorLine
= (UINT
)ErrorLineUL
;
77 if (!NT_SUCCESS(Status
))
78 return INVALID_HANDLE_VALUE
;
83 #endif /* __REACTOS__ */
87 IN PINFCONTEXT Context
,
92 return InfGetData(Context
, Key
, Data
);
94 static PWCHAR pLastCallData
[4] = { NULL
, NULL
, NULL
, NULL
};
95 static DWORD currentIndex
= 0;
101 if (Key
) *Key
= NULL
;
102 if (Data
) *Data
= NULL
;
104 if (SetupGetFieldCount(Context
) != 1)
107 for (i
= 0; i
<= 1; i
++)
109 ret
= SetupGetStringFieldW(
117 HeapFree(GetProcessHeap(), 0, pLastCallData
[i
+ currentIndex
]);
118 pLastCallData
[i
+ currentIndex
] = HeapAlloc(GetProcessHeap(), 0, dwSize
* sizeof(WCHAR
));
119 ret
= SetupGetStringFieldW(
122 pLastCallData
[i
+ currentIndex
],
130 *Key
= pLastCallData
[0 + currentIndex
];
132 *Data
= pLastCallData
[1 + currentIndex
];
134 #endif /* !__REACTOS__ */
139 IN PINFCONTEXT Context
,
144 return InfGetDataField(Context
, FieldIndex
, Data
);
146 static PWCHAR pLastCallsData
[] = { NULL
, NULL
, NULL
};
147 static DWORD NextIndex
= 0;
153 ret
= SetupGetStringFieldW(
161 HeapFree(GetProcessHeap(), 0, pLastCallsData
[NextIndex
]);
162 pLastCallsData
[NextIndex
] = HeapAlloc(GetProcessHeap(), 0, dwSize
* sizeof(WCHAR
));
163 ret
= SetupGetStringFieldW(
166 pLastCallsData
[NextIndex
],
172 *Data
= pLastCallsData
[NextIndex
];
173 NextIndex
= (NextIndex
+ 1) % (sizeof(pLastCallsData
) / sizeof(pLastCallsData
[0]));
175 #endif /* !__REACTOS__ */
179 INF_OpenBufferedFileA(
192 Status
= InfOpenBufferedFile(
196 LANGIDFROMLCID(LocaleId
),
198 *ErrorLine
= (UINT
)ErrorLineUL
;
199 if (!NT_SUCCESS(Status
))
200 return INVALID_HANDLE_VALUE
;
204 return INVALID_HANDLE_VALUE
;
205 #endif /* !__REACTOS__ */