Thanks Michael, changes now merged and submitted to svn/trunk.
On Tue, Feb 15, 2011 at 12:32 PM, Michael Platings <[email protected]> wrote: > Hi Robert & Sukender, > I'm guessing that the stack corruption was caused by calling > GetFullPathNameW with the nBufferLength argument as the number of bytes in > the buffer, rather than the number of characters. I've attached code that > uses GetFullPathNameW et al. with _countof() rather than sizeof() and this > works fine. > Cheers > Michael > > On 14 February 2011 12:24, Robert Osfield <[email protected]> wrote: >> >> Hi Sukender and Michael, >> >> Michael could you review Sukender's changee and make comments as I >> can't provide expertise on the Win32 side so have to defer to the >> community. >> >> Thanks, >> Robert. >> >> On Fri, Feb 11, 2011 at 9:08 AM, Sukender <[email protected]> wrote: >> > Hi Michael and Robert, >> > >> > Here is the modified submission. Thoughts? >> > >> > Sukender >> > PVLE - Lightweight cross-platform game engine - >> > http://pvle.sourceforge.net/ >> > >> > ----- "Sukender" <[email protected]> a écrit : >> > >> >> You're absolutely right, Michael, but the function is called only for >> >> complete paths. I'll make a tiny change in order to make it clearer >> >> (or make the function more general). >> >> >> >> Sukender >> >> PVLE - Lightweight cross-platform game engine - >> >> http://pvle.sourceforge.net/ >> >> >> >> ----- "Michael Platings" <[email protected]> a écrit : >> >> >> >> > Hi Sukender, >> >> > I just had a quick look at this and if I'm reading it right, valid >> >> > paths such as "..\..\folder\thing.osg" would cause a warning in >> >> > cleanPath() and would return an incorrect path. >> >> > >> >> > >> >> > On 10 February 2011 16:05, Sukender < [email protected] > wrote: >> >> > >> >> > >> >> > Hi Robert, >> >> > >> >> > This is kind of tricky submission... I found that the current >> >> > getRealPath() implementation for Windows doesn't work well with UTF8 >> >> > paths. So I tried to add the support using Unicode Windows API >> >> calls. >> >> > But unfortunately, the GetFullPathNameW() *corrupts the stack*! >> >> Yes... >> >> > I've done multiple tries and each with the same conclusion. I added >> >> a >> >> > detailed comment about this, and finally wrote my own implementation >> >> > of this Windows API function. So you'll find: >> >> > - getFullPathName(), a replacement for GetFullPathNameA() and >> >> > GetFullPathNameW() >> >> > - cleanPath(), which simply removes "." and ".." from a path >> >> > - and a modified getRealPath() >> >> > >> >> > This is a bit risky as this is quite low level. Moreover I cannot be >> >> > sure this submission 100% works in all cases, and I do not have >> >> access >> >> > to more robust impementations (ie. C++0x or boost::filesystem). >> >> > Please tell me if it seems okay for you. >> >> > >> >> > File modified: rev.12156. >> >> > >> >> > Cheers, >> >> > >> >> > Sukender >> >> > PVLE - Lightweight cross-platform game engine - >> >> > http://pvle.sourceforge.net/ >> >> > >> >> > _______________________________________________ >> >> > osg-submissions mailing list >> >> > [email protected] >> >> > >> >> >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> >> > >> >> > >> >> > >> >> > _______________________________________________ >> >> > osg-submissions mailing list >> >> > [email protected] >> >> > >> >> >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> >> _______________________________________________ >> >> osg-submissions mailing list >> >> [email protected] >> >> >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > >> > _______________________________________________ >> > osg-submissions mailing list >> > [email protected] >> > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > >> > >> _______________________________________________ >> osg-submissions mailing list >> [email protected] >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
