Thread: A Few Questions

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    A Few Questions

    I'm working on a program that does a number of system level things. One of which is to create a Hard Drive that acts like a drive in almost every way but it actually redirects to a folder somewhere. Much like Daemon tools creates a fake DVD drive and redirects all read access to a mounted CD image. How would I go about doing this? Are there any Links for this? Is it possible to redirect ALL file IO activity of a program???

    Secondly, this program that I'm writing is going to be a service (for obvious reasons) but its going to install system wide hooks, that which mimic an anti virus. So that all file read/write AND Registry calls are hooked. Anyone know which WM_ messages might I need to look for to intercept calls? Where can I read about these hooks?


    Non-coding Questions:

    Where can I find out some info on how the Registry is structured?
    Founder and avid member of the Internationsl Typo Associateion

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > One of which is to create a Hard Drive that acts like a drive in almost every way
    > but it actually redirects to a folder somewhere.
    You mean like the subst console command?
    subst s: "c:\Program Files"

    > Are there any Links for this?
    I'm sure several hours wandering round MSDN (or other search engines) should lead somewhere.

    > Is it possible to redirect ALL file IO activity of a program?
    Lets see
    - all network activity goes via the firewall
    - all file activity goes via the virus scanner
    I'm going with "yes"

    You'll probably find some useful stuff on www.sysinternals.com which have many tools which use the things you describe.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Assuming that you aren't doing something illegal...like a rootkit...
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  4. #4
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195
    Heh, no its perfectly Legal. Its actually an academic Project.

    And as per Salem's answer, im looking for code samples i could use to learn these techniques. Microsoft isn't exactly a huge repository of free code. is there an open source version of the subst command so I may learn the code behind it?
    Last edited by Mastadex; 01-14-2007 at 02:40 PM.
    Founder and avid member of the Internationsl Typo Associateion

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    subst uses DefineDosDevice.

  6. #6
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195
    Ok cool. so is this the official way of creating a "virtual" drive? Ive heard that using DDK functionality (IoRegisterDeviceInterface and similar functions) to simulate a drive functionality is a bit more compatible with the different flavors of Windows (9x and up). But I might be wrong.

    Although I have not found any resources yet that show you exactly how to use the Io functions in the DDK. If anyone has more info on this, it would be greatly appreciated.
    Founder and avid member of the Internationsl Typo Associateion

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 07:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM