How can I develop a virtual drive - c++

I would like to create a virtual drive for windows. I'm not looking to map a drive or something like that, I'm looking to map it to my DLL functions or something of that sort.
How can I get this accomplished?
I read that I would have to develop a device driver, or a shell extension?
I have a lot of experience with C++ and C#. Where do I get started?
I want to make it as simple as possible at first, how much time do I think it would take me? And what's the simplest way to do it, so that I could build my prototype.
My motivation is to pipe a file into an application, that currently only reads files from the file system. I'm only interested in pumping 1 file, so I think that a whole virtual drive would be an overkill, as well as writing kernel mode code.

If you want to build it from scratch then yes, you have to build a driver. However, it would be much easier for you to use a proxy driver like Dokan, and create the file system in user mode.
Take a look at the Wikipedia article on IFS, there are links to other useful tools at the bottom of the page.

I don't know what it worth, and it's not open source, but I've found this. It's a "fuse" like for windows

Related

How to track the number of times my console application in C++14 has been launched?

I'm building a barebones Notepad-styled project (console-based, does not have a GUI as of now) and I'd like to track, display (and later use it in some ways) the number of times the console application has been launched. I don't know if this helps, but I'm building my console application on Windows 10, but I'd like it to run on Windows 7+ as well as on Linux distros such as Ubuntu and the like.
I prefer not storing the details in a file and then subsequently reading from it to maintain count. Please suggest a way or any other resource that details how to do this.
I'd put a strikethrough on my quote above, but SO doesn't have it apparently.
Note that this is my first time building such a project so I may not be familiar with advanced stuff... So, when you're answering please try to explain as is required for a not-so-experienced software developer.
Thanks & Have a great one!
Edit: It seems that the general advice is to use text files to protect portability and to account for the fact that if down-the-line, I need to store some extra info, the text file will come in super handy. In light of this, I'll focus my efforts on the text file.
Thanks to all for keeping my efforts from de-railing!
I prefer not storing the details in a file
In the comments, you wrote that the reason is security and you consider using a file as "over-kill" in this case.
Security can be solved easily - just encrypt the file. You can use a library like this to get it done.
In addition, since you are writing and reading to/from the file only once each time the application is opened/closed, and the file should take only small number of bytes to store such data, I think it's the right, portable solution.
If you still don't want to use a file, you can use windows registry to store the data, but this solution is not portable

How can I get direct keyboard input in cpp? (cross platform)

I want to be able to control the program with direct input without pauseing the program and without waiting for the user to press enter.
I can currently achieve this with kbhit, but it appears that is a windows only solution.
Ncurses also looks promising, but it appears to only work for linux (and maybe mac? Is unix the structure mac is based on?).
I especially like the kbhit for it's simplicity, and I like the tool set that ncurses, but I was wondering if there was a simple, easy way to get something running cross-platform without having to maintain essentially 2-3 versions of the code using these different tools?
I figured out my problem. I'm trying to do many things that cpp was never intended to do by default, so the options are to use libraries like allegro, or, in my case it turns out what I needed was a game engine. I found that Unity with text mesh pro can do everything I need it to. It comes with an entire input management system.

DBGP Implementation C/C++

Is there a Library that implements XDebug's DBGP in C/C++?
I'm interested in wrtting debugger and if such library exists will save me a lot!
I want to add the debugger to my editor coded in C++ Language but it is an editor for PHP Files.
None Exists. There was one from GSOC (App not a library) but I cannot take time to read and convert to my needs plus its written for wx2.8
So I will roll a class to Just glue up with my Editor
Edit
I ended using that one as I said.
Inside there is buggy libDBGp but I will fix it myself huh!
If you are interested its here (thanks to GitHub)
There are a few GDB based libraries that help debugger frontend writers like libgdb. DBGP is a very stupid and protocol with very small feature set - not enough for debugging C++.
For windows there is nothing like this. You can read the PDB database but it's pretty difficult. I spend a week to see how far i can get but wasn't very successfull. only the theory is easy. It might be better to write a frontend for the command line debugger windbg just like in the old days where you had to do this for GDB.

Simple cross-platform settings manager

I'm writing a cross-platform game (in C++) called Bombz and I need a way to read/write users' settings etc, which will also include records of which levels have been completed. Something like an ini file parser will be fine, and it doesn't really need to be efficient and/or scaleable - I can read all the settings at start-up instead of looking up named keys on the fly.
I've found a few simple ini file parsers but they overlook the question of where to store the files and it looks like I might have to write all this stuff myself. Should I just use something like:
Windows: $APPDATA/realh/Bombz/config
Mac: $HOME/Library/Bombz/config
Linux etc: $HOME/.bombz/config (or use the XDG spec)
where I look up $HOME or $APPDATA with getenv()? I know there are "better approved" ways of looking that up in Windows but I'm a Linux guy and I don't want to have to deal with the Windows API directly.
Well, it's quite interesting -- someone trying to write a game without calling OS-functions. Quite a challenge.
Other than that, if you don't want to call SHGetKnownFolderPath() then environment variables are your only bet. Although for myself, I don't even trust $HOME on Linux -- I use getpwuid_r(). And NSHomeDirectory() on MacOS.

How can I write my own 'filesystem' within Windows?

I've recalled using little 'filesystems' before that basically provided an interface to something else. For example, I believe there was a GMail filesystem that created an entry in My Computer and could be used like any other drive on your local computer. How can I go about implementing something like this in C++?
Thank you!
Try Dokan. It's like FUSE, except for Windows. I think there are certain limitations to namespace extensions, like they cannot be accessed from the command line, but I'm really not sure as of now.
Writing an actual file-system involves writing a driver; which means kernel-mode code (scary stuff) and paying for getting the IFS DDK. (edit: looks like they don't charge for it anymore)
What you probably want is a “namespace extension”.
Try this: The Complete Idiot's Guide to Writing Namespace Extensions - CodeProject
This may be a starting point to extending NTFS in the way that the GMail filesystem used to do: Windows NT reparse points.
The GMail Filesystem is just the name given; it is not any filesystem as such. It is just a namespace extension for Windows Explorer that links with the GMail account of yours!
I dont know exactly what you are trying to do, but in anyway, I believe, the following link will be of some use to you:
http://msdn.microsoft.com/en-us/magazine/cc188741.aspx
Just as a reference: virtual drives can be created using our Callback File System product, which is a supported, documented and maintained solution.
I was thinking of this too, perhaps some example code ? (email me if i forget plz ;p doin sdk now)
I'm thinking of a similar filesystem that would plug in as a driver and allow dynamic 'soft raid' on larger files mostly by putting them on more than one disk, perhaps some compression options and 'smart' filters to toggle usage in high disk space low usage and other situations more effectively, with status controls and indicators as a normalish program too
Seems like I would load the driver kit,
then i want the file writing event, and am mostly replacing fopen and similar functions automatically as an intermediate driver with a little windows network driver experience
I also heard good things about developing on a virtual machine for less crashing and more debugging
Also perhaps more metainfo on some or all files, including files in special folders with options too, including maybe both fast and simple (obfuscated and/or symmetic key) encryption options on folder, specified, all, letter, etc, or whatever, or the slower version and maybe integrated and optional (also profitable) online cvs-like diff style backups that mostly target changes to hot files for online backup at intervals and prices, mostly perhaps with matching keyboard events and might even be useful as simply a keylogging online backup service that is reasonably secure too
while avoiding common files like windows files or the normal stuff in the 'programs' directory that can be copied easily with pirate tools, unlike all of your documents.