Andrew,

I've already moved the patch out of ShellPkg in my environment and in to
MdePkg so the attached suggested patch reflects that.  Also, I had to do a
diff on two files to create the patch, I used the GIT tool because it
created a good patch, the SVN diff just - all of them and + all of them.

Anyway, the first suggestion is to allow multiple options by keeping a
count so an app can have routines that open it, process on it, call another
routine which may at some where down the line open it again, then close it.

Second suggestion is to NOT attempt to set the original returned interface
to NULL as that can be dangerous.   Say someone gets it to a local variable
then copies it over to a structure or some global variable, then does the
close procedure, updating that pointer to the auto variable will corrupt
the stack.  I don't think people would expect that feature, they can set
their own interface pointers to NULL when needed to be NULL.

Third is that it always (for sure) returns a NULL interface on failure
(just in case an implementation of OpenProtocol changed it but still
returned false).

PS none of that is the cause of the hang issue / proof (which I did repeat
on another completely different HP system - a laptop HP system wouldn't
boot the shell for some reason, it just hung so couldn't test on that one).

BTW, did my various STDLIB patches come through on the system.

"Contributed-under: TianoCore Contribution Agreement 1.0"

Attachment: SafeOpenProtocolLib.patch
Description: Binary data

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to