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.

163 lines
9.8 KiB

  1. #include <windows.h>
  2. #include <ntverp.h>
  3. #define VER_FILETYPE VFT_DLL
  4. #define VER_FILESUBTYPE VFT2_UNKNOWN
  5. #define VER_FILEDESCRIPTION_STR "Cyclom-Y Enumerator Driver"
  6. #define VER_INTERNALNAME_STR "cyclom-y.sys"
  7. #define VER_ORIGINALFILENAME_STR "cyclom-y.sys"
  8. #define VER_LEGALCOPYRIGHT_YEARS "1996-2001"
  9. #define VER_LEGALCOPYRIGHT_STR "Copyright (C) Cyclades Corp. " VER_LEGALCOPYRIGHT_YEARS
  10. #define VER_FILEVERSION 1,0,22,0
  11. #define VER_FILEVERSION_STR "1.0.22.0"
  12. #include "common.ver"
  13. #include "log.rc"
  14. // History
  15. //
  16. // 1.0.22.0 07/06/01 Fix from DDK RC1: IoMarkIrpPending called when
  17. // Irp->PendingReturned set in the IoCompletion routine of Device
  18. // Power Irp.
  19. // 1.0.19.0 04/27/01 _WIN64 code removed. UINumber is always set to 0xFFFFFFFF
  20. // when IoGetDeviceProperty fails.
  21. // 1.0.18.0 04/25/01 DeviceData->IsPci was not being set in
  22. // _WIN64.
  23. // 1.0.17.0 04/25/01 Delete #defines for VER_COMPANYNAME_STR,
  24. // VER_PRODUCTNAME_STR, VER_PRODUCTVERSION and
  25. // VER_PRODUCTVERSION_STR to fix compilation
  26. // warnings.
  27. // Fix for Driver Verifier: dispatch handler was returning a
  28. // status that was inconsistent with the Irp's
  29. // IoStatus.Status field (IoStatus.Status = 00000002,
  30. // returned = 00000000) in IRP_MN_REMOVE_DEVICE.
  31. // Cyclomy_KdPrint in AddDevice replaced by
  32. // Cyclomy_KdPrint_Def.
  33. // Error status logged in CyyLogError in AddDevice.
  34. // 1.0.16.0 04/18/01 UINumber hardcoded to 0xFFFFFFFF for _WIN64
  35. // because IoGetDeviceProperty to get UINumber
  36. // is failing in 64-bit.
  37. // 1.0.15.0 04/17/01 STATUS_PENDING returned from Cyclomy_FDO_Power
  38. // instead of status from PoCallDriver. That's how
  39. // Eliyas Yakub said we should do.
  40. // 1.0.14.0 04/16/01 Fix for Driver Verifier: IoMarkIrpPending required
  41. // when STATUS_PENDING returned.
  42. // 1.0.13.0 04/02/01 Just version change.
  43. // 1.0.12.0 03/19/01 Just version change.
  44. // 1.0.11.0 03/14/01 Changes for serenum from DDK 2416 (Whistler pre-Beta2)
  45. // to DDK 2446 (Whistler pre-Beta2) applied.
  46. // 1.0.10.0 03/12/01 Changes for serenum from DDK 2195 (Windows 2000) to DDK
  47. // 2416 (Whistler pre-Beta2) applied.
  48. // PdoData->HardwareIDs and PdoData->CompIDs freed using
  49. // CyclomyFreeUnicodeString instead RtlFreeUnicodeString.
  50. // PdoData->InstanceIDs and PdoData->DevDesc were not being
  51. // freed, so this was fixed.
  52. // Messages logged in case of AddDevice failure.
  53. // 1.0.9.0 03/12/01 Just version change.
  54. // 1.0.8.0 03/02/01 Child PDO BusNumber was changed from 0 to PCI UINumber
  55. // (slot number). This BusNumber is used by cyyport AddDevice.
  56. // 1.0.7.0 02/26/01 Just version change.
  57. // 1.0.6.0 02/16/01 Just version change.
  58. // 1.0.5.0 02/15/01 Debug message changes.
  59. // 1.0.4.0 02/08/01 power.c: Cyclomy_FDO_Power with System IRP_MN_SET_POWER
  60. // request changed to return STATUS_PENDING, set an
  61. // IoCompletion routine, and request Device power Irp in
  62. // the IoCompletion routine.
  63. // DDK 2416 serenum power.c changes applied to power.c.
  64. // 1.0.3.0 02/01/01 Just version change.
  65. // 1.0.2.0 01/30/01 Creation of Cyclomy_Delay().
  66. // 01/25/01 Driver built with Whistler DDK 2416.
  67. // Reset board and reset chip is no longer done by cyyport. They are
  68. // called during FDO IRP_MN_START_DEVICE and FDO IRP_MN_SET_POWER
  69. // to D0. Cyclomy_EnableInterruptInPLX created. Files changed: pnp.c,
  70. // power.c and cyclom-y.h.
  71. // 1.0.1.0 12/06/00 Driver built with Whistler DDK (Beta1).
  72. // 1.0.0.29 09/20/00 Set DeviceState for PowerSystemSleeping1, PowerSystemSleeping2 and
  73. // PowerSystemSleeping3 to PowerDeviceD3 to fix hang in Standby.
  74. // 1.0.0.28 08/29/00 Replace "break" by a "return" in FDO IRP_MN_CANCEL_REMOVE_DEVICE.
  75. // This bug could cause crash.
  76. // 1.0.0.27 07/14/00 SER_DEFAULT_DEBUG_OUTPUT_LEVEL set to 0.
  77. // 1.0.0.23 06/23/00 Name "Cyclom-Y Bus Driver" changed to "Cyclom-Y Enumerator Driver".
  78. // 1.0.0.22 06/20/00 Added error logging.
  79. // 1.0.0.21 06/15/00 Added support to IRP_MN_SURPRISE_REMOVAL.
  80. // Removed and Started flags in the Extension replaced by
  81. // DevicePnPState. Cyclomy_FDO_Power just passes IRPs to lower
  82. // drivers if DevicePnPState != Started, instead of
  83. // Started != TRUE. This means that Cyclomy_FDO_Power passes
  84. // IRPs without handling when DevicePnPState is StopPending,
  85. // Stopped, RemovePending and SurprisePending.
  86. // Removed support to IRP_MJ_INTERNAL_DEVICE_CONTROL.
  87. // Removed initialization of all DriverObject->MajorFunction[]
  88. // with Cyclomy_DispatchPassThrough, the only exception is
  89. // IRP_MJ_SYSTEM_CONTROL. For IRP_MJ_CREATE and IRP_MJ_CLOSE,
  90. // IRP's are completed instead of sent to lower drivers.
  91. // Code cleanup.
  92. // 1.0.0.20 06/05/00 Buffers allocated with correct tag.
  93. // 1.0.0.16 05/12/00 Save number of ports to the Registry, so that Property Page
  94. // code can retrieve it.
  95. // Print the child PDO's during QUERY_DEVICE_RELATIONS if
  96. // SER_DBG_PNP_TRACE is enabled.
  97. // 1.0.0.15 04/21/00 Cyclomy_KdPrint_Def added for Cyclomy_IoCtl and
  98. // Cyclomy_InternIoCtl.
  99. // 1.0.0.14 -------- None.
  100. // 1.0.0.13 03/31/00 Re-compiled becaused cd1400.h changed for cyyport.
  101. // 1.0.0.12 03/29/00 Cyclomy_ReenumerateDevices fixed to indicate that devices
  102. // are not Attached when actual numPorts < FdoData->NumPDOs.
  103. // Cyclomy_PnPRemove() doesn't need to reset PdoData->Attached
  104. // because PdoData will be deleted.
  105. // 03/03/00 Add changes from serenum build 1946 to 2000:
  106. // - DeviceData->SystemWake and DeviceWake initialized to
  107. // PowerSystemUnspecified and PowerDeviceUnspecified in
  108. // Cyclomy_AddDevice.
  109. // - nameLength returned by IoGetDeviceProperty checked for
  110. // non zero before returned status is checked.
  111. // - Call IoCompleteRequest in case status is
  112. // STATUS_UNSUCCESSFUL in FDO IRP_MN_QUERY_STOP_DEVICE.
  113. // - FDO IRP_MN_QUERY_DEVICE_RELATIONS calls IoCompleteRequest
  114. // in case of failure to allocate buffer for relations.
  115. // - Handle FDO IRP_MN_QUERY_CAPABILITIES to get SystemWake
  116. // and DeviceWake from lower drivers.
  117. // - Create SystemWake and DeviceWake fields in FDO_DEVICE_DATA.
  118. // - PDO IRP_MN_QUERY_CAPABILITIES sets SystemWake and
  119. // DeviceWake with values returned from FDO
  120. // IRP_MN_QUERY_CAPABILITIES.
  121. // - PDO IRP_MN_QUERY_ID sets status in each case of switch
  122. // instead of before switch.
  123. // - Cyclomy_InternIoCtl just passes to lower drivers any
  124. // non recognized IoControlCode instead of returning
  125. // STATUS_INVALID_PARAMETER.
  126. // Copyright updated to 2000.
  127. // 1.0.0.11 03/01/00 Cyclomy_FDO_Power should change DevicePowerState of itself
  128. // instead of DevicePowerState of child devices during
  129. // IRP_MN_SET_POWER SystemPowerState.
  130. // 1.0.0.10 02/29/00 Use the latest cd1400.h from cyyport driver, modified on
  131. // 02/28/00.
  132. // 1.0.0.9 02/25/00 Fix FDO IRP_MN_CANCEL_STOP_DEVICE: wait for lower
  133. // drivers to process this IRP before returning status.
  134. // Fix FDO IRP_MN_REMOVE_DEVICE: set Irp->IoStatus.Status
  135. // before calling lower drivers.
  136. // Use "event" local variable instead of allocating
  137. // pResFiltEvent from NonPagedPool during
  138. // IRP_MN_FILTER_RESOURCE_REQUIREMENTS.
  139. // 1.0.0.8 01/13/00 cyclom-y is getting BreakOnEntry and DebugLevel from the
  140. // Registry.
  141. // 12/23/99 Fix BugCheck 0xC1 when "Special Pool" Verifier is enabled.
  142. // The problem was that IRP_MN_QUERY_DEVICE_TEXT was
  143. // allocating DevDesc->Length, but writing up to
  144. // DevDesc->MaximumLength.
  145. // Cosmetic changes in the src code.
  146. // 1.0.0.7 10/14/99 Allow multiple ISA boards installation. For this, change
  147. // IRP_MN_FILTER_RESOURCE_REQUIREMENTS to not set memory
  148. // ShareDisposition as Shared, and to only keep IRP shared
  149. // if the board is PCI.
  150. // 1.0.0.6 10/11/99 pnp.c #if 0 in IRP_MN_QUERY_RESOURCE_REQUIREMENTS and in
  151. // IRP_MN_QUERY_RESOURCES; IRP_MN_START_DEVICE of the PDO
  152. // will save the REG_RESOURCE_LIST of the board to the
  153. // Registry; cyclom-y.h with new fields in the PDO extension.
  154. // 1.0.0.6 10/07/99 enum.c Remove extra space from the device Description.
  155. // 1.0.0.5 10/07/99 New child Hardware Id's, Instances and Descriptions;
  156. // cyclom-y.h, cyyhw.h, enum.c, pnp.c, do.bat changed.
  157. // 1.0.0.4 09/20/99 Support to ISA boards.