Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

823 lines
19 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1991 - 1999
  3. Module Name:
  4. cdromp.h
  5. Abstract:
  6. Private header file for cdrom.sys. This contains private
  7. structure and function declarations as well as constant
  8. values which do not need to be exported.
  9. Author:
  10. Environment:
  11. kernel mode only
  12. Notes:
  13. Revision History:
  14. --*/
  15. #ifndef __CDROMP_H__
  16. #define __CDROMP_H__
  17. #include "ntddmmc.h"
  18. #include "trace.h"
  19. extern CLASSPNP_SCAN_FOR_SPECIAL_INFO CdromHackItems[];
  20. typedef enum {
  21. CdromDebugError = 0, // always printed
  22. CdromDebugWarning = 1, // set bit 0x00000001 in nt!kd_cdrom_mask
  23. CdromDebugTrace = 2, // set bit 0x00000002 in nt!kd_cdrom_mask
  24. CdromDebugInfo = 3, // set bit 0x00000004 in nt!kd_cdrom_mask
  25. #if 0
  26. CdromDebug = z, // set bit 0x00000000 in nt!kd_cdrom_mask
  27. CdromDebug = z, // set bit 0x00000000 in nt!kd_cdrom_mask
  28. CdromDebug = z, // set bit 0x00000000 in nt!kd_cdrom_mask
  29. CdromDebug = z, // set bit 0x00000000 in nt!kd_cdrom_mask
  30. #endif 0
  31. CdromDebugFeatures = 32 // set bit 0x80000000 in nt!kd_cdrom_mask
  32. };
  33. #define CDROM_GET_CONFIGURATION_TIMEOUT (0x4)
  34. #define CDROM_HACK_DEC_RRD (0x00000001)
  35. #define CDROM_HACK_FUJITSU_FMCD_10x (0x00000002)
  36. #define CDROM_HACK_HITACHI_1750 (0x00000004)
  37. #define CDROM_HACK_HITACHI_GD_2000 (0x00000008)
  38. #define CDROM_HACK_TOSHIBA_SD_W1101 (0x00000010)
  39. #define CDROM_HACK_TOSHIBA_XM_3xx (0x00000020)
  40. #define CDROM_HACK_NEC_CDDA (0x00000040)
  41. #define CDROM_HACK_PLEXTOR_CDDA (0x00000080)
  42. #define CDROM_HACK_BAD_GET_CONFIG_SUPPORT (0x00000100)
  43. #define CDROM_HACK_FORCE_READ_CD_DETECTION (0x00000200)
  44. #define CDROM_HACK_READ_CD_SUPPORTED (0x00000400)
  45. #define CDROM_HACK_LOCKED_PAGES (0x80000000) // not a valid flag to save
  46. #define CDROM_HACK_VALID_FLAGS (0x000007ff)
  47. #define CDROM_HACK_INVALID_FLAGS (~CDROM_HACK_VALID_FLAGS)
  48. typedef struct _XA_CONTEXT {
  49. //
  50. // Pointer to the device object.
  51. //
  52. PDEVICE_OBJECT DeviceObject;
  53. //
  54. // Pointer to the original request when
  55. // a mode select must be sent.
  56. //
  57. PIRP OriginalRequest;
  58. //
  59. // Pointer to the mode select srb.
  60. //
  61. PSCSI_REQUEST_BLOCK Srb;
  62. } XA_CONTEXT, *PXA_CONTEXT;
  63. typedef struct _ERROR_RECOVERY_DATA {
  64. MODE_PARAMETER_HEADER Header;
  65. MODE_PARAMETER_BLOCK BlockDescriptor;
  66. MODE_READ_RECOVERY_PAGE ReadRecoveryPage;
  67. } ERROR_RECOVERY_DATA, *PERROR_RECOVERY_DATA;
  68. typedef struct _ERROR_RECOVERY_DATA10 {
  69. MODE_PARAMETER_HEADER10 Header10;
  70. MODE_PARAMETER_BLOCK BlockDescriptor10;
  71. MODE_READ_RECOVERY_PAGE ReadRecoveryPage10;
  72. } ERROR_RECOVERY_DATA10, *PERROR_RECOVERY_DATA10;
  73. //
  74. // CdRom specific addition to device extension.
  75. //
  76. typedef struct _CDROM_DRIVER_EXTENSION {
  77. ULONG InterlockedCdRomCounter;
  78. PVOID Reserved[3];
  79. } CDROM_DRIVER_EXTENSION, *PCDROM_DRIVER_EXTENSION;
  80. #define CdromMmcUpdateComplete 0
  81. #define CdromMmcUpdateRequired 1
  82. #define CdromMmcUpdateStarted 2
  83. typedef struct _CDROM_MMC_EXTENSION {
  84. ULONG IsMmc; // allow quick checks
  85. ULONG WriteAllowed;
  86. LONG UpdateState;
  87. LIST_ENTRY DelayedIrpsList;
  88. ULONG NumDelayedIrps;
  89. KSPIN_LOCK DelayedIrpsLock;
  90. PIO_WORKITEM CapabilitiesWorkItem;
  91. PIRP CapabilitiesIrp;
  92. PMDL CapabilitiesMdl;
  93. PGET_CONFIGURATION_HEADER CapabilitiesBuffer;
  94. ULONG CapabilitiesBufferSize;
  95. KEVENT CapabilitiesEvent;
  96. SCSI_REQUEST_BLOCK CapabilitiesSrb;
  97. } CDROM_MMC_EXTENSION, *PCDROM_MMC_EXTENSION;
  98. #define CDROM_DRIVER_EXTENSION_ID CdRomAddDevice
  99. typedef struct _CDROM_DATA {
  100. //
  101. // Pointer to the cdrom driver extension
  102. //
  103. PCDROM_DRIVER_EXTENSION DriverExtension;
  104. //
  105. // These bits allow detection of when to requery the
  106. // drive's capabilities.
  107. //
  108. CDROM_MMC_EXTENSION Mmc;
  109. //
  110. // hack flags for ScanForSpecial routines
  111. //
  112. ULONG_PTR HackFlags;
  113. //
  114. // the error handling routines need to be per-device,
  115. // not per-driver....
  116. //
  117. PCLASS_ERROR ErrorHandler;
  118. //
  119. // Indicates whether an audio play operation
  120. // is currently being performed.
  121. // Only thing this does is prevent reads and
  122. // toc requests while playing audio.
  123. //
  124. BOOLEAN PlayActive;
  125. //
  126. // Indicates whether the blocksize used for user data
  127. // is 2048 or 2352.
  128. //
  129. BOOLEAN RawAccess;
  130. //
  131. // Indicates that this is a DEC RRD cdrom.
  132. // This drive requires software to fix responses
  133. // from the faulty firmware
  134. //
  135. BOOLEAN IsDecRrd;
  136. //
  137. // This points to an irp which needs to be delayed for a bit before a
  138. // retry can be attempted. The interval counter is set by the deferring
  139. // routine and will be decremented to zero in the tick handler. Once
  140. // the counter goes to zero the irp will be issued again.
  141. // DelayedRetryResend controls whether the irp is resent to the lower
  142. // driver (TRUE) or reissued into the startio routine (FALSE)
  143. //
  144. BOOLEAN DelayedRetryResend;
  145. PIRP DelayedRetryIrp;
  146. ULONG DelayedRetryInterval;
  147. KSPIN_LOCK DelayedRetrySpinLock;
  148. //
  149. // indicate we need to pick a default dvd region
  150. // for the user if we can
  151. //
  152. ULONG PickDvdRegion;
  153. //
  154. // The interface strings registered for this device.
  155. //
  156. UNICODE_STRING CdromInterfaceString;
  157. UNICODE_STRING VolumeInterfaceString;
  158. //
  159. // The well known name link for this device.
  160. //
  161. UNICODE_STRING WellKnownName;
  162. //
  163. // Indicates whether 6 or 10 bytes mode sense/select
  164. // should be used
  165. //
  166. ULONG XAFlags;
  167. //
  168. // keep track of what type of DVD device we are
  169. //
  170. BOOLEAN DvdRpc0Device;
  171. BOOLEAN DvdRpc0LicenseFailure;
  172. UCHAR Rpc0SystemRegion; // bitmask, one means prevent play
  173. UCHAR Rpc0SystemRegionResetCount;
  174. ULONG Rpc0RetryRegistryCallback; // one until initial region choosen
  175. KMUTEX Rpc0RegionMutex;
  176. //
  177. // Storage for the error recovery page. This is used
  178. // as an easy method to switch block sizes.
  179. //
  180. // NOTE - doubly unnamed structs just aren't very clean looking code - this
  181. // should get cleaned up at some point in the future.
  182. //
  183. union {
  184. ERROR_RECOVERY_DATA;
  185. ERROR_RECOVERY_DATA10;
  186. };
  187. } CDROM_DATA, *PCDROM_DATA;
  188. #define DEVICE_EXTENSION_SIZE sizeof(FUNCTIONAL_DEVICE_EXTENSION) + sizeof(CDROM_DATA)
  189. #define SCSI_CDROM_TIMEOUT 10
  190. #define SCSI_CHANGER_BONUS_TIMEOUT 10
  191. #define HITACHI_MODE_DATA_SIZE 12
  192. #define MODE_DATA_SIZE 64
  193. #define RAW_SECTOR_SIZE 2352
  194. #define COOKED_SECTOR_SIZE 2048
  195. #define CDROM_SRB_LIST_SIZE 4
  196. #define PLAY_ACTIVE(x) (((PCDROM_DATA)(x->CommonExtension.DriverData))->PlayActive)
  197. #define MSF_TO_LBA(Minutes,Seconds,Frames) \
  198. (ULONG)((60 * 75 * (Minutes)) + (75 * (Seconds)) + ((Frames) - 150))
  199. #define LBA_TO_MSF(Lba,Minutes,Seconds,Frames) \
  200. { \
  201. (Minutes) = (UCHAR)(Lba / (60 * 75)); \
  202. (Seconds) = (UCHAR)((Lba % (60 * 75)) / 75); \
  203. (Frames) = (UCHAR)((Lba % (60 * 75)) % 75); \
  204. }
  205. #define DEC_TO_BCD(x) (((x / 10) << 4) + (x % 10))
  206. //
  207. // Define flags for XA, CDDA, and Mode Select/Sense
  208. //
  209. #define XA_USE_6_BYTE 0x01
  210. #define XA_USE_10_BYTE 0x02
  211. #define XA_NOT_SUPPORTED 0x10
  212. #define XA_USE_READ_CD 0x20
  213. #define XA_PLEXTOR_CDDA 0x40
  214. #define XA_NEC_CDDA 0x80
  215. //
  216. // Sector types for READ_CD
  217. //
  218. #define ANY_SECTOR 0
  219. #define CD_DA_SECTOR 1
  220. #define YELLOW_MODE1_SECTOR 2
  221. #define YELLOW_MODE2_SECTOR 3
  222. #define FORM2_MODE1_SECTOR 4
  223. #define FORM2_MODE2_SECTOR 5
  224. #define MAX_COPY_PROTECT_AGID 4
  225. #ifdef ExAllocatePool
  226. #undef ExAllocatePool
  227. #define ExAllocatePool #assert(FALSE)
  228. #endif
  229. #define CDROM_TAG_GET_CONFIG 'cCcS' // "ScCc" - ioctl GET_CONFIGURATION
  230. #define CDROM_TAG_DC_EVENT 'ECcS' // "ScCE" - device control synch event
  231. #define CDROM_TAG_FEATURE 'FCcS' // "ScCF" - allocated by CdRomGetConfiguration(), free'd by caller
  232. #define CDROM_TAG_DISK_GEOM 'GCcS' // "ScCG" - disk geometry buffer
  233. #define CDROM_TAG_HITACHI_ERROR 'HCcS' // "ScCH" - hitachi error buffer
  234. #define CDROM_TAG_SENSE_INFO 'ICcS' // "ScCI" - sense info buffers
  235. #define CDROM_TAG_POWER_IRP 'iCcS' // "ScCi" - irp for power request
  236. #define CDROM_TAG_SRB 'SCcS' // "ScCS" - srb allocation
  237. #define CDROM_TAG_STRINGS 'sCcS' // "ScCs" - assorted string data
  238. #define CDROM_TAG_MODE_DATA 'MCcS' // "ScCM" - mode data buffer
  239. #define CDROM_TAG_READ_CAP 'PCcS' // "ScCP" - read capacity buffer
  240. #define CDROM_TAG_PLAY_ACTIVE 'pCcS' // "ScCp" - play active checks
  241. #define CDROM_TAG_SUB_Q 'QCcS' // "ScCQ" - read sub q buffer
  242. #define CDROM_TAG_RAW 'RCcS' // "ScCR" - raw mode read buffer
  243. #define CDROM_TAG_TOC 'TCcS' // "ScCT" - read toc buffer
  244. #define CDROM_TAG_TOSHIBA_ERROR 'tCcS' // "ScCt" - toshiba error buffer
  245. #define CDROM_TAG_DEC_ERROR 'dCcS' // "ScCt" - DEC error buffer
  246. #define CDROM_TAG_UPDATE_CAP 'UCcS' // "ScCU" - update capacity path
  247. #define CDROM_TAG_VOLUME 'VCcS' // "ScCV" - volume control buffer
  248. #define CDROM_TAG_VOLUME_INT 'vCcS' // "ScCv" - volume control buffer
  249. #define DVD_TAG_READ_STRUCTURE 'SVcS' // "ScVS" - used for dvd structure reads
  250. #define DVD_TAG_READ_KEY 'kVcS' // "ScVk" - read buffer for dvd key
  251. #define DVD_TAG_SEND_KEY 'KVcS' // "ScVK" - write buffer for dvd key
  252. #define DVD_TAG_RPC2_CHECK 'sVcS' // "ScVs" - read buffer for dvd/rpc2 check
  253. #define DVD_TAG_DVD_REGION 'tVcS' // "ScVt" - read buffer for rpc2 check
  254. #define DVD_TAG_SECURITY 'XVcS' // "ScVX" - security descriptor
  255. #define CDROM_SUBKEY_NAME (L"CdRom") // store new settings here
  256. #define CDROM_READ_CD_NAME (L"ReadCD") // READ_CD support previously detected
  257. #define CDROM_NON_MMC_DRIVE_NAME (L"NonMmc") // MMC commands hang
  258. //
  259. // DVD Registry Value Names for RPC0 Device
  260. //
  261. #define DVD_DEFAULT_REGION (L"DefaultDvdRegion") // this is init. by the dvd class installer
  262. #define DVD_CURRENT_REGION (L"DvdR")
  263. #define DVD_REGION_RESET_COUNT (L"DvdRCnt")
  264. #define DVD_MAX_REGION_RESET_COUNT 2
  265. #define DVD_MAX_REGION 8
  266. #define BAIL_OUT(Irp) \
  267. DebugPrint((2, "Cdrom: [%p] Bailing with status " \
  268. " %lx at line %x file %s\n", \
  269. (Irp), (Irp)->IoStatus.Status, \
  270. __LINE__, __FILE__))
  271. /*++
  272. Routine Description:
  273. This routine grabs an extra remove lock using a local variable
  274. for a unique tag. It then completes the irp in question, and
  275. the just-acquired removelock guarantees that it is still safe
  276. to call IoStartNextPacket(). When that finishes, we release
  277. the newly acquired RemoveLock and return.
  278. Arguments:
  279. DeviceObject - the device object for the StartIo queue
  280. Irp - the request we are completing
  281. Return Value:
  282. None
  283. Notes:
  284. This is implemented as an inline function to allow the compiler
  285. to optimize this as either a function call or as actual inline code.
  286. This routine will not work with IoXxxRemoveLock() calls, as the
  287. behavior is different. ClassXxxRemoveLock() calls succeed until
  288. the remove has completed, while IoXxxRemoveLock() calls fail as
  289. soon as the call to IoReleaseRemoveLockAndWait() has been called.
  290. The Class version allows this routine to work in a safe manner.
  291. replaces the following two lines:
  292. IoStartNextPacket(DeviceObject, FALSE);
  293. ClassReleaseRemoveLock(DeviceObject, Irp);
  294. and raises irql as needed to call IoStartNextPacket()
  295. --*/
  296. __inline
  297. VOID
  298. CdRomCompleteIrpAndStartNextPacketSafely(
  299. IN PDEVICE_OBJECT DeviceObject,
  300. IN PIRP Irp
  301. )
  302. {
  303. UCHAR uniqueAddress;
  304. KIRQL oldIrql = KeGetCurrentIrql();
  305. ClassAcquireRemoveLock(DeviceObject, (PIRP)&uniqueAddress);
  306. ClassReleaseRemoveLock(DeviceObject, Irp);
  307. ClassCompleteRequest(DeviceObject, Irp, IO_CD_ROM_INCREMENT);
  308. if (oldIrql > DISPATCH_LEVEL) {
  309. ASSERT(!"Cannot call IoStartNextPacket at raised IRQL!");
  310. } else if (oldIrql < DISPATCH_LEVEL) {
  311. KeRaiseIrqlToDpcLevel();
  312. } else { // (oldIrql == DISPATCH_LEVEL)
  313. NOTHING;
  314. }
  315. IoStartNextPacket(DeviceObject, FALSE);
  316. if (oldIrql > DISPATCH_LEVEL) {
  317. ASSERT(!"Cannot call IoStartNextPacket at raised IRQL!");
  318. } else if (oldIrql < DISPATCH_LEVEL) {
  319. KeLowerIrql(oldIrql);
  320. } else { // (oldIrql == DISPATCH_LEVEL)
  321. NOTHING;
  322. }
  323. ClassReleaseRemoveLock(DeviceObject, (PIRP)&uniqueAddress);
  324. return;
  325. }
  326. VOID
  327. CdRomDeviceControlDvdReadStructure(
  328. IN PDEVICE_OBJECT DeviceObject,
  329. IN PIRP OriginalIrp,
  330. IN PIRP NewIrp,
  331. IN PSCSI_REQUEST_BLOCK Srb
  332. );
  333. VOID
  334. CdRomDeviceControlDvdEndSession(
  335. IN PDEVICE_OBJECT DeviceObject,
  336. IN PIRP OriginalIrp,
  337. IN PIRP NewIrp,
  338. IN PSCSI_REQUEST_BLOCK Srb
  339. );
  340. VOID
  341. CdRomDeviceControlDvdStartSessionReadKey(
  342. IN PDEVICE_OBJECT DeviceObject,
  343. IN PIRP OriginalIrp,
  344. IN PIRP NewIrp,
  345. IN PSCSI_REQUEST_BLOCK Srb
  346. );
  347. VOID
  348. CdRomDeviceControlDvdSendKey(
  349. IN PDEVICE_OBJECT DeviceObject,
  350. IN PIRP OriginalIrp,
  351. IN PIRP NewIrp,
  352. IN PSCSI_REQUEST_BLOCK Srb
  353. );
  354. NTSTATUS
  355. DriverEntry(
  356. IN PDRIVER_OBJECT DriverObject,
  357. IN PUNICODE_STRING RegistryPath
  358. );
  359. VOID
  360. CdRomUnload(
  361. IN PDRIVER_OBJECT DriverObject
  362. );
  363. NTSTATUS
  364. CdRomAddDevice(
  365. IN PDRIVER_OBJECT DriverObject,
  366. IN PDEVICE_OBJECT Pdo
  367. );
  368. NTSTATUS
  369. CdRomOpenClose(
  370. IN PDEVICE_OBJECT DeviceObject,
  371. IN PIRP Irp
  372. );
  373. NTSTATUS
  374. CdRomReadWriteVerification(
  375. IN PDEVICE_OBJECT DeviceObject,
  376. IN PIRP Irp
  377. );
  378. NTSTATUS
  379. CdRomSwitchMode(
  380. IN PDEVICE_OBJECT DeviceObject,
  381. IN ULONG SectorSize,
  382. IN PIRP OriginalRequest
  383. );
  384. NTSTATUS
  385. CdRomDeviceControlDispatch(
  386. IN PDEVICE_OBJECT DeviceObject,
  387. IN PIRP Irp
  388. );
  389. NTSTATUS
  390. CdRomDeviceControlCompletion(
  391. IN PDEVICE_OBJECT DeviceObject,
  392. IN PIRP Irp,
  393. IN PVOID Context
  394. );
  395. NTSTATUS
  396. CdRomSetVolumeIntermediateCompletion(
  397. IN PDEVICE_OBJECT DeviceObject,
  398. IN PIRP Irp,
  399. IN PVOID Context
  400. );
  401. NTSTATUS
  402. CdRomSwitchModeCompletion(
  403. IN PDEVICE_OBJECT DeviceObject,
  404. IN PIRP Irp,
  405. IN PVOID Context
  406. );
  407. NTSTATUS
  408. CdRomXACompletion(
  409. IN PDEVICE_OBJECT DeviceObject,
  410. IN PIRP Irp,
  411. IN PVOID Context
  412. );
  413. NTSTATUS
  414. CdRomClassIoctlCompletion(
  415. IN PDEVICE_OBJECT DeviceObject,
  416. IN PIRP Irp,
  417. IN PVOID Context
  418. );
  419. VOID
  420. CdRomStartIo(
  421. IN PDEVICE_OBJECT DeviceObject,
  422. IN PIRP Irp
  423. );
  424. VOID
  425. CdRomTickHandler(
  426. IN PDEVICE_OBJECT DeviceObject
  427. );
  428. NTSTATUS
  429. CdRomUpdateCapacity(
  430. IN PFUNCTIONAL_DEVICE_EXTENSION DeviceExtension,
  431. IN PIRP IrpToComplete,
  432. IN OPTIONAL PKEVENT IoctlEvent
  433. );
  434. NTSTATUS
  435. CdRomCreateDeviceObject(
  436. IN PDRIVER_OBJECT DriverObject,
  437. IN PDEVICE_OBJECT Pdo
  438. );
  439. VOID
  440. ScanForSpecialHandler(
  441. PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  442. ULONG_PTR HackFlags
  443. );
  444. VOID
  445. ScanForSpecial(
  446. PDEVICE_OBJECT DeviceObject
  447. );
  448. BOOLEAN
  449. CdRomIsPlayActive(
  450. IN PDEVICE_OBJECT DeviceObject
  451. );
  452. VOID
  453. CdRomErrorHandler(
  454. PDEVICE_OBJECT DeviceObject,
  455. PSCSI_REQUEST_BLOCK Srb,
  456. NTSTATUS *Status,
  457. BOOLEAN *Retry
  458. );
  459. VOID
  460. HitachiProcessErrorGD2000(
  461. PDEVICE_OBJECT DeviceObject,
  462. PSCSI_REQUEST_BLOCK Srb,
  463. NTSTATUS *Status,
  464. BOOLEAN *Retry
  465. );
  466. VOID
  467. HitachiProcessError(
  468. PDEVICE_OBJECT DeviceObject,
  469. PSCSI_REQUEST_BLOCK Srb,
  470. NTSTATUS *Status,
  471. BOOLEAN *Retry
  472. );
  473. VOID
  474. ToshibaProcessError(
  475. PDEVICE_OBJECT DeviceObject,
  476. PSCSI_REQUEST_BLOCK Srb,
  477. NTSTATUS *Status,
  478. BOOLEAN *Retry
  479. );
  480. NTSTATUS
  481. ToshibaProcessErrorCompletion(
  482. PDEVICE_OBJECT DeviceObject,
  483. PIRP Irp,
  484. PVOID Context
  485. );
  486. VOID
  487. CdRomCreateNamedEvent(
  488. IN PFUNCTIONAL_DEVICE_EXTENSION DeviceExtension,
  489. IN ULONG DeviceNumber
  490. );
  491. NTSTATUS
  492. CdRomInitDevice(
  493. IN PDEVICE_OBJECT Fdo
  494. );
  495. NTSTATUS
  496. CdRomStartDevice(
  497. IN PDEVICE_OBJECT Fdo
  498. );
  499. NTSTATUS
  500. CdRomStopDevice(
  501. IN PDEVICE_OBJECT DeviceObject,
  502. IN UCHAR Type
  503. );
  504. NTSTATUS
  505. CdRomRemoveDevice(
  506. IN PDEVICE_OBJECT DeviceObject,
  507. IN UCHAR Type
  508. );
  509. NTSTATUS
  510. CdRomDvdEndAllSessionsCompletion(
  511. IN PDEVICE_OBJECT DeviceObject,
  512. IN PIRP Irp,
  513. IN PVOID Context
  514. );
  515. NTSTATUS
  516. CdRomDvdReadDiskKeyCompletion(
  517. IN PDEVICE_OBJECT DeviceObject,
  518. IN PIRP Irp,
  519. IN PVOID Context
  520. );
  521. DEVICE_TYPE
  522. CdRomGetDeviceType(
  523. IN PDEVICE_OBJECT DeviceObject
  524. );
  525. NTSTATUS
  526. CdRomCreateWellKnownName(
  527. IN PDEVICE_OBJECT DeviceObject
  528. );
  529. VOID
  530. CdRomDeleteWellKnownName(
  531. IN PDEVICE_OBJECT DeviceObject
  532. );
  533. NTSTATUS
  534. CdRomGetDeviceParameter (
  535. IN PDEVICE_OBJECT DeviceObject,
  536. IN PWSTR ParameterName,
  537. IN OUT PULONG ParameterValue
  538. );
  539. NTSTATUS
  540. CdRomSetDeviceParameter (
  541. IN PDEVICE_OBJECT DeviceObject,
  542. IN PWSTR ParameterName,
  543. IN ULONG ParameterValue
  544. );
  545. VOID
  546. CdRomPickDvdRegion (
  547. IN PDEVICE_OBJECT Fdo
  548. );
  549. NTSTATUS
  550. CdRomRetryRequest(
  551. IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  552. IN PIRP Irp,
  553. IN ULONG Delay,
  554. IN BOOLEAN ResendIrp
  555. );
  556. NTSTATUS
  557. CdRomRerunRequest(
  558. IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  559. IN OPTIONAL PIRP Irp,
  560. IN BOOLEAN ResendIrp
  561. );
  562. NTSTATUS
  563. CdRomGetRpc0Settings(
  564. IN PDEVICE_OBJECT Fdo
  565. );
  566. NTSTATUS
  567. CdRomSetRpc0Settings(
  568. IN PDEVICE_OBJECT Fdo,
  569. IN UCHAR NewRegion
  570. );
  571. NTSTATUS
  572. CdRomShutdownFlush(
  573. IN PDEVICE_OBJECT DeviceObject,
  574. IN PIRP Irp
  575. );
  576. ////////////////////////////////////////////////////////////////////////////////
  577. VOID
  578. CdRomIsDeviceMmcDevice(
  579. IN PDEVICE_OBJECT Fdo,
  580. OUT PBOOLEAN IsMmc
  581. );
  582. NTSTATUS
  583. CdRomMmcErrorHandler(
  584. IN PDEVICE_OBJECT Fdo,
  585. IN PSCSI_REQUEST_BLOCK Srb,
  586. OUT PNTSTATUS Status,
  587. OUT PBOOLEAN Retry
  588. );
  589. PVOID
  590. CdRomFindFeaturePage(
  591. IN PGET_CONFIGURATION_HEADER FeatureBuffer,
  592. IN ULONG Length,
  593. IN FEATURE_NUMBER Feature
  594. );
  595. NTSTATUS
  596. CdRomGetConfiguration(
  597. IN PDEVICE_OBJECT Fdo,
  598. OUT PGET_CONFIGURATION_HEADER *Buffer,
  599. OUT PULONG BytesReturned,
  600. IN FEATURE_NUMBER StartingFeature,
  601. IN ULONG RequestedType
  602. );
  603. VOID
  604. CdRomUpdateMmcDriveCapabilities(
  605. IN PDEVICE_OBJECT Fdo,
  606. IN PVOID Context // RESERVED == NULL
  607. );
  608. VOID
  609. CdRomFindProfileInProfiles(
  610. IN PFEATURE_DATA_PROFILE_LIST ProfileHeader,
  611. IN FEATURE_PROFILE_TYPE ProfileToFind,
  612. OUT PBOOLEAN Exists
  613. );
  614. NTSTATUS
  615. CdRomAllocateMmcResources(
  616. IN PDEVICE_OBJECT Fdo
  617. );
  618. VOID
  619. CdRomDeAllocateMmcResources(
  620. IN PDEVICE_OBJECT Fdo
  621. );
  622. VOID
  623. CdromFakePartitionInfo(
  624. IN PCOMMON_DEVICE_EXTENSION CommonExtension,
  625. IN PIRP Irp
  626. );
  627. VOID
  628. CdRomInterpretReadCapacity(
  629. IN PDEVICE_OBJECT Fdo,
  630. IN PREAD_CAPACITY_DATA ReadCapacityBuffer
  631. );
  632. NTSTATUS
  633. CdRomShutdownFlushCompletion(
  634. IN PDEVICE_OBJECT DeviceObject,
  635. IN PIRP Irp,
  636. IN PVOID Context
  637. );
  638. VOID
  639. CdRompFlushDelayedList(
  640. IN PDEVICE_OBJECT Fdo,
  641. IN PCDROM_MMC_EXTENSION MmcData,
  642. IN NTSTATUS Status,
  643. IN BOOLEAN CalledFromWorkItem
  644. );
  645. #endif // __CDROMP_H__