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.

2058 lines
40 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 1999
  3. Module Name:
  4. parport.sys
  5. File Name:
  6. funcdecl.h
  7. Abstract:
  8. This file contains the parport function declarations for functions
  9. that are called from a translation unit other than the one in
  10. which the function is defined.
  11. --*/
  12. NTSTATUS
  13. P5FdoCreateThread(
  14. PFDO_EXTENSION Fdx
  15. );
  16. NTSTATUS
  17. PptAcquirePortViaIoctl(
  18. IN PDEVICE_OBJECT PortDeviceObject,
  19. IN PLARGE_INTEGER Timeout OPTIONAL
  20. );
  21. VOID
  22. P5SetPhase( PPDO_EXTENSION Pdx, P1284_PHASE Phase );
  23. VOID
  24. P5BSetPhase( PIEEE_STATE IeeeState, P1284_PHASE Phase );
  25. VOID
  26. P5TraceIrpArrival( PDEVICE_OBJECT DevObj, PIRP Irp );
  27. VOID
  28. P5TraceIrpCompletion( PIRP Irp );
  29. // irpQueue.c
  30. VOID
  31. P2InitIrpQueueContext(
  32. IN PIRPQUEUE_CONTEXT IrpQueueContext
  33. );
  34. VOID
  35. P2CancelQueuedIrp(
  36. IN PIRPQUEUE_CONTEXT IrpQueueContext,
  37. IN PIRP Irp
  38. );
  39. NTSTATUS
  40. P2QueueIrp(
  41. IN PIRP Irp,
  42. IN PIRPQUEUE_CONTEXT IrpQueueContext,
  43. IN PDRIVER_CANCEL CancelRoutine
  44. );
  45. PIRP
  46. P2DequeueIrp(
  47. IN PIRPQUEUE_CONTEXT IrpQueueContext,
  48. IN PDRIVER_CANCEL CancelRoutine
  49. );
  50. VOID
  51. P2CancelRoutine(
  52. IN PDEVICE_OBJECT DevObj,
  53. IN PIRP Irp
  54. );
  55. // test.c
  56. //
  57. // ieee1284.c
  58. //
  59. VOID
  60. IeeeTerminate1284Mode(
  61. IN PPDO_EXTENSION Extension
  62. );
  63. NTSTATUS
  64. IeeeEnter1284Mode(
  65. IN PPDO_EXTENSION Extension,
  66. IN UCHAR Extensibility
  67. );
  68. VOID
  69. IeeeDetermineSupportedProtocols(
  70. IN PPDO_EXTENSION Extension
  71. );
  72. NTSTATUS
  73. IeeeNegotiateBestMode(
  74. IN PPDO_EXTENSION Extension,
  75. IN USHORT usReadMask,
  76. IN USHORT usWriteMask
  77. );
  78. NTSTATUS
  79. IeeeNegotiateMode(
  80. IN PPDO_EXTENSION Extension,
  81. IN USHORT usReadMask,
  82. IN USHORT usWriteMask
  83. );
  84. //
  85. // port.c
  86. //
  87. VOID
  88. ParReleasePortInfoToPortDevice(
  89. IN PPDO_EXTENSION Extension
  90. );
  91. VOID
  92. ParFreePort(
  93. IN PPDO_EXTENSION Extension
  94. );
  95. NTSTATUS
  96. ParAllocPortCompletionRoutine(
  97. IN PDEVICE_OBJECT DeviceObject,
  98. IN PIRP Irp,
  99. IN PVOID Context
  100. );
  101. BOOLEAN
  102. ParAllocPort(
  103. IN PPDO_EXTENSION Extension
  104. );
  105. NTSTATUS
  106. PptWmiQueryWmiRegInfo(
  107. IN PDEVICE_OBJECT PDevObj,
  108. OUT PULONG PRegFlags,
  109. OUT PUNICODE_STRING PInstanceName,
  110. OUT PUNICODE_STRING *PRegistryPath,
  111. OUT PUNICODE_STRING MofResourceName,
  112. OUT PDEVICE_OBJECT *Pdo
  113. );
  114. NTSTATUS
  115. PptWmiQueryWmiDataBlock(
  116. IN PDEVICE_OBJECT DeviceObject,
  117. IN PIRP Irp,
  118. IN ULONG GuidIndex,
  119. IN ULONG InstanceIndex,
  120. IN ULONG InstanceCount,
  121. IN OUT PULONG InstanceLengthArray,
  122. IN ULONG OutBufferSize,
  123. OUT PUCHAR Buffer
  124. );
  125. NTSTATUS
  126. ParGetPortInfoFromPortDevice(
  127. IN OUT PPDO_EXTENSION Extension
  128. );
  129. VOID
  130. ParReleasePortInfoToPortDevice(
  131. IN PPDO_EXTENSION Extension
  132. );
  133. VOID
  134. ParFreePort(
  135. IN PPDO_EXTENSION Extension
  136. );
  137. NTSTATUS
  138. ParAllocPortCompletionRoutine(
  139. IN PDEVICE_OBJECT DeviceObject,
  140. IN PIRP Irp,
  141. IN PVOID Context
  142. );
  143. BOOLEAN
  144. ParAllocPort(
  145. IN PPDO_EXTENSION Extension
  146. );
  147. VOID
  148. TstReadDeviceId( PFDO_EXTENSION Ext );
  149. NTSTATUS
  150. P4IeeeEnter1284Mode(
  151. IN PUCHAR Controller,
  152. IN UCHAR Extensibility,
  153. IN OUT PIEEE_STATE State
  154. );
  155. VOID
  156. P4IeeeTerminate1284Mode(
  157. IN PUCHAR Controller,
  158. IN OUT PIEEE_STATE IeeeState,
  159. IN enum XFlagOnEvent24 XFlagOnEvent24
  160. );
  161. NTSTATUS
  162. P4NibbleModeRead(
  163. IN PUCHAR Controller,
  164. IN PVOID Buffer,
  165. IN ULONG BufferSize,
  166. OUT PULONG BytesTransferred,
  167. IN OUT PIEEE_STATE IeeeState
  168. );
  169. VOID
  170. P4MakeClassNameFromPortLptName(
  171. IN PWSTR LptName,
  172. IN OUT PUNICODE_STRING ParallelName
  173. );
  174. VOID
  175. ParMakeClassNameFromNumber(
  176. IN ULONG Number,
  177. OUT PUNICODE_STRING ClassName
  178. );
  179. //
  180. NTSTATUS
  181. PptFdoUnhandledRequest( PDEVICE_OBJECT DevObj, PIRP Irp );
  182. NTSTATUS
  183. PptPdoUnhandledRequest( PDEVICE_OBJECT DevObj, PIRP Irp );
  184. NTSTATUS
  185. PptDispatchPnp( PDEVICE_OBJECT DevObj, PIRP Irp );
  186. NTSTATUS
  187. PptDispatchPower( PDEVICE_OBJECT DevObj, PIRP Irp );
  188. NTSTATUS
  189. PptDispatchCreate( PDEVICE_OBJECT DevObj, PIRP Irp );
  190. NTSTATUS
  191. PptDispatchClose( PDEVICE_OBJECT DevObj, PIRP Irp );
  192. NTSTATUS
  193. PptDispatchCleanup( PDEVICE_OBJECT DevObj, PIRP Irp );
  194. NTSTATUS
  195. PptDispatchRead( PDEVICE_OBJECT DevObj, PIRP Irp );
  196. NTSTATUS
  197. PptDispatchWrite( PDEVICE_OBJECT DevObj, PIRP Irp );
  198. NTSTATUS
  199. PptDispatchDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  200. NTSTATUS
  201. PptDispatchInternalDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  202. NTSTATUS
  203. PptDispatchQueryInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  204. NTSTATUS
  205. PptDispatchSetInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  206. NTSTATUS
  207. PptDispatchSystemControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  208. NTSTATUS
  209. PptFdoPnp( PDEVICE_OBJECT DevObj, PIRP Irp );
  210. NTSTATUS
  211. PptFdoPower( PDEVICE_OBJECT DevObj, PIRP Irp );
  212. NTSTATUS
  213. PptFdoCreateOpen( PDEVICE_OBJECT DevObj, PIRP Irp );
  214. NTSTATUS
  215. PptFdoClose( PDEVICE_OBJECT DevObj, PIRP Irp );
  216. NTSTATUS
  217. PptFdoCleanup( PDEVICE_OBJECT DevObj, PIRP Irp );
  218. NTSTATUS
  219. PptFdoRead( PDEVICE_OBJECT DevObj, PIRP Irp );
  220. NTSTATUS
  221. PptFdoWrite( PDEVICE_OBJECT DevObj, PIRP Irp );
  222. NTSTATUS
  223. PptFdoDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  224. NTSTATUS
  225. PptFdoInternalDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  226. NTSTATUS
  227. PptFdoQueryInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  228. NTSTATUS
  229. PptFdoSetInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  230. NTSTATUS
  231. PptFdoSystemControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  232. NTSTATUS
  233. PptPdoPnp( PDEVICE_OBJECT DevObj, PIRP Irp );
  234. NTSTATUS
  235. PptPdoPower( PDEVICE_OBJECT DevObj, PIRP Irp );
  236. NTSTATUS
  237. PptPdoCreate( PDEVICE_OBJECT DevObj, PIRP Irp );
  238. NTSTATUS
  239. PptPdoClose( PDEVICE_OBJECT DevObj, PIRP Irp );
  240. NTSTATUS
  241. PptPdoCleanup( PDEVICE_OBJECT DevObj, PIRP Irp );
  242. NTSTATUS
  243. PptPdoRead( PDEVICE_OBJECT DevObj, PIRP Irp );
  244. NTSTATUS
  245. PptPdoWrite( PDEVICE_OBJECT DevObj, PIRP Irp );
  246. NTSTATUS
  247. PptPdoDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  248. NTSTATUS
  249. PptPdoInternalDeviceControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  250. NTSTATUS
  251. PptPdoQueryInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  252. NTSTATUS
  253. PptPdoSetInformation( PDEVICE_OBJECT DevObj, PIRP Irp );
  254. NTSTATUS
  255. PptPdoSystemControl( PDEVICE_OBJECT DevObj, PIRP Irp );
  256. NTSTATUS
  257. PptWmiInitWmi(PDEVICE_OBJECT DeviceObject);
  258. NTSTATUS
  259. PptDispatchSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
  260. //
  261. // pnp.c - dvdf
  262. //
  263. VOID
  264. PptPnpInitDispatchFunctionTable(
  265. VOID
  266. );
  267. NTSTATUS
  268. P5AddDevice(
  269. IN PDRIVER_OBJECT pDriverObject,
  270. IN PDEVICE_OBJECT pPhysicalDeviceObject
  271. );
  272. NTSTATUS
  273. PptDispatchPnp (
  274. IN PDEVICE_OBJECT DeviceObject,
  275. IN PIRP Irp
  276. );
  277. //
  278. //
  279. //
  280. NTSTATUS
  281. PptFailRequest(
  282. IN PIRP Irp,
  283. IN NTSTATUS Status
  284. );
  285. NTSTATUS
  286. PptDispatchPreProcessIrp(
  287. IN PDEVICE_OBJECT DeviceObject,
  288. IN PIRP Irp
  289. );
  290. NTSTATUS
  291. PptDispatchPostProcessIrp();
  292. //
  293. // initunld.c
  294. //
  295. NTSTATUS
  296. DriverEntry(
  297. IN PDRIVER_OBJECT DriverObject,
  298. IN PUNICODE_STRING RegistryPath
  299. );
  300. VOID
  301. PptUnload(
  302. IN PDRIVER_OBJECT DriverObject
  303. );
  304. //
  305. // parport.c
  306. //
  307. NTSTATUS
  308. PptSystemControl (
  309. IN PDEVICE_OBJECT pDeviceObject,
  310. IN PIRP pIrp
  311. );
  312. NTSTATUS
  313. PptSynchCompletionRoutine(
  314. IN PDEVICE_OBJECT DeviceObject,
  315. IN PIRP Irp,
  316. IN PKEVENT Event
  317. );
  318. VOID
  319. PptLogError(
  320. IN PDRIVER_OBJECT DriverObject,
  321. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  322. IN PHYSICAL_ADDRESS P1,
  323. IN PHYSICAL_ADDRESS P2,
  324. IN ULONG SequenceNumber,
  325. IN UCHAR MajorFunctionCode,
  326. IN UCHAR RetryCount,
  327. IN ULONG UniqueErrorValue,
  328. IN NTSTATUS FinalStatus,
  329. IN NTSTATUS SpecificIOStatus
  330. );
  331. NTSTATUS
  332. PptConnectInterrupt(
  333. IN PFDO_EXTENSION Extension
  334. );
  335. VOID
  336. PptDisconnectInterrupt(
  337. IN PFDO_EXTENSION Extension
  338. );
  339. NTSTATUS
  340. PptDispatchCreateOpen(
  341. IN PDEVICE_OBJECT DeviceObject,
  342. IN PIRP Irp
  343. );
  344. NTSTATUS
  345. PptDispatchClose(
  346. IN PDEVICE_OBJECT DeviceObject,
  347. IN PIRP Irp
  348. );
  349. BOOLEAN
  350. PptSynchronizedIncrement(
  351. IN OUT PVOID SyncContext
  352. );
  353. BOOLEAN
  354. PptSynchronizedDecrement(
  355. IN OUT PVOID SyncContext
  356. );
  357. BOOLEAN
  358. PptSynchronizedRead(
  359. IN OUT PVOID SyncContext
  360. );
  361. BOOLEAN
  362. PptSynchronizedQueue(
  363. IN PVOID Context
  364. );
  365. BOOLEAN
  366. PptSynchronizedDisconnect(
  367. IN PVOID Context
  368. );
  369. VOID
  370. PptCancelRoutine(
  371. IN OUT PDEVICE_OBJECT DeviceObject,
  372. IN OUT PIRP Irp
  373. );
  374. VOID
  375. PptFreePortDpc(
  376. IN PKDPC Dpc,
  377. IN OUT PVOID Extension,
  378. IN PVOID SystemArgument1,
  379. IN PVOID SystemArgument2
  380. );
  381. BOOLEAN
  382. PptTryAllocatePortAtInterruptLevel(
  383. IN PVOID Context
  384. );
  385. VOID
  386. PptFreePortFromInterruptLevel(
  387. IN PVOID Context
  388. );
  389. BOOLEAN
  390. PptInterruptService(
  391. IN PKINTERRUPT Interrupt,
  392. IN PVOID Extension
  393. );
  394. BOOLEAN
  395. PptTryAllocatePort(
  396. IN PVOID Extension
  397. );
  398. BOOLEAN
  399. PptTraversePortCheckList(
  400. IN PVOID Extension
  401. );
  402. VOID
  403. PptFreePort(
  404. IN PVOID Extension
  405. );
  406. ULONG
  407. PptQueryNumWaiters(
  408. IN PVOID Extension
  409. );
  410. NTSTATUS
  411. PptDispatchInternalDeviceControl(
  412. IN PDEVICE_OBJECT DeviceObject,
  413. IN PIRP Irp
  414. );
  415. VOID
  416. PptCleanupDevice(
  417. IN PFDO_EXTENSION Extension
  418. );
  419. NTSTATUS
  420. PptDispatchCleanup(
  421. IN PDEVICE_OBJECT DeviceObject,
  422. IN PIRP Irp
  423. );
  424. BOOLEAN
  425. PptIsNecR98Machine(
  426. void
  427. );
  428. VOID
  429. PowerStateCallback(
  430. IN PVOID CallbackContext,
  431. IN PVOID Argument1,
  432. IN PVOID Argument2
  433. );
  434. NTSTATUS
  435. PptDispatchPower (
  436. IN PDEVICE_OBJECT pDeviceObject,
  437. IN PIRP pIrp
  438. );
  439. VOID
  440. PptRegInitDriverSettings(
  441. PUNICODE_STRING RegistryPath
  442. );
  443. PWSTR
  444. PptGetPortNameFromPhysicalDeviceObject(
  445. PDEVICE_OBJECT PhysicalDeviceObject
  446. );
  447. PVOID
  448. PptSetCancelRoutine(
  449. IN PIRP Irp,
  450. IN PDRIVER_CANCEL CancelRoutine
  451. );
  452. NTSTATUS
  453. PptAcquireRemoveLockOrFailIrp(
  454. IN PDEVICE_OBJECT DeviceObject,
  455. PIRP Irp
  456. );
  457. //
  458. // debug.c
  459. //
  460. UCHAR
  461. P5ReadPortUchar( PUCHAR Port );
  462. VOID
  463. P5ReadPortBufferUchar( PUCHAR Port, PUCHAR Buffer, ULONG Count );
  464. VOID
  465. P5WritePortUchar( PUCHAR Port, UCHAR Value );
  466. VOID
  467. P5WritePortBufferUchar( PUCHAR Port, PUCHAR Buffer, ULONG Count );
  468. VOID
  469. PptFdoDumpPnpIrpInfo(
  470. IN PDEVICE_OBJECT Fdo,
  471. IN PIRP Irp
  472. );
  473. VOID
  474. PptPdoDumpPnpIrpInfo(
  475. IN PDEVICE_OBJECT Pdo,
  476. IN PIRP Irp
  477. );
  478. NTSTATUS
  479. PptAcquireRemoveLock(
  480. IN PIO_REMOVE_LOCK RemoveLock,
  481. IN PVOID Tag OPTIONAL
  482. );
  483. VOID
  484. PptReleaseRemoveLock(
  485. IN PIO_REMOVE_LOCK RemoveLock,
  486. IN PVOID Tag OPTIONAL
  487. );
  488. VOID
  489. PptReleaseRemoveLockAndWait(
  490. IN PIO_REMOVE_LOCK RemoveLock,
  491. IN PVOID Tag
  492. );
  493. VOID
  494. PptDebugDumpResourceList(
  495. PIO_RESOURCE_LIST ResourceList
  496. );
  497. VOID
  498. PptDebugDumpResourceRequirementsList(
  499. PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList
  500. );
  501. //
  502. //
  503. //
  504. VOID
  505. PptLogError(
  506. IN PDRIVER_OBJECT DriverObject,
  507. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  508. IN PHYSICAL_ADDRESS P1,
  509. IN PHYSICAL_ADDRESS P2,
  510. IN ULONG SequenceNumber,
  511. IN UCHAR MajorFunctionCode,
  512. IN UCHAR RetryCount,
  513. IN ULONG UniqueErrorValue,
  514. IN NTSTATUS FinalStatus,
  515. IN NTSTATUS SpecificIOStatus
  516. );
  517. VOID
  518. PptReportResourcesDevice(
  519. IN PFDO_EXTENSION Extension,
  520. IN BOOLEAN ClaimInterrupt,
  521. OUT PBOOLEAN ConflictDetected
  522. );
  523. VOID
  524. PptUnReportResourcesDevice(
  525. IN OUT PFDO_EXTENSION Extension
  526. );
  527. NTSTATUS
  528. PptConnectInterrupt(
  529. IN PFDO_EXTENSION Extension
  530. );
  531. VOID
  532. PptDisconnectInterrupt(
  533. IN PFDO_EXTENSION Extension
  534. );
  535. NTSTATUS
  536. PptDispatchCreateClose(
  537. IN PDEVICE_OBJECT DeviceObject,
  538. IN PIRP Irp
  539. );
  540. BOOLEAN
  541. PptSynchronizedIncrement(
  542. IN OUT PVOID SyncContext
  543. );
  544. BOOLEAN
  545. PptSynchronizedDecrement(
  546. IN OUT PVOID SyncContext
  547. );
  548. BOOLEAN
  549. PptSynchronizedRead(
  550. IN OUT PVOID SyncContext
  551. );
  552. BOOLEAN
  553. PptSynchronizedQueue(
  554. IN PVOID Context
  555. );
  556. BOOLEAN
  557. PptSynchronizedDisconnect(
  558. IN PVOID Context
  559. );
  560. VOID
  561. PptCancelRoutine(
  562. IN OUT PDEVICE_OBJECT DeviceObject,
  563. IN OUT PIRP Irp
  564. );
  565. VOID
  566. PptFreePortDpc(
  567. IN PKDPC Dpc,
  568. IN OUT PVOID Extension,
  569. IN PVOID SystemArgument1,
  570. IN PVOID SystemArgument2
  571. );
  572. BOOLEAN
  573. PptTryAllocatePortAtInterruptLevel(
  574. IN PVOID Context
  575. );
  576. VOID
  577. PptFreePortFromInterruptLevel(
  578. IN PVOID Context
  579. );
  580. BOOLEAN
  581. PptInterruptService(
  582. IN PKINTERRUPT Interrupt,
  583. IN PVOID Extension
  584. );
  585. BOOLEAN
  586. PptTryAllocatePort(
  587. IN PVOID Extension
  588. );
  589. BOOLEAN
  590. PptTraversePortCheckList(
  591. IN PVOID Extension
  592. );
  593. VOID
  594. PptFreePort(
  595. IN PVOID Extension
  596. );
  597. ULONG
  598. PptQueryNumWaiters(
  599. IN PVOID Extension
  600. );
  601. NTSTATUS
  602. PptDispatchDeviceControl(
  603. IN PDEVICE_OBJECT DeviceObject,
  604. IN PIRP Irp
  605. );
  606. VOID
  607. PptCleanupDevice(
  608. IN PFDO_EXTENSION Extension
  609. );
  610. NTSTATUS
  611. PptDispatchCleanup(
  612. IN PDEVICE_OBJECT DeviceObject,
  613. IN PIRP Irp
  614. );
  615. VOID
  616. PptUnload(
  617. IN PDRIVER_OBJECT DriverObject
  618. );
  619. BOOLEAN
  620. PptIsNecR98Machine(
  621. void
  622. );
  623. //
  624. // parmode.c
  625. //
  626. NTSTATUS
  627. PptDetectChipFilter(
  628. IN PFDO_EXTENSION Extension
  629. );
  630. NTSTATUS
  631. PptDetectPortType(
  632. IN PFDO_EXTENSION Extension
  633. );
  634. NTSTATUS
  635. PptSetChipMode (
  636. IN PFDO_EXTENSION Extension,
  637. IN UCHAR ChipMode
  638. );
  639. NTSTATUS
  640. PptClearChipMode (
  641. IN PFDO_EXTENSION Extension,
  642. IN UCHAR ChipMode
  643. );
  644. //
  645. // par12843.c
  646. //
  647. ULONG
  648. PptInitiate1284_3(
  649. IN PVOID Extension
  650. );
  651. NTSTATUS
  652. PptTrySelectDevice(
  653. IN PVOID Context,
  654. IN PVOID TrySelectCommand
  655. );
  656. NTSTATUS
  657. PptDeselectDevice(
  658. IN PVOID Context,
  659. IN PVOID DeselectCommand
  660. );
  661. ULONG
  662. Ppt1284_3AssignAddress(
  663. IN PFDO_EXTENSION DeviceExtension
  664. );
  665. BOOLEAN
  666. PptSend1284_3Command(
  667. IN PUCHAR CurrentPort,
  668. IN UCHAR Command
  669. );
  670. //
  671. // Ppt RemoveLock function declarations
  672. //
  673. NTSTATUS
  674. PptAcquireRemoveLock(
  675. IN PIO_REMOVE_LOCK RemoveLock,
  676. IN PVOID Tag OPTIONAL
  677. );
  678. VOID
  679. PptReleaseRemoveLock(
  680. IN PIO_REMOVE_LOCK RemoveLock,
  681. IN PVOID Tag OPTIONAL
  682. );
  683. VOID
  684. PptReleaseRemoveLockAndWait(
  685. IN PIO_REMOVE_LOCK RemoveLock,
  686. IN PVOID Tag
  687. );
  688. //
  689. // power management function declarations
  690. //
  691. NTSTATUS
  692. PptPowerDispatch (
  693. IN PDEVICE_OBJECT pDeviceObject,
  694. IN PIRP pIrp
  695. );
  696. //
  697. // other function declarations
  698. //
  699. PWSTR
  700. PptGetPortNameFromPhysicalDeviceObject(
  701. PDEVICE_OBJECT PhysicalDeviceObject
  702. );
  703. NTSTATUS
  704. PptSynchCompletionRoutine(
  705. IN PDEVICE_OBJECT DeviceObject,
  706. IN PIRP Irp,
  707. IN PKEVENT Event
  708. );
  709. NTSTATUS
  710. PptTrySelectLegacyZip(
  711. IN PVOID Context,
  712. IN PVOID TrySelectCommand
  713. );
  714. NTSTATUS
  715. PptDeselectLegacyZip(
  716. IN PVOID Context,
  717. IN PVOID DeselectCommand
  718. );
  719. NTSTATUS
  720. PptRegGetDeviceParameterDword(
  721. IN PDEVICE_OBJECT Pdo,
  722. IN PWSTR ParameterName,
  723. IN OUT PULONG ParameterValue
  724. );
  725. NTSTATUS
  726. PptRegSetDeviceParameterDword(
  727. IN PDEVICE_OBJECT Pdo,
  728. IN PWSTR ParameterName,
  729. IN PULONG ParameterValue
  730. );
  731. NTSTATUS
  732. PptBuildParallelPortDeviceName(
  733. IN ULONG Number,
  734. OUT PUNICODE_STRING DeviceName
  735. );
  736. NTSTATUS
  737. PptInitializeDeviceExtension(
  738. IN PDRIVER_OBJECT pDriverObject,
  739. IN PDEVICE_OBJECT pPhysicalDeviceObject,
  740. IN PDEVICE_OBJECT pDeviceObject,
  741. IN PUNICODE_STRING uniNameString,
  742. IN PWSTR portName,
  743. IN ULONG portNumber
  744. );
  745. NTSTATUS
  746. PptGetPortNumberFromLptName(
  747. IN PWSTR PortName,
  748. OUT PULONG PortNumber
  749. );
  750. PDEVICE_OBJECT
  751. PptBuildFdo(
  752. IN PDRIVER_OBJECT pDriverObject,
  753. IN PDEVICE_OBJECT pPhysicalDeviceObject
  754. );
  755. VOID
  756. PptDetectEppPort(
  757. IN PFDO_EXTENSION Extension
  758. );
  759. // orig pnp.h follows
  760. NTSTATUS
  761. PptPnpFilterResourceRequirements(
  762. IN PDEVICE_OBJECT DeviceObject,
  763. IN PIRP Irp
  764. );
  765. NTSTATUS
  766. PptPnpQueryDeviceRelations(
  767. IN PDEVICE_OBJECT DeviceObject,
  768. IN PIRP Irp
  769. );
  770. NTSTATUS
  771. PptPnpQueryStopDevice(
  772. IN PDEVICE_OBJECT DeviceObject,
  773. IN PIRP Irp
  774. );
  775. NTSTATUS
  776. PptPnpCancelStopDevice(
  777. IN PDEVICE_OBJECT DeviceObject,
  778. IN PIRP Irp
  779. );
  780. NTSTATUS
  781. PptPnpStopDevice(
  782. IN PDEVICE_OBJECT DeviceObject,
  783. IN PIRP Irp
  784. );
  785. NTSTATUS
  786. PptPnpQueryRemoveDevice(
  787. IN PDEVICE_OBJECT DeviceObject,
  788. IN PIRP Irp
  789. );
  790. NTSTATUS
  791. PptPnpCancelRemoveDevice(
  792. IN PDEVICE_OBJECT DeviceObject,
  793. IN PIRP Irp
  794. );
  795. NTSTATUS
  796. PptPnpRemoveDevice(
  797. IN PDEVICE_OBJECT DeviceObject,
  798. IN PIRP Irp
  799. );
  800. NTSTATUS
  801. PptPnpSurpriseRemoval(
  802. IN PDEVICE_OBJECT DeviceObject,
  803. IN PIRP Irp
  804. );
  805. NTSTATUS
  806. PptPnpUnhandledIrp(
  807. IN PDEVICE_OBJECT DeviceObject,
  808. IN PIRP Irp
  809. );
  810. NTSTATUS
  811. PptPnpStartDevice(
  812. IN PDEVICE_OBJECT DeviceObject,
  813. IN PIRP Irp
  814. );
  815. NTSTATUS
  816. PptPnpStartValidateResources(
  817. IN PDEVICE_OBJECT DeviceObject,
  818. IN BOOLEAN FoundPort,
  819. IN BOOLEAN FoundIrq,
  820. IN BOOLEAN FoundDma
  821. );
  822. NTSTATUS
  823. PptPnpStartScanCmResourceList(
  824. IN PFDO_EXTENSION Extension,
  825. IN PIRP Irp,
  826. OUT PBOOLEAN FoundPort,
  827. OUT PBOOLEAN FoundIrq,
  828. OUT PBOOLEAN FoundDma
  829. );
  830. NTSTATUS
  831. PptPnpPassThroughPnpIrpAndReleaseRemoveLock(
  832. IN PFDO_EXTENSION Extension,
  833. IN PIRP Irp
  834. );
  835. NTSTATUS
  836. PptPnpRemoveDevice(
  837. IN PDEVICE_OBJECT DeviceObject,
  838. IN PIRP Irp
  839. );
  840. VOID
  841. PptPnpFilterNukeIrqResourceDescriptors(
  842. IN OUT PIO_RESOURCE_LIST IoResourceList
  843. );
  844. VOID
  845. PptPnpFilterNukeIrqResourceDescriptorsFromAllLists(
  846. IN OUT PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList
  847. );
  848. BOOLEAN
  849. PptPnpFilterExistsNonIrqResourceList(
  850. IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList
  851. );
  852. PVOID
  853. PptPnpFilterGetEndOfResourceRequirementsList(
  854. IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList
  855. );
  856. BOOLEAN
  857. PptPnpListContainsIrqResourceDescriptor(
  858. IN PIO_RESOURCE_LIST List
  859. );
  860. VOID
  861. PptPnpFilterRemoveIrqResourceLists(
  862. PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList
  863. );
  864. NTSTATUS
  865. PptPnpBounceAndCatchPnpIrp(
  866. IN PFDO_EXTENSION Extension,
  867. IN PIRP Irp
  868. );
  869. PWSTR
  870. P4MakePdoSymLinkName(
  871. IN PWSTR LptName,
  872. IN enum _PdoType PdoType,
  873. IN UCHAR DaisyChainId, // ignored unless PdoType == PdoTypeDaisyChain
  874. IN UCHAR RetryNumber
  875. );
  876. PWSTR
  877. P4MakePdoDeviceName(
  878. IN PWSTR LptName,
  879. IN enum _PdoType PdoType,
  880. IN UCHAR DaisyChainId, // ignored unless PdoType == PdoTypeDaisyChain
  881. IN UCHAR RetryNumber // used if we had a name collision on IoCreateDevice
  882. );
  883. PDEVICE_OBJECT
  884. P4CreatePdo(
  885. IN PDEVICE_OBJECT Fdo,
  886. IN enum _PdoType PdoType,
  887. IN UCHAR DaisyChainId, // ignored unless PdoType == PdoTypeDaisyChain
  888. IN PCHAR Ieee1284Id // NULL if device does not report IEEE 1284 Device ID
  889. );
  890. VOID
  891. P4DestroyPdo(
  892. IN PDEVICE_OBJECT Pdo
  893. );
  894. NTSTATUS
  895. PptFindNatChip(
  896. IN PFDO_EXTENSION Extension
  897. );
  898. NTSTATUS
  899. PptBuildResourceList(
  900. IN PFDO_EXTENSION Extension,
  901. IN ULONG Partial,
  902. IN PUCHAR *Addresses,
  903. OUT PCM_RESOURCE_LIST Resources
  904. );
  905. // parmode.h
  906. NTSTATUS
  907. PptDetectChipFilter(
  908. IN PFDO_EXTENSION Extension
  909. );
  910. NTSTATUS
  911. PptDetectPortType(
  912. IN PFDO_EXTENSION Extension
  913. );
  914. NTSTATUS
  915. PptDetectPortCapabilities(
  916. IN PFDO_EXTENSION Extension
  917. );
  918. VOID
  919. PptDetectEcpPort(
  920. IN PFDO_EXTENSION Extension
  921. );
  922. VOID
  923. PptDetectEppPortIfDot3DevicePresent(
  924. IN PFDO_EXTENSION Extension
  925. );
  926. VOID
  927. PptDetectEppPortIfUserRequested(
  928. IN PFDO_EXTENSION Extension
  929. );
  930. VOID
  931. PptDetectBytePort(
  932. IN PFDO_EXTENSION Extension
  933. );
  934. VOID
  935. PptDetermineFifoDepth(
  936. IN PFDO_EXTENSION Extension
  937. );
  938. VOID
  939. PptDetermineFifoWidth(
  940. IN PFDO_EXTENSION Extension
  941. );
  942. NTSTATUS
  943. PptSetChipMode (
  944. IN PFDO_EXTENSION Extension,
  945. IN UCHAR ChipMode
  946. );
  947. NTSTATUS
  948. PptClearChipMode (
  949. IN PFDO_EXTENSION Extension,
  950. IN UCHAR ChipMode
  951. );
  952. NTSTATUS
  953. PptEcrSetMode(
  954. IN PFDO_EXTENSION Extension,
  955. IN UCHAR ChipMode
  956. );
  957. NTSTATUS
  958. PptCheckBidiMode(
  959. IN PFDO_EXTENSION Extension
  960. );
  961. NTSTATUS
  962. PptEcrClearMode(
  963. IN PFDO_EXTENSION Extension
  964. );
  965. NTSTATUS
  966. PptSetByteMode(
  967. IN PFDO_EXTENSION Extension,
  968. IN UCHAR ChipMode
  969. );
  970. NTSTATUS
  971. PptClearByteMode(
  972. IN PFDO_EXTENSION Extension
  973. );
  974. NTSTATUS
  975. PptCheckByteMode(
  976. IN PFDO_EXTENSION Extension
  977. );
  978. NTSTATUS
  979. P4CompleteRequest(
  980. IN PIRP Irp,
  981. IN NTSTATUS Status,
  982. IN ULONG_PTR Information
  983. );
  984. NTSTATUS
  985. P4CompleteRequestReleaseRemLock(
  986. IN PIRP Irp,
  987. IN NTSTATUS Status,
  988. IN ULONG_PTR Information,
  989. IN PIO_REMOVE_LOCK RemLock
  990. );
  991. VOID
  992. P4SanitizeId(
  993. IN OUT PWSTR DeviceId
  994. );
  995. VOID
  996. P4AcquireBus( IN PDEVICE_OBJECT Fdo ); // this call will block until bus can be acquired
  997. VOID
  998. P4ReleaseBus( PDEVICE_OBJECT Fdo );
  999. PCHAR
  1000. P4ReadRawIeee1284DeviceId(
  1001. IN PUCHAR Controller
  1002. );
  1003. VOID
  1004. P4WritePortNameToDevNode( PDEVICE_OBJECT Pdo, PCHAR Location );
  1005. NTSTATUS
  1006. PptPdoCreateOpen(
  1007. IN PDEVICE_OBJECT Pdo,
  1008. IN PIRP Irp
  1009. );
  1010. NTSTATUS PptFdoHandleBusRelations( IN PDEVICE_OBJECT Fdo, IN PIRP Irp );
  1011. NTSTATUS PptPnpStartScanPciCardCmResourceList( PFDO_EXTENSION Extension, PIRP Irp, PBOOLEAN FoundPort, PBOOLEAN FoundIrq, PBOOLEAN FoundDma );
  1012. BOOLEAN PptIsPci( PFDO_EXTENSION Extension, PIRP Irp );
  1013. NTSTATUS PptPnpStartScanCmResourceList( PFDO_EXTENSION Extension, PIRP Irp, PBOOLEAN FoundPort, PBOOLEAN FoundIrq, PBOOLEAN FoundDma );
  1014. NTSTATUS PptPnpStartValidateResources( PDEVICE_OBJECT DeviceObject, IN BOOLEAN FoundPort, IN BOOLEAN FoundIrq, IN BOOLEAN FoundDma );
  1015. BOOLEAN PptPnpFilterExistsNonIrqResourceList( IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList );
  1016. VOID PptPnpFilterRemoveIrqResourceLists( PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList );
  1017. PVOID PptPnpFilterGetEndOfResourceRequirementsList( IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList );
  1018. VOID PptPnpFilterNukeIrqResourceDescriptorsFromAllLists( PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList );
  1019. VOID PptPnpFilterNukeIrqResourceDescriptors( PIO_RESOURCE_LIST IoResourceList );
  1020. BOOLEAN PptPnpListContainsIrqResourceDescriptor( IN PIO_RESOURCE_LIST List );
  1021. NTSTATUS PptPnpBounceAndCatchPnpIrp( PFDO_EXTENSION Extension, PIRP Irp );
  1022. NTSTATUS PptPnpPassThroughPnpIrpAndReleaseRemoveLock( IN PFDO_EXTENSION Extension, IN PIRP Irp );
  1023. VOID PptPdoGetPortInfoFromFdo( PDEVICE_OBJECT Pdo );
  1024. NTSTATUS
  1025. ParForwardToReverse(
  1026. IN PPDO_EXTENSION Extension
  1027. );
  1028. BOOLEAN
  1029. ParHaveReadData(
  1030. IN PPDO_EXTENSION Extension
  1031. );
  1032. NTSTATUS
  1033. ParPing(
  1034. IN PPDO_EXTENSION Extension
  1035. );
  1036. NTSTATUS
  1037. ParReverseToForward(
  1038. IN PPDO_EXTENSION Extension
  1039. );
  1040. NTSTATUS
  1041. ParRead(
  1042. IN PPDO_EXTENSION Extension,
  1043. OUT PVOID Buffer,
  1044. IN ULONG NumBytesToRead,
  1045. OUT PULONG NumBytesRead
  1046. );
  1047. VOID
  1048. ParReadIrp(
  1049. IN PPDO_EXTENSION Extension
  1050. );
  1051. NTSTATUS
  1052. ParSetFwdAddress(
  1053. IN PPDO_EXTENSION Extension
  1054. );
  1055. VOID
  1056. ParTerminate(
  1057. IN PPDO_EXTENSION Extension
  1058. );
  1059. NTSTATUS
  1060. ParWrite(
  1061. IN PPDO_EXTENSION Extension,
  1062. OUT PVOID Buffer,
  1063. IN ULONG NumBytesToWrite,
  1064. OUT PULONG NumBytesWritten
  1065. );
  1066. VOID
  1067. ParWriteIrp(
  1068. IN PPDO_EXTENSION Extension
  1069. );
  1070. NTSTATUS
  1071. ParWmiPdoQueryWmiDataBlock(
  1072. IN PDEVICE_OBJECT DeviceObject,
  1073. IN PIRP Irp,
  1074. IN ULONG GuidIndex,
  1075. IN ULONG InstanceIndex,
  1076. IN ULONG InstanceCount,
  1077. IN OUT PULONG InstanceLengthArray,
  1078. IN ULONG OutBufferSize,
  1079. OUT PUCHAR Buffer
  1080. );
  1081. NTSTATUS
  1082. ParWmiPdoQueryWmiRegInfo(
  1083. IN PDEVICE_OBJECT PDevObj,
  1084. OUT PULONG PRegFlags,
  1085. OUT PUNICODE_STRING PInstanceName,
  1086. OUT PUNICODE_STRING *PRegistryPath,
  1087. OUT PUNICODE_STRING MofResourceName,
  1088. OUT PDEVICE_OBJECT *Pdo
  1089. );
  1090. NTSTATUS
  1091. ParEcpEnterReversePhase(
  1092. IN PPDO_EXTENSION Extension
  1093. );
  1094. NTSTATUS
  1095. ParEcpExitReversePhase(
  1096. IN PPDO_EXTENSION Extension
  1097. );
  1098. NTSTATUS
  1099. ParEcpSetupPhase(
  1100. IN PPDO_EXTENSION Extension
  1101. );
  1102. VOID
  1103. ParCleanupHwEcpPort(
  1104. IN PPDO_EXTENSION Extension
  1105. );
  1106. NTSTATUS
  1107. ParEcpHwEmptyFIFO(
  1108. IN PPDO_EXTENSION Extension
  1109. );
  1110. NTSTATUS
  1111. ParEcpHwHostRecoveryPhase(
  1112. IN PPDO_EXTENSION Extension
  1113. );
  1114. NTSTATUS
  1115. ParEcpHwRecoverPort(
  1116. IN PPDO_EXTENSION Extension,
  1117. UCHAR bRecoverCode
  1118. );
  1119. NTSTATUS
  1120. ParEcpHwWaitForEmptyFIFO(
  1121. IN PPDO_EXTENSION Extension
  1122. );
  1123. //+-------------------------------------------------------------------------
  1124. //
  1125. // Microsoft Windows
  1126. //
  1127. // Copyright (C) Microsoft Corporation, 1998 - 1999
  1128. //
  1129. // File: pcfuncdecl.h
  1130. //
  1131. //--------------------------------------------------------------------------
  1132. //
  1133. // Function declarations for the ParClass (parallel.sys) driver
  1134. //
  1135. VOID
  1136. ParDumpDevExtTable();
  1137. NTSTATUS
  1138. ParWMIRegistrationControl(
  1139. IN PDEVICE_OBJECT DeviceObject,
  1140. IN ULONG Action
  1141. );
  1142. BOOLEAN
  1143. ParIsPodo(
  1144. IN PDEVICE_OBJECT DevObj
  1145. );
  1146. NTSTATUS
  1147. ParWmiPdoInitWmi(
  1148. IN PDEVICE_OBJECT DeviceObject
  1149. );
  1150. NTSTATUS
  1151. ParWmiPdoSystemControlDispatch(
  1152. IN PDEVICE_OBJECT DeviceObject,
  1153. IN PIRP Irp
  1154. );
  1155. PCHAR
  1156. Par3QueryDeviceId(
  1157. IN PPDO_EXTENSION Extension,
  1158. OUT PCHAR DeviceIdBuffer,
  1159. IN ULONG BufferSize,
  1160. OUT PULONG DeviceIdSize,
  1161. IN BOOLEAN bReturnRawString, // TRUE == include the 2 size bytes in the returned string
  1162. IN BOOLEAN bBuildStlDeviceId
  1163. );
  1164. PDEVICE_OBJECT
  1165. ParDetectCreatePdo(PDEVICE_OBJECT legacyPodo, UCHAR Dot3Id, BOOLEAN bStlDot3Id);
  1166. NTSTATUS
  1167. ParBuildSendInternalIoctl(
  1168. IN ULONG IoControlCode,
  1169. IN PDEVICE_OBJECT TargetDeviceObject,
  1170. IN PVOID InputBuffer OPTIONAL,
  1171. IN ULONG InputBufferLength,
  1172. OUT PVOID OutputBuffer OPTIONAL,
  1173. IN ULONG OutputBufferLength,
  1174. IN PLARGE_INTEGER Timeout OPTIONAL
  1175. );
  1176. //
  1177. // initunld.c - driver initialization and unload
  1178. //
  1179. NTSTATUS
  1180. DriverEntry(
  1181. IN PDRIVER_OBJECT DriverObject,
  1182. IN PUNICODE_STRING RegistryPath
  1183. );
  1184. VOID
  1185. ParUnload(
  1186. IN PDRIVER_OBJECT DriverObject
  1187. );
  1188. NTSTATUS
  1189. ParPower(
  1190. IN PDEVICE_OBJECT pDeviceObject,
  1191. IN PIRP pIrp
  1192. );
  1193. NTSTATUS
  1194. ParPdoPower(
  1195. IN PDEVICE_OBJECT Pdo,
  1196. IN PIRP pIrp
  1197. );
  1198. NTSTATUS
  1199. ParFdoPower(
  1200. IN PPDO_EXTENSION Extension,
  1201. IN PIRP pIrp
  1202. );
  1203. // parclass.c ?
  1204. VOID
  1205. ParLogError(
  1206. IN PDRIVER_OBJECT DriverObject,
  1207. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  1208. IN PHYSICAL_ADDRESS P1,
  1209. IN PHYSICAL_ADDRESS P2,
  1210. IN ULONG SequenceNumber,
  1211. IN UCHAR MajorFunctionCode,
  1212. IN UCHAR RetryCount,
  1213. IN ULONG UniqueErrorValue,
  1214. IN NTSTATUS FinalStatus,
  1215. IN NTSTATUS SpecificIOStatus
  1216. );
  1217. UCHAR
  1218. ParInitializeDevice(
  1219. IN PPDO_EXTENSION Extension
  1220. );
  1221. VOID
  1222. ParNotInitError(
  1223. IN PPDO_EXTENSION Extension,
  1224. IN UCHAR DeviceStatus
  1225. );
  1226. VOID
  1227. PptPdoStartIo(
  1228. IN PPDO_EXTENSION Extension
  1229. );
  1230. VOID
  1231. PptPdoThread(
  1232. IN PVOID Context
  1233. );
  1234. NTSTATUS
  1235. ParCreateSystemThread(
  1236. PPDO_EXTENSION Extension
  1237. );
  1238. VOID
  1239. ParCancelRequest(
  1240. PDEVICE_OBJECT DeviceObject,
  1241. PIRP Irp
  1242. );
  1243. // exports.c
  1244. USHORT
  1245. ParExportedDetermineIeeeModes(
  1246. IN PPDO_EXTENSION Extension
  1247. );
  1248. NTSTATUS
  1249. ParExportedIeeeFwdToRevMode(
  1250. IN PPDO_EXTENSION Extension
  1251. );
  1252. NTSTATUS
  1253. ParExportedIeeeRevToFwdMode(
  1254. IN PPDO_EXTENSION Extension
  1255. );
  1256. NTSTATUS
  1257. ParExportedNegotiateIeeeMode(
  1258. IN PPDO_EXTENSION Extension,
  1259. IN USHORT ModeMaskFwd,
  1260. IN USHORT ModeMaskRev,
  1261. IN PARALLEL_SAFETY ModeSafety,
  1262. IN BOOLEAN IsForward
  1263. );
  1264. NTSTATUS
  1265. ParExportedTerminateIeeeMode(
  1266. IN PPDO_EXTENSION Extension
  1267. );
  1268. NTSTATUS
  1269. ParExportedParallelRead(
  1270. IN PPDO_EXTENSION Extension,
  1271. IN PVOID Buffer,
  1272. IN ULONG NumBytesToRead,
  1273. OUT PULONG NumBytesRead,
  1274. IN UCHAR Channel
  1275. );
  1276. NTSTATUS
  1277. ParExportedParallelWrite(
  1278. IN PPDO_EXTENSION Extension,
  1279. OUT PVOID Buffer,
  1280. IN ULONG NumBytesToWrite,
  1281. OUT PULONG NumBytesWritten,
  1282. IN UCHAR Channel
  1283. );
  1284. NTSTATUS
  1285. ParTerminateParclassMode(
  1286. IN PPDO_EXTENSION Extension
  1287. );
  1288. VOID
  1289. ParWriteIo(
  1290. IN PPDO_EXTENSION Extension
  1291. );
  1292. VOID
  1293. ParReadIo(
  1294. IN PPDO_EXTENSION Extension
  1295. );
  1296. VOID
  1297. ParDeviceIo(
  1298. IN PPDO_EXTENSION Extension
  1299. );
  1300. // pnp?
  1301. NTSTATUS
  1302. DriverEntry(
  1303. IN PDRIVER_OBJECT DriverObject,
  1304. IN PUNICODE_STRING RegistryPath
  1305. );
  1306. NTSTATUS
  1307. ParPnpAddDevice(
  1308. IN PDRIVER_OBJECT pDriverObject,
  1309. IN PDEVICE_OBJECT pPhysicalDeviceObject
  1310. );
  1311. NTSTATUS
  1312. ParParallelPnp(
  1313. IN PDEVICE_OBJECT pDeviceObject,
  1314. IN PIRP pIrp
  1315. );
  1316. NTSTATUS
  1317. ParPdoParallelPnp(
  1318. IN PDEVICE_OBJECT pDeviceObject,
  1319. IN PIRP pIrp
  1320. );
  1321. NTSTATUS
  1322. ParFdoParallelPnp(
  1323. IN PDEVICE_OBJECT pDeviceObject,
  1324. IN PIRP pIrp
  1325. );
  1326. NTSTATUS
  1327. ParSynchCompletionRoutine(
  1328. IN PDEVICE_OBJECT DeviceObject,
  1329. IN PIRP Irp,
  1330. IN PKEVENT Event
  1331. );
  1332. PDEVICE_OBJECT
  1333. ParPnpCreateDevice(
  1334. IN PDRIVER_OBJECT pDriverObject
  1335. );
  1336. BOOLEAN
  1337. ParMakeNames(
  1338. IN ULONG ParallelPortNumber,
  1339. OUT PUNICODE_STRING ClassName,
  1340. OUT PUNICODE_STRING LinkName
  1341. );
  1342. VOID
  1343. ParCheckParameters(
  1344. IN OUT PPDO_EXTENSION Extension
  1345. );
  1346. VOID
  1347. ParPnpFindDeviceIdKeys(
  1348. OUT PCHAR *lppMFG,
  1349. OUT PCHAR *lppMDL,
  1350. OUT PCHAR *lppCLS,
  1351. OUT PCHAR *lppDES,
  1352. OUT PCHAR *lppAID,
  1353. OUT PCHAR *lppCID,
  1354. IN PCHAR lpDeviceID
  1355. );
  1356. VOID
  1357. ParDot3ParseDevId(
  1358. PCHAR *lpp_DL,
  1359. PCHAR *lpp_C,
  1360. PCHAR *lpp_CMD,
  1361. PCHAR *lpp_4DL,
  1362. PCHAR *lpp_M,
  1363. PCHAR lpDeviceID
  1364. );
  1365. VOID
  1366. GetCheckSum(
  1367. IN PCHAR Block,
  1368. IN USHORT Len,
  1369. OUT PUSHORT CheckSum
  1370. );
  1371. BOOLEAN
  1372. String2Num(
  1373. IN OUT PCHAR *lpp_Str,
  1374. IN CHAR c,
  1375. OUT ULONG *num
  1376. );
  1377. UCHAR
  1378. StringCountValues(
  1379. IN PCHAR string,
  1380. IN CHAR delimeter
  1381. );
  1382. PCHAR
  1383. StringChr(
  1384. IN PCHAR string,
  1385. IN CHAR c
  1386. );
  1387. ULONG
  1388. StringLen(
  1389. IN PUCHAR string
  1390. );
  1391. VOID
  1392. StringSubst(
  1393. IN OUT PCHAR lpS,
  1394. IN CHAR chTargetChar,
  1395. IN CHAR chReplacementChar,
  1396. IN USHORT cbS
  1397. );
  1398. BOOLEAN
  1399. ParSelectDevice(
  1400. IN PPDO_EXTENSION Extension,
  1401. IN BOOLEAN HavePort
  1402. );
  1403. BOOLEAN
  1404. ParDeselectDevice(
  1405. IN PPDO_EXTENSION Extension,
  1406. IN BOOLEAN KeepPort
  1407. );
  1408. NTSTATUS
  1409. ParAcquireRemoveLock(
  1410. IN PIO_REMOVE_LOCK RemoveLock,
  1411. IN PVOID Tag OPTIONAL
  1412. );
  1413. VOID
  1414. ParReleaseRemoveLock(
  1415. IN PIO_REMOVE_LOCK RemoveLock,
  1416. IN PVOID Tag OPTIONAL
  1417. );
  1418. VOID
  1419. ParReleaseRemoveLockAndWait(
  1420. IN PIO_REMOVE_LOCK RemoveLock,
  1421. IN PVOID Tag
  1422. );
  1423. NTSTATUS
  1424. ParPnpInterfaceChangeNotify(
  1425. IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION pDeviceInterfaceChangeNotification,
  1426. IN PVOID pContext
  1427. );
  1428. VOID
  1429. ParMakeClassNameFromNumber(
  1430. IN ULONG Number,
  1431. OUT PUNICODE_STRING ClassName
  1432. );
  1433. VOID
  1434. ParMakeDotClassNameFromBaseClassName(
  1435. IN PUNICODE_STRING BaseClassName,
  1436. IN ULONG Number,
  1437. OUT PUNICODE_STRING DotClassName
  1438. );
  1439. VOID
  1440. ParInitCommonDOPre(PDEVICE_OBJECT DevObj, PDEVICE_OBJECT Fdo, PUNICODE_STRING ClassName);
  1441. VOID
  1442. ParInitCommonDOPost(PDEVICE_OBJECT DevObj);
  1443. NTSTATUS
  1444. ParInitPdo(
  1445. IN PDEVICE_OBJECT NewPdo,
  1446. IN PUCHAR DeviceIdString,
  1447. IN ULONG DeviceIdLength,
  1448. IN PDEVICE_OBJECT LegacyPodo,
  1449. IN UCHAR Dot3Id
  1450. );
  1451. NTSTATUS
  1452. ParInitLegacyPodo(PDEVICE_OBJECT LegacyPodo, PUNICODE_STRING PortSymbolicLinkName);
  1453. VOID
  1454. ParAddDevObjToFdoList(PDEVICE_OBJECT DevObj);
  1455. PDEVICE_OBJECT
  1456. ParCreateLegacyPodo(PDEVICE_OBJECT Fdo, PUNICODE_STRING PortSymbolicLinkName);
  1457. VOID
  1458. ParAcquireListMutexAndKillDeviceObject(PDEVICE_OBJECT Fdo, PDEVICE_OBJECT DevObj);
  1459. VOID
  1460. ParKillDeviceObject(
  1461. PDEVICE_OBJECT DeviceObject
  1462. );
  1463. PWSTR
  1464. ParCreateWideStringFromUnicodeString(
  1465. PUNICODE_STRING UnicodeString
  1466. );
  1467. PDEVICE_OBJECT
  1468. ParDetectCreateEndOfChainPdo(PDEVICE_OBJECT LegacyPodo);
  1469. VOID
  1470. ParEnumerate1284_3Devices(
  1471. IN PDEVICE_OBJECT pFdoDeviceObject,
  1472. IN PDEVICE_OBJECT pPortDeviceObject,
  1473. IN PDEVICE_OBJECT EndOfChainDeviceObject
  1474. );
  1475. NTSTATUS
  1476. ParPnpNotifyTargetDeviceChange(
  1477. IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION pDeviceInterfaceChangeNotification,
  1478. IN PDEVICE_OBJECT pFdoDeviceObject
  1479. );
  1480. NTSTATUS
  1481. ParPnpNotifyInterfaceChange(
  1482. IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationStruct,
  1483. IN PDEVICE_OBJECT Fdo
  1484. );
  1485. NTSTATUS
  1486. ParPnpGetId(
  1487. IN PCHAR DeviceIdString,
  1488. IN ULONG Type,
  1489. OUT PCHAR resultString,
  1490. OUT PCHAR descriptionString
  1491. );
  1492. NTSTATUS
  1493. ParPnpFdoQueryDeviceRelationsBusRelations(
  1494. IN PDEVICE_OBJECT Fdo,
  1495. IN PIRP Irp
  1496. );
  1497. // VOID ParAddPodoToDevObjStruct(PPAR_DEVOBJ_STRUCT DevObjStructHead, PDEVICE_OBJECT CurrentDo);
  1498. // VOID ParAddEndOfChainPdoToDevObjStruct(PPAR_DEVOBJ_STRUCT DevObjStructHead, PDEVICE_OBJECT CurrentDo);
  1499. // VOID ParAddDot3PdoToDevObjStruct(PPAR_DEVOBJ_STRUCT DevObjStructHead, PDEVICE_OBJECT CurrentDo);
  1500. // VOID ParAddLegacyZipPdoToDevObjStruct(IN PPAR_DEVOBJ_STRUCT DevObjStructHead, IN PDEVICE_OBJECT CurrentDo);
  1501. // PPAR_DEVOBJ_STRUCT ParFindCreateDevObjStruct(PPAR_DEVOBJ_STRUCT DevObjStructHead, PUCHAR Controller);
  1502. // VOID ParDumpDevObjStructList(PPAR_DEVOBJ_STRUCT DevObjStructHead);
  1503. // PPAR_DEVOBJ_STRUCT ParBuildDevObjStructList(PDEVICE_OBJECT Fdo);
  1504. // VOID ParDoParallelBusRescan(PPAR_DEVOBJ_STRUCT DevObjStructHead);
  1505. BOOLEAN
  1506. ParDeviceExists(
  1507. PPDO_EXTENSION Extension,
  1508. IN BOOLEAN HavePortKeepPort
  1509. );
  1510. NTSTATUS
  1511. ParAllocatePortDevice(
  1512. IN PDEVICE_OBJECT PortDeviceObject
  1513. );
  1514. NTSTATUS
  1515. ParAllocatePortDevice(
  1516. IN PDEVICE_OBJECT PortDeviceObject
  1517. );
  1518. NTSTATUS
  1519. ParAcquirePort(
  1520. IN PDEVICE_OBJECT PortDeviceObject,
  1521. IN PLARGE_INTEGER Timeout OPTIONAL
  1522. );
  1523. NTSTATUS
  1524. ParReleasePort(
  1525. IN PDEVICE_OBJECT PortDeviceObject
  1526. );
  1527. VOID
  1528. ParDetectDot3DataLink(
  1529. IN PPDO_EXTENSION Extension,
  1530. IN PCHAR DeviceId
  1531. );
  1532. VOID
  1533. ParMarkPdoHardwareGone(
  1534. IN PPDO_EXTENSION Extension
  1535. );
  1536. NTSTATUS
  1537. ParInit1284_3Bus(
  1538. IN PDEVICE_OBJECT PortDeviceObject
  1539. );
  1540. UCHAR
  1541. ParGet1284_3DeviceCount(
  1542. IN PDEVICE_OBJECT PortDeviceObject
  1543. );
  1544. NTSTATUS
  1545. ParSelect1284_3Device(
  1546. IN PDEVICE_OBJECT PortDeviceObject,
  1547. IN UCHAR Dot3DeviceId
  1548. );
  1549. NTSTATUS
  1550. ParDeselect1284_3Device(
  1551. IN PDEVICE_OBJECT PortDeviceObject,
  1552. IN UCHAR Dot3DeviceId
  1553. );
  1554. PCHAR
  1555. Par3QueryLegacyZipDeviceId(
  1556. IN PPDO_EXTENSION Extension,
  1557. OUT PCHAR CallerDeviceIdBuffer, OPTIONAL
  1558. IN ULONG CallerBufferSize,
  1559. OUT PULONG DeviceIdSize,
  1560. IN BOOLEAN bReturnRawString // TRUE == include the 2 size bytes in the returned string
  1561. // FALSE == discard the 2 size bytes
  1562. );
  1563. PCHAR
  1564. ParStlQueryStlDeviceId(
  1565. IN PPDO_EXTENSION Extension,
  1566. OUT PCHAR CallerDeviceIdBuffer,
  1567. IN ULONG CallerBufferSize,
  1568. OUT PULONG DeviceIdSize,
  1569. IN BOOLEAN bReturnRawString
  1570. ) ;
  1571. BOOLEAN
  1572. ParStlCheckIfStl(
  1573. IN PPDO_EXTENSION Extension,
  1574. IN ULONG ulDaisyIndex
  1575. ) ;
  1576. VOID
  1577. ParCheckEnableLegacyZipFlag();
  1578. BOOLEAN
  1579. P5LegacyZipDetected(
  1580. IN PUCHAR Controller
  1581. );
  1582. PWSTR
  1583. ParGetPortLptName(
  1584. IN PDEVICE_OBJECT PortDeviceObject
  1585. );
  1586. NTSTATUS
  1587. ParCreateDevice(
  1588. IN PDRIVER_OBJECT DriverObject,
  1589. IN ULONG DeviceExtensionSize,
  1590. IN PUNICODE_STRING DeviceName OPTIONAL,
  1591. IN DEVICE_TYPE DeviceType,
  1592. IN ULONG DeviceCharacteristics,
  1593. IN BOOLEAN Exclusive,
  1594. OUT PDEVICE_OBJECT *DeviceObject
  1595. );
  1596. VOID
  1597. ParInitializeExtension1284Info(
  1598. IN PPDO_EXTENSION Extension
  1599. );
  1600. VOID
  1601. ParGetDriverParameterDword(
  1602. IN PUNICODE_STRING ServicePath,
  1603. IN PWSTR ParameterName,
  1604. IN OUT PULONG ParameterValue
  1605. );
  1606. NTSTATUS
  1607. PptRegGetDword(
  1608. IN ULONG RelativeTo,
  1609. IN PWSTR Path,
  1610. IN PWSTR ParameterName,
  1611. IN OUT PULONG ParameterValue
  1612. );
  1613. NTSTATUS
  1614. PptRegSetDword(
  1615. IN ULONG RelativeTo,
  1616. IN PWSTR Path,
  1617. IN PWSTR ParameterName,
  1618. IN PULONG ParameterValue
  1619. );
  1620. NTSTATUS
  1621. PptRegGetSz(
  1622. IN ULONG RelativeTo,
  1623. IN PWSTR Path,
  1624. IN PWSTR ParameterName,
  1625. IN OUT PUNICODE_STRING ParameterValue
  1626. );
  1627. NTSTATUS
  1628. PptRegSetSz(
  1629. IN ULONG RelativeTo,
  1630. IN PWSTR Path,
  1631. IN PWSTR ParameterName,
  1632. IN PWSTR ParameterValue
  1633. );
  1634. VOID
  1635. ParFixupDeviceId(
  1636. IN OUT PUCHAR DeviceId
  1637. );
  1638. VOID
  1639. PptWriteMfgMdlToDevNode(
  1640. IN PDEVICE_OBJECT Pdo,
  1641. IN PCHAR Mfg,
  1642. IN PCHAR Mdl
  1643. );
  1644. VOID
  1645. P4SanitizeMultiSzId(
  1646. IN OUT PWSTR WCharBuffer,
  1647. IN ULONG BufWCharCount
  1648. );
  1649. NTSTATUS
  1650. ParEnterByteMode(
  1651. IN PPDO_EXTENSION Extension,
  1652. IN BOOLEAN DeviceIdRequest
  1653. );
  1654. VOID
  1655. ParTerminateByteMode(
  1656. IN PPDO_EXTENSION Extension
  1657. );
  1658. NTSTATUS
  1659. ParByteModeRead(
  1660. IN PPDO_EXTENSION Extension,
  1661. IN PVOID Buffer,
  1662. IN ULONG BufferSize,
  1663. OUT PULONG BytesTransferred
  1664. );