mirror of
https://github.com/reactos/reactos.git
synced 2024-07-29 23:58:44 +00:00
[VIDEOPRT][FORMATTING]
Apply proper indentation. svn path=/trunk/; revision=60982
This commit is contained in:
parent
e36ca7f5e4
commit
a937b3aad1
|
@ -30,7 +30,8 @@ ULONG VideoPortDeviceNumber = 0;
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS **********************************************************/
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
ULONG NTAPI
|
ULONG
|
||||||
|
NTAPI
|
||||||
DriverEntry(
|
DriverEntry(
|
||||||
IN PVOID Context1,
|
IN PVOID Context1,
|
||||||
IN PVOID Context2)
|
IN PVOID Context2)
|
||||||
|
@ -38,7 +39,8 @@ DriverEntry(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVOID NTAPI
|
PVOID
|
||||||
|
NTAPI
|
||||||
IntVideoPortImageDirectoryEntryToData(
|
IntVideoPortImageDirectoryEntryToData(
|
||||||
PVOID BaseAddress,
|
PVOID BaseAddress,
|
||||||
ULONG Directory)
|
ULONG Directory)
|
||||||
|
@ -60,7 +62,8 @@ IntVideoPortImageDirectoryEntryToData(
|
||||||
return (PVOID)((ULONG_PTR)BaseAddress + Va);
|
return (PVOID)((ULONG_PTR)BaseAddress + Va);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NTAPI
|
VOID
|
||||||
|
NTAPI
|
||||||
IntVideoPortDeferredRoutine(
|
IntVideoPortDeferredRoutine(
|
||||||
IN PKDPC Dpc,
|
IN PKDPC Dpc,
|
||||||
IN PVOID DeferredContext,
|
IN PVOID DeferredContext,
|
||||||
|
@ -72,6 +75,7 @@ IntVideoPortDeferredRoutine(
|
||||||
((PMINIPORT_DPC_ROUTINE)SystemArgument1)(HwDeviceExtension, SystemArgument2);
|
((PMINIPORT_DPC_ROUTINE)SystemArgument1)(HwDeviceExtension, SystemArgument2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
IntCreateRegistryPath(
|
IntCreateRegistryPath(
|
||||||
IN PCUNICODE_STRING DriverRegistryPath,
|
IN PCUNICODE_STRING DriverRegistryPath,
|
||||||
|
@ -86,6 +90,7 @@ IntCreateRegistryPath(
|
||||||
UNICODE_STRING AfterControlSet;
|
UNICODE_STRING AfterControlSet;
|
||||||
|
|
||||||
AfterControlSet = *DriverRegistryPath;
|
AfterControlSet = *DriverRegistryPath;
|
||||||
|
|
||||||
/* Check if path begins with \\REGISTRY\\MACHINE\\SYSTEM\\ */
|
/* Check if path begins with \\REGISTRY\\MACHINE\\SYSTEM\\ */
|
||||||
Valid = (DriverRegistryPath->Length > sizeof(RegistryMachineSystem) &&
|
Valid = (DriverRegistryPath->Length > sizeof(RegistryMachineSystem) &&
|
||||||
0 == _wcsnicmp(DriverRegistryPath->Buffer, RegistryMachineSystem,
|
0 == _wcsnicmp(DriverRegistryPath->Buffer, RegistryMachineSystem,
|
||||||
|
@ -115,6 +120,7 @@ IntCreateRegistryPath(
|
||||||
AfterControlSet.Buffer++;
|
AfterControlSet.Buffer++;
|
||||||
AfterControlSet.Length -= sizeof(WCHAR);
|
AfterControlSet.Length -= sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
Valid = (AfterControlSet.Length > 0 && L'\\' == *AfterControlSet.Buffer);
|
Valid = (AfterControlSet.Length > 0 && L'\\' == *AfterControlSet.Buffer);
|
||||||
AfterControlSet.Buffer++;
|
AfterControlSet.Buffer++;
|
||||||
AfterControlSet.Length -= sizeof(WCHAR);
|
AfterControlSet.Length -= sizeof(WCHAR);
|
||||||
|
@ -163,8 +169,7 @@ IntCreateRegistryPath(
|
||||||
if (!Valid)
|
if (!Valid)
|
||||||
{
|
{
|
||||||
DeviceRegistryPath->MaximumLength = DriverRegistryPath->Length + sizeof(Insert2);
|
DeviceRegistryPath->MaximumLength = DriverRegistryPath->Length + sizeof(Insert2);
|
||||||
DeviceRegistryPath->Buffer = ExAllocatePoolWithTag(
|
DeviceRegistryPath->Buffer = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
NonPagedPool,
|
|
||||||
DeviceRegistryPath->MaximumLength,
|
DeviceRegistryPath->MaximumLength,
|
||||||
TAG_VIDEO_PORT);
|
TAG_VIDEO_PORT);
|
||||||
|
|
||||||
|
@ -178,7 +183,8 @@ IntCreateRegistryPath(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
IntVideoPortCreateAdapterDeviceObject(
|
IntVideoPortCreateAdapterDeviceObject(
|
||||||
IN PDRIVER_OBJECT DriverObject,
|
IN PDRIVER_OBJECT DriverObject,
|
||||||
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
||||||
|
@ -202,7 +208,6 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
* Find the first free device number that can be used for video device
|
* Find the first free device number that can be used for video device
|
||||||
* object names and symlinks.
|
* object names and symlinks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DeviceNumber = VideoPortDeviceNumber;
|
DeviceNumber = VideoPortDeviceNumber;
|
||||||
if (DeviceNumber == 0xFFFFFFFF)
|
if (DeviceNumber == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
|
@ -245,10 +250,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
|
|
||||||
(*DeviceObject)->Flags |= DO_BUFFERED_IO;
|
(*DeviceObject)->Flags |= DO_BUFFERED_IO;
|
||||||
|
|
||||||
/*
|
/* Initialize device extension. */
|
||||||
* Initialize device extension.
|
|
||||||
*/
|
|
||||||
|
|
||||||
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)((*DeviceObject)->DeviceExtension);
|
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)((*DeviceObject)->DeviceExtension);
|
||||||
DeviceExtension->Common.Fdo = TRUE;
|
DeviceExtension->Common.Fdo = TRUE;
|
||||||
DeviceExtension->DeviceNumber = DeviceNumber;
|
DeviceExtension->DeviceNumber = DeviceNumber;
|
||||||
|
@ -259,12 +261,8 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
|
|
||||||
InitializeListHead(&DeviceExtension->ChildDeviceList);
|
InitializeListHead(&DeviceExtension->ChildDeviceList);
|
||||||
|
|
||||||
/*
|
/* Get the registry path associated with this driver. */
|
||||||
* Get the registry path associated with this driver.
|
Status = IntCreateRegistryPath(&DriverExtension->RegistryPath,
|
||||||
*/
|
|
||||||
|
|
||||||
Status = IntCreateRegistryPath(
|
|
||||||
&DriverExtension->RegistryPath,
|
|
||||||
&DeviceExtension->RegistryPath);
|
&DeviceExtension->RegistryPath);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -300,8 +298,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
{
|
{
|
||||||
/* Get bus type from the upper level bus driver. */
|
/* Get bus type from the upper level bus driver. */
|
||||||
Size = sizeof(ULONG);
|
Size = sizeof(ULONG);
|
||||||
IoGetDeviceProperty(
|
IoGetDeviceProperty(PhysicalDeviceObject,
|
||||||
PhysicalDeviceObject,
|
|
||||||
DevicePropertyLegacyBusType,
|
DevicePropertyLegacyBusType,
|
||||||
Size,
|
Size,
|
||||||
&DeviceExtension->AdapterInterfaceType,
|
&DeviceExtension->AdapterInterfaceType,
|
||||||
|
@ -309,8 +306,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
|
|
||||||
/* Get bus device address from the upper level bus driver. */
|
/* Get bus device address from the upper level bus driver. */
|
||||||
Size = sizeof(ULONG);
|
Size = sizeof(ULONG);
|
||||||
IoGetDeviceProperty(
|
IoGetDeviceProperty(PhysicalDeviceObject,
|
||||||
PhysicalDeviceObject,
|
|
||||||
DevicePropertyAddress,
|
DevicePropertyAddress,
|
||||||
Size,
|
Size,
|
||||||
&PciSlotNumber,
|
&PciSlotNumber,
|
||||||
|
@ -326,8 +322,7 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
InitializeListHead(&DeviceExtension->AddressMappingListHead);
|
InitializeListHead(&DeviceExtension->AddressMappingListHead);
|
||||||
InitializeListHead(&DeviceExtension->DmaAdapterList);
|
InitializeListHead(&DeviceExtension->DmaAdapterList);
|
||||||
|
|
||||||
KeInitializeDpc(
|
KeInitializeDpc(&DeviceExtension->DpcObject,
|
||||||
&DeviceExtension->DpcObject,
|
|
||||||
IntVideoPortDeferredRoutine,
|
IntVideoPortDeferredRoutine,
|
||||||
DeviceExtension);
|
DeviceExtension);
|
||||||
|
|
||||||
|
@ -336,7 +331,8 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
/* Attach the device. */
|
/* Attach the device. */
|
||||||
if (PhysicalDeviceObject != NULL)
|
if (PhysicalDeviceObject != NULL)
|
||||||
DeviceExtension->NextDeviceObject = IoAttachDeviceToDeviceStack(
|
DeviceExtension->NextDeviceObject = IoAttachDeviceToDeviceStack(
|
||||||
*DeviceObject, PhysicalDeviceObject);
|
*DeviceObject,
|
||||||
|
PhysicalDeviceObject);
|
||||||
|
|
||||||
/* Remove the initailizing flag */
|
/* Remove the initailizing flag */
|
||||||
(*DeviceObject)->Flags &= ~DO_DEVICE_INITIALIZING;
|
(*DeviceObject)->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||||
|
@ -344,7 +340,8 @@ IntVideoPortCreateAdapterDeviceObject(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
IntVideoPortFindAdapter(
|
IntVideoPortFindAdapter(
|
||||||
IN PDRIVER_OBJECT DriverObject,
|
IN PDRIVER_OBJECT DriverObject,
|
||||||
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
|
||||||
|
@ -367,10 +364,7 @@ IntVideoPortFindAdapter(
|
||||||
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
DeviceNumber = DeviceExtension->DeviceNumber;
|
DeviceNumber = DeviceExtension->DeviceNumber;
|
||||||
|
|
||||||
/*
|
/* Setup a ConfigInfo structure that we will pass to HwFindAdapter. */
|
||||||
* Setup a ConfigInfo structure that we will pass to HwFindAdapter.
|
|
||||||
*/
|
|
||||||
|
|
||||||
RtlZeroMemory(&ConfigInfo, sizeof(VIDEO_PORT_CONFIG_INFO));
|
RtlZeroMemory(&ConfigInfo, sizeof(VIDEO_PORT_CONFIG_INFO));
|
||||||
ConfigInfo.Length = sizeof(VIDEO_PORT_CONFIG_INFO);
|
ConfigInfo.Length = sizeof(VIDEO_PORT_CONFIG_INFO);
|
||||||
ConfigInfo.AdapterInterfaceType = DeviceExtension->AdapterInterfaceType;
|
ConfigInfo.AdapterInterfaceType = DeviceExtension->AdapterInterfaceType;
|
||||||
|
@ -385,16 +379,13 @@ IntVideoPortFindAdapter(
|
||||||
ConfigInfo.BusInterruptVector = DeviceExtension->InterruptVector;
|
ConfigInfo.BusInterruptVector = DeviceExtension->InterruptVector;
|
||||||
|
|
||||||
Size = sizeof(SystemBasicInfo);
|
Size = sizeof(SystemBasicInfo);
|
||||||
Status = ZwQuerySystemInformation(
|
Status = ZwQuerySystemInformation(SystemBasicInformation,
|
||||||
SystemBasicInformation,
|
|
||||||
&SystemBasicInfo,
|
&SystemBasicInfo,
|
||||||
Size,
|
Size,
|
||||||
&Size);
|
&Size);
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ConfigInfo.SystemMemorySize =
|
ConfigInfo.SystemMemorySize = SystemBasicInfo.NumberOfPhysicalPages *
|
||||||
SystemBasicInfo.NumberOfPhysicalPages *
|
|
||||||
SystemBasicInfo.PageSize;
|
SystemBasicInfo.PageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,10 +498,7 @@ IntVideoPortFindAdapter(
|
||||||
|
|
||||||
/* FIXME: Allocate hardware resources for device. */
|
/* FIXME: Allocate hardware resources for device. */
|
||||||
|
|
||||||
/*
|
/* Allocate interrupt for device. */
|
||||||
* Allocate interrupt for device.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!IntVideoPortSetupInterrupt(DeviceObject, DriverExtension, &ConfigInfo))
|
if (!IntVideoPortSetupInterrupt(DeviceObject, DriverExtension, &ConfigInfo))
|
||||||
{
|
{
|
||||||
RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
|
RtlFreeUnicodeString(&DeviceExtension->RegistryPath);
|
||||||
|
@ -536,17 +524,18 @@ IntVideoPortFindAdapter(
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Query children of the device. */
|
||||||
* Query children of the device.
|
|
||||||
*/
|
|
||||||
VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL);
|
VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL);
|
||||||
|
|
||||||
INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
|
INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID
|
||||||
IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
|
FASTCALL
|
||||||
|
IntAttachToCSRSS(
|
||||||
|
PKPROCESS *CallingProcess,
|
||||||
|
PKAPC_STATE ApcState)
|
||||||
{
|
{
|
||||||
*CallingProcess = (PKPROCESS)PsGetCurrentProcess();
|
*CallingProcess = (PKPROCESS)PsGetCurrentProcess();
|
||||||
if (*CallingProcess != Csrss)
|
if (*CallingProcess != Csrss)
|
||||||
|
@ -555,8 +544,11 @@ IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID
|
||||||
IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
|
FASTCALL
|
||||||
|
IntDetachFromCSRSS(
|
||||||
|
PKPROCESS *CallingProcess,
|
||||||
|
PKAPC_STATE ApcState)
|
||||||
{
|
{
|
||||||
if (*CallingProcess != Csrss)
|
if (*CallingProcess != Csrss)
|
||||||
{
|
{
|
||||||
|
@ -569,8 +561,8 @@ IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
ULONG
|
||||||
ULONG NTAPI
|
NTAPI
|
||||||
VideoPortInitialize(
|
VideoPortInitialize(
|
||||||
IN PVOID Context1,
|
IN PVOID Context1,
|
||||||
IN PVOID Context2,
|
IN PVOID Context2,
|
||||||
|
@ -585,10 +577,7 @@ VideoPortInitialize(
|
||||||
|
|
||||||
TRACE_(VIDEOPRT, "VideoPortInitialize\n");
|
TRACE_(VIDEOPRT, "VideoPortInitialize\n");
|
||||||
|
|
||||||
/*
|
/* As a first thing do parameter checks. */
|
||||||
* As a first thing do parameter checks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (HwInitializationData->HwInitDataSize > sizeof(VIDEO_HW_INITIALIZATION_DATA))
|
if (HwInitializationData->HwInitDataSize > sizeof(VIDEO_HW_INITIALIZATION_DATA))
|
||||||
{
|
{
|
||||||
ERR_(VIDEOPRT, "Invalid HwInitializationData\n");
|
ERR_(VIDEOPRT, "Invalid HwInitializationData\n");
|
||||||
|
@ -609,7 +598,6 @@ VideoPortInitialize(
|
||||||
* NT4 drivers are special case, because we must use legacy method
|
* NT4 drivers are special case, because we must use legacy method
|
||||||
* of detection instead of the Plug & Play one.
|
* of detection instead of the Plug & Play one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA:
|
case SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA:
|
||||||
INFO_(VIDEOPRT, "We were loaded by a Windows NT miniport driver.\n");
|
INFO_(VIDEOPRT, "We were loaded by a Windows NT miniport driver.\n");
|
||||||
break;
|
break;
|
||||||
|
@ -667,7 +655,6 @@ VideoPortInitialize(
|
||||||
* drivers in that case adjust parameters and call VideoPortInitialize
|
* drivers in that case adjust parameters and call VideoPortInitialize
|
||||||
* again.
|
* again.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
||||||
if (DriverExtension == NULL)
|
if (DriverExtension == NULL)
|
||||||
{
|
{
|
||||||
|
@ -687,7 +674,6 @@ VideoPortInitialize(
|
||||||
* Save the registry path. This should be done only once even if
|
* Save the registry path. This should be done only once even if
|
||||||
* VideoPortInitialize is called multiple times.
|
* VideoPortInitialize is called multiple times.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (RegistryPath->Length != 0)
|
if (RegistryPath->Length != 0)
|
||||||
{
|
{
|
||||||
DriverExtension->RegistryPath.Length = 0;
|
DriverExtension->RegistryPath.Length = 0;
|
||||||
|
@ -716,9 +702,7 @@ VideoPortInitialize(
|
||||||
/*
|
/*
|
||||||
* Copy the correct miniport initialization data to the device extension.
|
* Copy the correct miniport initialization data to the device extension.
|
||||||
*/
|
*/
|
||||||
|
RtlCopyMemory(&DriverExtension->InitializationData,
|
||||||
RtlCopyMemory(
|
|
||||||
&DriverExtension->InitializationData,
|
|
||||||
HwInitializationData,
|
HwInitializationData,
|
||||||
HwInitializationData->HwInitDataSize);
|
HwInitializationData->HwInitDataSize);
|
||||||
if (HwInitializationData->HwInitDataSize <
|
if (HwInitializationData->HwInitDataSize <
|
||||||
|
@ -735,7 +719,6 @@ VideoPortInitialize(
|
||||||
* Plug & Play drivers registers the device in AddDevice routine. For
|
* Plug & Play drivers registers the device in AddDevice routine. For
|
||||||
* legacy drivers we must do it now.
|
* legacy drivers we must do it now.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (LegacyDetection)
|
if (LegacyDetection)
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
@ -745,8 +728,10 @@ VideoPortInitialize(
|
||||||
/* power management */
|
/* power management */
|
||||||
DriverObject->MajorFunction[IRP_MJ_POWER] = IntVideoPortDispatchPower;
|
DriverObject->MajorFunction[IRP_MJ_POWER] = IntVideoPortDispatchPower;
|
||||||
}
|
}
|
||||||
Status = IntVideoPortCreateAdapterDeviceObject(DriverObject, DriverExtension,
|
Status = IntVideoPortCreateAdapterDeviceObject(DriverObject,
|
||||||
NULL, &DeviceObject);
|
DriverExtension,
|
||||||
|
NULL,
|
||||||
|
&DeviceObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR_(VIDEOPRT, "IntVideoPortCreateAdapterDeviceObject returned 0x%x\n", Status);
|
ERR_(VIDEOPRT, "IntVideoPortCreateAdapterDeviceObject returned 0x%x\n", Status);
|
||||||
|
@ -775,11 +760,11 @@ VideoPortInitialize(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
VideoPortDebugPrint(
|
VideoPortDebugPrint(
|
||||||
IN VIDEO_DEBUG_LEVEL DebugPrintLevel,
|
IN VIDEO_DEBUG_LEVEL DebugPrintLevel,
|
||||||
IN PCHAR DebugMessage, ...)
|
IN PCHAR DebugMessage,
|
||||||
|
...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
@ -791,8 +776,8 @@ VideoPortDebugPrint(
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VideoPortLogError(
|
VideoPortLogError(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL,
|
IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL,
|
||||||
|
@ -810,8 +795,8 @@ VideoPortLogError(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
UCHAR
|
||||||
UCHAR NTAPI
|
NTAPI
|
||||||
VideoPortGetCurrentIrql(VOID)
|
VideoPortGetCurrentIrql(VOID)
|
||||||
{
|
{
|
||||||
return KeGetCurrentIrql();
|
return KeGetCurrentIrql();
|
||||||
|
@ -824,7 +809,9 @@ typedef struct QueryRegistryCallbackContext
|
||||||
PMINIPORT_GET_REGISTRY_ROUTINE HwGetRegistryRoutine;
|
PMINIPORT_GET_REGISTRY_ROUTINE HwGetRegistryRoutine;
|
||||||
} QUERY_REGISTRY_CALLBACK_CONTEXT, *PQUERY_REGISTRY_CALLBACK_CONTEXT;
|
} QUERY_REGISTRY_CALLBACK_CONTEXT, *PQUERY_REGISTRY_CALLBACK_CONTEXT;
|
||||||
|
|
||||||
static NTSTATUS NTAPI
|
static
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
QueryRegistryCallback(
|
QueryRegistryCallback(
|
||||||
IN PWSTR ValueName,
|
IN PWSTR ValueName,
|
||||||
IN ULONG ValueType,
|
IN ULONG ValueType,
|
||||||
|
@ -849,7 +836,8 @@ QueryRegistryCallback(
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VP_STATUS NTAPI
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
VideoPortGetRegistryParameters(
|
VideoPortGetRegistryParameters(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PWSTR ParameterName,
|
IN PWSTR ParameterName,
|
||||||
|
@ -860,6 +848,7 @@ VideoPortGetRegistryParameters(
|
||||||
RTL_QUERY_REGISTRY_TABLE QueryTable[2] = {{0}};
|
RTL_QUERY_REGISTRY_TABLE QueryTable[2] = {{0}};
|
||||||
QUERY_REGISTRY_CALLBACK_CONTEXT Context;
|
QUERY_REGISTRY_CALLBACK_CONTEXT Context;
|
||||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||||
|
|
||||||
|
@ -874,12 +863,12 @@ VideoPortGetRegistryParameters(
|
||||||
QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED;
|
QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED;
|
||||||
QueryTable[0].Name = ParameterName;
|
QueryTable[0].Name = ParameterName;
|
||||||
|
|
||||||
if (!NT_SUCCESS(RtlQueryRegistryValues(
|
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
|
||||||
RTL_REGISTRY_ABSOLUTE,
|
|
||||||
DeviceExtension->RegistryPath.Buffer,
|
DeviceExtension->RegistryPath.Buffer,
|
||||||
QueryTable,
|
QueryTable,
|
||||||
&Context,
|
&Context,
|
||||||
NULL)))
|
NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
WARN_(VIDEOPRT, "VideoPortGetRegistryParameters could not find the "
|
WARN_(VIDEOPRT, "VideoPortGetRegistryParameters could not find the "
|
||||||
"requested parameter\n");
|
"requested parameter\n");
|
||||||
|
@ -898,28 +887,28 @@ VideoPortGetRegistryParameters(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortSetRegistryParameters(
|
VideoPortSetRegistryParameters(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PWSTR ValueName,
|
IN PWSTR ValueName,
|
||||||
IN PVOID ValueData,
|
IN PVOID ValueData,
|
||||||
IN ULONG ValueLength)
|
IN ULONG ValueLength)
|
||||||
{
|
{
|
||||||
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
VP_STATUS Status;
|
VP_STATUS Status;
|
||||||
|
|
||||||
|
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||||
TRACE_(VIDEOPRT, "VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n",
|
TRACE_(VIDEOPRT, "VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n",
|
||||||
ValueName,
|
ValueName,
|
||||||
&VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath);
|
&DeviceExtension->RegistryPath);
|
||||||
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
|
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
|
||||||
Status = RtlWriteRegistryValue(
|
Status = RtlWriteRegistryValue(RTL_REGISTRY_ABSOLUTE,
|
||||||
RTL_REGISTRY_ABSOLUTE,
|
DeviceExtension->RegistryPath.Buffer,
|
||||||
VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath.Buffer,
|
|
||||||
ValueName,
|
ValueName,
|
||||||
REG_BINARY,
|
REG_BINARY,
|
||||||
ValueData,
|
ValueData,
|
||||||
ValueLength);
|
ValueLength);
|
||||||
|
|
||||||
if (Status != NO_ERROR)
|
if (Status != NO_ERROR)
|
||||||
WARN_(VIDEOPRT, "VideoPortSetRegistryParameters error 0x%x\n", Status);
|
WARN_(VIDEOPRT, "VideoPortSetRegistryParameters error 0x%x\n", Status);
|
||||||
|
|
||||||
|
@ -929,8 +918,8 @@ VideoPortSetRegistryParameters(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortGetVgaStatus(
|
VideoPortGetVgaStatus(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
OUT PULONG VgaStatus)
|
OUT PULONG VgaStatus)
|
||||||
|
@ -957,8 +946,8 @@ VideoPortGetVgaStatus(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
PVOID
|
||||||
PVOID NTAPI
|
NTAPI
|
||||||
VideoPortGetRomImage(
|
VideoPortGetRomImage(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PVOID Unused1,
|
IN PVOID Unused1,
|
||||||
|
@ -1015,8 +1004,8 @@ VideoPortGetRomImage(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
BOOLEAN
|
||||||
BOOLEAN NTAPI
|
NTAPI
|
||||||
VideoPortScanRom(
|
VideoPortScanRom(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PUCHAR RomBase,
|
IN PUCHAR RomBase,
|
||||||
|
@ -1049,8 +1038,8 @@ VideoPortScanRom(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
BOOLEAN
|
||||||
BOOLEAN NTAPI
|
NTAPI
|
||||||
VideoPortSynchronizeExecution(
|
VideoPortSynchronizeExecution(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN VIDEO_SYNCHRONIZE_PRIORITY Priority,
|
IN VIDEO_SYNCHRONIZE_PRIORITY Priority,
|
||||||
|
@ -1099,8 +1088,8 @@ VideoPortSynchronizeExecution(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortEnumerateChildren(
|
VideoPortEnumerateChildren(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PVOID Reserved)
|
IN PVOID Reserved)
|
||||||
|
@ -1145,7 +1134,8 @@ VideoPortEnumerateChildren(
|
||||||
|
|
||||||
ChildExtension = ChildDeviceObject->DeviceExtension;
|
ChildExtension = ChildDeviceObject->DeviceExtension;
|
||||||
|
|
||||||
RtlZeroMemory(ChildExtension, sizeof(VIDEO_PORT_CHILD_EXTENSION) +
|
RtlZeroMemory(ChildExtension,
|
||||||
|
sizeof(VIDEO_PORT_CHILD_EXTENSION) +
|
||||||
DeviceExtension->DriverExtension->InitializationData.HwChildDeviceExtensionSize);
|
DeviceExtension->DriverExtension->InitializationData.HwChildDeviceExtensionSize);
|
||||||
|
|
||||||
ChildExtension->Common.Fdo = FALSE;
|
ChildExtension->Common.Fdo = FALSE;
|
||||||
|
@ -1239,8 +1229,8 @@ VideoPortEnumerateChildren(
|
||||||
for (j = 0; j < sizeof (ChildExtension->ChildDescriptor); j += 8)
|
for (j = 0; j < sizeof (ChildExtension->ChildDescriptor); j += 8)
|
||||||
{
|
{
|
||||||
INFO_(VIDEOPRT, "%02x %02x %02x %02x %02x %02x %02x %02x\n",
|
INFO_(VIDEOPRT, "%02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||||
p[j+0], p[j+1], p[j+2], p[j+3],
|
p[j + 0], p[j + 1], p[j + 2], p[j + 3],
|
||||||
p[j+4], p[j+5], p[j+6], p[j+7]);
|
p[j + 4], p[j + 5], p[j + 6], p[j + 7]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ChildExtension->ChildType == Other)
|
else if (ChildExtension->ChildType == Other)
|
||||||
|
@ -1268,8 +1258,8 @@ VideoPortEnumerateChildren(
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortCreateSecondaryDisplay(
|
VideoPortCreateSecondaryDisplay(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN OUT PVOID *SecondaryDeviceExtension,
|
IN OUT PVOID *SecondaryDeviceExtension,
|
||||||
|
@ -1282,8 +1272,8 @@ VideoPortCreateSecondaryDisplay(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
BOOLEAN
|
||||||
BOOLEAN NTAPI
|
NTAPI
|
||||||
VideoPortQueueDpc(
|
VideoPortQueueDpc(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PMINIPORT_DPC_ROUTINE CallbackRoutine,
|
IN PMINIPORT_DPC_ROUTINE CallbackRoutine,
|
||||||
|
@ -1298,9 +1288,10 @@ VideoPortQueueDpc(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
PVOID
|
||||||
PVOID NTAPI
|
NTAPI
|
||||||
VideoPortGetAssociatedDeviceExtension(IN PVOID DeviceObject)
|
VideoPortGetAssociatedDeviceExtension(
|
||||||
|
IN PVOID DeviceObject)
|
||||||
{
|
{
|
||||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
|
@ -1314,8 +1305,8 @@ VideoPortGetAssociatedDeviceExtension(IN PVOID DeviceObject)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortGetVersion(
|
VideoPortGetVersion(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN OUT PVPOSVERSIONINFO VpOsVersionInfo)
|
IN OUT PVPOSVERSIONINFO VpOsVersionInfo)
|
||||||
|
@ -1352,8 +1343,8 @@ VideoPortGetVersion(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
BOOLEAN
|
||||||
BOOLEAN NTAPI
|
NTAPI
|
||||||
VideoPortCheckForDeviceExistence(
|
VideoPortCheckForDeviceExistence(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN USHORT VendorId,
|
IN USHORT VendorId,
|
||||||
|
@ -1413,8 +1404,8 @@ VideoPortCheckForDeviceExistence(
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
VP_STATUS
|
||||||
VP_STATUS NTAPI
|
NTAPI
|
||||||
VideoPortRegisterBugcheckCallback(
|
VideoPortRegisterBugcheckCallback(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN ULONG BugcheckCode,
|
IN ULONG BugcheckCode,
|
||||||
|
@ -1428,8 +1419,8 @@ VideoPortRegisterBugcheckCallback(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
LONGLONG
|
||||||
LONGLONG NTAPI
|
NTAPI
|
||||||
VideoPortQueryPerformanceCounter(
|
VideoPortQueryPerformanceCounter(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
OUT PLONGLONG PerformanceFrequency OPTIONAL)
|
OUT PLONGLONG PerformanceFrequency OPTIONAL)
|
||||||
|
@ -1444,8 +1435,8 @@ VideoPortQueryPerformanceCounter(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VideoPortAcquireDeviceLock(
|
VideoPortAcquireDeviceLock(
|
||||||
IN PVOID HwDeviceExtension)
|
IN PVOID HwDeviceExtension)
|
||||||
{
|
{
|
||||||
|
@ -1463,8 +1454,8 @@ VideoPortAcquireDeviceLock(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VideoPortReleaseDeviceLock(
|
VideoPortReleaseDeviceLock(
|
||||||
IN PVOID HwDeviceExtension)
|
IN PVOID HwDeviceExtension)
|
||||||
{
|
{
|
||||||
|
@ -1481,8 +1472,8 @@ VideoPortReleaseDeviceLock(
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
VOID
|
||||||
VOID NTAPI
|
NTAPI
|
||||||
VpNotifyEaData(
|
VpNotifyEaData(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PVOID Data)
|
IN PVOID Data)
|
||||||
|
@ -1493,12 +1484,13 @@ VpNotifyEaData(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
PVOID NTAPI
|
PVOID
|
||||||
|
NTAPI
|
||||||
VideoPortAllocateContiguousMemory(
|
VideoPortAllocateContiguousMemory(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN ULONG NumberOfBytes,
|
IN ULONG NumberOfBytes,
|
||||||
IN PHYSICAL_ADDRESS HighestAcceptableAddress
|
IN PHYSICAL_ADDRESS HighestAcceptableAddress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
return MmAllocateContiguousMemory(NumberOfBytes, HighestAcceptableAddress);
|
return MmAllocateContiguousMemory(NumberOfBytes, HighestAcceptableAddress);
|
||||||
|
@ -1507,7 +1499,8 @@ VideoPortAllocateContiguousMemory(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOLEAN NTAPI
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
VideoPortIsNoVesa(VOID)
|
VideoPortIsNoVesa(VOID)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
Loading…
Reference in a new issue