Hi,
Is it possible (as in: not too dangerous) to make a special API that does not exist in Windows, but then does exist in Wine, that would allow a program to mount the full Unix tree read only, such that only Wine programs can do that?
I don't think that's a clean solution.
Since NT-based systems (or was it XP only?) can mount volumes as a sub directory even after bootup, there could be an already existing device ioctl allowing for a new drive mapping in Windows. We'd then just have to implement this in Wine and call it from winecfg.
On the MSDN site I found http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base...,
which is an example that indeed seems to do this. However, mounting in Windows is just connecting a device (e.g. F:) to a directory (e.g. C:\FDrive). What they do is:
bFlag = GetVolumeNameForVolumeMountPoint( argv[2], // input volume mount point or directory Buf, // output volume name buffer BUFSIZE // size of volume name buffer );
That gives them the unique name of that drive, and they can then happily mount it somewhere else.
So, I guess we'd still need the Unix file system as a drive (or at least it's unique volume name). Further more, if winecfg can use this volume name in order to mount it somewhere, any Windows app could, so still there would be no extra safety.
In fact, the only ways I can think of to make this feature available just for Wine programs, is - Calling the Unix api directly from winecfg (I guess that is possible?) just to read out the directory contents and then put them into a list box. This requires copying the code of the SHBrowseForFolder listbox, which is a bit untidy too, since the Windows file system is then not used. - Indeed by making some extra APIs that are not available in Windows. This is indeed a bit untidy, but probably requires less code duplication.
Regards, Robert