Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
On Thu, 8 Dec 2022 at 23:35, Ard Biesheuvel wrote: > > On Thu, 8 Dec 2022 at 22:57, Kinney, Michael D > wrote: > > > > Ard, > > > > Thank you for the correction. > > > > If we add that CONST, then the ShellPkg build breaks with an error > > > > c:\work\github\tianocore\edk2\ShellPkg\Application\S

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
e of the callers. > OK, so what is the way forward here? > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Ard > > Biesheuvel > > Sent: Thursday, December 8, 2022 1:40 PM > > To: devel@edk2.groups.io; Kinney, Michael D > > Cc: N

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
> Cc: Ni, Ray ; Gao, Zhichao > Subject: RE: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > path protocols > > Ard, > > Thank you for the correction. > > If we add that CONST, then the ShellPkg build breaks with an error > > c:\work\

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
Kinney, Michael D > Cc: Ni, Ray ; Gao, Zhichao > Subject: Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > path protocols > > On Thu, 8 Dec 2022 at 22:15, Michael D Kinney > wrote: > > > > Hi Ard, > > > > There is a difference betw

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
On Thu, 8 Dec 2022 at 22:15, Michael D Kinney wrote: > > Hi Ard, > > There is a difference between returning a pointer to a device path > and modifying the device path contents. > > If you add CONST to the argument, then an updated pointer to a device > path can not be returned. > No, this is inc

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
022 12:12 PM > To: Kinney, Michael D > Cc: devel@edk2.groups.io; Ni, Ray ; Gao, Zhichao > > Subject: Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > path protocols > > On Thu, 8 Dec 2022 at 20:20, Kinney, Michael D > wrote: > > > > H

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
Biesheuvel > > Sent: Thursday, December 8, 2022 10:45 AM > > To: Kinney, Michael D > > Cc: devel@edk2.groups.io; Ni, Ray ; Gao, Zhichao > > > > Subject: Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed > > device path protocols > > >

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
5 AM > To: Kinney, Michael D > Cc: devel@edk2.groups.io; Ni, Ray ; Gao, Zhichao > > Subject: Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > path protocols > > On Thu, 8 Dec 2022 at 19:28, Kinney, Michael D > wrote: > > > > Hi Ard, > &g

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
On Thu, 8 Dec 2022 at 19:28, Kinney, Michael D wrote: > > Hi Ard, > > From this description, it does not look like it should be modifying the > contents of the device path. Just point to the device path end node that > follows the match found. > > /** > Gets the mapping that most closely matche

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
SetDevicePathEndNode (*DevicePath); ? Thanks, Mike > -Original Message- > From: Ard Biesheuvel > Sent: Thursday, December 8, 2022 9:23 AM > To: devel@edk2.groups.io; Kinney, Michael D > Cc: Ni, Ray ; Gao, Zhichao > Subject: Re: [edk2-devel] [PATCH] ShellPkg: Avoid corruptin

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Ard Biesheuvel
om: devel@edk2.groups.io On Behalf Of Ard > > Biesheuvel > > Sent: Wednesday, December 7, 2022 8:13 AM > > To: devel@edk2.groups.io > > Cc: Ni, Ray ; Gao, Zhichao ; Ard > > Biesheuvel > > Subject: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > &

Re: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-08 Thread Michael D Kinney
k2.groups.io > Cc: Ni, Ray ; Gao, Zhichao ; Ard > Biesheuvel > Subject: [edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device > path protocols > > The Shell locates device path protocol instances from the database and > happily passes them to destructive device pa

[edk2-devel] [PATCH] ShellPkg: Avoid corrupting installed device path protocols

2022-12-07 Thread Ard Biesheuvel
The Shell locates device path protocol instances from the database and happily passes them to destructive device path operations, resulting in the original protocol to get corrupted as well. So take a copy instead, and discard it once we no longer need it. Signed-off-by: Ard Biesheuvel --- Shell