ReactOS 0.4.17-dev-1190-g4c812f4
videoprt.h
Go to the documentation of this file.
1/*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#ifndef VIDEOPRT_H
23#define VIDEOPRT_H
24
25#include <ntifs.h>
26
27#define __BROKEN__
28#include <miniport.h>
29#include <video.h>
30#include <ntagp.h>
31#include <dderror.h>
32#include <windef.h>
33#include <wdmguid.h>
34
35/* PSEH for SEH Support */
36#include <pseh/pseh2.h>
37
38#define TAG_VIDEO_PORT 'PDIV'
39#define TAG_VIDEO_PORT_BUFFER '\0mpV'
40#define TAG_REQUEST_PACKET 'qRpV'
41
42#define GUID_STRING_LENGTH (38 * sizeof(WCHAR))
43
45{
54
56
58{
63
65{
70
72{
77
79{
82
84{
121
123{
125
129
131
134
136
139
140#define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
141 CONTAINING_RECORD( \
142 MiniportExtension, \
143 VIDEO_PORT_CHILD_EXTENSION, \
144 ChildDeviceExtension)
145
146#define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
147 CONTAINING_RECORD( \
148 MiniportExtension, \
149 VIDEO_PORT_DEVICE_EXTENSION, \
150 MiniPortDeviceExtension)
151
152typedef struct _VIDEO_PORT_EVENT
153{
156
157/* agp.c */
158
165
168 IN PVOID HwDeviceExtension,
170
171/* child.c */
172
176 IN PIRP Irp);
177
178/* dispatch.c */
179
184
188 IN PIRP Irp);
189
193 IN PIRP Irp);
194
198 IN PIRP Irp);
199
203 IN PIRP Irp);
204
208 IN PIRP Irp);
209
213 IN PIRP Irp);
214
218 IN PIRP Irp);
219
222
223/* timer.c */
224
229
230/* interrupt.c */
231
236 IN PVIDEO_PORT_CONFIG_INFO ConfigInfo);
237
238/* resource.c */
239
243 IN PIO_STACK_LOCATION IrpStack,
244 IN PIRP Irp);
245
246VOID
248 _In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
249
254 IN ULONG SizeInBytes,
257
258/* videoprt.c */
259
260extern PKPROCESS CsrProcess;
263
266extern KMUTEX VgaSyncLock;
269extern ULONG NumOfVgaRanges;
270
274 _Outptr_ PKPROCESS* CallingProcess,
276
277VOID
280 _In_ PKPROCESS CallingProcess,
282
288 _In_ USHORT AdapterNumber,
289 _In_ USHORT DisplayNumber,
291
296 _In_ _When_(LegacyDetection, _Null_) PDEVICE_OBJECT DeviceObject,
297 _In_ BOOLEAN LegacyDetection);
298
299PVOID
300NTAPI
302 _In_ PVOID HwDeviceExtension,
304
308 IN PIRP Irp);
309
310/* int10.c */
311
312#ifdef _M_IX86
313extern BOOLEAN VideoPortDisableX86Emulator;
314#endif
316
319
321NTAPI
324 _Out_ PUSHORT Seg,
327
329NTAPI
332 _In_ USHORT Seg,
333 _In_ USHORT Off);
334
336NTAPI
339 _In_ USHORT Seg,
343
345NTAPI
348 _In_ USHORT Seg,
352
354NTAPI
357 _Inout_ PINT10_BIOS_ARGUMENTS BiosArguments);
358
359/* registry.c */
360
362NTAPI
364 _In_ HANDLE SourceKeyHandle,
365 _In_ HANDLE DestKeyHandle);
366
368NTAPI
370 HANDLE SourceKeyHandle,
371 HANDLE DestKeyHandle,
373
375NTAPI
377 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
378
380NTAPI
382 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
383
385NTAPI
389 OUT PUNICODE_STRING DeviceRegistryPath);
390
391#endif /* VIDEOPRT_H */
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
Definition: acpixf.h:1279
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
Definition: bufpool.h:45
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1230
_In_ PIO_STATUS_BLOCK IoStatusBlock
Definition: dispmprt.h:608
_In_ ULONG _In_ MEMORY_CACHING_TYPE _Out_ PPHYSICAL_ADDRESS PhysicalAddress
Definition: dispmprt.h:714
_In_ ULONG _In_ MEMORY_CACHING_TYPE _Out_ PPHYSICAL_ADDRESS _Out_ PVOID * VirtualAddress
Definition: dispmprt.h:716
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
unsigned int UINT
Definition: sysinfo.c:13
UNICODE_STRING DriverRegistryPath
Definition: inport.c:17
_In_ PIRP Irp
Definition: kse.h:79
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Outptr_
Definition: no_sal2.h:262
#define _Null_
Definition: no_sal2.h:52
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
#define _When_(c, a)
Definition: no_sal2.h:38
#define FASTCALL
Definition: nt_native.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1751
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned short USHORT
Definition: pedump.c:61
char CHAR
Definition: pedump.c:57
enum _INTERFACE_TYPE INTERFACE_TYPE
LONG VP_STATUS
Definition: video.h:153
enum _VIDEO_CHILD_TYPE VIDEO_CHILD_TYPE
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: ketypes.h:767
Definition: typedefs.h:120
MEMORY_CACHING_TYPE CacheType
Definition: videoprt.h:51
PHYSICAL_ADDRESS IoAddress
Definition: videoprt.h:49
PHYSICAL_ADDRESS PhysicalAddress
Definition: videoprt.h:61
PVIDEO_PORT_AGP_MAPPING AgpMapping
Definition: videoprt.h:66
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:133
VIDEO_CHILD_TYPE ChildType
Definition: videoprt.h:127
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:132
VIDEO_PORT_COMMON_EXTENSION Common
Definition: videoprt.h:124
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:88
PCM_RESOURCE_LIST AllocatedResources
Definition: videoprt.h:95
PDEVICE_OBJECT NextDeviceObject
Definition: videoprt.h:90
VIDEO_PORT_DRIVER_EXTENSION * DriverExtension
Definition: videoprt.h:104
INTERFACE_TYPE AdapterInterfaceType
Definition: videoprt.h:99
CHAR POINTER_ALIGNMENT MiniPortDeviceExtension[1]
Definition: videoprt.h:119
UNICODE_STRING RegistryPath
Definition: videoprt.h:91
LIST_ENTRY AddressMappingListHead
Definition: videoprt.h:102
VIDEO_PORT_COMMON_EXTENSION Common
Definition: videoprt.h:85
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:87
AGP_BUS_INTERFACE_STANDARD AgpInterface
Definition: videoprt.h:106
UNICODE_STRING NewRegistryPath
Definition: videoprt.h:92
PDEVICE_OBJECT FunctionalDeviceObject
Definition: videoprt.h:89
UNICODE_STRING RegistryPath
Definition: videoprt.h:75
VIDEO_HW_INITIALIZATION_DATA InitializationData
Definition: videoprt.h:73
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ UCXUSBDEVICE _In_ ULONG Interface
Definition: ucxusbdevice.h:428
static int Protect(const char **args)
Definition: vfdcmd.c:2132
struct _VIDEO_PORT_AGP_MAPPING * PVIDEO_PORT_AGP_MAPPING
NTSTATUS IntInitializeInt10(VOID)
Definition: int10.c:766
ULONG NumOfVgaRanges
Definition: videoprt.c:48
NTSTATUS NTAPI IntVideoPortDispatchClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:434
VP_STATUS NTAPI IntInt10CallBios(_In_ PVOID Context, _Inout_ PINT10_BIOS_ARGUMENTS BiosArguments)
Definition: int10.c:737
PKPROCESS CsrProcess
Definition: videoprt.c:39
NTSTATUS NTAPI IntVideoPortMapPhysicalMemory(IN HANDLE Process, IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG SizeInBytes, IN ULONG Protect, IN OUT PVOID *VirtualAddress OPTIONAL)
Definition: resource.c:244
BOOLEAN VideoPortUseNewKey
Definition: videoprt.c:41
NTSTATUS NTAPI IntVideoPortDispatchCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1214
VP_STATUS NTAPI IntInt10WriteMemory(_In_ PVOID Context, _In_ USHORT Seg, _In_ USHORT Off, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Length)
Definition: int10.c:574
PVOID NTAPI IntVideoPortGetProcAddress(_In_ PVOID HwDeviceExtension, _In_ PUCHAR FunctionName)
Definition: funclist.c:106
VOID NTAPI IntVideoPortUnload(PDRIVER_OBJECT DriverObject)
Definition: dispatch.c:1288
VOID FASTCALL IntDetachFromCSRSS(_In_ PKPROCESS CallingProcess, _In_ PKAPC_STATE ApcState)
Detach the current thread from the CSRSS process. This routine is to be invoked after a previous succ...
Definition: videoprt.c:775
struct _VIDEO_PORT_EVENT VIDEO_PORT_EVENT
LIST_ENTRY HwResetAdaptersList
BOOLEAN NTAPI IntVideoPortSetupTimer(IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension)
Definition: timer.c:43
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING * PVIDEO_PORT_AGP_VIRTUAL_MAPPING
NTSTATUS NTAPI IntCreateRegistryPath(IN PCUNICODE_STRING DriverRegistryPath, IN ULONG DeviceNumber, OUT PUNICODE_STRING DeviceRegistryPath)
Definition: registry.c:603
struct _VIDEO_PORT_COMMON_EXTENSION VIDEO_PORT_COMMON_EXTENSION
NTSTATUS NTAPI IntVideoPortDispatchOpen(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:369
NTSTATUS NTAPI IntVideoPortDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:766
NTSTATUS IopInitiatePnpIrp(PDEVICE_OBJECT DeviceObject, PIO_STATUS_BLOCK IoStatusBlock, UCHAR MinorFunction, PIO_STACK_LOCATION Stack OPTIONAL)
Definition: agp.c:30
struct _VIDEO_PORT_AGP_MAPPING VIDEO_PORT_AGP_MAPPING
NTSTATUS NTAPI IntVideoPortDispatchSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1266
struct _VIDEO_PORT_EVENT * PVIDEO_PORT_EVENT
NTSTATUS NTAPI IntCopyRegistryValue(HANDLE SourceKeyHandle, HANDLE DestKeyHandle, PWSTR ValueName)
Definition: registry.c:233
NTSTATUS NTAPI IntVideoPortCreateAdapterDeviceObject(_In_ PDRIVER_OBJECT DriverObject, _In_ PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, _In_opt_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ USHORT AdapterNumber, _In_ USHORT DisplayNumber, _Out_opt_ PDEVICE_OBJECT *DeviceObject)
Definition: videoprt.c:171
struct _VIDEO_PORT_COMMON_EXTENSION * PVIDEO_PORT_COMMON_EXTENSION
struct _VIDEO_PORT_DRIVER_EXTENSION VIDEO_PORT_DRIVER_EXTENSION
struct _VIDEO_PORT_DRIVER_EXTENSION * PVIDEO_PORT_DRIVER_EXTENSION
NTSTATUS NTAPI IntCreateNewRegistryPath(PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: registry.c:408
NTSTATUS NTAPI IntVideoPortDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1200
NTSTATUS NTAPI IntVideoPortDispatchPdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: child.c:404
PVIDEO_PORT_DEVICE_EXTENSION VgaDeviceExtension
Definition: videoprt.c:46
VP_STATUS NTAPI IntInt10AllocateBuffer(_In_ PVOID Context, _Out_ PUSHORT Seg, _Out_ PUSHORT Off, _Inout_ PULONG Length)
Definition: int10.c:375
struct _VIDEO_PORT_DEVICE_EXTENSTION * PVIDEO_PORT_DEVICE_EXTENSION
BOOLEAN NTAPI IntVideoPortSetupInterrupt(IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PVIDEO_PORT_CONFIG_INFO ConfigInfo)
Definition: interrupt.c:45
NTSTATUS NTAPI IntVideoPortFilterResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpStack, IN PIRP Irp)
Definition: resource.c:81
ULONG VideoPortDeviceNumber
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING VIDEO_PORT_AGP_VIRTUAL_MAPPING
KMUTEX VideoPortInt10Mutex
Definition: int10.c:41
KMUTEX VgaSyncLock
Definition: videoprt.c:45
NTSTATUS NTAPI IntSetupDeviceSettingsKey(PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: registry.c:298
struct _VIDEO_PORT_ADDRESS_MAPPING VIDEO_PORT_ADDRESS_MAPPING
struct _VIDEO_PORT_CHILD_EXTENSION * PVIDEO_PORT_CHILD_EXTENSION
VOID IntVideoPortReleaseResources(_In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: resource.c:198
NTSTATUS NTAPI IntVideoPortAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: dispatch.c:334
NTSTATUS NTAPI IntAgpGetInterface(IN PVOID HwDeviceExtension, IN OUT PINTERFACE Interface)
Definition: agp.c:496
VP_STATUS NTAPI IntInt10ReadMemory(_In_ PVOID Context, _In_ USHORT Seg, _In_ USHORT Off, _Out_writes_bytes_(Length) PVOID Buffer, _In_ ULONG Length)
Definition: int10.c:507
struct _VIDEO_PORT_DEVICE_EXTENSTION VIDEO_PORT_DEVICE_EXTENSION
struct _VIDEO_PORT_ADDRESS_MAPPING * PVIDEO_PORT_ADDRESS_MAPPING
VP_STATUS NTAPI IntInt10FreeBuffer(_In_ PVOID Context, _In_ USHORT Seg, _In_ USHORT Off)
Definition: int10.c:444
KSPIN_LOCK HwResetAdaptersLock
Definition: videoprt.c:43
NTSTATUS IntVideoPortFindAdapter(_In_ PDRIVER_OBJECT DriverObject, _In_ PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, _In_ _When_(LegacyDetection, _Null_) PDEVICE_OBJECT DeviceObject, _In_ BOOLEAN LegacyDetection)
Definition: videoprt.c:433
PVIDEO_ACCESS_RANGE VgaRanges
Definition: videoprt.c:47
NTSTATUS NTAPI IntCopyRegistryKey(_In_ HANDLE SourceKeyHandle, _In_ HANDLE DestKeyHandle)
Definition: registry.c:34
NTSTATUS NTAPI IntVideoPortEnumerateChildren(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: videoprt.c:1478
BOOLEAN FASTCALL IntAttachToCSRSS(_Outptr_ PKPROCESS *CallingProcess, _Out_ PKAPC_STATE ApcState)
Attach the current thread to the CSRSS process. The caller must detach from the process by invoking I...
Definition: videoprt.c:748
NTSTATUS NTAPI IntVideoPortDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1232
struct _VIDEO_PORT_CHILD_EXTENSION VIDEO_PORT_CHILD_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1705
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define POINTER_ALIGNMENT
* PKAPC_STATE
Definition: ketypes.h:1727
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE