dokan-dev / dokan-rust

Dokan Rust Wrapper
MIT License
46 stars 9 forks source link

Need Help, Issue with read_file method in Rust FFI binding for Windows Virtual Drive System #10

Closed biplab5464 closed 5 months ago

biplab5464 commented 5 months ago

I’m relatively new to Rust FFI bindings and have been learning about how Windows handles various operations. My background is primarily in Rust, c and c++ programming for Linux-based OS, so diving into Windows is a fresh and exciting challenge for me.

I’ve been assigned a task to create a virtual drive system on Windows. So far, I’ve managed to list directories by replicating a folder from my local storage using the find_filesand create_filemethods.

My current understanding is that to open a file, I need to implement the read_filemethod, assign the file to the buffer as &[u8], and return the size as u32. However, I’ve been struggling with this for the past three days. The issue I’m facing is that the read_filemethod is not being called when I try to open a file.

When I attempt to open a file, I encounter an error dialogue box stating The Directory name is invalid.

I would greatly appreciate any guidance or suggestions on how to resolve this issue. Thanks in advance for your help!

Liryna commented 5 months ago

Hi @biplab5464 ,

The Directory name is invalid error might suggest the attributes or one of the info returned from find_files or get_file_information is incorrect and make the system believe it is a directory.

biplab5464 commented 5 months ago

Hi @Liryna Thanks for the help i was unaware of the get_file_imformation method.