Windows NT 4.0 source code leak
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.

123 lines
3.5 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. ixdat.c
  5. Abstract:
  6. Declares various data which is initialize data, or pagable data.
  7. Author:
  8. Environment:
  9. Kernel mode only.
  10. Revision History:
  11. --*/
  12. #include "pciport.h"
  13. //
  14. // PcipWorkdListLock - Lock to protect DeviceControl globals
  15. // PcipControlWorkerList - List of slot control's which are pending for worker thread
  16. // PcipControlDpcList - List of slot control's which are waiting, but are non-paged
  17. // PcipWorkItem - Enqueue for DeviceControl worker thread
  18. // PcipWorkDpc - Enqueue for DeviceControl DPC
  19. //
  20. FAST_MUTEX PcipMutex;
  21. KSPIN_LOCK PcipSpinlock;
  22. LIST_ENTRY PcipControlWorkerList;
  23. LIST_ENTRY PcipControlDpcList;
  24. LIST_ENTRY PcipCheckBusList;
  25. ULONG PcipWorkerQueued;
  26. WORK_QUEUE_ITEM PcipWorkItem;
  27. KDPC PcipWorkDpc;
  28. ULONG PcipDeviceHandlerObjectSize;
  29. //
  30. // DeviceControl dispatch table
  31. //
  32. #define B_EJECT BCTL_EJECT
  33. #define B_ID BCTL_QUERY_DEVICE_ID
  34. #define B_UID BCTL_QUERY_DEVICE_UNIQUE_ID
  35. #define B_CAPABILITIES BCTL_QUERY_DEVICE_CAPABILITIES
  36. #define B_RES BCTL_QUERY_DEVICE_RESOURCES
  37. #define B_RES_REQ BCTL_QUERY_DEVICE_RESOURCE_REQUIREMENTS
  38. #define B_QUERY_EJECT BCTL_QUERY_EJECT
  39. #define B_SET_LOCK BCTL_SET_LOCK
  40. #define B_SET_POWER BCTL_SET_POWER
  41. #define B_SET_RESUME BCTL_SET_RESUME
  42. #define B_SET_RES BCTL_SET_DEVICE_RESOURCES
  43. #define B_ASSIGN_RES BCTL_ASSIGN_SLOT_RESOURCES
  44. #define SIZE_BRES sizeof(CTL_ASSIGN_RESOURCES)
  45. #define SIZE_CAP sizeof(BCTL_DEVICE_CAPABILITIES)
  46. #define SIZE_CALL sizeof(PCALLBACK_OBJECT)
  47. DEVICE_CONTROL_HANDLER PcipControl[] = {
  48. B_EJECT, 0, PciBCtlEject, PciCtlEject,
  49. B_ID, 128, PciBCtlSync, PciCtlQueryDeviceId,
  50. B_UID, 128, PciBCtlSync, PciCtlQueryDeviceUniqueId,
  51. B_CAPABILITIES, SIZE_CAP, PciBCtlSync, PciCtlForward, // bugbug
  52. B_RES, sizeof(ULONG), PciBCtlSync, PciCtlQueryDeviceResources,
  53. B_RES_REQ, sizeof(ULONG), PciBCtlSync, PciCtlQueryDeviceResourceRequirements,
  54. B_QUERY_EJECT, SIZE_CALL, PciBCtlSync, PciCtlForward,
  55. B_SET_LOCK, sizeof(BOOLEAN), PciBCtlLock, PciCtlLock,
  56. B_SET_RESUME, sizeof(BOOLEAN), PciBCtlSync, PciCtlForward,
  57. B_SET_POWER, sizeof(POWER_STATE), PciBCtlPower, PciCtlPower,
  58. B_SET_RES, 0, PciBCtlSync, PciCtlSetDeviceResources,
  59. B_ASSIGN_RES, SIZE_BRES, PciBCtlSync, PciCtlAssignSlotResources,
  60. 0, 0, NULL, NULL
  61. };
  62. #ifdef ALLOC_DATA_PRAGMA
  63. #pragma data_seg("PAGE")
  64. #endif
  65. //
  66. // PciDriverObject - the driver object for pciport.sys
  67. //
  68. PDRIVER_OBJECT PciDriverObject;
  69. //
  70. // PciCodeLock - Handle for locked code (only used during system
  71. // Suspend/Hibernate/Resume procedure)
  72. //
  73. PVOID PciCodeLock;
  74. //
  75. // PciSuspendRegistration - A registration to the systems
  76. // Suspend/Hibernate/Resume callback
  77. //
  78. HAL_CALLBACKS PciHalCallbacks;
  79. //
  80. // PciSuspendRegistration - A registration to the systems
  81. // Suspend/Hibernate/Resume callback
  82. //
  83. PVOID PciSuspendRegistration;
  84. //
  85. // Some global strings
  86. //
  87. WCHAR rgzPCIDeviceName[] = L"\\Device\\PciBus_%d";
  88. WCHAR rgzSuspendCallbackName[] = L"\\Callback\\SuspendHibernateSystem";
  89. WCHAR PCI_ID[] = L"PCI\\%04x_%04x";
  90. WCHAR PNP_VGA[] = L"PCI\\*PNP_VGA";
  91. WCHAR PNP_IDE[] = L"PCI\\*PNP_IDE";