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
,
18 const CHAR
*HeaderComment
)
25 Status
= InfpBuildFileBuffer((PINFCACHE
) InfHandle
, &Buffer
, &BufferSize
);
26 if (! INF_SUCCESS(Status
))
32 File
= fopen(FileName
, "wb");
36 DPRINT1("fopen() failed (errno %d)\n", errno
);
40 DPRINT("fopen() successful\n");
42 if (NULL
!= HeaderComment
&& '\0' != *HeaderComment
)
44 // fprintf(File, "; %s\r\n\r\n", HeaderComment);
47 if (BufferSize
!= fwrite(Buffer
, (size_t)1, (size_t)BufferSize
, File
))
49 DPRINT1("fwrite() failed (errno %d)\n", errno
);
63 InfHostFindOrAddSection(HINF InfHandle
,
69 Status
= InfpFindOrAddSection((PINFCACHE
) InfHandle
, Section
, Context
);
70 if (INF_SUCCESS(Status
))
82 InfHostAddLine(PINFCONTEXT Context
, const WCHAR
*Key
)
86 Status
= InfpAddLineWithKey(Context
, Key
);
87 if (INF_SUCCESS(Status
))
99 InfHostAddField(PINFCONTEXT Context
, const WCHAR
*Data
)
103 Status
= InfpAddField(Context
, Data
);
104 if (INF_SUCCESS(Status
))