mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Do not overwrite existing hive files.
Add hive header checksum. svn path=/trunk/; revision=4710
This commit is contained in:
parent
bcef4d4f0e
commit
2cd0a85f57
2 changed files with 14 additions and 5 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: binhive.c,v 1.3 2003/04/22 21:14:39 ekohl Exp $
|
/* $Id: binhive.c,v 1.4 2003/05/18 13:50:58 ekohl Exp $
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS hive maker
|
* PROJECT: ReactOS hive maker
|
||||||
* FILE: tools/mkhive/binhive.c
|
* FILE: tools/mkhive/binhive.c
|
||||||
|
@ -1319,17 +1319,27 @@ CmiWriteHive(PREGISTRY_HIVE Hive,
|
||||||
FILE *File;
|
FILE *File;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
/* FIXME: Calculate header checksum */
|
/* Check for existing hive file */
|
||||||
|
File = fopen (FileName, "rb");
|
||||||
|
if (File != NULL)
|
||||||
|
{
|
||||||
|
printf (" File already exists\n");
|
||||||
|
fclose (File);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create new hive file */
|
||||||
File = fopen (FileName, "w+b");
|
File = fopen (FileName, "w+b");
|
||||||
if (File == NULL)
|
if (File == NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek (File, 0, SEEK_SET);
|
fseek (File, 0, SEEK_SET);
|
||||||
|
|
||||||
|
/* Calculate header checksum */
|
||||||
|
CmiCalcHiveChecksum (Hive);
|
||||||
|
|
||||||
/* Write hive header */
|
/* Write hive header */
|
||||||
fwrite (Hive->HiveHeader, REG_BLOCK_SIZE, 1, File);
|
fwrite (Hive->HiveHeader, REG_BLOCK_SIZE, 1, File);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: infcache.c,v 1.4 2003/05/18 12:12:07 ekohl Exp $
|
/* $Id: infcache.c,v 1.5 2003/05/18 13:50:58 ekohl Exp $
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS hive maker
|
* PROJECT: ReactOS hive maker
|
||||||
* FILE: tools/mkhive/infcache.c
|
* FILE: tools/mkhive/infcache.c
|
||||||
|
@ -426,7 +426,6 @@ inline static int is_eof( struct parser *parser, const CHAR *ptr )
|
||||||
/* check if the pointer points to an end of line */
|
/* check if the pointer points to an end of line */
|
||||||
inline static int is_eol( struct parser *parser, const CHAR *ptr )
|
inline static int is_eol( struct parser *parser, const CHAR *ptr )
|
||||||
{
|
{
|
||||||
// return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == '\r' /*'\n'*/);
|
|
||||||
return (ptr >= parser->end ||
|
return (ptr >= parser->end ||
|
||||||
*ptr == CONTROL_Z ||
|
*ptr == CONTROL_Z ||
|
||||||
*ptr == '\n' ||
|
*ptr == '\n' ||
|
||||||
|
|
Loading…
Reference in a new issue