-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19.03.2013 20:35, Janne Hyvärinen wrote: > > On 19.3.2013 15:49, JonY wrote: >> On 3/19/2013 19:59, Janne Hyvärinen wrote: >>> On 18.3.2013 12:25, Erik de Castro Lopo wrote: >>>> JonY wrote: >>>> >>>>> Before anyone does anything, see __wgetmainargs >>>>> <http://msdn.microsoft.com/en-us/library/ff770599.aspx>. >>>>> >>>>> It can expand wildcards. Since it already provides >>>>> argc/argv/env, it is more a less a drop-in replacement for >>>>> the main() arguments. >>>> +1 >>>> >>>> Erik >>> Alright, here's a patch utilizing this function. There's a lot >>> of changes here. Project files have a new configuration called >>> "Release (UTF8)", intended to be used when building the command >>> line tools. This project has the required UTF-8 define in place >>> so all libraries expect things in encoded format. Regular Debug >>> and Release configurations do not use any new tricks so >>> existing projects won't break when compiled with those >>> settings. >>> >>> I'm at work and couldn't do extensive testing, but command line >>> FLAC.exe seems to perform everything right with this. >>> >>> Metaflac probably requires some minor tweaks but I wanted to >>> show some progress so that 1.3 doesn't slip out the door while >>> I'm busy. >>> >> >> As for calling __wgetmainargs, I have some concerns about the >> security implications: LoadLibrary("msvcrt.dll") <- Which msvcrt? >> Theoretical security exploit. > > There is msvcrt.dll in the System32 dir in all supported Windows > systems. That is what the function targets, but of course > LoadLibrary searches from exe's dir first. I think security exploit > concerns are warrantless, if you can place malicious replacement > c-runtime dll in the exe's path you have already won. See [1] for the info. According to that article, LoadLibraryA("msvcrt.dll") should be perfectly safe.
[1] http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRSJzFAAoJEOs4Jb6SI2CwmdMIAJZyqiZ+PjwivvZ0QM5l/DdD aoS6zf5/crr6Dm6IMm58Sf/4RMIRUM4d/4wXZ4xKyQvP7wmxzzAN5QDTwHRXsDY7 CyjpPKv1NGiwOYux9fNUEQyo7eNvtl8BEg2pq7fXLH2h/kBnCtB7/V+X8OZqiSFD na2YnUOpNxBq0LnmkM3gQqlXE9ajsBDUNYfFDHBVtu3ZXDUVwKhdH8kX2pTJcjeS QSCwdxGS2uGVUj+E/+hUny3wcBEVN2z8gGxWzrGAMTcV4dYHlcD7cKXfG59eAw93 HomBZvrRLVss4aXrV2fGZ5VQm2AjlNRFKTNhtxkZ7npB4ManN0C0vuPxYMe3Uuk= =6WoQ -----END PGP SIGNATURE----- _______________________________________________ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev