EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Anyone impl NtOpenFile based on SolFS?

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#4970
Posted: 02/12/2008 01:31:23
by Volodymyr Zinin (Team)

And here the code for a directory enumeration. It's quite complicated for implementation.


[ Download ]
#4971
Posted: 02/12/2008 02:00:39
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

Thanks for those routines, better than what we just had put together.

Some more questions. Inside your kernel IRP_MJ_CREATE, how do you construct an object for a directory? I need to do same for NtCreateFile/NtOpenFile for a dir. For file, I can use StorageOpenFile, but it doesn't work for a dir. I need to return a handle for a dir too, so the dir can get enumerated in a subsequent call of NtQueryDirectoryFile API. If possible can u also provide the code to implement NtQueryDirectoryFile()? What about the short file names? how do i get those short names? ...

Thanks,

Huihong
#4972
Posted: 02/12/2008 02:13:22
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

I got the code for NtQueryDirectoryFile, thanks. Pls answer the other questions in my last message.
#4973
Posted: 02/12/2008 02:31:20
by Volodymyr Zinin (Team)

Quote
Huihong Luo wrote:
For file, I can use StorageOpenFile, but it doesn't work for a dir. I need to return a handle for a dir too, so the dir can get enumerated in a subsequent call of NtQueryDirectoryFile API.

You should create an intermediate handle when a file or directory is opened. It can be some internal structure. For example:
typedef struct _INTERMEDIATE_HANDLE {

// True - then the structure represents a handle for a file
// False - the structure represents a handle for a directory
BOOL FileHandle;

// The full file name
LPWSTR FullFileName;

Handle SolFSHandleForFile;

//
// Other necessary fields
//
...
} INTERMEDIATE_HANDLE, *PINTERMEDIATE_HANDLE;

In your NtCreateFile/NtOpenFile perform the following

...
PINTERMEDIATE_HANDLE Handle;
Handle = AllocateAndInitializeHandle(FileName);
return Handle;
...

And in all subsequent Nt-functions you will be able to operate with all necessary information about the opened file or directory.
#4974
Posted: 02/12/2008 02:32:16
by Volodymyr Zinin (Team)

Quote
Huihong Luo wrote:
What about the short file names? how do i get those short names?

SolFS driver doesn't support short names.
#4976
Posted: 02/12/2008 18:26:30
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

Is it possible to post the code that handles IRP_MJ_CREATE? it would be very helpful. There are many flags to deal with, such as FILE_SYNCHRONOUS_IO_NONALERT, FILE_NON_DIRECTORY_FILE, FILE_LIST_DIRECTORY, SYNCHRONIZE, etc. We need to learn more on how to create a file object.
#4977
Posted: 02/13/2008 02:07:20
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

Please also post the code for these structs: PFSD_VCB, PFSD_DCB, PFSD_CCB

You can email me the .h file if convenient.

Thanks a lot, your help is greatly appreciated.

Huihong

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 10569 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!