Hi,
I/O control allows doing low level things with devices in the system.
In the Win API you could call "DeviceIoControl" which is located in the kernel dll. You need a handle to the device so you call CreateFile first, then you need the IoControlCode which you find in the SDK include files (or just the tag if your compiler already has found the constant defined in a Windows include file) and that tells the device what it is you want to do. The rest of the parameters for DeviceIoControl are for your allocated buffers for this functions input and output and to tell the function how large these buffers really are, and how many bytes were really returned, and if you are using an Overlapped structure.
There is more to it than that once you know what IoControlCode you want to use, but you can find out more about this by doing a search for "DeviceIoControl" and that should turn up an MS dev network link which will take you right to the MS site where the information on how to use this will be found.
It just so happens that i used this just the other day, just to write a quick USB Flash Drive Ejector program so i did not have to click "Safely Remove Hardware" anymore because i found i had to do that too often and sometimes it would fail and i'd have to do it again. I found that it would often fail the first time for almost no reason so it got to be a pain. With the program (very short program really) it tries to dismount several times before it reports an error, so if it fails then another program is definitely using the drive so i dont really want to dismount yet.
As an example of one of the control codes i had to use, to lock the volume i had to use:
FSCTL_LOCK_VOLUME
as the control parameter to DeviceIoControl, and if the function fails then something else in the system is still using the drive so i try several more times and if it fails all those times then i dont dismount it yet.
Here's a quick excerpt from the old WinHelp API help file:
BOOL DeviceIoControl(
HANDLE hDevice, // handle to device of interest
DWORD dwIoControlCode, // control code of operation to perform
LPVOID lpInBuffer, // pointer to buffer to supply input data
DWORD nInBufferSize, // size of input buffer
LPVOID lpOutBuffer, // pointer to buffer to receive output data
DWORD nOutBufferSize, // size of output buffer
LPDWORD lpBytesReturned, // pointer to variable to receive output byte count
LPOVERLAPPED lpOverlapped // pointer to overlapped structure for asynchronous operation
);