win32 __PHYSFS_platformCalcBaseDir

Ryan C. Gordon icculus at clutteredmind.org
Wed Aug 29 01:04:57 EDT 2001


> Here you could use GetModuleHandle and GetModuleFileName to work out the
> executables directory.

(According to MSDN, you can just pass a NULL to GetModuleFileName() and
skip the call to GetModuleHandle()...is this inaccurate?)

The MSDN docs I'm looking at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/hh/winbase/dll_0ysl.asp

My concerns with this:
1) The MSDN docs say something about the "application's version number".
Where is that set?

2) There's no way to determine ahead of time how big the string
GetModuleFileName() returns will be. We could just allocate _MAX_PATH
chars, but that's obnoxious.

3) ...we have to cut the filename off the path, which is trivial,
but annoying.

Still, this could all be more efficient than the calls to SearchPath()...

--ryan.





More information about the physfs mailing list