ReactOS  0.4.15-dev-3295-gaa8fc87
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 {
53 
55 
57 {
62 
64 {
69 
71 {
76 
78 {
81 
83 {
115 
117 {
119 
123 
125 
128 
130 
133 
134 #define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
135  CONTAINING_RECORD( \
136  MiniportExtension, \
137  VIDEO_PORT_CHILD_EXTENSION, \
138  ChildDeviceExtension)
139 
140 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
141  CONTAINING_RECORD( \
142  MiniportExtension, \
143  VIDEO_PORT_DEVICE_EXTENSION, \
144  MiniPortDeviceExtension)
145 
146 typedef struct _VIDEO_PORT_EVENT
147 {
150 
151 /* agp.c */
152 
153 NTSTATUS
159 
162  IN PVOID HwDeviceExtension,
164 
165 /* child.c */
166 
170  IN PIRP Irp);
171 
172 /* dispatch.c */
173 
178 
182  IN PIRP Irp);
183 
187  IN PIRP Irp);
188 
192  IN PIRP Irp);
193 
197  IN PIRP Irp);
198 
202  IN PIRP Irp);
203 
207  IN PIRP Irp);
208 
212  IN PIRP Irp);
213 
214 VOID NTAPI
216 
217 /* timer.c */
218 
223 
224 /* interrupt.c */
225 
230  IN PVIDEO_PORT_CONFIG_INFO ConfigInfo);
231 
232 /* resource.c */
233 
237  IN PIO_STACK_LOCATION IrpStack,
238  IN PIRP Irp);
239 
242  IN HANDLE Process,
244  IN ULONG SizeInBytes,
245  IN ULONG Protect,
247 
248 /* videoprt.c */
249 
250 extern PKPROCESS CsrProcess;
255 
258 
261 
267  _In_ USHORT AdapterNumber,
268  _In_ USHORT DisplayNumber,
270 
276 
277 PVOID NTAPI
279  IN PVOID HwDeviceExtension,
281 
282 /* int10.c */
283 
284 NTSTATUS
285 NTAPI
287 
290  IN PVOID Context,
291  OUT PUSHORT Seg,
292  OUT PUSHORT Off,
293  IN OUT PULONG Length);
294 
297  IN PVOID Context,
298  IN USHORT Seg,
299  IN USHORT Off);
300 
303  IN PVOID Context,
304  IN USHORT Seg,
305  IN USHORT Off,
306  OUT PVOID Buffer,
307  IN ULONG Length);
308 
311  IN PVOID Context,
312  IN USHORT Seg,
313  IN USHORT Off,
314  IN PVOID Buffer,
315  IN ULONG Length);
316 
319  IN PVOID Context,
320  IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
321 
322 /* registry.c */
323 
324 NTSTATUS
325 NTAPI
327  _In_ HANDLE SourceKeyHandle,
328  _In_ HANDLE DestKeyHandle);
329 
330 NTSTATUS
331 NTAPI
333  HANDLE SourceKeyHandle,
334  HANDLE DestKeyHandle,
335  PWSTR ValueName);
336 
337 NTSTATUS
338 NTAPI
340  PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
341 
342 NTSTATUS
343 NTAPI
345  PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
346 
347 NTSTATUS
348 NTAPI
352  OUT PUNICODE_STRING DeviceRegistryPath);
353 
354 
355 #endif /* VIDEOPRT_H */
NTSTATUS NTAPI IntCopyRegistryKey(_In_ HANDLE SourceKeyHandle, _In_ HANDLE DestKeyHandle)
Definition: registry.c:31
VP_STATUS NTAPI IntInt10AllocateBuffer(IN PVOID Context, OUT PUSHORT Seg, OUT PUSHORT Off, IN OUT PULONG Length)
Definition: int10.c:210
struct _VIDEO_PORT_CHILD_EXTENSION * PVIDEO_PORT_CHILD_EXTENSION
#define IN
Definition: typedefs.h:39
UNICODE_STRING NewRegistryPath
Definition: videoprt.h:91
PDEVICE_OBJECT FunctionalDeviceObject
Definition: videoprt.h:88
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VIDEO_CHILD_TYPE ChildType
Definition: videoprt.h:121
enum _INTERFACE_TYPE INTERFACE_TYPE
struct _VIDEO_PORT_ADDRESS_MAPPING * PVIDEO_PORT_ADDRESS_MAPPING
#define _In_opt_
Definition: ms_sal.h:309
struct _VIDEO_PORT_EVENT VIDEO_PORT_EVENT
VIDEO_PORT_DRIVER_EXTENSION * DriverExtension
Definition: videoprt.h:103
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT _In_ ULONG _In_ ULONG Protect
Definition: zwfuncs.h:214
uint16_t * PWSTR
Definition: typedefs.h:56
NTSTATUS NTAPI IntVideoPortMapPhysicalMemory(IN HANDLE Process, IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG SizeInBytes, IN ULONG Protect, IN OUT PVOID *VirtualAddress OPTIONAL)
Definition: resource.c:194
NTSTATUS NTAPI IntVideoPortDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:718
VIDEO_HW_INITIALIZATION_DATA InitializationData
Definition: videoprt.h:72
unsigned char * PUCHAR
Definition: retypes.h:3
NTSTATUS NTAPI IntSetupDeviceSettingsKey(PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: registry.c:297
char CHAR
Definition: xmlstorage.h:175
PHYSICAL_ADDRESS IoAddress
Definition: videoprt.h:49
LONG NTSTATUS
Definition: precomp.h:26
struct _VIDEO_PORT_DEVICE_EXTENSTION * PVIDEO_PORT_DEVICE_EXTENSION
NTSTATUS NTAPI IntVideoPortDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1119
PCM_RESOURCE_LIST AllocatedResources
Definition: videoprt.h:94
LIST_ENTRY AddressMappingListHead
Definition: videoprt.h:101
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1155
AGP_BUS_INTERFACE_STANDARD AgpInterface
Definition: videoprt.h:105
#define FASTCALL
Definition: nt_native.h:50
struct _VIDEO_PORT_EVENT * PVIDEO_PORT_EVENT
VOID FASTCALL IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
Definition: videoprt.c:506
struct _VIDEO_PORT_COMMON_EXTENSION * PVIDEO_PORT_COMMON_EXTENSION
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING VIDEO_PORT_AGP_VIRTUAL_MAPPING
struct _VIDEO_PORT_AGP_MAPPING * PVIDEO_PORT_AGP_MAPPING
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
VOID FASTCALL IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
Definition: videoprt.c:493
ULONG VideoPortDeviceNumber
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _VIDEO_PORT_DRIVER_EXTENSION * PVIDEO_PORT_DRIVER_EXTENSION
_In_ PIRP Irp
Definition: csq.h:116
PHYSICAL_ADDRESS PhysicalAddress
Definition: videoprt.h:60
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:87
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1697
NTSTATUS NTAPI IntVideoPortDispatchClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:433
BOOLEAN NTAPI IntVideoPortSetupInterrupt(IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PVIDEO_PORT_CONFIG_INFO ConfigInfo)
Definition: interrupt.c:45
VIDEO_PORT_COMMON_EXTENSION Common
Definition: videoprt.h:118
unsigned char BOOLEAN
VOID NTAPI IntVideoPortUnload(PDRIVER_OBJECT DriverObject)
Definition: dispatch.c:1175
NTSTATUS NTAPI IntVideoPortFindAdapter(IN PDRIVER_OBJECT DriverObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PDEVICE_OBJECT DeviceObject)
Definition: videoprt.c:341
#define _In_
Definition: ms_sal.h:308
struct _VIDEO_PORT_ADDRESS_MAPPING VIDEO_PORT_ADDRESS_MAPPING
Definition: bufpool.h:45
NTSTATUS NTAPI IntVideoPortAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: dispatch.c:334
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:126
NTSTATUS NTAPI IntInitializeVideoAddressSpace(VOID)
Definition: int10.c:200
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define POINTER_ALIGNMENT
VP_STATUS NTAPI IntInt10CallBios(IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
Definition: int10.c:380
NTSTATUS NTAPI IntVideoPortDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1087
enum _VIDEO_CHILD_TYPE VIDEO_CHILD_TYPE
VP_STATUS NTAPI IntInt10ReadMemory(IN PVOID Context, IN USHORT Seg, IN USHORT Off, OUT PVOID Buffer, IN ULONG Length)
Definition: int10.c:306
CHAR POINTER_ALIGNMENT MiniPortDeviceExtension[1]
Definition: videoprt.h:113
NTSTATUS NTAPI IntCopyRegistryValue(HANDLE SourceKeyHandle, HANDLE DestKeyHandle, PWSTR ValueName)
Definition: registry.c:230
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: ketypes.h:687
PKPROCESS CsrProcess
Definition: videoprt.c:39
struct _VIDEO_PORT_DRIVER_EXTENSION VIDEO_PORT_DRIVER_EXTENSION
PDEVICE_OBJECT NextDeviceObject
Definition: videoprt.h:89
KSPIN_LOCK HwResetAdaptersLock
Definition: videoprt.c:42
struct _VIDEO_PORT_CHILD_EXTENSION VIDEO_PORT_CHILD_EXTENSION
Definition: typedefs.h:119
PVOID NTAPI IntVideoPortGetProcAddress(IN PVOID HwDeviceExtension, IN PUCHAR FunctionName)
Definition: funclist.c:100
PVIDEO_PORT_AGP_MAPPING AgpMapping
Definition: videoprt.h:65
NTSTATUS NTAPI IntAgpGetInterface(IN PVOID HwDeviceExtension, IN OUT PINTERFACE Interface)
Definition: agp.c:496
NTSTATUS IopInitiatePnpIrp(PDEVICE_OBJECT DeviceObject, PIO_STATUS_BLOCK IoStatusBlock, UCHAR MinorFunction, PIO_STACK_LOCATION Stack OPTIONAL)
Definition: agp.c:30
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:86
NTSTATUS NTAPI IntCreateRegistryPath(IN PCUNICODE_STRING DriverRegistryPath, IN ULONG DeviceNumber, OUT PUNICODE_STRING DeviceRegistryPath)
Definition: registry.c:601
NTSTATUS NTAPI IntVideoPortDispatchPdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: child.c:386
struct _VIDEO_PORT_DEVICE_EXTENSTION VIDEO_PORT_DEVICE_EXTENSION
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING * PVIDEO_PORT_AGP_VIRTUAL_MAPPING
UNICODE_STRING DriverRegistryPath
Definition: inport.c:17
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IntVideoPortDispatchCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1101
UNICODE_STRING RegistryPath
Definition: videoprt.h:74
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1679
NTSTATUS NTAPI IntVideoPortDispatchOpen(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:369
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define _Out_opt_
Definition: ms_sal.h:346
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
VP_STATUS NTAPI IntInt10FreeBuffer(IN PVOID Context, IN USHORT Seg, IN USHORT Off)
Definition: int10.c:273
VIDEO_PORT_COMMON_EXTENSION Common
Definition: videoprt.h:84
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:1274
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
BOOLEAN NTAPI IntVideoPortSetupTimer(IN PDEVICE_OBJECT DeviceObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension)
Definition: timer.c:43
#define OUT
Definition: typedefs.h:40
NTSTATUS NTAPI IntCreateNewRegistryPath(PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: registry.c:407
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:127
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned int ULONG
Definition: retypes.h:1
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:152
NTSTATUS NTAPI IntVideoPortFilterResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpStack, IN PIRP Irp)
Definition: resource.c:77
LIST_ENTRY HwResetAdaptersList
LONG VP_STATUS
Definition: video.h:153
UNICODE_STRING RegistryPath
Definition: videoprt.h:90
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1229
VP_STATUS NTAPI IntInt10WriteMemory(IN PVOID Context, IN USHORT Seg, IN USHORT Off, IN PVOID Buffer, IN ULONG Length)
Definition: int10.c:344
INTERFACE_TYPE AdapterInterfaceType
Definition: videoprt.h:98
NTSTATUS NTAPI IntVideoPortDispatchSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1153
struct _VIDEO_PORT_COMMON_EXTENSION VIDEO_PORT_COMMON_EXTENSION
unsigned short * PUSHORT
Definition: retypes.h:2
KMUTEX VideoPortInt10Mutex
Definition: videoprt.c:41
* PKAPC_STATE
Definition: ketypes.h:1280
struct _VIDEO_PORT_AGP_MAPPING VIDEO_PORT_AGP_MAPPING
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68