📄 ntddvdeo.h
字号:
//
typedef struct _VIDEO_VDM {
HANDLE ProcessHandle;
} VIDEO_VDM, *PVIDEO_VDM;
//
//ProcessHandle - Handle to the process for which this request must be
// performed. This is required because the console calls the miniport on
// the behalf of the VDM process; we are not performing this request in
// the context of the current caller.
//
typedef struct _VIDEO_REGISTER_VDM {
ULONG MinimumStateSize;
} VIDEO_REGISTER_VDM, *PVIDEO_REGISTER_VDM;
//
//MinimumStateSize - Output value determining the minimum size required to
// store the video hardware state when performing SAVE_HARDWARE_SATE or
// RESTORE_HARDWARE_STATE Ioctls.
//
//
// IOCTL_VIDEO_ENUM_MONITOR_PDO
//
// Descriptor of monitor devices
//
typedef struct tagVIDEO_MONITOR_DEVICE {
ULONG flag; // The monitor is ON/OFF
HANDLE pdo; // Monitor device handle
ULONG HwID;
} VIDEO_MONITOR_DEVICE, *PVIDEO_MONITOR_DEVICE;
//
// IOCTL_VIDEO_INIT_WIN32K_CALLBACKS
//
// List of function pointers used to make callbacks to win32k
//
typedef enum _VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE {
VideoPowerNotifyCallout = 1,
VideoDisplaySwitchCallout,
VideoEnumChildPdoNotifyCallout,
VideoFindAdapterCallout,
VideoWakeupCallout,
VideoChangeDisplaySettingsCallout
} VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE;
typedef struct _VIDEO_WIN32K_CALLBACKS_PARAMS {
VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE CalloutType;
PVOID PhysDisp;
ULONG_PTR Param;
LONG Status;
} VIDEO_WIN32K_CALLBACKS_PARAMS, *PVIDEO_WIN32K_CALLBACKS_PARAMS;
typedef
VOID
(*PVIDEO_WIN32K_CALLOUT) (
IN PVOID Params
);
typedef struct _VIDEO_WIN32K_CALLBACKS {
PVOID PhysDisp;
PVIDEO_WIN32K_CALLOUT Callout;
ULONG bACPI;
HANDLE pPhysDeviceObject;
ULONG DualviewFlags;
} VIDEO_WIN32K_CALLBACKS, *PVIDEO_WIN32K_CALLBACKS;
//
// IOCTL_VIDEO_USE_DEVICE_IN_SESSION
//
// Parameters to request new enabled/disabled state for a device
//
typedef struct _VIDEO_DEVICE_SESSION_STATUS {
ULONG bEnable; // Is device being enabled or disabled
ULONG bSuccess; // Was request validated
} VIDEO_DEVICE_SESSION_STATUS, *PVIDEO_DEVICE_SESSION_STATUS;
//
// defines for Dualview Flags
//
#define VIDEO_DUALVIEW_REMOVABLE 0x00000001
#define VIDEO_DUALVIEW_PRIMARY 0x80000000
#define VIDEO_DUALVIEW_SECONDARY 0x40000000
//
// defines for child state flag
//
#define VIDEO_CHILD_ACTIVE 0x00000001
#define VIDEO_CHILD_DETACHED 0x00000002
#define VIDEO_CHILD_NOPRUNE_FREQ 0x80000000
#define VIDEO_CHILD_NOPRUNE_RESOLUTION 0x40000000
//
// Second set of structures
//
//
// These IOCTLs are used by the VDM and the console to communicate state
// changes between the VDM and the kernel video driver.
//
// IOCTL_VIDEO_SAVE_HARDWARE_STATE -
// IOCTL_VIDEO_RESTORE_HARDWARE_STATE -
//
//
// This structure is at the start of the block used when saving or restoring
// the state of the video hardware using ConsoleHardwareState().
// the ULONG are offset to the location of the rest of the data. That data
// is stored within the same memory block pointed to by the
// VIDEO_HARDWARE_STATE structure, right after this header.
//
// Information used by this function is passed using the following structure:
//
typedef struct _VIDEO_HARDWARE_STATE_HEADER {
ULONG Length;
UCHAR PortValue[0x30];
ULONG AttribIndexDataState;
ULONG BasicSequencerOffset;
ULONG BasicCrtContOffset;
ULONG BasicGraphContOffset;
ULONG BasicAttribContOffset;
ULONG BasicDacOffset;
ULONG BasicLatchesOffset;
ULONG ExtendedSequencerOffset;
ULONG ExtendedCrtContOffset;
ULONG ExtendedGraphContOffset;
ULONG ExtendedAttribContOffset;
ULONG ExtendedDacOffset;
ULONG ExtendedValidatorStateOffset;
ULONG ExtendedMiscDataOffset;
ULONG PlaneLength;
ULONG Plane1Offset;
ULONG Plane2Offset;
ULONG Plane3Offset;
ULONG Plane4Offset;
ULONG VGAStateFlags;
ULONG DIBOffset;
ULONG DIBBitsPerPixel;
ULONG DIBXResolution;
ULONG DIBYResolution;
ULONG DIBXlatOffset;
ULONG DIBXlatLength;
ULONG VesaInfoOffset;
PVOID FrameBufferData;
} VIDEO_HARDWARE_STATE_HEADER, *PVIDEO_HARDWARE_STATE_HEADER;
//
// defines for VGAStateFlags
//
#define VIDEO_STATE_NON_STANDARD_VGA 0x00000001
#define VIDEO_STATE_UNEMULATED_VGA_STATE 0x00000002
#define VIDEO_STATE_PACKED_CHAIN4_MODE 0x00000004
typedef struct _VIDEO_HARDWARE_STATE {
PVIDEO_HARDWARE_STATE_HEADER StateHeader;
ULONG StateLength;
} VIDEO_HARDWARE_STATE, *PVIDEO_HARDWARE_STATE;
//
//Length - Length of the basic structure. Used for versioning purposes. The
// length field should be initialized to be equal to
// sizeof(VIDEO_HARDWARE_STATE_HEADER).
//
//PortValue - Array of entries containing the data values for port 3B0 through
// 3DF.
//
//AttribIndexDataState - State of the attribute index register.
//
//BasicSequencerOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// sequencer register set of the VGA.
//
//BasicCrtContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// CRT register set of the VGA.
//
//BasicGraphContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// graphics controller register set of the VGA.
//
//BasicAttribContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// attribute controller register set of the VGA.
//
//BasicDacOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// DAC registers of the VGA.
//
//BasicLatchesOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the register values for the basic
// latches of the VGA.
//
//ExtendedSequencerOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the registers values for the extended
// sequencer register set of the VGA.
//
//ExtendedCrtContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the registers values for the extended
// CRT register set of the VGA.
//
//ExtendedGraphContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the registers values for the extended
// graphics controller register set of the VGA.
//
//ExtendedAttribContOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the registers values for the extended
// attribute controller register set of the VGA.
//
//ExtendedDacOffset - Offset, in bytes, from the beginning of the structure,
// to an array of fields containing the registers values for the extended
// DAC registers of the VGA.
//
//ExtendedValidatorStateOffset - Offset, in bytes, from the beginning of the
// structure, to an area reserved for the miniport to put the unemulated
// save state that the miniport uses to perform instruction validation for
// DOS apps.
//
//ExtendedMiscDataOffset - Offset, in bytes, from the beginning of the structure,
// to an area reserved for the use of the miniport.
//
//PlaneLength - Length of each of the following plane (if present)
//
//Plane1Offset - Offset, in bytes, from the beginning of the structure, to an
// array of fields containing the data of the first plane of video memory.
//
//Plane2Offset - Offset, in bytes, from the beginning of the structure, to an
// array of fields containing the data of the second plane of video memory.
//
//Plane3Offset - Offset, in bytes, from the beginning of the structure, to an
// array of fields containing the data of the third plane of video memory.
//
//Plane4Offset - Offset, in bytes, from the beginning of the structure, to an
// array of fields containing the data of the fourth plane of video memory.
//
//VGAStateFlags - Flags used for the interpretation of the VGA state.
// VIDEO_STATE_NON_STANDARD_VGA is set when the set of registers the VGA
// returns is not the basic set (all super vga's are not standard).
// The VDM should not emulate the saved state unless a specific VDD
// has been written for the device.
// VIDEO_STATE_UNEMULATED_VGA_STATE specified the miniport has stored
// informaiton in the ExtendedValidatorState field and the miniport
// should treat this as a frozen state, whatever the registers say.
// VIDEO_STATE_PACKED_CHAIN4_MODE indicates that in mode 13 (320x200x256).
// the data is stored in a packed pixel format in the plane, as
// opposed to the standard VGA format where the data is interleaved
// at every four bytes, and on every 16K boundary, offset by one
// extra byte.
//
//DIBOffset - Offset to the location of the DIB in the allocated data
// structure. If NULL, no translation is available.
//
//DIBBitsPerPixel - Format of the DIB.
//
//DIBXResolution - Width of the DIB in pixels.
//
//DIBYResolution - Height of the DIB in pixels.
//
//DIBXlatOffset - Offset to the location of the translation vector
// from DIB pixel values to 32-bit RGB (1 byte red, 1 byte green, 1 byte
// blue, 1 byte empty). Maximum length 256. If NULL, the standard
// VGA palette stored in this structure should be used.
//
//DIBXlatLength - Length of the RGB translation vector at DIBXlatOffset.
//
// For each of the offset fields, if an offset value is NULL, then there is
// no data for that offset.
// The length of a data area is:
// 1) the specific length given to it : plane length (planes) or XResolution *
// Yresolution * BitsPerPel (DIB)
// 2) otherwise, the length = next_non-null_offset_value -
// current_offset_value
//
//
//StateHeader - Pointer to the VIDEO_HARDWARE_STATE_HEADER structure.
//
//StateLength - Size of the VIDEO_HARDWARE_STATE_HEADER structure.
//
//
// IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES - Returns number of different modes
// available on the controller.
//
// Information used by this function is passed using the following structure:
//
typedef struct _VIDEO_NUM_MODES {
ULONG NumModes;
ULONG ModeInformationLength;
} VIDEO_NUM_MODES, *PVIDEO_NUM_MODES;
//
//NumModes - Returns the number of modes supported by the kernel driver.
//
//ModeInformationLength - Length of the VIDEO_MODE_INFORMATION structure
// for the IOCTL_VIDEO QUERY_AVAILABLE_MODES IOCTL.
//
// IOCTL_VIDEO_SET_CURRENT_MODE - Is used to set the mode of the controller.
//
// Information used by this function is passed using the following structure:
//
typedef struct _VIDEO_MODE {
ULONG RequestedMode;
} VIDEO_MODE, *PVIDEO_MODE;
#define VIDEO_MODE_NO_ZERO_MEMORY 0x80000000 // High order bit of the mode
// determines if the set mode
// should (0) or should not (1)
// cause the video memory to be
// zeroed out simultaneously to
// the set mode operation.
#define VIDEO_MODE_MAP_MEM_LINEAR 0x40000000 // Miniports which support this
// flag will set a linear mode
// if possible when this flag
// is set. Note: Some miniports
// may return a linear mode even
// if this flag is not set.
//
//RequestedMode - Indicates in which mode the adapter should be initialized.
//
//
// IOCTL_VIDEO_RESET_DEVICE - Is used to reset the mode of the adapter when GDI
// gives up control of the device to allow a VDM to
// access the hardware. x86 only.
// The default mode should be whatever is the
// default mode when the machine is booted
//
// No information is needed fo this function.
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -