2 * PROJECT: .inf file parser
3 * LICENSE: GPL - See COPYING in the top level directory
4 * COPYRIGHT: Copyright 2005 Ge van Geldorp <gvg@reactos.org>
7 /* INCLUDES *****************************************************************/
16 InfHostWriteFile(HINF InfHandle
, const CHAR
*FileName
,
17 const CHAR
*HeaderComment
)
24 Status
= InfpBuildFileBuffer((PINFCACHE
) InfHandle
, &Buffer
, &BufferSize
);
25 if (! INF_SUCCESS(Status
))
31 File
= fopen(FileName
, "wb");
35 DPRINT1("fopen() failed (errno %d)\n", errno
);
39 DPRINT("fopen() successful\n");
41 if (NULL
!= HeaderComment
&& '\0' != *HeaderComment
)
43 fprintf(File
, "; %s\r\n\r\n", HeaderComment
);
46 if (BufferSize
!= fwrite(Buffer
, (size_t)1, (size_t)BufferSize
, File
))
48 DPRINT1("fwrite() failed (errno %d)\n", errno
);
62 InfHostFindOrAddSection(HINF InfHandle
,
68 Status
= InfpFindOrAddSection((PINFCACHE
) InfHandle
, Section
, Context
);
69 if (INF_SUCCESS(Status
))
81 InfHostAddLine(PINFCONTEXT Context
, const CHAR
*Key
)
85 Status
= InfpAddLineWithKey(Context
, Key
);
86 if (INF_SUCCESS(Status
))
98 InfHostAddField(PINFCONTEXT Context
, const CHAR
*Data
)
102 Status
= InfpAddField(Context
, Data
);
103 if (INF_SUCCESS(Status
))