ReactOS  0.4.14-dev-1036-g3c5b10f
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 {
112 
114 {
116 
120 
122 
125 
127 
130 
131 #define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
132  CONTAINING_RECORD( \
133  MiniportExtension, \
134  VIDEO_PORT_CHILD_EXTENSION, \
135  ChildDeviceExtension)
136 
137 #define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
138  CONTAINING_RECORD( \
139  MiniportExtension, \
140  VIDEO_PORT_DEVICE_EXTENSION, \
141  MiniPortDeviceExtension)
142 
143 typedef struct _VIDEO_PORT_EVENT
144 {
147 
148 /* agp.c */
149 
150 NTSTATUS
156 
159  IN PVOID HwDeviceExtension,
161 
162 /* child.c */
163 
167  IN PIRP Irp);
168 
169 /* dispatch.c */
170 
175 
179  IN PIRP Irp);
180 
184  IN PIRP Irp);
185 
189  IN PIRP Irp);
190 
194  IN PIRP Irp);
195 
199  IN PIRP Irp);
200 
204  IN PIRP Irp);
205 
209  IN PIRP Irp);
210 
211 VOID NTAPI
213 
214 /* timer.c */
215 
220 
221 /* interrupt.c */
222 
227  IN PVIDEO_PORT_CONFIG_INFO ConfigInfo);
228 
229 /* resource.c */
230 
234  IN PIRP Irp);
235 
238  IN HANDLE Process,
240  IN ULONG SizeInBytes,
241  IN ULONG Protect,
243 
244 /* videoprt.c */
245 
246 extern PKPROCESS CsrProcess;
251 
254 
257 
264 
270 
271 PVOID NTAPI
273  IN PVOID HwDeviceExtension,
275 
276 /* int10.c */
277 
278 NTSTATUS
279 NTAPI
281 
284  IN PVOID Context,
285  OUT PUSHORT Seg,
286  OUT PUSHORT Off,
287  IN OUT PULONG Length);
288 
291  IN PVOID Context,
292  IN USHORT Seg,
293  IN USHORT Off);
294 
297  IN PVOID Context,
298  IN USHORT Seg,
299  IN USHORT Off,
300  OUT PVOID Buffer,
301  IN ULONG Length);
302 
305  IN PVOID Context,
306  IN USHORT Seg,
307  IN USHORT Off,
308  IN PVOID Buffer,
309  IN ULONG Length);
310 
313  IN PVOID Context,
314  IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
315 
316 /* registry.c */
317 
318 NTSTATUS
319 NTAPI
321  _In_ HANDLE SourceKeyHandle,
322  _In_ HANDLE DestKeyHandle);
323 
324 NTSTATUS
325 NTAPI
327  HANDLE SourceKeyHandle,
328  HANDLE DestKeyHandle,
329  PWSTR ValueName);
330 
331 NTSTATUS
332 NTAPI
334  PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
335 
336 NTSTATUS
337 NTAPI
339  PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
340 
341 NTSTATUS
342 NTAPI
345  OUT PUNICODE_STRING DeviceRegistryPath);
346 
347 
348 #endif /* VIDEOPRT_H */
NTSTATUS NTAPI IntCopyRegistryKey(_In_ HANDLE SourceKeyHandle, _In_ HANDLE DestKeyHandle)
Definition: registry.c:30
VP_STATUS NTAPI IntInt10AllocateBuffer(IN PVOID Context, OUT PUSHORT Seg, OUT PUSHORT Off, IN OUT PULONG Length)
Definition: int10.c:156
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
VIDEO_CHILD_TYPE ChildType
Definition: videoprt.h:118
enum _INTERFACE_TYPE INTERFACE_TYPE
struct _VIDEO_PORT_ADDRESS_MAPPING * PVIDEO_PORT_ADDRESS_MAPPING
struct _VIDEO_PORT_EVENT VIDEO_PORT_EVENT
NTSTATUS NTAPI IntVideoPortFilterResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: resource.c:77
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
_In_ PIRP Irp
Definition: csq.h:116
uint16_t * PWSTR
Definition: typedefs.h:55
NTSTATUS NTAPI IntVideoPortMapPhysicalMemory(IN HANDLE Process, IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG SizeInBytes, IN ULONG Protect, IN OUT PVOID *VirtualAddress OPTIONAL)
Definition: resource.c:192
NTSTATUS NTAPI IntVideoPortDispatchDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:714
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:296
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:1115
PCM_RESOURCE_LIST AllocatedResources
Definition: videoprt.h:94
LIST_ENTRY AddressMappingListHead
Definition: videoprt.h:101
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
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:452
struct _VIDEO_PORT_COMMON_EXTENSION * PVIDEO_PORT_COMMON_EXTENSION
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING VIDEO_PORT_AGP_VIRTUAL_MAPPING
struct _VIDEO_PORT_AGP_MAPPING * PVIDEO_PORT_AGP_MAPPING
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
VOID FASTCALL IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
Definition: videoprt.c:439
ULONG VideoPortDeviceNumber
Definition: videoprt.c:38
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
NTSTATUS NTAPI IntVideoPortCreateAdapterDeviceObject(IN PDRIVER_OBJECT DriverObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, OUT PDEVICE_OBJECT *DeviceObject OPTIONAL)
Definition: videoprt.c:92
PHYSICAL_ADDRESS PhysicalAddress
Definition: videoprt.h:60
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:87
NTSTATUS NTAPI IntVideoPortDispatchClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:429
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:115
NTSTATUS NTAPI IntCreateRegistryPath(IN PCUNICODE_STRING DriverRegistryPath, OUT PUNICODE_STRING DeviceRegistryPath)
Definition: registry.c:532
unsigned char BOOLEAN
VOID NTAPI IntVideoPortUnload(PDRIVER_OBJECT DriverObject)
Definition: dispatch.c:1171
NTSTATUS NTAPI IntVideoPortFindAdapter(IN PDRIVER_OBJECT DriverObject, IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PDEVICE_OBJECT DeviceObject)
Definition: videoprt.c:252
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
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
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:123
NTSTATUS NTAPI IntInitializeVideoAddressSpace(VOID)
Definition: int10.c:146
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
VP_STATUS NTAPI IntInt10CallBios(IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
Definition: int10.c:315
NTSTATUS NTAPI IntVideoPortDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1083
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:251
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTSTATUS NTAPI IntCopyRegistryValue(HANDLE SourceKeyHandle, HANDLE DestKeyHandle, PWSTR ValueName)
Definition: registry.c:229
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1061
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: ketypes.h:687
PKPROCESS CsrProcess
Definition: videoprt.c:37
struct _VIDEO_PORT_DRIVER_EXTENSION VIDEO_PORT_DRIVER_EXTENSION
PDEVICE_OBJECT NextDeviceObject
Definition: videoprt.h:89
KSPIN_LOCK HwResetAdaptersLock
Definition: videoprt.c:40
struct _VIDEO_PORT_CHILD_EXTENSION VIDEO_PORT_CHILD_EXTENSION
Definition: typedefs.h:118
_In_ ULONG _In_ BOOLEAN _Must_inspect_result_ PVOID * VirtualAddress
Definition: ndis.h:3791
PVOID NTAPI IntVideoPortGetProcAddress(IN PVOID HwDeviceExtension, IN PUCHAR FunctionName)
Definition: funclist.c:100
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
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 IntVideoPortDispatchPdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: child.c:319
struct _VIDEO_PORT_DEVICE_EXTENSTION VIDEO_PORT_DEVICE_EXTENSION
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING * PVIDEO_PORT_AGP_VIRTUAL_MAPPING
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IntVideoPortDispatchCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1097
UNICODE_STRING RegistryPath
Definition: videoprt.h:74
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1492
NTSTATUS NTAPI IntVideoPortDispatchOpen(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:366
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
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:218
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:357
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:124
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY HwResetAdaptersList
LONG VP_STATUS
Definition: video.h:153
UNICODE_STRING RegistryPath
Definition: videoprt.h:90
VP_STATUS NTAPI IntInt10WriteMemory(IN PVOID Context, IN USHORT Seg, IN USHORT Off, IN PVOID Buffer, IN ULONG Length)
Definition: int10.c:283
INTERFACE_TYPE AdapterInterfaceType
Definition: videoprt.h:98
NTSTATUS NTAPI IntVideoPortDispatchSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: dispatch.c:1149
struct _VIDEO_PORT_COMMON_EXTENSION VIDEO_PORT_COMMON_EXTENSION
unsigned short * PUSHORT
Definition: retypes.h:2
UNICODE_STRING DriverRegistryPath
Definition: ramdisk.c:124
KMUTEX VideoPortInt10Mutex
Definition: videoprt.c:39
* PKAPC_STATE
Definition: ketypes.h:1273
struct _VIDEO_PORT_AGP_MAPPING VIDEO_PORT_AGP_MAPPING
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68