0

how can i develop a simple minifilter driver that will specify a drive/directory (as input) from user-mode, for example "Z:\", and communicates with the kernel-mode and then display all the files/folders exists in the user-mode.

please i need a shoulder on this.. =(

and thanks in advance..

-noobDriverDev-

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by n30h
0

Not Sure how to do it in Kernel-Mode, but the same task can be accomplished in user-mode, here's a little something i just put together

#include <windows.h>
#include <iostream>
using namespace std;

void EnumDirectories(string start){
    WIN32_FIND_DATA info;
    int length= start.length()-1;
    string buffer=start,buffer2;
    HANDLE CurrentFile;
    
    if (start[length] != '\\' && start[length] != '/')
     buffer+="\\*";
    CurrentFile=FindFirstFile(buffer.c_str(),&info);
    if(CurrentFile==INVALID_HANDLE_VALUE)
      return;
    while(FindNextFile(CurrentFile,&info))
    {
        buffer2=info.cFileName;
        if(info.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY && buffer2.find("..")==string::npos)
        {
          buffer=start;
          length=buffer.length()-1;
          if (buffer[length] != '\\' && buffer[length] != '/')
           buffer+="\\"+buffer2;
          cout << buffer << endl;
          EnumDirectories(buffer);
    }
    }
    CloseHandle(CurrentFile);
}
int main()
{
 EnumDirectories("Z:");
 cin.get();
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.