Ricardo, apologies for the late response.
I am not aware of any native Java implementation of the WinFsp native API. It would be great if you attempted a Java port and I would certainly support such an effort.
Bill
--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
winfsp+un...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/winfsp/d5b24139-c7ea-4042-a505-67e723e9b83en%40googlegroups.com.
Hello, Ricardo:
Re: FspFileSystemPreflight. You do not need to use this API. It is only used to perform preliminary checks, such as whether the file system driver is available, etc. I use it in cases where file system initialization is expensive: if FspFileSystemPreflight does not succeed, it is not necessary to go through the expensive file system initialization.
If you use this API either specify an actual drive letter as a mountpoint (e.g. X:) or NULL. The STATUS_NO_SUCH_DEVICE error code likely means that the device driver was not loaded correctly and the primary WinFsp device was not created for some reason. Another likely reason is that you did not pass the correct device name (just pass "WinFsp.Disk" if you want a "disk" file system or "WinFsp.Net" if you want a "network" file system).
Re: fuse_main_real. This function performs a lot of steps that are necessary only for FUSE file systems. You do not need to perform all these steps in a native file system.
The necessary steps for a native file system are:
- FspFileSystemCreate: Creates the file system in kernel and also prepares necessary data structures for serving file system requests in user mode.
- FspFileSystemSetMountPoint: Specifies the mountpoint. This is usually a drive letter (e.g. X:) but can also be a directory.
- FspFileSystemStartDispatcher: This starts a number of threads to service file system requests.
When you are done with the file system shut it down as follows:
- FspFileSystemStopDispatcher: This shuts down the file system threads in an orderly manner.
- FspFileSystemRemoveMountPoint: Removes the file system mountpoint.
- FspFileSystemDelete: Deletes any user mode data structures and also removes the in-kernel file system.
Additionally WinFsp provides optional support for easily creating Windows services (because file systems often work best as Windows services). The passthrough tutorial should explain those steps for you.
Re: answers to your questions:
1. Likely you are not passing the correct device name. See my comments above.
2. No because the steps performed are specific to FUSE.
3. You do not need to open any files as in passthrough. These steps are specific to passthrough, because it exposes an existing directory as a new file system.
Bill
From: 'Ricardo Fonseca' via WinFsp <win...@googlegroups.com>
Sent: Tuesday, July 6, 2021 8:53 PM
To: WinFsp <win...@googlegroups.com>
Subject: Re: [winfsp] Java implementation of WinFsp Native API
Hi Bill.
Thanks for the support.
I am trying to mimic what jnr-fuse does while following your tutorial and I got mixed results. I managed to bridge some of the functions in winfsp.h to Java using JNR:
· FspFileSystemPreflight
· FspFileSystemCreate
but when I call the FspFileSystemPreflight function with an empty folder path and "WinFsp.Disk" as arguments I get an NTSTATUS C000000E (STATUS_NO_SUCH_DEVICE).
I've looked through your samples but couldn't find any usage of the FspFileSystemPreflight function so maybe I'm missing something that needs to be done before calling that function.
Also, the FUSE API has a point of entry at the fuse_main_real function, which performs many useful operations before mounting the file system. I couldn't find any similar function for the native API.
My questions to you are:
1. Does the STATUS_NO_SUCH_DEVICE error code mean I need to perform some operation before calling the FspFileSystemPreflight function?
2. Are there any plans for adding a function similar to fuse_main_real for the native API?
3. In order to call FspFileSystemCreate do I always need to precede it with the same steps as in samples\passthrough\passthrough.c, such as opening the file handle, retrieving information and closing it?
Cheers,
Ricardo
On Sunday, 4 July 2021 at 11:58:59 UTC+1 bill...@navimatics.com wrote:
Ricardo, apologies for the late response.
I am not aware of any native Java implementation of the WinFsp native API. It would be great if you attempted a Java port and I would certainly support such an effort.
Bill
From: 'Ricardo Fonseca' via WinFsp <win...@googlegroups.com>
Sent: Friday, July 2, 2021 3:28 PM
To: WinFsp <win...@googlegroups.com>
Subject: [winfsp] Java implementation of WinFsp Native API
Hi.
Apologies if this is not the right place to ask this question.
I am looking for a way to implement the WinFsp Native API calls in Java. Do you know of any open-source library that provides that? There is jnr-fuse but it only seems to implement the POSIX FUSE calls.
If not, I am willing to try implement one myself (should be fun!).
Thanks.
--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to winfsp+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/winfsp/d5b24139-c7ea-4042-a505-67e723e9b83en%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
winfsp+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/winfsp/b567d520-6c17-489a-be57-937c48a66411n%40googlegroups.com.
Ricardo:
Apologies for the late response. I am currently on vacation.
Good to hear that you managed to resolve the access violation.
Regarding getting debug output: The FspDebugSetLogHandle determines where debug output goes, but does not turn it on. To turn it on you must call FspFileSystemSetDebugLog(FileSystem, DebugLog) and pass it a value of DebugLog==-1 (which will instruct the file system to log all requests/responses).
Thanks.
To view this discussion on the web visit https://groups.google.com/d/msgid/winfsp/a7620c51-ea60-4dd4-9313-6d552ab23422n%40googlegroups.com.
You are right. Some of these are inline functions and therefore not directly available to languages other than C/C++. For this reason I have created some "out-of-line" functions with the "F" suffix for use by languages such as Java, Python, etc.
To view this discussion on the web visit https://groups.google.com/d/msgid/winfsp/b8422988-30e2-4ae1-9038-7ac13f493156n%40googlegroups.com.