3 * Copyright (C) 2003, 2006 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 hive maker
22 * FILE: tools/mkhive/mkhive.c
24 * PROGRAMMER: Eric Kohl
36 #define PATH_MAX _MAX_PATH
43 #define DIR_SEPARATOR_CHAR '/'
44 #define DIR_SEPARATOR_STRING "/"
46 #define DIR_SEPARATOR_CHAR '\\'
47 #define DIR_SEPARATOR_STRING "\\"
53 printf ("Usage: mkhive <dstdir> <inffiles>\n\n");
54 printf (" dstdir - binary hive files are created in this directory\n");
55 printf (" inffiles - inf files with full path\n");
58 void convert_path(char *dst
, char *src
)
86 int main (int argc
, char *argv
[])
88 char FileName
[PATH_MAX
];
97 printf ("Binary hive maker\n");
99 RegInitializeRegistry ();
101 for (i
= 2; i
< argc
; i
++)
103 convert_path (FileName
, argv
[i
]);
104 ImportRegistryFile (FileName
);
107 convert_path (FileName
, argv
[1]);
108 strcat (FileName
, DIR_SEPARATOR_STRING
);
109 strcat (FileName
, "default");
110 if (!ExportBinaryHive (FileName
, &DefaultHive
))
115 convert_path (FileName
, argv
[1]);
116 strcat (FileName
, DIR_SEPARATOR_STRING
);
117 strcat (FileName
, "sam");
118 if (!ExportBinaryHive (FileName
, &SamHive
))
123 convert_path (FileName
, argv
[1]);
124 strcat (FileName
, DIR_SEPARATOR_STRING
);
125 strcat (FileName
, "security");
126 if (!ExportBinaryHive (FileName
, &SecurityHive
))
131 convert_path (FileName
, argv
[1]);
132 strcat (FileName
, DIR_SEPARATOR_STRING
);
133 strcat (FileName
, "software");
134 if (!ExportBinaryHive (FileName
, &SoftwareHive
))
139 convert_path (FileName
, argv
[1]);
140 strcat (FileName
, DIR_SEPARATOR_STRING
);
141 strcat (FileName
, "system");
142 if (!ExportBinaryHive (FileName
, &SystemHive
))
147 convert_path (FileName
, argv
[1]);
148 strcat (FileName
, DIR_SEPARATOR_STRING
);
149 strcat (FileName
, "BCD");
150 if (!ExportBinaryHive (FileName
, &BcdHive
))
155 RegShutdownRegistry ();