Click here to Skip to main content
15,906,947 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: usb programming Pin
duo!@#14-Mar-08 4:29
duo!@#14-Mar-08 4:29 
GeneralRe: usb programming Pin
Matthew Butler14-Mar-08 4:57
Matthew Butler14-Mar-08 4:57 
GeneralRe: usb programming Pin
JudyL_MD17-Mar-08 3:28
JudyL_MD17-Mar-08 3:28 
General[Message Deleted] Pin
M.Nouri12-Mar-08 3:42
M.Nouri12-Mar-08 3:42 
GeneralRe: RS232 Pin
Paul Conrad12-Mar-08 5:47
professionalPaul Conrad12-Mar-08 5:47 
GeneralRe: RS232 Pin
M.Nouri12-Mar-08 23:27
M.Nouri12-Mar-08 23:27 
QuestionFile System Filter Drivers to substitue a shell Namespace Extension? Pin
gn0tto5-Mar-08 22:55
gn0tto5-Mar-08 22:55 
GeneralRe: File System Filter Drivers to substitue a shell Namespace Extension? Pin
Randor 11-Mar-08 5:42
professional Randor 11-Mar-08 5:42 
gn0tto wrote:
Hi there,

i am new to driver-programming and right now im trying to get into it, especially filter drivers, which turns out to be pretty hard for a newbie.
I try to discover if a file system filter driver or a minifilter in windows provides the possibility of returning more files than actually exist.


It would be easier to accomplish this by hooking ZwQueryDirectoryFile. If you look at the declaration of ZwQueryDirectoryFile you will see it is passed a constant named FileInformationClass. The return buffer may contain one of various structs depending on the FileInformationClass that was passed. Which can be one of the following values:

FileBothDirectoryInformation Return a FILE_BOTH_DIR_INFORMATION structure for each file.
FileDirectoryInformation Return a FILE_DIRECTORY_INFORMATION structure for each file.
FileFullDirectoryInformation Return a FILE_FULL_DIR_INFORMATION structure for each file.
FileIdBothDirectoryInformation Return a FILE_ID_BOTH_DIR_INFORMATION structure for each file.
FileIdFullDirectoryInformation Return a FILE_ID_FULL_DIR_INFORMATION structure for each file.
FileNamesInformation Return a FILE_NAMES_INFORMATION structure for each file.
FileObjectIdInformation Return a FILE_OBJECTID_INFORMATION structure for each file. This information class is valid only for NTFS volumes on Microsoft Windows 2000 and later.
FileReparsePointInformation Return a single FILE_REPARSE_POINT_INFORMATION structure for the directory.

More information here:

http://msdn2.microsoft.com/en-us/library/ms801001.aspx[^]

If you look at the declaration of each struct you will see they all contain a field named:

ULONG NextEntryOffset;

So essentially in your ZwQueryDirectoryFile hook if the FileInformationClass was 'FileFullDirectoryInformation' you would simply need to allocate a new FILE_FULL_DIR_INFORMATION struct and then walk the existing linked list. Once you have reached the end you could simply set the NextEntryOffset to the address of your newly allocated and populated struct.

gn0tto wrote:
What i also didnt get is: if a folder is requested, how and when does windows enumerate the files under the folder?


if you wish to implement a filter driver you will need to implement:

pYourDriver->MajorFunction[IRP_MJ_DIRECTORY_CONTROL]=YourFilterDirectoryControl;

And within your control function you will need to set the I/O completion routine with IoSetCompletionRoutineEx. Thats where you can filter the FILE_INFORMATION_CLASS determined return values.

http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/File/FILE_INFORMATION_CLASS.html[^]

gn0tto wrote:
My approach for the "virtual elements" would be to set a filter, which detects when folder "A" wants to enumerate its children and just adds one that isnt actually there but i cant perceive how to hook into this request.


Hooking ZwQueryDirectoryFile is a much easier approach if this was the only goal. The filter driver requires much more knowledge of driver implementation and internals.

gn0tto wrote:
I think that this could give me the possibility not even to have a virtual drive in the windows explorer but to have it actually inside my file system, so i can approch elements beneath it by file-paths. All in all it seems to be more powerful than the extension and i want to estimate if this desired benefit justifies the additional expenses that i expect in development


Interesting idea... however it sounds to me like you want to take a hammer and smash a square block of wood into a round hole. Rather than implmenting a filter driver for an existing disk. What you are describing would be better implemented as a virtual disk driver.
You should begin by downloading the Microsoft IFS Kit.

http://www.microsoft.com/whdc/DevTools/IFSKit/default.mspx[^]

Good Luck,
-David Delaune
GeneralRe: File System Filter Drivers to substitue a shell Namespace Extension? Pin
Mike Dimmick11-Mar-08 6:31
Mike Dimmick11-Mar-08 6:31 
GeneralRe: File System Filter Drivers to substitue a shell Namespace Extension? Pin
Randor 11-Mar-08 7:22
professional Randor 11-Mar-08 7:22 
GeneralRe: File System Filter Drivers to substitue a shell Namespace Extension? Pin
gn0tto12-Mar-08 3:14
gn0tto12-Mar-08 3:14 
GeneralRe: File System Filter Drivers to substitue a shell Namespace Extension? Pin
Mike Dimmick12-Mar-08 7:47
Mike Dimmick12-Mar-08 7:47 
GeneralWindows Memory mangement Pin
ForNow5-Mar-08 14:04
ForNow5-Mar-08 14:04 
GeneralRe: Windows Memory mangement Pin
JudyL_MD6-Mar-08 2:26
JudyL_MD6-Mar-08 2:26 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 2:47
ForNow6-Mar-08 2:47 
GeneralRe: Windows Memory mangement Pin
JudyL_MD6-Mar-08 2:56
JudyL_MD6-Mar-08 2:56 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 6:09
ForNow6-Mar-08 6:09 
GeneralRe: Windows Memory mangement Pin
Luc Pattyn6-Mar-08 6:54
sitebuilderLuc Pattyn6-Mar-08 6:54 
GeneralRe: Windows Memory mangement Pin
ForNow6-Mar-08 13:13
ForNow6-Mar-08 13:13 
GeneralRe: Windows Memory mangement Pin
Randor 7-Mar-08 5:54
professional Randor 7-Mar-08 5:54 
GeneralRe: Windows Memory mangement Pin
Luc Pattyn7-Mar-08 6:23
sitebuilderLuc Pattyn7-Mar-08 6:23 
GeneralRe: Windows Memory mangement Pin
Mike Dimmick7-Mar-08 15:56
Mike Dimmick7-Mar-08 15:56 
GeneralRe: Windows Memory mangement Pin
ForNow8-Mar-08 14:51
ForNow8-Mar-08 14:51 
GeneralRe: Windows Memory mangement Pin
Mike Dimmick9-Mar-08 3:26
Mike Dimmick9-Mar-08 3:26 
GeneralRe: Windows Memory mangement Pin
ForNow9-Mar-08 7:50
ForNow9-Mar-08 7:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.