Hey, can someone tell me if its possible to control (change speed, start/stop) the cd-rom motor?
Thanks in advance :P
Thanks in advance :P
|
C#
Controlling cd-rom motor |
(Aug 10, 2016 10:13 AM)Mudzay Wrote: Hey, can someone tell me if its possible to control (change speed, start/stop) the cd-rom motor? lol i asked my teacher about that, he told me that it is not possible with .NET (Aug 10, 2016 10:29 AM)i-manuel Wrote: lol i asked my teacher about that, he told me that it is not possible with .NET Everything is possible. I'm sure there's a dll out there somewhere or something. (Aug 10, 2016 10:29 AM)i-manuel Wrote: lol i asked my teacher about that, he told me that it is not possible with .NETU can always make c++ etc. dll and call it from c# xD (I think its possible, windows dlls like wimm.dll are c or c++)
You can open/close the tray from within c# easily. Not so sure about the speed, though.
Aug 10, 2016 07:33 PM
(This post was last modified: Aug 10, 2016 07:35 PM by еlixir.)
Code public bool IsDiscAvailable(int driveNumber)or Code using System;The snippets above checks for a disk, causing the motor to run. source: http://stackoverflow.com/questions/11420...-dvd-drive
Aug 10, 2016 07:45 PM
(This post was last modified: Aug 10, 2016 07:46 PM by 0xDEAD10CC.)
You would need to use IOCTL's for this. IOCTL_CDROM_SET_SPEED more specifically as the control code that you'd have to send to the CD-ROM class driver as a request of type CdromSetSpeed (from the CDROM_SPEED_REQUEST enum) in the RequestType memer of the CDROM_SET_SPEED struct. The buffer at Irp->AssociatedIrp.SystemBuffer would contain the CDROM_SET_SPEED structure. You wouldn't need to keep track of the previous speed either because when media is changed it will revert to it's default speed. From a user-mode application you would have to call DeviceIoControl() to send these requests.
(Aug 10, 2016 07:33 PM)еlixir Wrote: ... Yeah wonderful -- Not at ALL what OP asked for...
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Python] by SIM-1517404Sep 19, 2017 11:33 PM | 2 | 101 |
Sep 19, 2017 11:33 PM Last Post: SIM-1517404 |
| [Python] by SIM-1517404Aug 17, 2017 08:24 AM | 7 | 341 |
Aug 17, 2017 08:24 AM Last Post: SIM-1517404 |
| [Python] by FolksMay 19, 2017 02:44 PM | 3 | 126 |
May 19, 2017 02:44 PM Last Post: hunter24957 |