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.

155 lines
3.5 KiB

  1. #include "dderror.h"
  2. #include "devioctl.h"
  3. #include "miniport.h"
  4. #include "ntddvdeo.h"
  5. #include "video.h"
  6. #include "mirror.h"
  7. VOID DbgBreakPoint() {};
  8. VOID MirrorNotImplemented(char *s)
  9. {
  10. VideoDebugPrint((0, "Mirror Sample: Not used '%s'.\n", s));
  11. }
  12. BOOLEAN
  13. MirrorResetHW(
  14. PVOID HwDeviceExtension,
  15. ULONG Columns,
  16. ULONG Rows
  17. )
  18. {
  19. MirrorNotImplemented("MirrorResetHW");
  20. return TRUE;
  21. }
  22. BOOLEAN
  23. MirrorVidInterrupt(
  24. PVOID HwDeviceExtension
  25. )
  26. {
  27. MirrorNotImplemented("MirrorVidInterrupt");
  28. return TRUE;
  29. }
  30. VP_STATUS
  31. MirrorGetPowerState(
  32. PVOID HwDeviceExtension,
  33. ULONG HwId,
  34. PVIDEO_POWER_MANAGEMENT VideoPowerControl
  35. )
  36. {
  37. MirrorNotImplemented("MirrorGetPowerState");
  38. return NO_ERROR;
  39. }
  40. VP_STATUS
  41. MirrorSetPowerState(
  42. PVOID HwDeviceExtension,
  43. ULONG HwId,
  44. PVIDEO_POWER_MANAGEMENT VideoPowerControl
  45. )
  46. {
  47. MirrorNotImplemented("MirrorSetPowerState");
  48. return NO_ERROR;
  49. }
  50. ULONG
  51. MirrorGetChildDescriptor (
  52. IN PVOID HwDeviceExtension,
  53. IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
  54. OUT PVIDEO_CHILD_TYPE pChildType,
  55. OUT PVOID pChildDescriptor,
  56. OUT PULONG pUId,
  57. OUT PULONG pUnused
  58. )
  59. {
  60. MirrorNotImplemented("MirrorGetChildDescriptor");
  61. return ERROR_NO_MORE_DEVICES;
  62. }
  63. VP_STATUS MirrorFindAdapter(
  64. IN PVOID HwDeviceExtension,
  65. IN PVOID HwContext,
  66. IN PWSTR ArgumentString,
  67. IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
  68. OUT PUCHAR Again
  69. )
  70. {
  71. VideoDebugPrint((0,"FindAdapter Called.\n"));
  72. return NO_ERROR;
  73. }
  74. BOOLEAN MirrorInitialize(
  75. PVOID HwDeviceExtension
  76. )
  77. {
  78. VideoDebugPrint((0,"Initialize Called.\n"));
  79. return TRUE;
  80. }
  81. BOOLEAN MirrorStartIO(
  82. PVOID HwDeviceExtension,
  83. PVIDEO_REQUEST_PACKET RequestPacket
  84. )
  85. {
  86. VideoDebugPrint((0,"StartIO Called.\n"));
  87. return TRUE;
  88. }
  89. ULONG
  90. DriverEntry (
  91. PVOID Context1,
  92. PVOID Context2
  93. )
  94. {
  95. VIDEO_HW_INITIALIZATION_DATA hwInitData;
  96. ULONG initializationStatus;
  97. VideoDebugPrint((0, "Mirrored Driver VideoPort [Driver Entry]\n"));
  98. // Zero out structure.
  99. VideoPortZeroMemory(&hwInitData, sizeof(VIDEO_HW_INITIALIZATION_DATA));
  100. // Specify sizes of structure and extension.
  101. hwInitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA);
  102. // Set entry points.
  103. hwInitData.HwFindAdapter = &MirrorFindAdapter;
  104. hwInitData.HwInitialize = &MirrorInitialize;
  105. hwInitData.HwStartIO = &MirrorStartIO;
  106. hwInitData.HwResetHw = &MirrorResetHW;
  107. hwInitData.HwInterrupt = &MirrorVidInterrupt;
  108. hwInitData.HwGetPowerState = &MirrorGetPowerState;
  109. hwInitData.HwSetPowerState = &MirrorSetPowerState;
  110. hwInitData.HwGetVideoChildDescriptor = &MirrorGetChildDescriptor;
  111. hwInitData.HwLegacyResourceList = NULL;
  112. hwInitData.HwLegacyResourceCount = 0;
  113. // no device extension necessary
  114. hwInitData.HwDeviceExtensionSize = 0;
  115. hwInitData.AdapterInterfaceType = 0;
  116. initializationStatus = VideoPortInitialize(Context1,
  117. Context2,
  118. &hwInitData,
  119. NULL);
  120. return initializationStatus;
  121. } // end DriverEntry()