[physfs] win32: Using PhysFS from inside a DLL?

Ryan C. Gordon icculus at clutteredmind.org
Wed Sep 3 19:14:02 EDT 2003

> I've been working out how to do a virtual file system (through intercepting
> the open-file calls), and PhysFS would be perfect for this, I just don't
> know how well it would work in a DLL.
> (Aside from any more technical problems, there's no way I can get at argv0,
> but I should be able to fake that pretty easily)

You don't need argv0 on Windows...we need it on Unix to figure out where
the program is being run from, but the Windows backend uses the win32 API
to determine this and ignores argv[0]. If you are doing Windows-specific
code, it's safe to pass a NULL to PHYSFS_Init() (or, in a worst-case
scenario, you could accurately recreate argv0 if needed).

As for technical issues, the only one I can think of would be the
possibility of FILE * being meaningless to an external DLL, but we use the
Win32 API under the hood for file i/o anyhow. (And we don't write to
zipfiles, they're pretty much read-only).


More information about the physfs mailing list