Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

On-Access, Transparent, Per-File Data Encryption:

OSR's File Encryption Solution Framework (FESF) provides all the infrastructure you need to build a transparent file encryption product REALLY FAST.

Super flexible policy determination and customization, all done in user-mode. Extensive starter/sample code provided.

Proven, robust, flexible. In use in multiple commercial products.

Currently available on Windows. FESF for Linux will ship in 2018.

For more info: https://www.osr.com/fesf

Go Back   OSR Online Lists > ntfsd
Welcome, Guest
You must login to post to this list
  Message 1 of 5  
17 Jul 17 14:04
hongwei xu
xxxxxx@gmail.com
Join Date: 13 Jul 2017
Posts To This List: 33
Problem: Changing extension in PreCreate

Hi all, I'm new in minifilter. If anyone could give me some advice, I would be very grateful. The problem is: I changed the file extension in preCreate (e.g., from "abc.txt" to "abc.txt.encrypt", then set callbackdata dirty). but in postCreate, every time I received an error status as "STATUS_OBJECT_PATH_NOT_FOUND" . Therefore, I failed to create the file. I also set "FltObjects->FileObject->RelatedFileObject = NULL;" I think there must be something wrong. Could anyone please give me some advice? Many thanks.
  Message 2 of 5  
17 Jul 17 14:08
hongwei xu
xxxxxx@gmail.com
Join Date: 13 Jul 2017
Posts To This List: 33
Problem: Changing extension in PreCreate

status = IoReplaceFileObjectName(Data->Iopb->TargetFileObject, newName.Buffer, newName.Length); where "newName" is a full name, containing volume name, parentDir and final component. Thanks!
  Message 3 of 5  
18 Jul 17 03:56
dhananjay kr
xxxxxx@gmail.com
Join Date: 15 Mar 2014
Posts To This List: 33
Problem: Changing extension in PreCreate

Please check the flags with which you are calling CreateFile. Are they trying to open an existing file or trying to create a new file? On Mon, Jul 17, 2017 at 11:38 PM, xxxxx@gmail.com < xxxxx@lists.osr.com> wrote: > status = IoReplaceFileObjectName(Data->Iopb->TargetFileObject, > newName.Buffer, newName.Length); > > where "newName" is a full name, containing volume name, parentDir and > final component. > > Thanks! > > --- > NTFSD is sponsored by OSR <...excess quoted lines suppressed...> --
  Message 4 of 5  
18 Jul 17 06:10
hongwei xu
xxxxxx@gmail.com
Join Date: 13 Jul 2017
Posts To This List: 33
Problem: Changing extension in PreCreate

Thanks dhananjay. Sorry I didn't provide more information. It was "FILE_CREATE", trying to create a new file. What I want to do are: 1. when opening or creating a file (e.g., abc.txt), if the file exists, do nothing. 2. if the file does not exists, try opening/creating its corresponding encrypted version: i.e. abc.txt.encrypt. I think maybe something is wrong with the "desktop.ini" file. When create a new file, I add an extra extension ".encrypt" to it. But now I have NOT finish the QueryInformation, DirectoryControl IRPs to hide the extension. I'm going to do more test to fix the issue. Thank you.
  Message 5 of 5  
18 Jul 17 10:47
hongwei xu
xxxxxx@gmail.com
Join Date: 13 Jul 2017
Posts To This List: 33
Problem: Changing extension in PreCreate

Hi all. Finally, I fixed the problem. The point is that in PreCreate the FileObject->FileName does NOT contain the volume name. (like: \Users\WDKRemoteUser\Testing\ab.txt) I got the new name by FltGetFileNameInformation routine which returned a full path containing volume Name. (like: \Device\HarddiskVolume2\Users\WDKRemoteUser\Testing\ab.txt) When I replaced it with IoReplaceFileObjectName, in the postCreate callback, it always returned a "STATUS_OBJECT_PATH_NOT_FOUND" status. I hope this can help beginners.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntfsd list to be able to post.

All times are GMT -5. The time now is 08:12.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license