ReactOS 0.4.16-dev-2491-g3dc6630
resource.c
Go to the documentation of this file.
1/*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002 - 2005 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#include "videoprt.h"
23
24#define NDEBUG
25#include <debug.h>
26
27extern BOOLEAN VpBaseVideo;
28
30
31/* PRIVATE FUNCTIONS **********************************************************/
32
36 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
37 OUT PVIDEO_ACCESS_RANGE *AccessRanges,
38 OUT PULONG AccessRangeCount)
39{
40 PCI_COMMON_CONFIG PciConfig;
42
43 if (!DriverExtension->InitializationData.HwGetLegacyResources &&
44 !DriverExtension->InitializationData.HwLegacyResourceCount)
45 {
46 /* No legacy resources to report */
47 *AccessRangeCount = 0;
48 return STATUS_SUCCESS;
49 }
50
51 if (DriverExtension->InitializationData.HwGetLegacyResources)
52 {
54 DeviceExtension->SystemIoBusNumber,
55 DeviceExtension->SystemIoSlotNumber,
56 &PciConfig,
57 sizeof(PciConfig));
58 if (ReadLength != sizeof(PciConfig))
59 {
60 /* This device doesn't exist */
62 }
63
64 DriverExtension->InitializationData.HwGetLegacyResources(PciConfig.VendorID,
65 PciConfig.DeviceID,
66 AccessRanges,
67 AccessRangeCount);
68 }
69 else
70 {
71 *AccessRanges = DriverExtension->InitializationData.HwLegacyResourceList;
72 *AccessRangeCount = DriverExtension->InitializationData.HwLegacyResourceCount;
73 }
74
75 INFO_(VIDEOPRT, "Got %d legacy access ranges\n", *AccessRangeCount);
76
77 return STATUS_SUCCESS;
78}
79
83 IN PIO_STACK_LOCATION IrpStack,
84 IN PIRP Irp)
85{
88 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
89 PVIDEO_ACCESS_RANGE AccessRanges;
90 ULONG AccessRangeCount, ListSize, i;
92 PIO_RESOURCE_REQUIREMENTS_LIST OldResList = IrpStack->Parameters.FilterResourceRequirements.IoResourceRequirementList;
93 PIO_RESOURCE_DESCRIPTOR CurrentDescriptor;
95
96 DriverObject = DeviceObject->DriverObject;
98 DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
99
100 Status = IntVideoPortGetLegacyResources(DriverExtension, DeviceExtension, &AccessRanges, &AccessRangeCount);
101 if (!NT_SUCCESS(Status))
102 return Status;
103 if (!AccessRangeCount)
104 {
105 /* No legacy resources to report */
106 return Irp->IoStatus.Status;
107 }
108
109 /* OK, we've got the access ranges now. Let's set up the resource requirements list */
110
111 if (OldResList)
112 {
113 /* Already one there so let's add to it */
114 ListSize = OldResList->ListSize + sizeof(IO_RESOURCE_DESCRIPTOR) * AccessRangeCount;
116 ListSize);
117 if (!ResList) return STATUS_NO_MEMORY;
118
119 RtlCopyMemory(ResList, OldResList, OldResList->ListSize);
120
121 ASSERT(ResList->AlternativeLists == 1);
122
123 ResList->ListSize = ListSize;
124 ResList->List[0].Count += AccessRangeCount;
125
126 CurrentDescriptor = (PIO_RESOURCE_DESCRIPTOR)((PUCHAR)ResList + OldResList->ListSize);
127
128 ExFreePool(OldResList);
129 Irp->IoStatus.Information = 0;
130 }
131 else
132 {
133 /* We need to make a new one */
134 ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) + sizeof(IO_RESOURCE_DESCRIPTOR) * (AccessRangeCount - 1);
136 ListSize);
137 if (!ResList) return STATUS_NO_MEMORY;
138
139 RtlZeroMemory(ResList, ListSize);
140
141 /* We need to initialize some fields */
142 ResList->ListSize = ListSize;
143 ResList->InterfaceType = DeviceExtension->AdapterInterfaceType;
144 ResList->BusNumber = DeviceExtension->SystemIoBusNumber;
145 ResList->SlotNumber = DeviceExtension->SystemIoSlotNumber;
146 ResList->AlternativeLists = 1;
147 ResList->List[0].Version = 1;
148 ResList->List[0].Revision = 1;
149 ResList->List[0].Count = AccessRangeCount;
150
151 CurrentDescriptor = ResList->List[0].Descriptors;
152 }
153
154 for (i = 0; i < AccessRangeCount; i++)
155 {
156 /* This is a required resource */
157 CurrentDescriptor->Option = 0;
158
159 if (AccessRanges[i].RangeInIoSpace)
160 CurrentDescriptor->Type = CmResourceTypePort;
161 else
162 CurrentDescriptor->Type = CmResourceTypeMemory;
163
164 CurrentDescriptor->ShareDisposition =
166
167 CurrentDescriptor->Flags = 0;
168
169 if (CurrentDescriptor->Type == CmResourceTypePort)
170 {
171 CurrentDescriptor->u.Port.Length = AccessRanges[i].RangeLength;
172 CurrentDescriptor->u.Port.MinimumAddress = AccessRanges[i].RangeStart;
173 CurrentDescriptor->u.Port.MaximumAddress.QuadPart = AccessRanges[i].RangeStart.QuadPart + AccessRanges[i].RangeLength - 1;
174 CurrentDescriptor->u.Port.Alignment = 1;
175 if (AccessRanges[i].RangePassive & VIDEO_RANGE_PASSIVE_DECODE)
176 CurrentDescriptor->Flags |= CM_RESOURCE_PORT_PASSIVE_DECODE;
177 if (AccessRanges[i].RangePassive & VIDEO_RANGE_10_BIT_DECODE)
178 CurrentDescriptor->Flags |= CM_RESOURCE_PORT_10_BIT_DECODE;
179 }
180 else
181 {
182 CurrentDescriptor->u.Memory.Length = AccessRanges[i].RangeLength;
183 CurrentDescriptor->u.Memory.MinimumAddress = AccessRanges[i].RangeStart;
184 CurrentDescriptor->u.Memory.MaximumAddress.QuadPart = AccessRanges[i].RangeStart.QuadPart + AccessRanges[i].RangeLength - 1;
185 CurrentDescriptor->u.Memory.Alignment = 1;
186 CurrentDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
187 }
188
189 CurrentDescriptor++;
190 }
191
192 Irp->IoStatus.Information = (ULONG_PTR)ResList;
193
194 return STATUS_SUCCESS;
195}
196
197VOID
199 _In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
200{
202 BOOLEAN ConflictDetected;
203 // An empty CM_RESOURCE_LIST
204 UCHAR EmptyResourceList[FIELD_OFFSET(CM_RESOURCE_LIST, List)] = {0};
205
206 if (DeviceExtension->IsLegacyDevice || DeviceExtension->IsLegacyDetect || DeviceExtension->IsVgaDetect)
207 {
209 DeviceExtension->DriverObject,
210 NULL, 0, /* Driver List */
211 DeviceExtension->PhysicalDeviceObject,
212 (PCM_RESOURCE_LIST)EmptyResourceList,
213 sizeof(EmptyResourceList),
214 &ConflictDetected);
215
216 if (!NT_SUCCESS(Status))
217 {
218 ERR_(VIDEOPRT,
219 "VideoPortReleaseResources (Detect) failed with 0x%08lx ; ConflictDetected: %s\n",
220 Status, ConflictDetected ? "TRUE" : "FALSE");
221 }
222 }
223 else
224 {
226 DeviceExtension->DriverObject,
227 NULL,
228 0,
229 DeviceExtension->PhysicalDeviceObject,
230 (PCM_RESOURCE_LIST)EmptyResourceList,
231 sizeof(EmptyResourceList),
232 FALSE,
233 &ConflictDetected);
234 if (!NT_SUCCESS(Status))
235 {
236 ERR_(VIDEOPRT,
237 "VideoPortReleaseResources (Usage) failed with 0x%08lx ; ConflictDetected: %s\n",
238 Status, ConflictDetected ? "TRUE" : "FALSE");
239 }
240 }
241}
242
247 IN ULONG SizeInBytes,
250{
251 OBJECT_ATTRIBUTES ObjAttribs;
253 HANDLE hMemObj;
255 SIZE_T Size;
256
257 /* Initialize object attribs */
258 RtlInitUnicodeString(&UnicodeString, L"\\Device\\PhysicalMemory");
259 InitializeObjectAttributes(&ObjAttribs,
262 NULL, NULL);
263
264 /* Open physical memory section */
265 Status = ZwOpenSection(&hMemObj, SECTION_ALL_ACCESS, &ObjAttribs);
266 if (!NT_SUCCESS(Status))
267 {
268 WARN_(VIDEOPRT, "ZwOpenSection() failed! (0x%x)\n", Status);
269 return Status;
270 }
271
272 /* Map view of section */
273 Size = SizeInBytes;
274 Status = ZwMapViewOfSection(hMemObj,
275 Process,
277 0,
278 Size,
280 &Size,
281 ViewUnmap,
282 0,
283 Protect);
284 ZwClose(hMemObj);
285 if (!NT_SUCCESS(Status))
286 {
287 WARN_(VIDEOPRT, "ZwMapViewOfSection() failed! (0x%x)\n", Status);
288 }
289
290 return Status;
291}
292
293static BOOLEAN
295 _In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
297{
298 CM_RESOURCE_LIST *Res = DeviceExtension->AllocatedResources;
301
302 if (!Res || Res->Count == 0)
303 return FALSE;
304 Full = &Res->List[0];
305 for (Desc = Full->PartialResourceList.PartialDescriptors;
306 Desc < Full->PartialResourceList.PartialDescriptors + Full->PartialResourceList.Count;
307 ++Desc)
308 {
309 if (Range->RangeInIoSpace && Desc->Type == CmResourceTypePort)
310 {
311 if (Desc->u.Port.Start.QuadPart == Range->RangeStart.QuadPart &&
312 Desc->u.Port.Length == Range->RangeLength)
313 return TRUE;
314 }
315 else if (!Range->RangeInIoSpace && Desc->Type == CmResourceTypeMemory)
316 {
317 if (Desc->u.Memory.Start.QuadPart == Range->RangeStart.QuadPart &&
318 Desc->u.Memory.Length == Range->RangeLength)
319 return TRUE;
320 }
321 }
322 return FALSE;
323}
324
325
328 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
329 IN PHYSICAL_ADDRESS IoAddress,
330 IN ULONG NumberOfUchars,
331 IN ULONG InIoSpace,
334{
336 PVIDEO_PORT_ADDRESS_MAPPING AddressMapping;
338 PVOID MappedAddress;
340
341 INFO_(VIDEOPRT, "- IoAddress: %lx\n", IoAddress.u.LowPart);
342 INFO_(VIDEOPRT, "- NumberOfUchars: %lx\n", NumberOfUchars);
343 INFO_(VIDEOPRT, "- InIoSpace: %x\n", InIoSpace);
344
345 InIoSpace &= ~VIDEO_MEMORY_SPACE_DENSE;
346
347 if (ProcessHandle != NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0)
348 {
349 INFO_(VIDEOPRT, "ProcessHandle is not NULL (0x%x) but InIoSpace does not have "
350 "VIDEO_MEMORY_SPACE_USER_MODE set! Setting "
351 "VIDEO_MEMORY_SPACE_USER_MODE.\n",
353 InIoSpace |= VIDEO_MEMORY_SPACE_USER_MODE;
354 }
355 else if (ProcessHandle == NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
356 {
357 INFO_(VIDEOPRT, "ProcessHandle is NULL (0x%x) but InIoSpace does have "
358 "VIDEO_MEMORY_SPACE_USER_MODE set! Setting ProcessHandle "
359 "to NtCurrentProcess()\n",
362 }
363
364 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0 &&
365 !IsListEmpty(&DeviceExtension->AddressMappingListHead))
366 {
367 Entry = DeviceExtension->AddressMappingListHead.Flink;
368 while (Entry != &DeviceExtension->AddressMappingListHead)
369 {
370 AddressMapping = CONTAINING_RECORD(
371 Entry,
373 List);
374 if (IoAddress.QuadPart == AddressMapping->IoAddress.QuadPart &&
375 NumberOfUchars <= AddressMapping->NumberOfUchars)
376 {
377 {
378 AddressMapping->MappingCount++;
379 if (Status)
380 *Status = NO_ERROR;
381 return AddressMapping->MappedAddress;
382 }
383 }
384 Entry = Entry->Flink;
385 }
386 }
387
388 AddressSpace = (ULONG)InIoSpace;
391 DeviceExtension->AdapterInterfaceType,
392 DeviceExtension->SystemIoBusNumber,
393 IoAddress,
396 {
397 if (Status)
399
400 return NULL;
401 }
402
403 /* I/O space */
404 if (AddressSpace != 0)
405 {
406 ASSERT(0 == TranslatedAddress.u.HighPart);
407 if (Status)
408 *Status = NO_ERROR;
409
410 return (PVOID)(ULONG_PTR)TranslatedAddress.u.LowPart;
411 }
412
413 /* user space */
414 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
415 {
416 NTSTATUS NtStatus;
418 if (InIoSpace & VIDEO_MEMORY_SPACE_P6CACHE)
420 else
422 MappedAddress = NULL;
425 NumberOfUchars,
426 Protect,
427 &MappedAddress);
428 if (!NT_SUCCESS(NtStatus))
429 {
430 ERR_(VIDEOPRT, "IntVideoPortMapPhysicalMemory() failed! (0x%x)\n", NtStatus);
431 if (Status)
433 return NULL;
434 }
435 INFO_(VIDEOPRT, "Mapped user address = 0x%08x\n", MappedAddress);
436 }
437 else /* kernel space */
438 {
439 MappedAddress = MmMapIoSpace(
441 NumberOfUchars,
443 }
444
445 if (MappedAddress != NULL)
446 {
447 if (Status)
448 {
449 *Status = NO_ERROR;
450 }
451 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0)
452 {
453 AddressMapping = ExAllocatePoolWithTag(
454 PagedPool,
457
458 if (AddressMapping == NULL)
459 return MappedAddress;
460
461 RtlZeroMemory(AddressMapping, sizeof(VIDEO_PORT_ADDRESS_MAPPING));
462 AddressMapping->NumberOfUchars = NumberOfUchars;
463 AddressMapping->IoAddress = IoAddress;
464 AddressMapping->SystemIoBusNumber = DeviceExtension->SystemIoBusNumber;
465 AddressMapping->MappedAddress = MappedAddress;
466 AddressMapping->MappingCount = 1;
468 &DeviceExtension->AddressMappingListHead,
469 &AddressMapping->List);
470 }
471
472 return MappedAddress;
473 }
474
475 ERR_(VIDEOPRT,
476 "Couldn't map video memory. IoAddress: 0x%lx, NumberOfUchars: 0x%lx, InIoSpace: 0x%x\n",
477 IoAddress.u.LowPart, NumberOfUchars, InIoSpace);
478 if (Status)
480
481 return NULL;
482}
483
486 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
487 IN PVOID MappedAddress)
488{
489 PVIDEO_PORT_ADDRESS_MAPPING AddressMapping;
492
493 Entry = DeviceExtension->AddressMappingListHead.Flink;
494 while (Entry != &DeviceExtension->AddressMappingListHead)
495 {
496 AddressMapping = CONTAINING_RECORD(
497 Entry,
499 List);
500 if (AddressMapping->MappedAddress == MappedAddress)
501 {
502 ASSERT(AddressMapping->MappingCount > 0);
503 AddressMapping->MappingCount--;
504 if (AddressMapping->MappingCount == 0)
505 {
507 AddressMapping->MappedAddress,
508 AddressMapping->NumberOfUchars);
510 ExFreePool(AddressMapping);
511 }
512 return;
513 }
514
515 Entry = Entry->Flink;
516 }
517
518 /* If there was no kernelmode mapping for the given address found we assume
519 * that the given address is a usermode mapping and try to unmap it.
520 *
521 * FIXME: Is it ok to use NtCurrentProcess?
522 */
523 Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress);
524 if (!NT_SUCCESS(Status))
525 {
526 WARN_(VIDEOPRT, "Warning: Mapping for address 0x%p not found!\n", MappedAddress);
527 }
528}
529
530/* PUBLIC FUNCTIONS ***********************************************************/
531
532/*
533 * @implemented
534 */
535
538 IN PVOID HwDeviceExtension,
539 IN PHYSICAL_ADDRESS IoAddress,
540 IN ULONG NumberOfUchars,
541 IN UCHAR InIoSpace)
542{
543 TRACE_(VIDEOPRT, "VideoPortGetDeviceBase\n");
545 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
546 IoAddress,
547 NumberOfUchars,
548 InIoSpace,
549 NULL,
550 NULL);
551}
552
553/*
554 * @implemented
555 */
556
559 IN PVOID HwDeviceExtension,
560 IN PVOID MappedAddress)
561{
562 TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
564 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
565 MappedAddress);
566}
567
568/*
569 * @unimplemented
570 */
571
574 IN PVOID HwDeviceExtension,
577 IN PULONG InIoSpace,
579 IN ULONG BankLength,
580 IN UCHAR ReadWriteBank,
581 IN PBANKED_SECTION_ROUTINE BankRoutine,
583{
584 TRACE_(VIDEOPRT, "VideoPortMapBankedMemory\n");
587}
588
589
590/*
591 * @implemented
592 */
593
596 IN PVOID HwDeviceExtension,
599 IN PULONG InIoSpace,
601{
602 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
604
605 TRACE_(VIDEOPRT, "VideoPortMapMemory\n");
606 INFO_(VIDEOPRT, "- *VirtualAddress: 0x%x\n", *VirtualAddress);
607
608 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
610 DeviceExtension,
612 *Length,
613 *InIoSpace,
615 &Status);
616
617 return Status;
618}
619
620/*
621 * @implemented
622 */
623
626 IN PVOID HwDeviceExtension,
629{
630 TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
631
633 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
635
636 return NO_ERROR;
637}
638
685NTAPI
687 _In_ PVOID HwDeviceExtension,
688 _In_opt_ ULONG NumRequestedResources,
689 _In_reads_opt_(NumRequestedResources)
690 PIO_RESOURCE_DESCRIPTOR RequestedResources,
691 _In_ ULONG NumAccessRanges,
692 _Out_writes_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges,
693 _In_ PVOID VendorId,
694 _In_ PVOID DeviceId,
695 _Out_ PULONG Slot)
696{
697 PCI_SLOT_NUMBER PciSlotNumber;
699 ULONG FunctionNumber;
703 UINT AssignedCount = 0;
706 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
708 USHORT VendorIdToFind;
709 USHORT DeviceIdToFind;
711 PVIDEO_ACCESS_RANGE LegacyAccessRanges;
712 ULONG LegacyAccessRangeCount;
714 ULONG ListSize;
716 BOOLEAN DeviceAndVendorFound = FALSE;
717
718 TRACE_(VIDEOPRT, "VideoPortGetAccessRanges(%d, %p, %d, %p)\n",
719 NumRequestedResources, RequestedResources, NumAccessRanges, AccessRanges);
720
721 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
722 DriverObject = DeviceExtension->DriverObject;
724
725 if (NumRequestedResources == 0)
726 {
727 AllocatedResources = DeviceExtension->AllocatedResources;
728 if (AllocatedResources == NULL &&
729 DeviceExtension->AdapterInterfaceType == PCIBus)
730 {
731 if (DeviceExtension->PhysicalDeviceObject != NULL)
732 {
733 PciSlotNumber.u.AsULONG = DeviceExtension->SystemIoSlotNumber;
734
736 DeviceExtension->SystemIoBusNumber,
737 PciSlotNumber.u.AsULONG,
738 &Config,
739 sizeof(Config));
740
741 if (ReturnedLength != sizeof(Config))
742 {
744 }
745 }
746 else
747 {
748 VendorIdToFind = VendorId != NULL ? *(PUSHORT)VendorId : 0;
749 DeviceIdToFind = DeviceId != NULL ? *(PUSHORT)DeviceId : 0;
750
751 if (VendorIdToFind == 0 && DeviceIdToFind == 0)
752 {
753 /* We're screwed */
754 return ERROR_DEV_NOT_EXIST;
755 }
756
757 INFO_(VIDEOPRT, "Looking for VendorId 0x%04x DeviceId 0x%04x\n",
758 VendorIdToFind, DeviceIdToFind);
759
760 /*
761 * Search for the device id and vendor id on this bus.
762 */
763 PciSlotNumber.u.bits.Reserved = 0;
765 {
766 PciSlotNumber.u.bits.DeviceNumber = DeviceNumber;
767 for (FunctionNumber = 0; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++)
768 {
769 INFO_(VIDEOPRT, "- Function number: %d\n", FunctionNumber);
770 PciSlotNumber.u.bits.FunctionNumber = FunctionNumber;
772 DeviceExtension->SystemIoBusNumber,
773 PciSlotNumber.u.AsULONG,
774 &Config,
775 sizeof(Config));
776
777 INFO_(VIDEOPRT, "- Length of data: %x\n", ReturnedLength);
778
779 if (ReturnedLength == sizeof(Config))
780 {
781 INFO_(VIDEOPRT, "- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x "
782 "DeviceId 0x%04x\n",
783 PciSlotNumber.u.AsULONG,
784 PciSlotNumber.u.bits.DeviceNumber,
785 PciSlotNumber.u.bits.FunctionNumber,
786 Config.VendorID,
787 Config.DeviceID);
788
789 if ((VendorIdToFind == 0 || Config.VendorID == VendorIdToFind) &&
790 (DeviceIdToFind == 0 || Config.DeviceID == DeviceIdToFind))
791 {
792 DeviceAndVendorFound = TRUE;
793 break;
794 }
795 }
796 }
797 if (DeviceAndVendorFound)
798 break;
799 }
800 if (FunctionNumber == PCI_MAX_FUNCTION)
801 {
802 WARN_(VIDEOPRT, "Didn't find device.\n");
803 return ERROR_DEV_NOT_EXIST;
804 }
805 }
806
807 Status = HalAssignSlotResources(&DeviceExtension->RegistryPath,
808 NULL,
809 DeviceExtension->DriverObject,
810 DeviceExtension->DriverObject->DeviceObject,
811 DeviceExtension->AdapterInterfaceType,
812 DeviceExtension->SystemIoBusNumber,
813 PciSlotNumber.u.AsULONG,
815 if (!NT_SUCCESS(Status))
816 {
817 WARN_(VIDEOPRT, "HalAssignSlotResources failed with status %x.\n",Status);
818 return Status;
819 }
820 DeviceExtension->AllocatedResources = AllocatedResources;
821 DeviceExtension->SystemIoSlotNumber = PciSlotNumber.u.AsULONG;
822
823 /* Add legacy resources to the resources from HAL */
825 &LegacyAccessRanges, &LegacyAccessRangeCount);
826 if (!NT_SUCCESS(Status))
827 return ERROR_DEV_NOT_EXIST;
828
829 if (NumAccessRanges < LegacyAccessRangeCount)
830 {
831 ERR_(VIDEOPRT, "Too many legacy access ranges found\n");
832 return ERROR_NOT_ENOUGH_MEMORY; // ERROR_MORE_DATA;
833 }
834
835 RtlCopyMemory(AccessRanges, LegacyAccessRanges, LegacyAccessRangeCount * sizeof(VIDEO_ACCESS_RANGE));
836 AssignedCount = LegacyAccessRangeCount;
837 }
838 }
839 else
840 {
841 ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) + (NumRequestedResources - 1) * sizeof(IO_RESOURCE_DESCRIPTOR);
842 ResReqList = ExAllocatePool(NonPagedPool, ListSize);
843 if (!ResReqList)
845
846 ResReqList->ListSize = ListSize;
847 ResReqList->InterfaceType = DeviceExtension->AdapterInterfaceType;
848 ResReqList->BusNumber = DeviceExtension->SystemIoBusNumber;
849 ResReqList->SlotNumber = DeviceExtension->SystemIoSlotNumber;
850 ResReqList->AlternativeLists = 1;
851 ResReqList->List[0].Version = 1;
852 ResReqList->List[0].Revision = 1;
853 ResReqList->List[0].Count = NumRequestedResources;
854
855 /* Copy in the caller's resource list */
856 RtlCopyMemory(ResReqList->List[0].Descriptors,
857 RequestedResources,
858 NumRequestedResources * sizeof(IO_RESOURCE_DESCRIPTOR));
859
860 Status = IoAssignResources(&DeviceExtension->RegistryPath,
861 NULL,
862 DeviceExtension->DriverObject,
863 DeviceExtension->PhysicalDeviceObject ?
864 DeviceExtension->PhysicalDeviceObject :
865 DeviceExtension->DriverObject->DeviceObject,
866 ResReqList,
868
869 if (!NT_SUCCESS(Status))
870 return Status;
871
872 if (!DeviceExtension->AllocatedResources)
873 DeviceExtension->AllocatedResources = AllocatedResources;
874 }
875
878
879 /* Return the slot number if the caller wants it */
880 if (Slot != NULL) *Slot = DeviceExtension->SystemIoSlotNumber;
881
882 FullList = AllocatedResources->List;
883 ASSERT(AllocatedResources->Count == 1);
884 INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n",
885 FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber,
887
888 ASSERT(FullList->InterfaceType == PCIBus);
889 ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber);
890 ASSERT(1 == FullList->PartialResourceList.Version);
891 ASSERT(1 == FullList->PartialResourceList.Revision);
892
894 Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count;
895 Descriptor++)
896 {
897 if ((Descriptor->Type == CmResourceTypeMemory ||
898 Descriptor->Type == CmResourceTypePort) &&
899 AssignedCount >= NumAccessRanges)
900 {
901 ERR_(VIDEOPRT, "Too many access ranges found\n");
902 return ERROR_MORE_DATA;
903 }
904 else if (Descriptor->Type == CmResourceTypeMemory)
905 {
906 INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n",
907 Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length);
908 AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start;
909 AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length;
910 AccessRanges[AssignedCount].RangeInIoSpace = 0;
911 AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */
912 AccessRanges[AssignedCount].RangeShareable =
913 (Descriptor->ShareDisposition == CmResourceShareShared);
914 AccessRanges[AssignedCount].RangePassive = 0;
915 AssignedCount++;
916 }
917 else if (Descriptor->Type == CmResourceTypePort)
918 {
919 INFO_(VIDEOPRT, "Port range starting at 0x%04x length %d\n",
920 Descriptor->u.Port.Start.u.LowPart, Descriptor->u.Port.Length);
921 AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start;
922 AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length;
923 AccessRanges[AssignedCount].RangeInIoSpace = 1;
924 AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */
925 AccessRanges[AssignedCount].RangeShareable =
926 (Descriptor->ShareDisposition == CmResourceShareShared);
927 AccessRanges[AssignedCount].RangePassive = 0;
929 AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_10_BIT_DECODE;
931 AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_PASSIVE_DECODE;
932 AssignedCount++;
933 }
934 else if (Descriptor->Type == CmResourceTypeInterrupt)
935 {
936 DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level;
937 DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector;
938 if (Descriptor->ShareDisposition == CmResourceShareShared)
939 DeviceExtension->InterruptShared = TRUE;
940 else
941 DeviceExtension->InterruptShared = FALSE;
942 }
943 // else if (Descriptor->Type == CmResourceTypeDma) // TODO!
944 else
945 {
946 ASSERT(FALSE);
948 }
949 }
950
951 return NO_ERROR;
952}
953
975NTAPI
977 _In_ PVOID HwDeviceExtension,
978 _In_opt_ ULONG NumAccessRanges,
979 _In_reads_opt_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges)
980{
981 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
982 BOOLEAN ConflictDetected;
983 ULONG ResourceListSize;
985 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
986 ULONG i;
988
989 TRACE_(VIDEOPRT, "VideoPortVerifyAccessRanges\n");
990
991 /* Verify parameters */
992 if (NumAccessRanges && !AccessRanges)
994
995 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
996
997 if (NumAccessRanges == 0)
998 {
999 /* Release the resources and do nothing more for now... */
1000 IntVideoPortReleaseResources(DeviceExtension);
1001 /* If releasing VGA device resources, clear tracked ranges */
1002 if (DeviceExtension->IsVgaDriver)
1003 {
1005 if (VgaRanges)
1006 {
1008 VgaRanges = NULL;
1009 }
1010 NumOfVgaRanges = 0;
1013 }
1014 return NO_ERROR;
1015 }
1016
1017 /*
1018 * For non-legacy PCI devices, validate that the relevant I/O or memory
1019 * decoding bits are enabled in the PCI command register before claiming
1020 */
1021 if (!DeviceExtension->IsLegacyDevice && DeviceExtension->AdapterInterfaceType == PCIBus)
1022 {
1023 USHORT PciCommand;
1025
1027 DeviceExtension->SystemIoBusNumber,
1028 DeviceExtension->SystemIoSlotNumber,
1029 &PciCommand,
1031 sizeof(PciCommand));
1032 if (BytesRead == sizeof(PciCommand))
1033 {
1034 for (i = 0; i < NumAccessRanges; i++)
1035 {
1036 if (AccessRanges[i].RangeInIoSpace)
1037 {
1038 if ((PciCommand & PCI_ENABLE_IO_SPACE) == 0)
1039 {
1040 WARN_(VIDEOPRT, "PCI I/O space disabled; refusing access range claim\n");
1042 }
1043 }
1044 else
1045 {
1046 if ((PciCommand & PCI_ENABLE_MEMORY_SPACE) == 0)
1047 {
1048 WARN_(VIDEOPRT, "PCI memory space disabled; refusing access range claim\n");
1050 }
1051 }
1052 }
1053 }
1054 }
1055
1056 /* Determine which ranges need to be claimed (exclude PnP-assigned ones) */
1057 ULONG Needed = 0;
1058 for (i = 0; i < NumAccessRanges; ++i)
1059 {
1060 if (DeviceExtension->PhysicalDeviceObject && !DeviceExtension->IsLegacyDevice)
1061 {
1062 if (IntAccessRangeIsInAllocatedResources(DeviceExtension, &AccessRanges[i]))
1063 continue;
1064 }
1065 ++Needed;
1066 }
1067
1068 if (Needed == 0)
1069 {
1070 /* Nothing to report/claim */
1071 return NO_ERROR;
1072 }
1073
1074 /* Create the resource list for the non-PnP-assigned ranges */
1075 ResourceListSize = sizeof(CM_RESOURCE_LIST)
1076 + (Needed - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
1078 if (!ResourceList)
1079 {
1080 WARN_(VIDEOPRT, "ExAllocatePool() failed\n");
1082 }
1083
1084 /* Fill resource list */
1085 ResourceList->Count = 1;
1086 ResourceList->List[0].InterfaceType = DeviceExtension->AdapterInterfaceType;
1087 ResourceList->List[0].BusNumber = DeviceExtension->SystemIoBusNumber;
1088 ResourceList->List[0].PartialResourceList.Version = 1;
1089 ResourceList->List[0].PartialResourceList.Revision = 1;
1090 ResourceList->List[0].PartialResourceList.Count = Needed;
1091
1092 ULONG j = 0;
1093 for (i = 0; i < NumAccessRanges; ++i)
1094 {
1095 if (DeviceExtension->PhysicalDeviceObject && !DeviceExtension->IsLegacyDevice)
1096 {
1097 if (IntAccessRangeIsInAllocatedResources(DeviceExtension, &AccessRanges[i]))
1098 continue;
1099 }
1100
1101 PartialDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[j++];
1102 if (AccessRanges[i].RangeInIoSpace)
1103 {
1104 PartialDescriptor->Type = CmResourceTypePort;
1105 PartialDescriptor->u.Port.Start = AccessRanges[i].RangeStart;
1106 PartialDescriptor->u.Port.Length = AccessRanges[i].RangeLength;
1107 }
1108 else
1109 {
1110 PartialDescriptor->Type = CmResourceTypeMemory;
1111 PartialDescriptor->u.Memory.Start = AccessRanges[i].RangeStart;
1112 PartialDescriptor->u.Memory.Length = AccessRanges[i].RangeLength;
1113 }
1114 PartialDescriptor->ShareDisposition = AccessRanges[i].RangeShareable ?
1116 PartialDescriptor->Flags = 0;
1117 if (AccessRanges[i].RangePassive & VIDEO_RANGE_PASSIVE_DECODE)
1118 PartialDescriptor->Flags |= CM_RESOURCE_PORT_PASSIVE_DECODE;
1119 if (AccessRanges[i].RangePassive & VIDEO_RANGE_10_BIT_DECODE)
1120 PartialDescriptor->Flags |= CM_RESOURCE_PORT_10_BIT_DECODE;
1121 }
1122
1123 if (DeviceExtension->IsLegacyDevice || DeviceExtension->IsLegacyDetect || DeviceExtension->IsVgaDetect)
1124 {
1126 DeviceExtension->DriverObject,
1127 NULL, 0, /* Driver List */
1128 DeviceExtension->PhysicalDeviceObject,
1129 ResourceList, ResourceListSize,
1130 &ConflictDetected);
1131
1132 /* IntIsVgaSaveDriver() will later ignore STATUS_CONFLICTING_ADDRESSES, but we still claim it */
1133 if (!NT_SUCCESS(Status) && DeviceExtension->IsVgaDriver)
1134 {
1135 NTSTATUS fbStatus;
1136 BOOLEAN fbConflict = FALSE;
1138 DeviceExtension->DriverObject,
1139 NULL,
1140 0,
1141 DeviceExtension->PhysicalDeviceObject,
1143 ResourceListSize,
1144 FALSE,
1145 &fbConflict);
1146 INFO_(VIDEOPRT, "VGA detect->usage fallback: Status=0x%lx Conflict=%d fbStatus=0x%lx fbConflict=%d\n",
1147 Status, ConflictDetected, fbStatus, fbConflict);
1148 Status = fbStatus;
1149 ConflictDetected = fbConflict;
1150 }
1151 }
1152 else
1153 {
1155 DeviceExtension->DriverObject,
1156 NULL,
1157 0,
1158 DeviceExtension->PhysicalDeviceObject,
1160 ResourceListSize,
1161 FALSE,
1162 &ConflictDetected);
1163 }
1165
1166 /* If VgaSave driver is conflicting and we don't explicitly want
1167 * to use it, ignore the problem (because win32k will try to use
1168 * this driver only if all other ones are failing). */
1169 if ((Status == STATUS_CONFLICTING_ADDRESSES || ConflictDetected) &&
1170 DeviceExtension->IsVgaDriver && !VpBaseVideo)
1171 {
1172 return NO_ERROR;
1173 }
1174
1175 if (!NT_SUCCESS(Status) || ConflictDetected)
1177 else
1178 {
1179 /* Track VGA access ranges on success for fallback handling */
1180 if (DeviceExtension->IsVgaDriver && AccessRanges != VgaRanges)
1181 {
1183 if (VgaRanges)
1184 {
1186 VgaRanges = NULL;
1187 NumOfVgaRanges = 0;
1188 }
1189 if (NumAccessRanges)
1190 {
1191 SIZE_T sz = NumAccessRanges * sizeof(VIDEO_ACCESS_RANGE);
1193 if (VgaRanges)
1194 {
1195 RtlCopyMemory(VgaRanges, AccessRanges, sz);
1196 NumOfVgaRanges = NumAccessRanges;
1197 VgaDeviceExtension = DeviceExtension;
1198 }
1199 }
1201 }
1202 /* Leave VGA detect phase after first successful claim */
1203 DeviceExtension->IsVgaDetect = FALSE;
1204 return NO_ERROR;
1205 }
1206}
1207
1208/*
1209 * @unimplemented
1210 */
1211
1214 IN PVOID HwDeviceExtension,
1215 IN VIDEO_DEVICE_DATA_TYPE DeviceDataType,
1218{
1219 TRACE_(VIDEOPRT, "VideoPortGetDeviceData\n");
1222}
1223
1224/*
1225 * @implemented
1226 */
1227
1230 IN PVOID HwDeviceExtension,
1233 IN ULONG Tag)
1234{
1235 TRACE_(VIDEOPRT, "VideoPortAllocatePool\n");
1237}
1238
1239/*
1240 * @implemented
1241 */
1242
1243VOID NTAPI
1245 IN PVOID HwDeviceExtension,
1246 IN PVOID Ptr)
1247{
1248 ExFreePool(Ptr);
1249}
1250
1251/*
1252 * @implemented
1253 */
1254
1257 IN PVOID HwDeviceExtension,
1258 IN ULONG Size,
1259 OUT PVOID *Buffer)
1260{
1261 TRACE_(VIDEOPRT, "VideoPortAllocateBuffer\n");
1264}
1265
1266/*
1267 * @implemented
1268 */
1269
1270VOID NTAPI
1272 IN PVOID HwDeviceExtension,
1273 IN PVOID Ptr)
1274{
1275 TRACE_(VIDEOPRT, "VideoPortReleaseBuffer\n");
1276 ExFreePool(Ptr);
1277}
1278
1279/*
1280 * @implemented
1281 */
1282
1285 IN PVOID HwDeviceExtension,
1287 IN ULONG Length,
1289{
1290 PMDL Mdl;
1291
1293 if (!Mdl)
1294 {
1295 return NULL;
1296 }
1297 /* FIXME use seh */
1299 return Mdl;
1300}
1301
1302/*
1303 * @implemented
1304 */
1305
1306BOOLEAN
1307NTAPI
1309 IN PVOID HwDeviceExtension,
1311 IN PEVENT pUEvent,
1312 IN PEVENT pDisplayEvent,
1313 IN DMA_FLAGS DmaFlags)
1314{
1315 PVOID Buffer;
1316
1317 /* clear output buffer */
1318 pVrp->OutputBuffer = NULL;
1319
1320 if (DmaFlags != VideoPortDmaInitOnly)
1321 {
1322 /* VideoPortKeepPagesLocked / VideoPortUnlockAfterDma is no-op */
1323 return FALSE;
1324 }
1325
1326 /* lock the buffer */
1327 Buffer = VideoPortLockBuffer(HwDeviceExtension, pVrp->InputBuffer, pVrp->InputBufferLength, IoModifyAccess);
1328
1329 if (Buffer)
1330 {
1331 /* store result buffer & length */
1332 pVrp->OutputBuffer = Buffer;
1333 pVrp->OutputBufferLength = pVrp->InputBufferLength;
1334
1335 /* operation succeeded */
1336 return TRUE;
1337 }
1338
1339 /* operation failed */
1340 return FALSE;
1341}
1342
1343
1344/*
1345 * @implemented
1346 */
1347
1348VOID NTAPI
1350 IN PVOID HwDeviceExtension,
1351 IN PVOID Mdl)
1352{
1353 if (Mdl)
1354 {
1356 IoFreeMdl(Mdl);
1357 }
1358}
1359
1360/*
1361 * @unimplemented
1362 */
1363
1366 IN PVOID HwDeviceExtension,
1367 IN ULONG NumAccessRanges,
1368 IN PVIDEO_ACCESS_RANGE AccessRange)
1369{
1371 /* Should store the ranges in the device extension for use by ntvdm. */
1372 return NO_ERROR;
1373}
1374
1375/*
1376 * @implemented
1377 */
1378
1381 IN PVOID HwDeviceExtension,
1382 IN BUS_DATA_TYPE BusDataType,
1385 IN ULONG Offset,
1386 IN ULONG Length)
1387{
1388 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
1389
1390 TRACE_(VIDEOPRT, "VideoPortGetBusData\n");
1391
1392 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
1393
1394 if (BusDataType != Cmos)
1395 {
1396 /* Legacy vs. PnP behaviour */
1397 if (DeviceExtension->PhysicalDeviceObject != NULL)
1398 SlotNumber = DeviceExtension->SystemIoSlotNumber;
1399 }
1400
1401 return HalGetBusDataByOffset(
1402 BusDataType,
1403 DeviceExtension->SystemIoBusNumber,
1404 SlotNumber,
1405 Buffer,
1406 Offset,
1407 Length);
1408}
1409
1410/*
1411 * @implemented
1412 */
1413
1416 IN PVOID HwDeviceExtension,
1417 IN BUS_DATA_TYPE BusDataType,
1419 IN PVOID Buffer,
1420 IN ULONG Offset,
1421 IN ULONG Length)
1422{
1423 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
1424
1425 TRACE_(VIDEOPRT, "VideoPortSetBusData\n");
1426
1427 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
1428
1429 if (BusDataType != Cmos)
1430 {
1431 /* Legacy vs. PnP behaviour */
1432 if (DeviceExtension->PhysicalDeviceObject != NULL)
1433 SlotNumber = DeviceExtension->SystemIoSlotNumber;
1434 }
1435
1436 return HalSetBusDataByOffset(
1437 BusDataType,
1438 DeviceExtension->SystemIoBusNumber,
1439 SlotNumber,
1440 Buffer,
1441 Offset,
1442 Length);
1443}
ULONG ReadLength
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:188
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
Definition: bufpool.h:45
_In_ PCHAR _In_ ULONG DeviceNumber
Definition: classpnp.h:1230
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define ERROR_DEV_NOT_EXIST
Definition: dderror.h:8
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRACE_(x)
Definition: compat.h:76
#define L(x)
Definition: resources.c:13
#define ULONG_PTR
Definition: config.h:101
NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(PUNICODE_STRING, PUNICODE_STRING, PDRIVER_OBJECT, PDEVICE_OBJECT, INTERFACE_TYPE, ULONG, ULONG, PCM_RESOURCE_LIST *)
NTHALAPI ULONG NTAPI HalGetBusData(BUS_DATA_TYPE, ULONG, ULONG, PVOID, ULONG)
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
#define PagedPool
Definition: env_spec_w32.h:308
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
_Must_inspect_result_ _In_ PFLT_GET_OPERATION_STATUS_CALLBACK CallbackRoutine
Definition: fltkernel.h:1035
FP_OP Operation
Definition: fpcontrol.c:150
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define IoFreeMdl
Definition: fxmdl.h:89
#define IoAllocateMdl
Definition: fxmdl.h:88
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
ULONG NTAPI HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bus.c:123
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bus.c:140
ULONG NTAPI HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: bus.c:73
NTSTATUS NTAPI IoReportResourceUsage(_In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST DriverList, _In_opt_ ULONG DriverListSize, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST DeviceList, _In_opt_ ULONG DeviceListSize, _In_ BOOLEAN OverrideConflict, _Out_ PBOOLEAN ConflictDetected)
Reports hardware resources in the \Registry\Machine\Hardware\ResourceMap tree, so that a subsequently...
Definition: iorsrce.c:1041
NTSTATUS NTAPI IoAssignResources(_In_ PUNICODE_STRING RegistryPath, _In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
Definition: iorsrce.c:1134
VOID NTAPI MmUnmapIoSpace(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes)
Definition: iosup.c:193
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
Definition: iosup.c:47
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:931
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1435
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4643
unsigned int UINT
Definition: ndis.h:50
#define CM_RESOURCE_MEMORY_READ_WRITE
Definition: cmtypes.h:121
#define CM_RESOURCE_PORT_PASSIVE_DECODE
Definition: cmtypes.h:114
#define CM_RESOURCE_PORT_10_BIT_DECODE
Definition: cmtypes.h:110
#define KernelMode
Definition: asm.h:38
NTSYSAPI NTSTATUS NTAPI ZwOpenSection(_Out_ PHANDLE SectionHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_reads_opt_(s)
Definition: no_sal2.h:222
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define PAGE_NOCACHE
Definition: nt_native.h:1314
#define PAGE_READWRITE
Definition: nt_native.h:1307
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1296
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NtCurrentProcess()
Definition: nt_native.h:1660
@ ViewUnmap
Definition: nt_native.h:1282
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1916
LONG NTAPI KeReleaseMutex(IN PKMUTEX Mutex, IN BOOLEAN Wait)
Definition: mutex.c:189
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:354
static BOOL Full
Definition: pageheap.c:12
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IoReportResourceForDetection(IN PDRIVER_OBJECT DriverObject, IN PCM_RESOURCE_LIST DriverList OPTIONAL, IN ULONG DriverListSize OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PCM_RESOURCE_LIST DeviceList OPTIONAL, IN ULONG DeviceListSize OPTIONAL, OUT PBOOLEAN ConflictDetected)
Definition: pnpreport.c:394
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
struct _CM_RESOURCE_LIST CM_RESOURCE_LIST
#define CmResourceTypeMemory
Definition: restypes.h:106
@ PCIBus
Definition: restypes.h:126
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR
#define CmResourceTypePort
Definition: restypes.h:104
#define CmResourceTypeInterrupt
Definition: restypes.h:105
struct _IO_RESOURCE_DESCRIPTOR * PIO_RESOURCE_DESCRIPTOR
@ Cmos
Definition: miniport.h:89
@ PCIConfiguration
Definition: miniport.h:93
enum _BUS_DATA_TYPE BUS_DATA_TYPE
VOID(NTAPI * PBANKED_SECTION_ROUTINE)(IN ULONG ReadBank, IN ULONG WriteBank, IN PVOID Context)
Definition: miniport.h:50
struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
#define VIDEO_RANGE_10_BIT_DECODE
Definition: video.h:99
LONG VP_STATUS
Definition: video.h:153
@ VideoPortDmaInitOnly
Definition: video.h:551
#define VIDEO_MEMORY_SPACE_USER_MODE
Definition: video.h:134
enum _DMA_FLAGS DMA_FLAGS
enum _VP_POOL_TYPE VP_POOL_TYPE
VP_STATUS(NTAPI * PMINIPORT_QUERY_DEVICE_ROUTINE)(IN PVOID HwDeviceExtension, IN PVOID Context, IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, IN PVOID Identifier, IN ULONG IdentifierLength, IN PVOID ConfigurationData, IN ULONG ConfigurationDataLength, IN OUT PVOID ComponentInformation, IN ULONG ComponentInformationLength)
Definition: video.h:498
#define VIDEO_MEMORY_SPACE_P6CACHE
Definition: video.h:136
enum _VIDEO_DEVICE_DATA_TYPE VIDEO_DEVICE_DATA_TYPE
#define VIDEO_RANGE_PASSIVE_DECODE
Definition: video.h:98
struct _VIDEO_ACCESS_RANGE VIDEO_ACCESS_RANGE
enum _VP_LOCK_OPERATION VP_LOCK_OPERATION
#define INFO_(ch,...)
Definition: debug.h:159
#define ERR_(ch,...)
Definition: debug.h:156
#define WARN_(ch,...)
Definition: debug.h:157
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
_In_ PVOID Context
Definition: storport.h:2269
Definition: shell.h:41
base of all file and directory entries
Definition: entries.h:83
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: restypes.h:144
INTERFACE_TYPE InterfaceType
Definition: restypes.h:142
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@384 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@384::@386 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@384::@389 Memory
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: restypes.h:100
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: restypes.h:149
PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2279
struct _IO_RESOURCE_DESCRIPTOR::@2228::@2229 Port
union _IO_RESOURCE_DESCRIPTOR::@2228 u
struct _IO_RESOURCE_DESCRIPTOR::@2228::@2230 Memory
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: iotypes.h:2739
INTERFACE_TYPE InterfaceType
Definition: iotypes.h:2744
IO_RESOURCE_LIST List[1]
Definition: iotypes.h:2749
Definition: typedefs.h:120
union _PCI_SLOT_NUMBER::@4370 u
struct _PCI_SLOT_NUMBER::@4370::@4371 bits
ULONG RangeLength
Definition: video.h:216
UCHAR RangeShareable
Definition: video.h:219
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215
PHYSICAL_ADDRESS IoAddress
Definition: videoprt.h:49
PDEVICE_OBJECT PhysicalDeviceObject
Definition: videoprt.h:87
PCM_RESOURCE_LIST AllocatedResources
Definition: videoprt.h:94
INTERFACE_TYPE AdapterInterfaceType
Definition: videoprt.h:98
UNICODE_STRING RegistryPath
Definition: videoprt.h:90
PDRIVER_OBJECT DriverObject
Definition: videoprt.h:86
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2480 u
ULONG NumOfVgaRanges
Definition: videoprt.c:48
PVIDEO_PORT_DEVICE_EXTENSION VgaDeviceExtension
Definition: videoprt.c:46
KMUTEX VgaSyncLock
Definition: videoprt.c:45
PVIDEO_ACCESS_RANGE VgaRanges
Definition: videoprt.c:47
#define VIDEO_PORT_GET_DEVICE_EXTENSION(MiniportExtension)
Definition: videoprt.h:145
#define TAG_VIDEO_PORT
Definition: videoprt.h:38
struct _VIDEO_PORT_DEVICE_EXTENSTION * PVIDEO_PORT_DEVICE_EXTENSION
#define TAG_VIDEO_PORT_BUFFER
Definition: videoprt.h:39
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2061
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4071
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3821
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:870
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
VOID NTAPI VideoPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
Definition: resource.c:558
VP_STATUS NTAPI VideoPortGetAccessRanges(_In_ PVOID HwDeviceExtension, _In_opt_ ULONG NumRequestedResources, _In_reads_opt_(NumRequestedResources) PIO_RESOURCE_DESCRIPTOR RequestedResources, _In_ ULONG NumAccessRanges, _Out_writes_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges, _In_ PVOID VendorId, _In_ PVOID DeviceId, _Out_ PULONG Slot)
Retrieves bus-relative (mainly PCI) hardware resources access ranges and, if possible,...
Definition: resource.c:686
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
VOID NTAPI VideoPortUnlockBuffer(IN PVOID HwDeviceExtension, IN PVOID Mdl)
Definition: resource.c:1349
static UNICODE_STRING VideoClassName
Definition: resource.c:29
ULONG NTAPI VideoPortSetBusData(IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: resource.c:1415
static BOOLEAN IntAccessRangeIsInAllocatedResources(_In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_ACCESS_RANGE Range)
Definition: resource.c:294
VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN PULONG Length, IN PULONG InIoSpace, OUT PVOID *VirtualAddress)
Definition: resource.c:595
VP_STATUS NTAPI VideoPortMapBankedMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN PULONG Length, IN PULONG InIoSpace, OUT PVOID *VirtualAddress, IN ULONG BankLength, IN UCHAR ReadWriteBank, IN PBANKED_SECTION_ROUTINE BankRoutine, IN PVOID Context)
Definition: resource.c:573
PVOID NTAPI VideoPortLockBuffer(IN PVOID HwDeviceExtension, IN PVOID BaseAddress, IN ULONG Length, IN VP_LOCK_OPERATION Operation)
Definition: resource.c:1284
PVOID NTAPI IntVideoPortMapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, IN PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfUchars, IN ULONG InIoSpace, IN HANDLE ProcessHandle, OUT VP_STATUS *Status)
Definition: resource.c:327
VOID NTAPI VideoPortFreePool(IN PVOID HwDeviceExtension, IN PVOID Ptr)
Definition: resource.c:1244
VOID NTAPI IntVideoPortUnmapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, IN PVOID MappedAddress)
Definition: resource.c:485
ULONG NTAPI VideoPortGetBusData(IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, IN ULONG SlotNumber, OUT PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: resource.c:1380
VP_STATUS NTAPI VideoPortGetDeviceData(IN PVOID HwDeviceExtension, IN VIDEO_DEVICE_DATA_TYPE DeviceDataType, IN PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine, IN PVOID Context)
Definition: resource.c:1213
VP_STATUS NTAPI VideoPortVerifyAccessRanges(_In_ PVOID HwDeviceExtension, _In_opt_ ULONG NumAccessRanges, _In_reads_opt_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges)
Claims or releases a range of hardware resources and checks for conflicts.
Definition: resource.c:976
PVOID NTAPI VideoPortAllocatePool(IN PVOID HwDeviceExtension, IN VP_POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
Definition: resource.c:1229
VP_STATUS NTAPI VideoPortSetTrappedEmulatorPorts(IN PVOID HwDeviceExtension, IN ULONG NumAccessRanges, IN PVIDEO_ACCESS_RANGE AccessRange)
Definition: resource.c:1365
NTSTATUS NTAPI IntVideoPortFilterResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpStack, IN PIRP Irp)
Definition: resource.c:81
BOOLEAN VpBaseVideo
Definition: videoprt.c:36
VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN PVOID VirtualAddress, IN HANDLE ProcessHandle)
Definition: resource.c:625
VP_STATUS NTAPI VideoPortAllocateBuffer(IN PVOID HwDeviceExtension, IN ULONG Size, OUT PVOID *Buffer)
Definition: resource.c:1256
VOID NTAPI VideoPortReleaseBuffer(IN PVOID HwDeviceExtension, IN PVOID Ptr)
Definition: resource.c:1271
VOID IntVideoPortReleaseResources(_In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: resource.c:198
PVOID NTAPI VideoPortGetDeviceBase(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfUchars, IN UCHAR InIoSpace)
Definition: resource.c:537
BOOLEAN NTAPI VideoPortLockPages(IN PVOID HwDeviceExtension, IN OUT PVIDEO_REQUEST_PACKET pVrp, IN PEVENT pUEvent, IN PEVENT pDisplayEvent, IN DMA_FLAGS DmaFlags)
Definition: resource.c:1308
NTSTATUS NTAPI IntVideoPortGetLegacyResources(IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension, IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, OUT PVIDEO_ACCESS_RANGE *AccessRanges, OUT PULONG AccessRangeCount)
Definition: resource.c:34
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareShared
Definition: cmtypes.h:243
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2275
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2274
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
#define PCI_ENABLE_IO_SPACE
Definition: iotypes.h:3618
#define PCI_ENABLE_MEMORY_SPACE
Definition: iotypes.h:3619
#define PCI_MAX_FUNCTION
Definition: iotypes.h:3601
#define PCI_MAX_DEVICES
Definition: iotypes.h:3600
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036
struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
#define KeWaitForMutexObject
Definition: kefuncs.h:543
@ Executive
Definition: ketypes.h:467
@ IoModifyAccess
Definition: ketypes.h:917
@ MmNonCached
Definition: mmtypes.h:129
#define PAGE_WRITECOMBINE
Definition: mmtypes.h:78
unsigned char UCHAR
Definition: xmlstorage.h:181
_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:221