return rc;
}
- if (windows_info->system_root) {
- rc = xmlTextWriterWriteElement(writer, "SYSTEMROOT",
- windows_info->system_root);
- if (rc < 0)
- return rc;
- }
-
if (windows_info->product_type) {
rc = xmlTextWriterWriteElement(writer, "PRODUCTTYPE",
windows_info->product_type);
return rc;
}
+ if (windows_info->system_root) {
+ rc = xmlTextWriterWriteElement(writer, "SYSTEMROOT",
+ windows_info->system_root);
+ if (rc < 0)
+ return rc;
+ }
+
return xmlTextWriterEndElement(writer); /* </WINDOWS> */
}
return rc;
rc = xmlTextWriterWriteFormatElement(writer, "HIGHPART",
- "0x%"PRIX32, (u32)(time >> 32));
+ "0x%08"PRIX32, (u32)(time >> 32));
if (rc < 0)
return rc;
rc = xmlTextWriterWriteFormatElement(writer, "LOWPART",
- "0x%"PRIX32, (u32)time);
+ "0x%08"PRIX32, (u32)time);
if (rc < 0)
return rc;
size_t bytes_written;
off_t start_offset, end_offset;
- wimlib_assert(image == WIM_ALL_IMAGES ||
+ wimlib_assert(image == WIMLIB_ALL_IMAGES ||
(wim_info != NULL && image >= 1 &&
image <= wim_info->num_images));
if (wim_info != NULL) {
DEBUG("Writing %d <IMAGE> elements", (int)wim_info->num_images);
for (int i = 1; i <= (int)wim_info->num_images; i++) {
- if (image != WIM_ALL_IMAGES && i != image)
+ if (image != WIMLIB_ALL_IMAGES && i != image)
continue;
DEBUG("Writing <IMAGE> element for image %d", i);
ret = xml_write_image_info(writer, &wim_info->images[i - 1]);
int i;
DEBUG("Checking to see if the image name `%s' is already in use", name);
- if (!name || !w->wim_info)
+ if (!name || !*name || !w->wim_info)
return false;
for (i = 1; i <= w->wim_info->num_images; i++)
if (strcmp(w->wim_info->images[i - 1].name, name) == 0)
WIMLIBAPI int wimlib_extract_xml_data(WIMStruct *w, FILE *fp)
{
DEBUG("Extracting the XML data.");
+ if (!w->xml_data)
+ return WIMLIB_ERR_INVALID_PARAM;
+
if (fwrite(w->xml_data, 1, w->hdr.xml_res_entry.size, fp) !=
w->hdr.xml_res_entry.size) {
ERROR_WITH_ERRNO("Failed to extract XML data");