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.

847 lines
23 KiB

  1. #ifndef TFFSPORT_H
  2. #define TFFSPORT_H
  3. #include "wmilib.h"
  4. #include "wmistr.h"
  5. #define VENDORSTRING "MSystems"
  6. #define PRODUCTSTRING "DiskOnChip2000 "
  7. #define REVISIONSTRING "1.00"
  8. #define SERIALSTRING "0001"
  9. #define VENDORSTRINGSIZE 8
  10. #define PRODUCTSTRINGSIZE 16
  11. #define REVISIONSTRINGSIZE 4
  12. #define SERIALSTRINGSIZE 4
  13. #define DISKONCHIP_WINDOW_SIZE 0x2000
  14. #define START_SEARCH_ADDRESS 0xc8000L
  15. #define END_SEARCH_ADDRESS 0xda000L
  16. #define DISKONCHIP_INTERFACE Isa
  17. #define DISKONCHIP_BUSNUMBER 0
  18. #define d_SEARCH_ADDRESS 0xd0000L
  19. #define dd_SEARCH_ADDRESS 0xd4000L
  20. #define TFFS_MEMORY_SPACE 0
  21. #define TFFS_IO_SPACE 1
  22. #define MAX_TRANSFER_SIZE_PER_SRB (0x10000)
  23. #define MODE_DATA_SIZE 192
  24. #define DEVICE_DEFAULT_IDLE_TIMEOUT 0xffffffff
  25. #define DEVICE_VERY_LONG_IDLE_TIMEOUT 0xfffffffe
  26. // Device state flags
  27. #define DEVICE_FLAG_STOPPED 0x00000001
  28. #define DEVICE_FLAG_REMOVED 0x00000002
  29. #define DEVICE_FLAG_CLAIMED 0x00000004
  30. #define DEVICE_FLAG_QUERY_STOP_REMOVE 0x00000008
  31. #define DEVICE_FLAG_STARTED 0x00000010
  32. #define DEVICE_FLAG_HOLD_IRPS 0x00000020
  33. #define DEVICE_FLAG_CHILD_REMOVED 0x00000040
  34. // Removed WE DONT NEED THIS FLAG
  35. // instead examine the threadObject .. that object gets nulled
  36. // when the thread has exited.
  37. // #define DEVICE_FLAG_THREAD 0x00000080
  38. #define DRIVER_PARAMETER_SUBKEY "Parameters"
  39. #define LEGACY_DETECTION L"LegacyDetection"
  40. #define DRIVER_OBJECT_EXTENSION_ID DriverEntry
  41. #define NUM_WMI_MINOR_FUNCTION (0xa)
  42. typedef struct _TempINFO{
  43. long baseAddress;
  44. unsigned char nextPartition;
  45. }TempINFO;
  46. typedef struct /* represents DOC 2000 & Millenium memory window */
  47. {
  48. UCHAR IPLpart1[0x800]; /* read not used here */
  49. volatile UCHAR IPLpart2[0x800]; /* read IO for MDOC */
  50. volatile UCHAR chipId; /* read */
  51. volatile UCHAR DOCstatus; /* read */
  52. volatile UCHAR DOCcontrol; /* write */
  53. volatile UCHAR ASICselect; /* read write */
  54. volatile UCHAR signals; /* read write */
  55. volatile UCHAR deviceSelector; /* read write */
  56. volatile UCHAR ECCconfig; /* write */
  57. volatile UCHAR ECCstatus; /* read */
  58. volatile UCHAR test[5]; /* not used here */
  59. volatile UCHAR slowIO; /* read write */
  60. UCHAR filler1[2]; /* -- -- */
  61. volatile UCHAR syndrom[6]; /* read */
  62. UCHAR filler2[5]; /* -- -- */
  63. volatile UCHAR aliasResolution; /* read write MDOC only */
  64. volatile UCHAR configInput; /* read write - || - */
  65. volatile UCHAR readPipeInit; /* read - || - */
  66. volatile UCHAR writePipeTerm; /* write - || - */
  67. volatile UCHAR readLastData; /* read write - || - */
  68. volatile UCHAR NOPreg; /* read write - || - */
  69. UCHAR filler3[0x1D]; /* -- -- */
  70. volatile UCHAR ROMwriteEnable; /* write DOC only */
  71. volatile UCHAR foudaryTest; /* write */
  72. UCHAR filler4[0x800-0x40]; /* -- -- */
  73. volatile UCHAR io[0x800]; /* read write */
  74. } DOC2window;
  75. typedef struct /* represents MDOC PLUS memory window */
  76. {
  77. unsigned char IPLpart1[0x800]; /* 0000-07ff */
  78. volatile unsigned char io1[0x800]; /* 0800-0fff */
  79. volatile unsigned char chipId; /* 1000 */
  80. unsigned char filler1; /* -- -- */
  81. volatile unsigned char NopReg; /* 1002 */
  82. unsigned char filler2; /* -- -- */
  83. volatile unsigned char AliasResolution; /* 1004 */
  84. unsigned char filler3; /* -- -- */
  85. volatile unsigned char DOCcontrol; /* 1006 */
  86. unsigned char filler4; /* -- -- */
  87. volatile unsigned char DeviceIDselect; /* 1008 */
  88. unsigned char filler5; /* -- -- */
  89. volatile unsigned char ConfigReg; /* 100A */
  90. unsigned char filler6; /* -- -- */
  91. volatile unsigned char OutputReg; /* 100C */
  92. unsigned char filler7; /* -- -- */
  93. volatile unsigned char IntCntReg; /* 100E */
  94. unsigned char filler8; /* -- -- */
  95. volatile unsigned char IntVecReg; /* 1010 */
  96. unsigned char filler9; /* -- -- */
  97. volatile unsigned char OutputEnableReg; /* 1012 */
  98. unsigned char filler10[0xB]; /* -- -- */
  99. volatile unsigned char FlSlowReg[2]; /* 101E - 101F */
  100. volatile unsigned char FlCntReg; /* 1020 */
  101. unsigned char filler11; /* -- -- */
  102. volatile unsigned char FlSelectReg; /* 1022 */
  103. unsigned char filler12; /* -- -- */
  104. volatile unsigned char FlCmdReg; /* 1024 */
  105. unsigned char filler13; /* -- -- */
  106. volatile unsigned char FlAddressReg; /* 1026 */
  107. unsigned char filler14; /* -- -- */
  108. volatile unsigned char FlDataReg[2]; /* 1028-1029 */
  109. volatile unsigned char readPipeInit; /* 102A */
  110. unsigned char filler15; /* -- -- */
  111. volatile unsigned char readLastData[2]; /* 102C-102D */
  112. volatile unsigned char WritePipeTerm; /* 102E */
  113. unsigned char filler16[17]; /* -- -- */
  114. volatile unsigned char syndrom[6]; /* 1040-1045 */
  115. volatile unsigned char EccCntReg; /* 1046 */
  116. unsigned char filler17; /* -- -- */
  117. volatile unsigned char CotpReg; /* 1048 */
  118. unsigned char filler18[17]; /* -- -- */
  119. volatile unsigned char FlGeometryReg; /* 105A */
  120. unsigned char filler19; /* -- -- */
  121. volatile unsigned char DataProtect[0x17]; /* 105C-1072 */
  122. unsigned char filler20; /* -- -- */
  123. volatile unsigned char DownloadReg; /* 1074 */
  124. unsigned char filler21; /* -- -- */
  125. volatile unsigned char DocCntConfirmReg; /* 1076 */
  126. unsigned char filler22; /* -- -- */
  127. volatile unsigned char ProtectionReg; /* 1078 */
  128. unsigned char filler23[0x6]; /* -- -- */
  129. volatile unsigned char foundryTest; /* 107E */
  130. unsigned char filler24; /* -- -- */
  131. unsigned char filler25[0x77F]; /* -- -- */
  132. volatile unsigned char io2[0x7FF]; /* 1800-1FFF */
  133. volatile unsigned char PowerDownReg; /* 1FFF */
  134. } MDOCPwindow;
  135. /* MDOC PLUS */
  136. typedef struct _NTpcicParams {
  137. PHYSICAL_ADDRESS phWindowBase;
  138. ULONGLONG physWindow;
  139. ULONG windowSize;
  140. ULONG addressSpace;
  141. PVOID windowBase;
  142. INTERFACE_TYPE InterfaceType;
  143. ULONG BusNumber;
  144. } NTpcicParams;
  145. typedef struct _TRUEFFSDRIVER_EXTENSION {
  146. UNICODE_STRING RegistryPath;
  147. } TRUEFFSDRIVER_EXTENSION, *PTRUEFFSDRIVER_EXTENSION;
  148. #define EXTENSION_COMMON_HEADER PDEVICE_OBJECT DeviceObject; \
  149. PDEVICE_OBJECT LowerDeviceObject; \
  150. PDRIVER_OBJECT DriverObject; \
  151. DEVICE_POWER_STATE DevicePowerState; \
  152. SYSTEM_POWER_STATE SystemPowerState; \
  153. ULONG PagingPathCount; \
  154. ULONG HiberPathCount; \
  155. ULONG CrashDumpPathCount; \
  156. WMILIB_CONTEXT WmiLibInfo
  157. typedef struct _DEVICE_EXTENSION_HEADER {
  158. EXTENSION_COMMON_HEADER;
  159. } DEVICE_EXTENSION_HEADER, * PDEVICE_EXTENSION_HEADER;
  160. typedef struct _DEVICE_EXTENSION {
  161. EXTENSION_COMMON_HEADER;
  162. PDEVICE_OBJECT MainPdo;
  163. PDEVICE_OBJECT ChildPdo;
  164. ULONG DeviceFlags;
  165. ULONG Cylinders;
  166. ULONG NumberOfHeads;
  167. ULONG SectorsPerTrack;
  168. ULONG BytesPerSector;
  169. ULONG noOfHiddenSectors;
  170. ULONG totalSectors;
  171. PSCSI_REQUEST_BLOCK CurrentSrb;
  172. PUSHORT DataBuffer;
  173. BOOLEAN SymbolicLinkCreated;
  174. ULONG TrueffsDeviceNumber;
  175. ULONG UnitNumber;
  176. ULONG ScsiPortNumber;
  177. UCHAR ScsiDeviceType;
  178. KSPIN_LOCK ExtensionDataSpinLock;
  179. LIST_ENTRY listEntry;
  180. KSEMAPHORE requestSemaphore;
  181. KSPIN_LOCK listSpinLock;
  182. LONG threadReferenceCount;
  183. KEVENT PendingIRPEvent;
  184. BOOLEAN removableMedia;
  185. ULONG NumberOfDisksPoweredUp;
  186. NTpcicParams pcmciaParams;
  187. PKTHREAD TffsportThreadObject;
  188. BOOLEAN IsPartitonTableWritten;
  189. BOOLEAN IsWriteProtected;
  190. UCHAR PartitonTable[0x200];
  191. BOOLEAN IsSWWriteProtected;
  192. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  193. typedef struct _PDO_EXTENSION {
  194. EXTENSION_COMMON_HEADER;
  195. PDEVICE_EXTENSION Pext; // parent device extension
  196. PIRP PendingPowerIrp;
  197. PULONG IdleCounter;
  198. } PDO_EXTENSION, *PPDO_EXTENSION;
  199. typedef struct _TFFS_DEVICE_TYPE {
  200. PCSTR DeviceTypeString;
  201. PCSTR CompatibleIdString;
  202. PCSTR PeripheralIdString;
  203. } TFFS_DEVICE_TYPE, * PTFFS_DEVICE_TYPE;
  204. typedef struct _FDO_POWER_CONTEXT {
  205. POWER_STATE_TYPE PowerType;
  206. POWER_STATE PowerState;
  207. } FDO_POWER_CONTEXT, *PFDO_POWER_CONTEXT;
  208. #define IS_FDO(devExtension) (devExtension->LowerDeviceObject != NULL)
  209. typedef
  210. VOID
  211. (*PSTALL_ROUTINE) (
  212. IN ULONG Delay
  213. );
  214. typedef
  215. BOOLEAN
  216. (*PDUMP_DRIVER_OPEN) (
  217. IN LARGE_INTEGER PartitionOffset
  218. );
  219. typedef
  220. NTSTATUS
  221. (*PDUMP_DRIVER_WRITE) (
  222. IN PLARGE_INTEGER DiskByteOffset,
  223. IN PMDL Mdl
  224. );
  225. typedef
  226. VOID
  227. (*PDUMP_DRIVER_FINISH) (
  228. VOID
  229. );
  230. struct _ADAPTER_OBJECT;
  231. //
  232. // This is the information passed from the system to the disk dump driver
  233. // during the driver's initialization.
  234. //
  235. typedef struct _INITIALIZATION_CONTEXT {
  236. ULONG Length;
  237. ULONG DiskSignature;
  238. PVOID MemoryBlock;
  239. PVOID CommonBuffer[2];
  240. PHYSICAL_ADDRESS PhysicalAddress[2];
  241. PSTALL_ROUTINE StallRoutine;
  242. PDUMP_DRIVER_OPEN OpenRoutine;
  243. PDUMP_DRIVER_WRITE WriteRoutine;
  244. PDUMP_DRIVER_FINISH FinishRoutine;
  245. struct _ADAPTER_OBJECT *AdapterObject;
  246. PVOID MappedRegisterBase;
  247. PVOID PortConfiguration;
  248. BOOLEAN CrashDump;
  249. ULONG MaximumTransferSize;
  250. ULONG CommonBufferSize;
  251. PVOID TargetAddress; //Opaque pointer to target address structure
  252. } INITIALIZATION_CONTEXT, *PINITIALIZATION_CONTEXT;
  253. typedef struct _CRASHDUMP_INIT_DATA {
  254. PDEVICE_EXTENSION cdFdoExtension;
  255. } CRASHDUMP_INIT_DATA, *PCRASHDUMP_INIT_DATA;
  256. typedef struct _CRASHDUMP_DATA {
  257. PCRASHDUMP_INIT_DATA CrashInitData;
  258. LARGE_INTEGER PartitionOffset;
  259. PSTALL_ROUTINE StallRoutine;
  260. SCSI_REQUEST_BLOCK Srb;
  261. DEVICE_EXTENSION fdoExtension;
  262. ULONG MaxBlockSize;
  263. } CRASHDUMP_DATA, *PCRASHDUMP_DATA;
  264. typedef struct _WMI_FLASH_DISK_INFO {
  265. ULONG Number;
  266. ULONG Address;
  267. ULONG Size;
  268. } WMI_FLASH_DISK_INFO, *PWMI_FLASH_DISK_INFO;
  269. NTSTATUS
  270. DriverEntry(
  271. IN PDRIVER_OBJECT DriverObject,
  272. IN PUNICODE_STRING RegistryPath
  273. );
  274. NTSTATUS
  275. TrueffsFetchKeyValue(
  276. IN PDRIVER_OBJECT DriverObject,
  277. IN PUNICODE_STRING RegistryPath,
  278. IN PWSTR KeyName,
  279. IN OUT ULONG* KeyValue
  280. );
  281. NTSTATUS
  282. TrueffsDetectRegistryValues(
  283. IN PDRIVER_OBJECT DriverObject,
  284. IN PUNICODE_STRING RegistryPath
  285. );
  286. NTSTATUS
  287. TrueffsDetectDiskOnChip(
  288. IN PDRIVER_OBJECT DriverObject,
  289. IN PUNICODE_STRING RegistryPath
  290. );
  291. NTSTATUS
  292. TrueffsTranslateAddress(
  293. IN INTERFACE_TYPE InterfaceType,
  294. IN ULONG BusNumber,
  295. IN PHYSICAL_ADDRESS StartAddress,
  296. IN LONG Length,
  297. IN OUT PULONG AddressSpace,
  298. OUT PVOID *TranslatedAddress,
  299. OUT PPHYSICAL_ADDRESS TranslatedMemoryAddress
  300. );
  301. VOID
  302. TrueffsFreeTranslatedAddress(
  303. IN PVOID TranslatedAddress,
  304. IN LONG Length,
  305. IN ULONG AddressSpace
  306. );
  307. NTSTATUS
  308. TrueffsAddDevice(
  309. PDRIVER_OBJECT DriverObject,
  310. PDEVICE_OBJECT Pdo
  311. );
  312. NTSTATUS
  313. TrueffsCreateDevObject(
  314. IN PDRIVER_OBJECT DriverObject,
  315. IN PDEVICE_OBJECT Pdo,
  316. OUT PDEVICE_EXTENSION *FdoExtension
  317. );
  318. NTSTATUS
  319. TrueffsStartDevice(
  320. IN PDEVICE_EXTENSION deviceExtension,
  321. IN PCM_RESOURCE_LIST ResourceList,
  322. IN BOOLEAN CheckResources
  323. );
  324. NTSTATUS
  325. TrueffsMountMedia(
  326. IN PDEVICE_EXTENSION deviceExtension
  327. );
  328. NTSTATUS
  329. TrueffsStopRemoveDevice(
  330. PDEVICE_EXTENSION deviceExtension
  331. );
  332. NTSTATUS
  333. TrueffsCreateSymblicLinks (
  334. PDEVICE_EXTENSION FdoExtension
  335. );
  336. NTSTATUS
  337. TrueffsDeleteSymblicLinks (
  338. PDEVICE_EXTENSION FdoExtension
  339. );
  340. NTSTATUS
  341. TrueffsDeviceControl(
  342. IN PDEVICE_OBJECT DeviceObject,
  343. IN PIRP Irp
  344. );
  345. NTSTATUS
  346. TrueffsDispatchSystemControl(
  347. IN PDEVICE_OBJECT DeviceObject,
  348. IN OUT PIRP Irp
  349. );
  350. NTSTATUS
  351. TrueffsQueryProperty(
  352. IN PDEVICE_EXTENSION deviceExtension,
  353. IN PIRP QueryIrp
  354. );
  355. NTSTATUS
  356. TrueffsScsiRequests(
  357. IN PDEVICE_OBJECT DeviceObject,
  358. IN PIRP Irp
  359. );
  360. NTSTATUS
  361. TrueffsCreateClose(
  362. IN PDEVICE_OBJECT DeviceObject,
  363. IN PIRP Irp
  364. );
  365. NTSTATUS
  366. TrueffsPnpDeviceControl(
  367. PDEVICE_OBJECT DeviceObject,
  368. PIRP Irp
  369. );
  370. NTSTATUS
  371. TrueffsPowerControl(
  372. PDEVICE_OBJECT DeviceObject,
  373. PIRP Irp
  374. );
  375. VOID
  376. TrueffsUnload(
  377. IN PDRIVER_OBJECT DriverObject
  378. );
  379. VOID
  380. TrueffsStartIo (
  381. IN PDEVICE_OBJECT DeviceObject,
  382. IN PIRP Irp
  383. );
  384. VOID
  385. TrueffsThread(
  386. PVOID Context
  387. );
  388. NTSTATUS
  389. QueueIrpToThread(
  390. IN OUT PIRP Irp,
  391. IN OUT PDEVICE_EXTENSION deviceExtension
  392. );
  393. NTSTATUS
  394. TrueffsTranslateSRBStatus(
  395. ULONG status
  396. );
  397. NTSTATUS
  398. TrueffsDeviceQueryId (
  399. IN PDEVICE_OBJECT DeviceObject,
  400. IN OUT PIRP Irp,
  401. BOOLEAN Fdo
  402. );
  403. PWSTR
  404. DeviceBuildBusId(
  405. IN PDEVICE_EXTENSION deviceExtension,
  406. BOOLEAN Fdo
  407. );
  408. PWSTR
  409. DeviceBuildInstanceId(
  410. IN PDEVICE_EXTENSION deviceExtension,
  411. BOOLEAN Fdo
  412. );
  413. PWSTR
  414. DeviceBuildCompatibleId(
  415. IN PDEVICE_EXTENSION deviceExtension,
  416. BOOLEAN Fdo
  417. );
  418. PWSTR
  419. DeviceBuildHardwareId(
  420. IN PDEVICE_EXTENSION deviceExtension,
  421. BOOLEAN Fdo
  422. );
  423. VOID
  424. CopyField(
  425. IN PUCHAR Destination,
  426. IN PUCHAR Source,
  427. IN ULONG Count,
  428. IN UCHAR Change
  429. );
  430. PCSTR
  431. TrueffsGetDeviceTypeString (
  432. IN ULONG DeviceType
  433. );
  434. PCSTR
  435. TrueffsGetCompatibleIdString (
  436. IN ULONG DeviceType
  437. );
  438. PCSTR
  439. TrueffsGetPeripheralIdString (
  440. IN ULONG DeviceType
  441. );
  442. PCSTR
  443. TrueffsGetDeviceTypeStringFDO (
  444. IN ULONG DeviceType
  445. );
  446. PCSTR
  447. TrueffsGetCompatibleIdStringFDO (
  448. IN ULONG DeviceType
  449. );
  450. PCSTR
  451. TrueffsGetPeripheralIdStringFDO (
  452. IN ULONG DeviceType
  453. );
  454. NTSTATUS
  455. TrueffsQueryDeviceRelations (
  456. IN PDEVICE_OBJECT DeviceObject,
  457. IN OUT PIRP Irp,
  458. BOOLEAN Fdo
  459. );
  460. BOOLEAN
  461. TrueffsOkToDetectLegacy (
  462. IN PDRIVER_OBJECT DriverObject
  463. );
  464. NTSTATUS
  465. TrueffsGetParameterFromServiceSubKey (
  466. IN PDRIVER_OBJECT DriverObject,
  467. IN PWSTR ParameterName,
  468. IN ULONG ParameterType,
  469. IN BOOLEAN Read,
  470. OUT PVOID *ParameterValue,
  471. IN ULONG ParameterValueWriteSize
  472. );
  473. NTSTATUS
  474. TrueffsRegQueryRoutine (
  475. IN PWSTR ValueName,
  476. IN ULONG ValueType,
  477. IN PVOID ValueData,
  478. IN ULONG ValueLength,
  479. IN PVOID Context,
  480. IN PVOID EntryContext
  481. );
  482. HANDLE
  483. TrueffsOpenServiceSubKey (
  484. IN PDRIVER_OBJECT DriverObject,
  485. IN PUNICODE_STRING SubKeyPath
  486. );
  487. VOID
  488. TrueffsCloseServiceSubKey (
  489. IN HANDLE SubServiceKey
  490. );
  491. NTSTATUS
  492. TrueffsFindDiskOnChip(
  493. IN INTERFACE_TYPE InterfaceType,
  494. IN ULONG BusNumber,
  495. IN ULONG StartSearchAddress,
  496. IN LONG WindowSize,
  497. IN BOOLEAN StartSearch,
  498. OUT PVOID *WindowBase
  499. );
  500. NTSTATUS
  501. TrueffsCheckDiskOnChip(
  502. IN INTERFACE_TYPE InterfaceType,
  503. IN ULONG BusNumber,
  504. IN ULONG StartSearchAddress,
  505. IN LONG WindowSize,
  506. OUT PVOID *WindowBase,
  507. OUT PULONG AddressSpace
  508. );
  509. VOID
  510. TrueffsResetDiskOnChip(
  511. IN INTERFACE_TYPE InterfaceType,
  512. IN ULONG BusNumber,
  513. IN ULONG StartSearchAddress,
  514. IN LONG WindowSize
  515. );
  516. PPDO_EXTENSION
  517. AllocatePdo(
  518. IN PDEVICE_EXTENSION FdoExtension
  519. );
  520. NTSTATUS
  521. FreePdo(
  522. IN PDEVICE_OBJECT PhysicalDeviceObject
  523. );
  524. VOID
  525. flBuildGeometry(dword capacity,
  526. dword FAR2 *cylinders,
  527. dword FAR2 *heads,
  528. dword FAR2 *sectors,
  529. FLBoolean oldFormat);
  530. NTSTATUS
  531. TrueffsSetPdoDevicePowerState( IN PDEVICE_OBJECT Pdo,
  532. IN OUT PIRP Irp
  533. );
  534. NTSTATUS
  535. TrueffsSetPdoSystemPowerState (
  536. IN PDEVICE_OBJECT DeviceObject,
  537. IN OUT PIRP Irp
  538. );
  539. NTSTATUS
  540. TrueffsSetPdoPowerState(
  541. IN PDEVICE_OBJECT Pdo,
  542. IN OUT PIRP Irp
  543. );
  544. NTSTATUS
  545. TrueffsSetFdoPowerState (
  546. IN PDEVICE_OBJECT DeviceObject,
  547. IN OUT PIRP Irp
  548. );
  549. NTSTATUS
  550. TrueffsFdoDevicePowerIrpCompletionRoutine(
  551. IN PDEVICE_OBJECT DeviceObject,
  552. IN UCHAR MinorFunction,
  553. IN POWER_STATE PowerState,
  554. IN PVOID contextIrp,
  555. IN PIO_STATUS_BLOCK IoStatus
  556. );
  557. NTSTATUS
  558. TrueffsFdoPowerCompletionRoutine (
  559. IN PDEVICE_OBJECT DeviceObject,
  560. IN PIRP Irp,
  561. IN PVOID Context
  562. );
  563. VOID
  564. TrueffsPdoCompletePowerIrp (
  565. IN PDEVICE_OBJECT DeviceObject,
  566. IN PIRP Irp
  567. );
  568. VOID
  569. TrueffsPdoRequestPowerCompletionRoutine(
  570. IN PDEVICE_OBJECT Pdo,
  571. IN UCHAR MinorFunction,
  572. IN POWER_STATE PowerState,
  573. IN PVOID Context,
  574. IN PIO_STATUS_BLOCK IoStatus
  575. );
  576. NTSTATUS
  577. TrueffsFdoChildRequestPowerUp (
  578. IN PDEVICE_EXTENSION FdoExtension,
  579. IN PPDO_EXTENSION PdoExtension,
  580. IN PIRP Irp
  581. );
  582. NTSTATUS
  583. TrueffsFdoChildRequestPowerUpCompletionRoutine (
  584. IN PDEVICE_OBJECT DeviceObject,
  585. IN UCHAR MinorFunction,
  586. IN POWER_STATE PowerState,
  587. IN PVOID Context,
  588. IN PIO_STATUS_BLOCK IoStatus
  589. );
  590. NTSTATUS
  591. TrueffsParentPowerUpCompletionRoutine(
  592. IN PVOID Context,
  593. IN NTSTATUS FdoStatus
  594. );
  595. VOID
  596. TrueffsFdoChildReportPowerDown (
  597. IN PDEVICE_EXTENSION FdoExtension
  598. );
  599. NTSTATUS
  600. TrueffsDeviceQueryCapabilities(IN PDEVICE_EXTENSION deviceExtension,
  601. IN PDEVICE_CAPABILITIES Capabilities
  602. );
  603. NTSTATUS
  604. updateDocSocketParams(PDEVICE_EXTENSION fdoExtension);
  605. NTSTATUS updatePcmciaSocketParams(PDEVICE_EXTENSION fdoExtension);
  606. NTSTATUS
  607. TrueffsSyncSendIrp (
  608. IN PDEVICE_OBJECT TargetDeviceObject,
  609. IN PIO_STACK_LOCATION IrpSp,
  610. IN OUT OPTIONAL PIO_STATUS_BLOCK IoStatus
  611. );
  612. NTSTATUS
  613. TrueffsSyncSendIrpCompletionRoutine (
  614. IN PDEVICE_OBJECT DeviceObject,
  615. IN PIRP Irp,
  616. IN PVOID Context
  617. );
  618. NTSTATUS
  619. TrueffsCallDriverSync(
  620. IN PDEVICE_OBJECT DeviceObject,
  621. IN OUT PIRP Irp
  622. );
  623. NTSTATUS
  624. TrueffsCallDriverSyncCompletion(
  625. IN PDEVICE_OBJECT DeviceObject,
  626. IN PIRP Irp,
  627. IN PVOID Context
  628. );
  629. ULONG
  630. TrueffsCrashDumpDriverEntry (
  631. PVOID Context
  632. );
  633. BOOLEAN
  634. TrueffsCrashDumpOpen (
  635. IN LARGE_INTEGER PartitionOffset
  636. );
  637. NTSTATUS
  638. TrueffsCrashDumpWrite (
  639. IN PLARGE_INTEGER DiskByteOffset,
  640. IN PMDL Mdl
  641. );
  642. VOID
  643. TrueffsCrashDumpFinish (
  644. VOID
  645. );
  646. VOID
  647. TrueffsWmiInit (
  648. VOID
  649. );
  650. NTSTATUS
  651. TrueffsWmiRegister(
  652. PDEVICE_EXTENSION_HEADER DevExtension
  653. );
  654. NTSTATUS
  655. TrueffsWmiDeregister(
  656. PDEVICE_EXTENSION_HEADER DevExtension
  657. );
  658. NTSTATUS
  659. TrueffsWmiSystemControl(
  660. IN PDEVICE_OBJECT DeviceObject,
  661. IN PIRP Irp
  662. );
  663. NTSTATUS
  664. TrueffsQueryWmiDataBlock(
  665. IN PDEVICE_OBJECT DeviceObject,
  666. IN PIRP Irp,
  667. IN ULONG GuidIndex,
  668. IN ULONG InstanceIndex,
  669. IN ULONG InstanceCount,
  670. IN OUT PULONG InstanceLengthArray,
  671. IN ULONG OutBufferSize,
  672. OUT PUCHAR Buffer
  673. );
  674. NTSTATUS
  675. TrueffsQueryWmiRegInfo(
  676. IN PDEVICE_OBJECT DeviceObject,
  677. OUT PULONG RegFlags,
  678. OUT PUNICODE_STRING InstanceName,
  679. OUT PUNICODE_STRING *RegistryPath,
  680. OUT PUNICODE_STRING MofResourceName,
  681. OUT PDEVICE_OBJECT *Pdo
  682. );
  683. NTSTATUS
  684. TrueffsSetWmiDataBlock(
  685. IN PDEVICE_OBJECT DeviceObject,
  686. IN PIRP Irp,
  687. IN ULONG GuidIndex,
  688. IN ULONG InstanceIndex,
  689. IN ULONG BufferSize,
  690. IN PUCHAR Buffer
  691. );
  692. NTSTATUS
  693. TrueffsSetWmiDataItem(
  694. IN PDEVICE_OBJECT DeviceObject,
  695. IN PIRP Irp,
  696. IN ULONG GuidIndex,
  697. IN ULONG InstanceIndex,
  698. IN ULONG DataItemId,
  699. IN ULONG BufferSize,
  700. IN PUCHAR Buffer
  701. );
  702. #if DBG
  703. #define TffsDebugPrint(X) TrueffsDebugPrint X
  704. #define TFFS_DEB_ALL 0x0000FFFF
  705. #define TFFS_DEB_INFO 0x00000001
  706. #define TFFS_DEB_WARN 0x00000002
  707. #define TFFS_DEB_ERROR 0x00000004
  708. VOID
  709. TrueffsDebugPrint(ULONG DebugPrintLevel, PCHAR DebugMessage, ...);
  710. #else
  711. #define TffsDebugPrint(X)
  712. #endif
  713. #endif