Leaked source code of windows server 2003
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.

816 lines
20 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 DEC_TO_BCD(x) (((x / 10) << 4) + (x % 10))
  200. //
  201. // Define flags for XA, CDDA, and Mode Select/Sense
  202. //
  203. #define XA_USE_6_BYTE 0x01
  204. #define XA_USE_10_BYTE 0x02
  205. #define XA_NOT_SUPPORTED 0x10
  206. #define XA_USE_READ_CD 0x20
  207. #define XA_PLEXTOR_CDDA 0x40
  208. #define XA_NEC_CDDA 0x80
  209. //
  210. // Sector types for READ_CD
  211. //
  212. #define ANY_SECTOR 0
  213. #define CD_DA_SECTOR 1
  214. #define YELLOW_MODE1_SECTOR 2
  215. #define YELLOW_MODE2_SECTOR 3
  216. #define FORM2_MODE1_SECTOR 4
  217. #define FORM2_MODE2_SECTOR 5
  218. #define MAX_COPY_PROTECT_AGID 4
  219. #ifdef ExAllocatePool
  220. #undef ExAllocatePool
  221. #define ExAllocatePool #assert(FALSE)
  222. #endif
  223. #define CDROM_TAG_GET_CONFIG 'cCcS' // "ScCc" - ioctl GET_CONFIGURATION
  224. #define CDROM_TAG_DC_EVENT 'ECcS' // "ScCE" - device control synch event
  225. #define CDROM_TAG_FEATURE 'FCcS' // "ScCF" - allocated by CdRomGetConfiguration(), free'd by caller
  226. #define CDROM_TAG_DISK_GEOM 'GCcS' // "ScCG" - disk geometry buffer
  227. #define CDROM_TAG_HITACHI_ERROR 'HCcS' // "ScCH" - hitachi error buffer
  228. #define CDROM_TAG_SENSE_INFO 'ICcS' // "ScCI" - sense info buffers
  229. #define CDROM_TAG_POWER_IRP 'iCcS' // "ScCi" - irp for power request
  230. #define CDROM_TAG_SRB 'SCcS' // "ScCS" - srb allocation
  231. #define CDROM_TAG_STRINGS 'sCcS' // "ScCs" - assorted string data
  232. #define CDROM_TAG_MODE_DATA 'MCcS' // "ScCM" - mode data buffer
  233. #define CDROM_TAG_READ_CAP 'PCcS' // "ScCP" - read capacity buffer
  234. #define CDROM_TAG_PLAY_ACTIVE 'pCcS' // "ScCp" - play active checks
  235. #define CDROM_TAG_SUB_Q 'QCcS' // "ScCQ" - read sub q buffer
  236. #define CDROM_TAG_RAW 'RCcS' // "ScCR" - raw mode read buffer
  237. #define CDROM_TAG_TOC 'TCcS' // "ScCT" - read toc buffer
  238. #define CDROM_TAG_TOSHIBA_ERROR 'tCcS' // "ScCt" - toshiba error buffer
  239. #define CDROM_TAG_DEC_ERROR 'dCcS' // "ScCt" - DEC error buffer
  240. #define CDROM_TAG_UPDATE_CAP 'UCcS' // "ScCU" - update capacity path
  241. #define CDROM_TAG_VOLUME 'VCcS' // "ScCV" - volume control buffer
  242. #define CDROM_TAG_VOLUME_INT 'vCcS' // "ScCv" - volume control buffer
  243. #define DVD_TAG_READ_STRUCTURE 'SVcS' // "ScVS" - used for dvd structure reads
  244. #define DVD_TAG_READ_KEY 'kVcS' // "ScVk" - read buffer for dvd key
  245. #define DVD_TAG_SEND_KEY 'KVcS' // "ScVK" - write buffer for dvd key
  246. #define DVD_TAG_RPC2_CHECK 'sVcS' // "ScVs" - read buffer for dvd/rpc2 check
  247. #define DVD_TAG_DVD_REGION 'tVcS' // "ScVt" - read buffer for rpc2 check
  248. #define DVD_TAG_SECURITY 'XVcS' // "ScVX" - security descriptor
  249. #define CDROM_SUBKEY_NAME (L"CdRom") // store new settings here
  250. #define CDROM_READ_CD_NAME (L"ReadCD") // READ_CD support previously detected
  251. #define CDROM_NON_MMC_DRIVE_NAME (L"NonMmc") // MMC commands hang
  252. //
  253. // DVD Registry Value Names for RPC0 Device
  254. //
  255. #define DVD_DEFAULT_REGION (L"DefaultDvdRegion") // this is init. by the dvd class installer
  256. #define DVD_CURRENT_REGION (L"DvdR")
  257. #define DVD_REGION_RESET_COUNT (L"DvdRCnt")
  258. #define DVD_MAX_REGION_RESET_COUNT 2
  259. #define DVD_MAX_REGION 8
  260. #define BAIL_OUT(Irp) \
  261. DebugPrint((2, "Cdrom: [%p] Bailing with status " \
  262. " %lx at line %x file %s\n", \
  263. (Irp), (Irp)->IoStatus.Status, \
  264. __LINE__, __FILE__))
  265. /*++
  266. Routine Description:
  267. This routine grabs an extra remove lock using a local variable
  268. for a unique tag. It then completes the irp in question, and
  269. the just-acquired removelock guarantees that it is still safe
  270. to call IoStartNextPacket(). When that finishes, we release
  271. the newly acquired RemoveLock and return.
  272. Arguments:
  273. DeviceObject - the device object for the StartIo queue
  274. Irp - the request we are completing
  275. Return Value:
  276. None
  277. Notes:
  278. This is implemented as an inline function to allow the compiler
  279. to optimize this as either a function call or as actual inline code.
  280. This routine will not work with IoXxxRemoveLock() calls, as the
  281. behavior is different. ClassXxxRemoveLock() calls succeed until
  282. the remove has completed, while IoXxxRemoveLock() calls fail as
  283. soon as the call to IoReleaseRemoveLockAndWait() has been called.
  284. The Class version allows this routine to work in a safe manner.
  285. replaces the following two lines:
  286. IoStartNextPacket(DeviceObject, FALSE);
  287. ClassReleaseRemoveLock(DeviceObject, Irp);
  288. and raises irql as needed to call IoStartNextPacket()
  289. --*/
  290. __inline
  291. VOID
  292. CdRomCompleteIrpAndStartNextPacketSafely(
  293. IN PDEVICE_OBJECT DeviceObject,
  294. IN PIRP Irp
  295. )
  296. {
  297. UCHAR uniqueAddress;
  298. KIRQL oldIrql = KeGetCurrentIrql();
  299. ClassAcquireRemoveLock(DeviceObject, (PIRP)&uniqueAddress);
  300. ClassReleaseRemoveLock(DeviceObject, Irp);
  301. ClassCompleteRequest(DeviceObject, Irp, IO_CD_ROM_INCREMENT);
  302. if (oldIrql > DISPATCH_LEVEL) {
  303. ASSERT(!"Cannot call IoStartNextPacket at raised IRQL!");
  304. } else if (oldIrql < DISPATCH_LEVEL) {
  305. KeRaiseIrqlToDpcLevel();
  306. } else { // (oldIrql == DISPATCH_LEVEL)
  307. NOTHING;
  308. }
  309. IoStartNextPacket(DeviceObject, FALSE);
  310. if (oldIrql > DISPATCH_LEVEL) {
  311. ASSERT(!"Cannot call IoStartNextPacket at raised IRQL!");
  312. } else if (oldIrql < DISPATCH_LEVEL) {
  313. KeLowerIrql(oldIrql);
  314. } else { // (oldIrql == DISPATCH_LEVEL)
  315. NOTHING;
  316. }
  317. ClassReleaseRemoveLock(DeviceObject, (PIRP)&uniqueAddress);
  318. return;
  319. }
  320. VOID
  321. CdRomDeviceControlDvdReadStructure(
  322. IN PDEVICE_OBJECT DeviceObject,
  323. IN PIRP OriginalIrp,
  324. IN PIRP NewIrp,
  325. IN PSCSI_REQUEST_BLOCK Srb
  326. );
  327. VOID
  328. CdRomDeviceControlDvdEndSession(
  329. IN PDEVICE_OBJECT DeviceObject,
  330. IN PIRP OriginalIrp,
  331. IN PIRP NewIrp,
  332. IN PSCSI_REQUEST_BLOCK Srb
  333. );
  334. VOID
  335. CdRomDeviceControlDvdStartSessionReadKey(
  336. IN PDEVICE_OBJECT DeviceObject,
  337. IN PIRP OriginalIrp,
  338. IN PIRP NewIrp,
  339. IN PSCSI_REQUEST_BLOCK Srb
  340. );
  341. VOID
  342. CdRomDeviceControlDvdSendKey(
  343. IN PDEVICE_OBJECT DeviceObject,
  344. IN PIRP OriginalIrp,
  345. IN PIRP NewIrp,
  346. IN PSCSI_REQUEST_BLOCK Srb
  347. );
  348. NTSTATUS
  349. DriverEntry(
  350. IN PDRIVER_OBJECT DriverObject,
  351. IN PUNICODE_STRING RegistryPath
  352. );
  353. VOID
  354. CdRomUnload(
  355. IN PDRIVER_OBJECT DriverObject
  356. );
  357. NTSTATUS
  358. CdRomAddDevice(
  359. IN PDRIVER_OBJECT DriverObject,
  360. IN PDEVICE_OBJECT Pdo
  361. );
  362. NTSTATUS
  363. CdRomOpenClose(
  364. IN PDEVICE_OBJECT DeviceObject,
  365. IN PIRP Irp
  366. );
  367. NTSTATUS
  368. CdRomReadWriteVerification(
  369. IN PDEVICE_OBJECT DeviceObject,
  370. IN PIRP Irp
  371. );
  372. NTSTATUS
  373. CdRomSwitchMode(
  374. IN PDEVICE_OBJECT DeviceObject,
  375. IN ULONG SectorSize,
  376. IN PIRP OriginalRequest
  377. );
  378. NTSTATUS
  379. CdRomDeviceControlDispatch(
  380. IN PDEVICE_OBJECT DeviceObject,
  381. IN PIRP Irp
  382. );
  383. NTSTATUS
  384. CdRomDeviceControlCompletion(
  385. IN PDEVICE_OBJECT DeviceObject,
  386. IN PIRP Irp,
  387. IN PVOID Context
  388. );
  389. NTSTATUS
  390. CdRomSetVolumeIntermediateCompletion(
  391. IN PDEVICE_OBJECT DeviceObject,
  392. IN PIRP Irp,
  393. IN PVOID Context
  394. );
  395. NTSTATUS
  396. CdRomSwitchModeCompletion(
  397. IN PDEVICE_OBJECT DeviceObject,
  398. IN PIRP Irp,
  399. IN PVOID Context
  400. );
  401. NTSTATUS
  402. CdRomXACompletion(
  403. IN PDEVICE_OBJECT DeviceObject,
  404. IN PIRP Irp,
  405. IN PVOID Context
  406. );
  407. NTSTATUS
  408. CdRomClassIoctlCompletion(
  409. IN PDEVICE_OBJECT DeviceObject,
  410. IN PIRP Irp,
  411. IN PVOID Context
  412. );
  413. VOID
  414. CdRomStartIo(
  415. IN PDEVICE_OBJECT DeviceObject,
  416. IN PIRP Irp
  417. );
  418. VOID
  419. CdRomTickHandler(
  420. IN PDEVICE_OBJECT DeviceObject
  421. );
  422. NTSTATUS
  423. CdRomUpdateCapacity(
  424. IN PFUNCTIONAL_DEVICE_EXTENSION DeviceExtension,
  425. IN PIRP IrpToComplete,
  426. IN OPTIONAL PKEVENT IoctlEvent
  427. );
  428. NTSTATUS
  429. CdRomCreateDeviceObject(
  430. IN PDRIVER_OBJECT DriverObject,
  431. IN PDEVICE_OBJECT Pdo
  432. );
  433. VOID
  434. ScanForSpecialHandler(
  435. PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  436. ULONG_PTR HackFlags
  437. );
  438. VOID
  439. ScanForSpecial(
  440. PDEVICE_OBJECT DeviceObject
  441. );
  442. BOOLEAN
  443. CdRomIsPlayActive(
  444. IN PDEVICE_OBJECT DeviceObject
  445. );
  446. VOID
  447. CdRomErrorHandler(
  448. PDEVICE_OBJECT DeviceObject,
  449. PSCSI_REQUEST_BLOCK Srb,
  450. NTSTATUS *Status,
  451. BOOLEAN *Retry
  452. );
  453. VOID
  454. HitachiProcessErrorGD2000(
  455. PDEVICE_OBJECT DeviceObject,
  456. PSCSI_REQUEST_BLOCK Srb,
  457. NTSTATUS *Status,
  458. BOOLEAN *Retry
  459. );
  460. VOID
  461. HitachiProcessError(
  462. PDEVICE_OBJECT DeviceObject,
  463. PSCSI_REQUEST_BLOCK Srb,
  464. NTSTATUS *Status,
  465. BOOLEAN *Retry
  466. );
  467. VOID
  468. ToshibaProcessError(
  469. PDEVICE_OBJECT DeviceObject,
  470. PSCSI_REQUEST_BLOCK Srb,
  471. NTSTATUS *Status,
  472. BOOLEAN *Retry
  473. );
  474. NTSTATUS
  475. ToshibaProcessErrorCompletion(
  476. PDEVICE_OBJECT DeviceObject,
  477. PIRP Irp,
  478. PVOID Context
  479. );
  480. VOID
  481. CdRomCreateNamedEvent(
  482. IN PFUNCTIONAL_DEVICE_EXTENSION DeviceExtension,
  483. IN ULONG DeviceNumber
  484. );
  485. NTSTATUS
  486. CdRomInitDevice(
  487. IN PDEVICE_OBJECT Fdo
  488. );
  489. NTSTATUS
  490. CdRomStartDevice(
  491. IN PDEVICE_OBJECT Fdo
  492. );
  493. NTSTATUS
  494. CdRomStopDevice(
  495. IN PDEVICE_OBJECT DeviceObject,
  496. IN UCHAR Type
  497. );
  498. NTSTATUS
  499. CdRomRemoveDevice(
  500. IN PDEVICE_OBJECT DeviceObject,
  501. IN UCHAR Type
  502. );
  503. NTSTATUS
  504. CdRomDvdEndAllSessionsCompletion(
  505. IN PDEVICE_OBJECT DeviceObject,
  506. IN PIRP Irp,
  507. IN PVOID Context
  508. );
  509. NTSTATUS
  510. CdRomDvdReadDiskKeyCompletion(
  511. IN PDEVICE_OBJECT DeviceObject,
  512. IN PIRP Irp,
  513. IN PVOID Context
  514. );
  515. DEVICE_TYPE
  516. CdRomGetDeviceType(
  517. IN PDEVICE_OBJECT DeviceObject
  518. );
  519. NTSTATUS
  520. CdRomCreateWellKnownName(
  521. IN PDEVICE_OBJECT DeviceObject
  522. );
  523. VOID
  524. CdRomDeleteWellKnownName(
  525. IN PDEVICE_OBJECT DeviceObject
  526. );
  527. NTSTATUS
  528. CdRomGetDeviceParameter (
  529. IN PDEVICE_OBJECT DeviceObject,
  530. IN PWSTR ParameterName,
  531. IN OUT PULONG ParameterValue
  532. );
  533. NTSTATUS
  534. CdRomSetDeviceParameter (
  535. IN PDEVICE_OBJECT DeviceObject,
  536. IN PWSTR ParameterName,
  537. IN ULONG ParameterValue
  538. );
  539. VOID
  540. CdRomPickDvdRegion (
  541. IN PDEVICE_OBJECT Fdo
  542. );
  543. NTSTATUS
  544. CdRomRetryRequest(
  545. IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  546. IN PIRP Irp,
  547. IN ULONG Delay,
  548. IN BOOLEAN ResendIrp
  549. );
  550. NTSTATUS
  551. CdRomRerunRequest(
  552. IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
  553. IN OPTIONAL PIRP Irp,
  554. IN BOOLEAN ResendIrp
  555. );
  556. NTSTATUS
  557. CdRomGetRpc0Settings(
  558. IN PDEVICE_OBJECT Fdo
  559. );
  560. NTSTATUS
  561. CdRomSetRpc0Settings(
  562. IN PDEVICE_OBJECT Fdo,
  563. IN UCHAR NewRegion
  564. );
  565. NTSTATUS
  566. CdRomShutdownFlush(
  567. IN PDEVICE_OBJECT DeviceObject,
  568. IN PIRP Irp
  569. );
  570. ////////////////////////////////////////////////////////////////////////////////
  571. VOID
  572. CdRomIsDeviceMmcDevice(
  573. IN PDEVICE_OBJECT Fdo,
  574. OUT PBOOLEAN IsMmc
  575. );
  576. NTSTATUS
  577. CdRomMmcErrorHandler(
  578. IN PDEVICE_OBJECT Fdo,
  579. IN PSCSI_REQUEST_BLOCK Srb,
  580. OUT PNTSTATUS Status,
  581. OUT PBOOLEAN Retry
  582. );
  583. PVOID
  584. CdRomFindFeaturePage(
  585. IN PGET_CONFIGURATION_HEADER FeatureBuffer,
  586. IN ULONG Length,
  587. IN FEATURE_NUMBER Feature
  588. );
  589. NTSTATUS
  590. CdRomGetConfiguration(
  591. IN PDEVICE_OBJECT Fdo,
  592. OUT PGET_CONFIGURATION_HEADER *Buffer,
  593. OUT PULONG BytesReturned,
  594. IN FEATURE_NUMBER StartingFeature,
  595. IN ULONG RequestedType
  596. );
  597. VOID
  598. CdRomUpdateMmcDriveCapabilities(
  599. IN PDEVICE_OBJECT Fdo,
  600. IN PVOID Context // RESERVED == NULL
  601. );
  602. VOID
  603. CdRomFindProfileInProfiles(
  604. IN PFEATURE_DATA_PROFILE_LIST ProfileHeader,
  605. IN FEATURE_PROFILE_TYPE ProfileToFind,
  606. OUT PBOOLEAN Exists
  607. );
  608. NTSTATUS
  609. CdRomAllocateMmcResources(
  610. IN PDEVICE_OBJECT Fdo
  611. );
  612. VOID
  613. CdRomDeAllocateMmcResources(
  614. IN PDEVICE_OBJECT Fdo
  615. );
  616. VOID
  617. CdromFakePartitionInfo(
  618. IN PCOMMON_DEVICE_EXTENSION CommonExtension,
  619. IN PIRP Irp
  620. );
  621. VOID
  622. CdRomInterpretReadCapacity(
  623. IN PDEVICE_OBJECT Fdo,
  624. IN PREAD_CAPACITY_DATA ReadCapacityBuffer
  625. );
  626. NTSTATUS
  627. CdRomShutdownFlushCompletion(
  628. IN PDEVICE_OBJECT DeviceObject,
  629. IN PIRP Irp,
  630. IN PVOID Context
  631. );
  632. VOID
  633. CdRompFlushDelayedList(
  634. IN PDEVICE_OBJECT Fdo,
  635. IN PCDROM_MMC_EXTENSION MmcData,
  636. IN NTSTATUS Status,
  637. IN BOOLEAN CalledFromWorkItem
  638. );
  639. #endif // __CDROMP_H__