Hello I am trying to make a simple program to send a MMC command (Read CD for example) to a DVD Writer (assigned letter E in my computer) when I click a button. I just started programming and I tried to make something but I got no idea what to do.
I tried to define the letter for the target drive, because SendCommandNoData seems to me like you can't specify the wanted drive (can I make the user able to choose the dvd writer from a list of found ones in the computer?). Then I tried to send the command. It is probably very bad code, but I just want to learn. Thank you.
Code:
Private Command1_Click()
Function SendCommandNoData()
Handle hVol = CreateFile("\\.\E:", GENERIC_READ, GENERIC_WRITE)
DeviceIoControl(hVol, IoControlCode, InBuffer, OutBuffer, Overlapped)
SendCommandNoData(
[in] BYTE *READ CD,
[in] ULONG 12,
[out] BYTE SenseBuffer[18],
[in] ULONG 5
);
End Function