Help handling a device
HANDLE hDevice;
DWORD dwIoControlCode;
LPVOID lpInBuffer;
DWORD nInBufferSize;
DWORD nOutBufferSize;
LPDWORD lpBytesReturned;
LPOVERLAPPED lpOverlapped;
FSCTL_DISMOUNT_VOLUME disMount;
hDevice = CreateFile (TEXT("\\\\.\\e:"), // drive (THIS IS THE LETTER OF MY USB DRIVE)
0, // no access to the drive
FILE_SHARE_READ, // share mode
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes
DeviceIoControl(hDevice, // device to be queried
disMount, // operation to perform
NULL, 0, // no input buffer
// pdg, sizeof(*pdg), // output buffer DONT KNOW WHAT THIS IS FOR
// &junk, // # bytes returned DONT KNOW WHAT THIS IS FOR
(LPOVERLAPPED) NULL); // synchronous I/O
CloseHandle(hDevice);

