From be5bc6f3b75589bc3b6a339283576f09b457d42d Mon Sep 17 00:00:00 2001 From: longpanda Date: Fri, 22 Oct 2021 11:59:51 +0800 Subject: [PATCH] Optimization for Ventoy2Disk.exe --- INSTALL/Ventoy2Disk.exe | Bin 345600 -> 345600 bytes Ventoy2Disk/Ventoy2Disk/PhyDrive.c | 3 +++ 2 files changed, 3 insertions(+) diff --git a/INSTALL/Ventoy2Disk.exe b/INSTALL/Ventoy2Disk.exe index 63cb2bca4ab543f75597d65b5c8e88560246741b..9c439a33811ff2acc8bc26488fdc65ad3060bf4b 100644 GIT binary patch delta 5010 zcmZ8kdtA)v_y3$}Vs;Cu2^B?>k}lKCG@s8*GbQ8_c8G+;x~z|uLPhIVq>?G(SQCq7 zAIk)G0a*Et@irlMY z;E*3W$KnL593TcilTL$c=-{aCTy}!va%-h2Hrt_#Z)`T3J3l;z6OHR*IBOw}bR6Uz zMFL`3X$+UbS(UX+*d?zf(_5?~metqtwd3Npuno2HSV+Pp@~}=p2bqjaS(9wKH~xez z^R+0eB}qA+l79@lQ0?9yCRrA^e=mX0Fs9RHc#Xexx(t5!mB&i>6bE|t>X1^wc5qhK zOt5buCVfx(qj0%rA6GZ~lB}_9y!e`N9V+m;XA*2j-pd!3;yAA$NWcQGP*?wbb}Jg? zwg~a!Ns@HOIkuKw3Nh+@r9@OaAp#$!vU#T&;@H!J4vKt@mgvxxPp#pX&_=| znhy-Le46G3&>Q#9ngPeqd$uoZ#6Gioz+9X*+X}^KoD&2e;=(yonMrdLa0=z=-Pvu@ zV_*_4NRNOZJdhp7Y+2s(Ou^K@nR383ODdMJm06aVi_E~hlpW44nq32T@nv=}9LAnGMwp6O zIUfMUDyIfUV&Rft@W<*Uv2e@sc1dS|Z_z8)7d}TrZlIU@0DIsH`U zV)O+%V;nBcT?jYPmK*9{(U0Ry>Wsd9nVAXVBWA+};!%d?J_F zt%fob^3p(syYo`rzl*Wou5qo%ahya$N3a-H;%bx`u0WRWug@LYv`?Q!*lhI9VW?Q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DbxkJLAq(S(eK47}y0@GoEsh=x!hS8=}SMY)!rb1T;1V7UrSC|Q# zOP1_6oA!A@hRfD+n_~uMJdsM?$53xvUMYIR2tUv)LXkd5L|H&9htYn2ycWuALJ*?#L>jQ-8t=pz+-=y0WBxU7<>ks&N@rz|QlT8IOj1rzrYdJB7b}aE zYm{Zm-Ac3ai1L`SMtM*9r?N>2s+KAbm7gk9rB)eKJyoBo2B|(*Wvb?@7OPgM*5#;n zsrIRksm`i?Rb5rxQPrtlseB`cMlOr|Ch~lwCGu(Ht4O)pN$sr;PH+Em z^-1-8^(_fRI8Ke19GhLIVnXAdu6lqXXs#&M0)jZO4)y~vb zXs>GTY5&kZ)w=4w(Us{==`QJ>=swcx^nLZo`WgB>eUaXz->9$AH|k&L-|A(CPYj-h zU_*C<*3ic=(2!^tX&7fnF=QDQ8j20;44VxVhNFfPhEq9)8p9=n#n5E1i)t0+71chf zTa*|T9o0Lkf7IZpFQc|aQF_#JTnW7iEy63qyC{Y!8Wr*gA!2;Q-iR9!{(KNWiQmm% z9`^cGZS!m0Cfo z(?)B1Y5QvXYvZ-kwCUPx?QCtXc7b-WworRS`;+#(Hdxm~*I$>c+pBw|>#YA&KTN+! NUs@RuX8&8;{{faT7JC2y diff --git a/Ventoy2Disk/Ventoy2Disk/PhyDrive.c b/Ventoy2Disk/Ventoy2Disk/PhyDrive.c index 2fb5273d..5aaa0dbd 100644 --- a/Ventoy2Disk/Ventoy2Disk/PhyDrive.c +++ b/Ventoy2Disk/Ventoy2Disk/PhyDrive.c @@ -2289,6 +2289,8 @@ End: VDS_ChangeVtoyEFI2Basic(pPhyDrive->PhyDrive, StartSector * 512); } + if (pPhyDrive->PartStyle == 1) + { if (ChangeAttr || ((pPhyDrive->Part2GPTAttr >> 56) != 0xC0)) { Log("Change EFI partition attr %u <0x%llx> to <0x%llx>", ChangeAttr, pPhyDrive->Part2GPTAttr, 0xC000000000000001ULL); @@ -2302,6 +2304,7 @@ End: Log("Change EFI partition attr failed"); } } + } if (pGptInfo) {