2004-01-19 15:56:53 +00:00
|
|
|
/*
|
|
|
|
* VideoPort driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002, 2003, 2004 ReactOS Team
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2009-10-27 10:34:16 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2004-01-19 15:56:53 +00:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-10-27 10:34:16 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2009-10-27 10:34:16 +00:00
|
|
|
* Lesser General Public License for more details.
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
2009-10-27 10:34:16 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-01-19 15:56:53 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIDEOPRT_H
|
|
|
|
#define VIDEOPRT_H
|
|
|
|
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ntifs.h>
|
|
|
|
|
2010-03-03 07:09:09 +00:00
|
|
|
#define __BROKEN__
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <miniport.h>
|
|
|
|
#include <video.h>
|
|
|
|
#include <ntagp.h>
|
2008-11-27 20:05:12 +00:00
|
|
|
#include <dderror.h>
|
|
|
|
#include <windef.h>
|
2011-07-28 16:13:00 +00:00
|
|
|
#include <wdmguid.h>
|
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define TAG_VIDEO_PORT 'PDIV'
|
|
|
|
#define TAG_VIDEO_PORT_BUFFER '\0mpV'
|
2012-10-06 20:15:36 +00:00
|
|
|
#define TAG_REQUEST_PACKET 'qRpV'
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2013-11-16 18:40:24 +00:00
|
|
|
#define GUID_STRING_LENGTH 38 * sizeof(WCHAR)
|
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
typedef struct _VIDEO_PORT_ADDRESS_MAPPING
|
|
|
|
{
|
|
|
|
LIST_ENTRY List;
|
|
|
|
PVOID MappedAddress;
|
|
|
|
ULONG NumberOfUchars;
|
|
|
|
PHYSICAL_ADDRESS IoAddress;
|
|
|
|
ULONG SystemIoBusNumber;
|
|
|
|
UINT MappingCount;
|
|
|
|
} VIDEO_PORT_ADDRESS_MAPPING, *PVIDEO_PORT_ADDRESS_MAPPING;
|
|
|
|
|
2005-01-07 01:03:34 +00:00
|
|
|
struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING;
|
|
|
|
|
|
|
|
typedef struct _VIDEO_PORT_AGP_MAPPING
|
|
|
|
{
|
|
|
|
ULONG NumberOfPages;
|
|
|
|
PVOID MapHandle;
|
|
|
|
PHYSICAL_ADDRESS PhysicalAddress;
|
|
|
|
} VIDEO_PORT_AGP_MAPPING, *PVIDEO_PORT_AGP_MAPPING;
|
|
|
|
|
|
|
|
typedef struct _VIDEO_PORT_AGP_VIRTUAL_MAPPING
|
|
|
|
{
|
|
|
|
PVIDEO_PORT_AGP_MAPPING AgpMapping;
|
|
|
|
HANDLE ProcessHandle;
|
|
|
|
PVOID MappedAddress;
|
|
|
|
} VIDEO_PORT_AGP_VIRTUAL_MAPPING, *PVIDEO_PORT_AGP_VIRTUAL_MAPPING;
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
typedef struct _VIDEO_PORT_DRIVER_EXTENSION
|
|
|
|
{
|
|
|
|
VIDEO_HW_INITIALIZATION_DATA InitializationData;
|
|
|
|
PVOID HwContext;
|
|
|
|
UNICODE_STRING RegistryPath;
|
|
|
|
} VIDEO_PORT_DRIVER_EXTENSION, *PVIDEO_PORT_DRIVER_EXTENSION;
|
|
|
|
|
2012-03-12 03:29:36 +00:00
|
|
|
typedef struct _VIDEO_PORT_COMMON_EXTENSION
|
|
|
|
{
|
|
|
|
BOOLEAN Fdo;
|
|
|
|
} VIDEO_PORT_COMMON_EXTENSION, *PVIDEO_PORT_COMMON_EXTENSION;
|
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
|
|
|
|
{
|
2012-03-12 03:29:36 +00:00
|
|
|
VIDEO_PORT_COMMON_EXTENSION Common;
|
2005-01-07 01:03:34 +00:00
|
|
|
ULONG DeviceNumber;
|
2005-06-03 16:56:27 +00:00
|
|
|
PDRIVER_OBJECT DriverObject;
|
2004-03-19 20:58:32 +00:00
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
PDEVICE_OBJECT FunctionalDeviceObject;
|
2004-12-19 15:51:51 +00:00
|
|
|
PDEVICE_OBJECT NextDeviceObject;
|
2004-03-19 20:58:32 +00:00
|
|
|
UNICODE_STRING RegistryPath;
|
2013-11-16 18:40:24 +00:00
|
|
|
UNICODE_STRING NewRegistryPath;
|
2004-01-19 15:56:53 +00:00
|
|
|
PKINTERRUPT InterruptObject;
|
|
|
|
KSPIN_LOCK InterruptSpinLock;
|
2005-01-07 01:03:34 +00:00
|
|
|
PCM_RESOURCE_LIST AllocatedResources;
|
2004-01-19 15:56:53 +00:00
|
|
|
ULONG InterruptVector;
|
|
|
|
ULONG InterruptLevel;
|
2005-03-23 21:51:40 +00:00
|
|
|
BOOLEAN InterruptShared;
|
2005-06-03 16:56:27 +00:00
|
|
|
INTERFACE_TYPE AdapterInterfaceType;
|
2004-01-19 15:56:53 +00:00
|
|
|
ULONG SystemIoBusNumber;
|
2004-03-19 20:58:32 +00:00
|
|
|
ULONG SystemIoSlotNumber;
|
|
|
|
LIST_ENTRY AddressMappingListHead;
|
2004-03-06 22:25:22 +00:00
|
|
|
KDPC DpcObject;
|
2004-03-19 20:58:32 +00:00
|
|
|
VIDEO_PORT_DRIVER_EXTENSION *DriverExtension;
|
2004-04-08 09:43:55 +00:00
|
|
|
ULONG DeviceOpened;
|
2005-01-07 01:03:34 +00:00
|
|
|
AGP_BUS_INTERFACE_STANDARD AgpInterface;
|
|
|
|
KMUTEX DeviceLock;
|
2012-03-12 03:29:36 +00:00
|
|
|
LIST_ENTRY DmaAdapterList, ChildDeviceList;
|
2013-11-22 11:36:22 +00:00
|
|
|
ULONG SessionId;
|
2004-03-19 20:58:32 +00:00
|
|
|
CHAR MiniPortDeviceExtension[1];
|
2004-01-19 15:56:53 +00:00
|
|
|
} VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
|
|
|
|
|
2012-03-12 03:29:36 +00:00
|
|
|
typedef struct _VIDEO_PORT_CHILD_EXTENSION
|
|
|
|
{
|
|
|
|
VIDEO_PORT_COMMON_EXTENSION Common;
|
|
|
|
|
|
|
|
ULONG ChildId;
|
|
|
|
VIDEO_CHILD_TYPE ChildType;
|
|
|
|
UCHAR ChildDescriptor[256];
|
|
|
|
|
|
|
|
BOOLEAN EdidValid;
|
|
|
|
|
|
|
|
PDRIVER_OBJECT DriverObject;
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
|
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
|
|
|
|
CHAR ChildDeviceExtension[1];
|
|
|
|
} VIDEO_PORT_CHILD_EXTENSION, *PVIDEO_PORT_CHILD_EXTENSION;
|
|
|
|
|
|
|
|
#define VIDEO_PORT_GET_CHILD_EXTENSION(MiniportExtension) \
|
|
|
|
CONTAINING_RECORD( \
|
|
|
|
MiniportExtension, \
|
|
|
|
VIDEO_PORT_CHILD_EXTENSION, \
|
|
|
|
ChildDeviceExtension)
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
#define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension) \
|
|
|
|
CONTAINING_RECORD( \
|
2012-03-12 03:29:36 +00:00
|
|
|
MiniportExtension, \
|
2004-03-19 20:58:32 +00:00
|
|
|
VIDEO_PORT_DEVICE_EXTENSION, \
|
|
|
|
MiniPortDeviceExtension)
|
|
|
|
|
2009-06-30 13:42:42 +00:00
|
|
|
typedef struct _VIDEO_PORT_EVENT
|
|
|
|
{
|
|
|
|
ENG_EVENT;
|
|
|
|
} VIDEO_PORT_EVENT, *PVIDEO_PORT_EVENT;
|
|
|
|
|
2005-01-07 01:03:34 +00:00
|
|
|
/* agp.c */
|
|
|
|
|
2005-12-31 16:01:02 +00:00
|
|
|
NTSTATUS
|
|
|
|
IopInitiatePnpIrp(
|
|
|
|
PDEVICE_OBJECT DeviceObject,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
2011-06-25 14:10:19 +00:00
|
|
|
UCHAR MinorFunction,
|
2005-12-31 16:01:02 +00:00
|
|
|
PIO_STACK_LOCATION Stack OPTIONAL);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-01-07 01:03:34 +00:00
|
|
|
IntAgpGetInterface(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN OUT PINTERFACE Interface);
|
|
|
|
|
2012-03-12 03:29:36 +00:00
|
|
|
/* child.c */
|
|
|
|
|
|
|
|
NTSTATUS NTAPI
|
|
|
|
IntVideoPortDispatchPdoPnp(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
/* dispatch.c */
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortAddDevice(
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PDEVICE_OBJECT PhysicalDeviceObject);
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchOpen(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchClose(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchCleanup(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchDeviceControl(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchPnp(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortDispatchPower(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2007-12-20 12:31:39 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
IntVideoPortDispatchSystemControl(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-10-17 21:36:23 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
IntVideoPortDispatchWrite(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VOID NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortUnload(PDRIVER_OBJECT DriverObject);
|
|
|
|
|
|
|
|
/* timer.c */
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
BOOLEAN NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortSetupTimer(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension);
|
|
|
|
|
|
|
|
/* interrupt.c */
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
BOOLEAN NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortSetupInterrupt(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
|
|
|
IN PVIDEO_PORT_CONFIG_INFO ConfigInfo);
|
|
|
|
|
2005-01-07 01:03:34 +00:00
|
|
|
/* resource.c */
|
|
|
|
|
2011-10-23 02:45:09 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
IntVideoPortFilterResourceRequirements(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-01-07 01:03:34 +00:00
|
|
|
IntVideoPortMapPhysicalMemory(
|
|
|
|
IN HANDLE Process,
|
|
|
|
IN PHYSICAL_ADDRESS PhysicalAddress,
|
|
|
|
IN ULONG SizeInBytes,
|
|
|
|
IN ULONG Protect,
|
|
|
|
IN OUT PVOID *VirtualAddress OPTIONAL);
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
/* videoprt.c */
|
|
|
|
|
|
|
|
extern ULONG CsrssInitialized;
|
2005-06-14 13:10:40 +00:00
|
|
|
extern PKPROCESS Csrss;
|
2008-05-07 21:51:39 +00:00
|
|
|
extern ULONG VideoPortDeviceNumber;
|
2017-05-18 21:29:24 +00:00
|
|
|
extern KMUTEX VideoPortInt10Mutex;
|
2004-03-19 20:58:32 +00:00
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
VOID FASTCALL
|
2005-06-14 20:24:02 +00:00
|
|
|
IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState);
|
2004-03-19 20:58:32 +00:00
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
VOID FASTCALL
|
2005-06-14 20:24:02 +00:00
|
|
|
IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState);
|
2004-03-19 20:58:32 +00:00
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-01-07 01:03:34 +00:00
|
|
|
IntVideoPortCreateAdapterDeviceObject(
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
|
|
|
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
|
|
|
|
OUT PDEVICE_OBJECT *DeviceObject OPTIONAL);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
NTSTATUS NTAPI
|
2004-03-19 20:58:32 +00:00
|
|
|
IntVideoPortFindAdapter(
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
2005-01-07 01:03:34 +00:00
|
|
|
IN PDEVICE_OBJECT DeviceObject);
|
2004-03-19 20:58:32 +00:00
|
|
|
|
2007-10-01 08:14:24 +00:00
|
|
|
PVOID NTAPI
|
|
|
|
IntVideoPortGetProcAddress(
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PUCHAR FunctionName);
|
|
|
|
|
2004-03-19 20:58:32 +00:00
|
|
|
/* int10.c */
|
2004-01-19 15:56:53 +00:00
|
|
|
|
2013-11-16 18:40:24 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntInitializeVideoAddressSpace(VOID);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInt10AllocateBuffer(
|
|
|
|
IN PVOID Context,
|
|
|
|
OUT PUSHORT Seg,
|
|
|
|
OUT PUSHORT Off,
|
|
|
|
IN OUT PULONG Length);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInt10FreeBuffer(
|
|
|
|
IN PVOID Context,
|
|
|
|
IN USHORT Seg,
|
|
|
|
IN USHORT Off);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInt10ReadMemory(
|
|
|
|
IN PVOID Context,
|
|
|
|
IN USHORT Seg,
|
|
|
|
IN USHORT Off,
|
|
|
|
OUT PVOID Buffer,
|
|
|
|
IN ULONG Length);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInt10WriteMemory(
|
|
|
|
IN PVOID Context,
|
|
|
|
IN USHORT Seg,
|
|
|
|
IN USHORT Off,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Length);
|
|
|
|
|
2005-08-24 21:29:24 +00:00
|
|
|
VP_STATUS NTAPI
|
2004-01-19 15:56:53 +00:00
|
|
|
IntInt10CallBios(
|
|
|
|
IN PVOID Context,
|
|
|
|
IN OUT PINT10_BIOS_ARGUMENTS BiosArguments);
|
|
|
|
|
2013-11-16 18:40:24 +00:00
|
|
|
/* registry.c */
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntCopyRegistryKey(
|
|
|
|
_In_ HANDLE SourceKeyHandle,
|
|
|
|
_In_ HANDLE DestKeyHandle);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntCopyRegistryValue(
|
|
|
|
HANDLE SourceKeyHandle,
|
|
|
|
HANDLE DestKeyHandle,
|
|
|
|
PWSTR ValueName);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntSetupDeviceSettingsKey(
|
|
|
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntCreateNewRegistryPath(
|
|
|
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IntCreateRegistryPath(
|
|
|
|
IN PCUNICODE_STRING DriverRegistryPath,
|
|
|
|
OUT PUNICODE_STRING DeviceRegistryPath);
|
|
|
|
|
|
|
|
|
2004-01-19 15:56:53 +00:00
|
|
|
#endif /* VIDEOPRT_H */
|