EaseFilter Demo Project
|
ControlFilterHandler.cpp
Go to the documentation of this file.
20 ProcessControlFilter( IN PMESSAGE_SEND_DATA pSendMessage,IN OUT PMESSAGE_REPLY_DATA pReplyMessage )
38 PrintMessage(L"File:%ws will be redirected to new file:%ws open",pSendMessage->FileName,GetTestReparseFileName());
41 memcpy(pReplyMessage->ReplyData.Data.DataBuffer,GetTestReparseFileName(),(ULONG)wcslen(GetTestReparseFileName())*sizeof(WCHAR));
42 pReplyMessage->ReplyData.Data.DataBufferLength =(ULONG)wcslen(GetTestReparseFileName())*sizeof(WCHAR);
44 pReplyMessage->FilterStatus = FILTER_MESSAGE_IS_DIRTY|FILTER_COMPLETE_PRE_OPERATION|FILTER_DATA_BUFFER_IS_UPDATED;
72 pReplyMessage->FilterStatus = FILTER_MESSAGE_IS_DIRTY|FILTER_COMPLETE_PRE_OPERATION|FILTER_DATA_BUFFER_IS_UPDATED;
75 PrintMessage(L"File:%ws is test file with pre-query-information-basicInfo,return with status:%0x.",pSendMessage->FileName,pReplyMessage->FilterStatus);
150 //For POST_SET_INFORMATION, you can't change anything, since the data was written to the file system.
153 //For PRE_DIRECTORY,you can complete it and return your own directory data,the data structure format
165 //here we use FileBothDirectoryInformation as example, for other classes, you can do the same operation.
168 memcpy(pReplyMessage->ReplyData.Data.DataBuffer,pSendMessage->DataBuffer,pSendMessage->DataBufferLength);
172 PFILE_BOTH_DIR_INFORMATION fileBothDirInfo = (PFILE_BOTH_DIR_INFORMATION)pReplyMessage->ReplyData.Data.DataBuffer;
188 ,fileBothDirInfo->FileName,fileBothDirInfo->FileAttributes,fileBothDirInfo->EndOfFile.QuadPart);
190 //You can modify the data of the fileBothDirInfo, but must be careful to change the size of the entry.
191 //This structure must be aligned on a LONGLONG (8-byte) boundary. If a buffer contains two or more of these structures,
200 memmove (fileBothDirInfo,(PUCHAR)fileBothDirInfo + nextOffset,totalBufferLength - returnBufferLength - nextOffset );
213 PrintMessage(L"File %ws attributs:0x%0x was added ReadOnly,Filesize:%I64d was changed to 1234567890"
214 ,fileBothDirInfo->FileName,fileBothDirInfo->FileAttributes,fileBothDirInfo->EndOfFile.QuadPart);
225 returnBufferLength += sizeof(FILE_BOTH_DIR_INFORMATION) + fileBothDirInfo->FileNameLength - sizeof(WCHAR);
237 //if you filter out all the files, you can return no more files status. The system won't generate another request.
245 PrintMessage(L"Update directory buffer,original length:%d new length:%d",pSendMessage->DataBufferLength,pReplyMessage->ReplyData.Data.DataBufferLength);
274 pReplyMessage->FilterStatus = FILTER_MESSAGE_IS_DIRTY|FILTER_COMPLETE_PRE_OPERATION|FILTER_DATA_BUFFER_IS_UPDATED;
293 memcpy(pReplyMessage->ReplyData.Data.DataBuffer,pSendMessage->DataBuffer,pSendMessage->DataBufferLength);
326 memcpy(pReplyMessage->ReplyData.Data.DataBuffer,pSendMessage->DataBuffer,pSendMessage->DataBufferLength);
346 //For post write operation, the data was written to the file system,at this point, we can't change anything.
Definition: FilterAPI.h:428
struct _FILE_BASIC_INFORMATION FILE_BASIC_INFORMATION
struct _FILE_BASIC_INFORMATION * PFILE_BASIC_INFORMATION
LARGE_INTEGER LastWriteTime
Definition: WinDataStructures.h:154
Definition: FilterAPI.h:163
Definition: FilterAPI.h:162
Definition: WinDataStructures.h:92
Definition: FilterAPI.h:427
Definition: FilterAPI.h:176
Definition: FilterAPI.h:161
IN LONGLONG IN LONGLONG IN OUT PFILE_ALLOCATED_RANGE_BUFFER IN ULONG OUT ULONG * returnBufferLength
Definition: FilterAPI.h:722
struct _FILE_BOTH_DIR_INFORMATION * PFILE_BOTH_DIR_INFORMATION
Definition: FilterAPI.h:384
Definition: FilterAPI.h:426
Definition: FilterAPI.h:452
Definition: FilterAPI.h:167
BOOL ProcessControlFilter(IN PMESSAGE_SEND_DATA pSendMessage, IN OUT PMESSAGE_REPLY_DATA pReplyMessage)
Definition: ControlFilterHandler.cpp:20
Definition: FilterAPI.h:172
Definition: FilterAPI.h:166
Definition: FilterAPI.h:170
Definition: WinDataStructures.h:151
Definition: FilterAPI.h:177
Definition: FilterAPI.h:165
Definition: FilterAPI.h:160
struct _FILE_BOTH_DIR_INFORMATION FILE_BOTH_DIR_INFORMATION
Definition: FilterAPI.h:181
Definition: FilterAPI.h:168
Definition: FilterAPI.h:164
Definition: FilterAPI.h:158
Definition: FilterAPI.h:178
Definition: FilterAPI.h:174
LARGE_INTEGER LastAccessTime
Definition: WinDataStructures.h:153
Services Overview
Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.
Contact Us
You are welcome to contact us for salse or partnership.
Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com