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 if (!ImportRegistryFile (FileName
))
110 convert_path (FileName
, argv
[1]);
111 strcat (FileName
, DIR_SEPARATOR_STRING
);
112 strcat (FileName
, "default");
113 if (!ExportBinaryHive (FileName
, &DefaultHive
))
118 convert_path (FileName
, argv
[1]);
119 strcat (FileName
, DIR_SEPARATOR_STRING
);
120 strcat (FileName
, "sam");
121 if (!ExportBinaryHive (FileName
, &SamHive
))
126 convert_path (FileName
, argv
[1]);
127 strcat (FileName
, DIR_SEPARATOR_STRING
);
128 strcat (FileName
, "security");
129 if (!ExportBinaryHive (FileName
, &SecurityHive
))
134 convert_path (FileName
, argv
[1]);
135 strcat (FileName
, DIR_SEPARATOR_STRING
);
136 strcat (FileName
, "software");
137 if (!ExportBinaryHive (FileName
, &SoftwareHive
))
142 convert_path (FileName
, argv
[1]);
143 strcat (FileName
, DIR_SEPARATOR_STRING
);
144 strcat (FileName
, "system");
145 if (!ExportBinaryHive (FileName
, &SystemHive
))
150 convert_path (FileName
, argv
[1]);
151 strcat (FileName
, DIR_SEPARATOR_STRING
);
152 strcat (FileName
, "BCD");
153 if (!ExportBinaryHive (FileName
, &BcdHive
))
158 RegShutdownRegistry ();