Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
88dcceea
Commit
88dcceea
authored
Jul 17, 2020
by
longpanda
Browse files
update
parent
ef204263
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
+19
-9
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
View file @
88dcceea
...
...
@@ -428,7 +428,7 @@ static int ventoy_get_override_info(grub_file_t file, wim_tail *wim_data)
return
0
;
}
static
int
ventoy_read_resource
(
grub_file_t
fp
,
wim_resource_header
*
head
,
void
**
buffer
)
static
int
ventoy_read_resource
(
grub_file_t
fp
,
wim_header
*
wimhdr
,
wim_resource_header
*
head
,
void
**
buffer
)
{
int
decompress_len
=
0
;
int
total_decompress
=
0
;
...
...
@@ -478,9 +478,14 @@ static int ventoy_read_resource(grub_file_t fp, wim_resource_header *head, void
}
else
{
decompress_len
=
(
int
)
lzx_decompress
(
buffer_compress
+
cur_offset
,
chunk_size
,
cur_dst
);
if
(
decompress
<
0
)
if
(
wimhdr
->
flags
&
FLAG_HEADER_COMPRESS_XPRESS
)
{
decompress_len
=
(
int
)
xca_decompress
(
buffer_compress
+
cur_offset
,
chunk_size
,
cur_dst
);
}
else
{
decompress_len
=
(
int
)
lzx_decompress
(
buffer_compress
+
cur_offset
,
chunk_size
,
cur_dst
);
}
}
//debug("chunk_size:%u decompresslen:%d\n", chunk_size, decompress_len);
...
...
@@ -502,9 +507,14 @@ static int ventoy_read_resource(grub_file_t fp, wim_resource_header *head, void
}
else
{
decompress_len
=
(
int
)
lzx_decompress
(
buffer_compress
+
cur_offset
,
head
->
size_in_wim
-
cur_offset
,
cur_dst
);
if
(
decompress
<
0
)
if
(
wimhdr
->
flags
&
FLAG_HEADER_COMPRESS_XPRESS
)
{
decompress_len
=
(
int
)
xca_decompress
(
buffer_compress
+
cur_offset
,
head
->
size_in_wim
-
cur_offset
,
cur_dst
);
}
else
{
decompress_len
=
(
int
)
lzx_decompress
(
buffer_compress
+
cur_offset
,
head
->
size_in_wim
-
cur_offset
,
cur_dst
);
}
}
cur_dst
+=
decompress_len
;
...
...
@@ -816,14 +826,14 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
return
1
;
}
if
((
head
->
flags
&
FLAG_HEADER_COMPRESS_XPRESS
)
||
(
head
->
flags
&
FLAG_HEADER_COMPRESS_LZMS
)
)
if
(
head
->
flags
&
FLAG_HEADER_COMPRESS_LZMS
)
{
debug
(
"
Xpress or
LZMS compress is not supported 0x%x
\n
"
,
head
->
flags
);
debug
(
"LZMS compress is not supported 0x%x
\n
"
,
head
->
flags
);
grub_file_close
(
file
);
return
1
;
}
rc
=
ventoy_read_resource
(
file
,
&
head
->
metadata
,
(
void
**
)
&
decompress_data
);
rc
=
ventoy_read_resource
(
file
,
head
,
&
head
->
metadata
,
(
void
**
)
&
decompress_data
);
if
(
rc
)
{
grub_printf
(
"failed to read meta data %d
\n
"
,
rc
);
...
...
@@ -860,7 +870,7 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch)
debug
(
"find replace lookup entry_id:%ld raw_size:%u
\n
"
,
((
long
)
patch
->
replace_look
-
(
long
)
lookup
)
/
sizeof
(
wim_lookup_entry
),
exe_len
);
if
(
0
==
ventoy_read_resource
(
file
,
&
(
patch
->
replace_look
->
resource
),
(
void
**
)
&
(
exe_data
)))
if
(
0
==
ventoy_read_resource
(
file
,
head
,
&
(
patch
->
replace_look
->
resource
),
(
void
**
)
&
(
exe_data
)))
{
ventoy_cat_exe_file_data
(
wim_data
,
exe_len
,
exe_data
);
grub_free
(
exe_data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment