ReactOS 0.4.16-dev-2206-gc56950d
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
33static BOOLEAN
35 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
36{
37 UNICODE_STRING VgaSave = RTL_CONSTANT_STRING(L"\\Driver\\VgaSave");
38 return RtlEqualUnicodeString(&VgaSave, &DeviceExtension->DriverObject->DriverName, TRUE);
39}
40
44 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
45 OUT PVIDEO_ACCESS_RANGE *AccessRanges,
46 OUT PULONG AccessRangeCount)
47{
48 PCI_COMMON_CONFIG PciConfig;
50
51 if (!DriverExtension->InitializationData.HwGetLegacyResources &&
52 !DriverExtension->InitializationData.HwLegacyResourceCount)
53 {
54 /* No legacy resources to report */
55 *AccessRangeCount = 0;
56 return STATUS_SUCCESS;
57 }
58
59 if (DriverExtension->InitializationData.HwGetLegacyResources)
60 {
62 DeviceExtension->SystemIoBusNumber,
63 DeviceExtension->SystemIoSlotNumber,
64 &PciConfig,
65 sizeof(PciConfig));
66 if (ReadLength != sizeof(PciConfig))
67 {
68 /* This device doesn't exist */
70 }
71
72 DriverExtension->InitializationData.HwGetLegacyResources(PciConfig.VendorID,
73 PciConfig.DeviceID,
74 AccessRanges,
75 AccessRangeCount);
76 }
77 else
78 {
79 *AccessRanges = DriverExtension->InitializationData.HwLegacyResourceList;
80 *AccessRangeCount = DriverExtension->InitializationData.HwLegacyResourceCount;
81 }
82
83 INFO_(VIDEOPRT, "Got %d legacy access ranges\n", *AccessRangeCount);
84
85 return STATUS_SUCCESS;
86}
87
91 IN PIO_STACK_LOCATION IrpStack,
92 IN PIRP Irp)
93{
96 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
97 PVIDEO_ACCESS_RANGE AccessRanges;
98 ULONG AccessRangeCount, ListSize, i;
100 PIO_RESOURCE_REQUIREMENTS_LIST OldResList = IrpStack->Parameters.FilterResourceRequirements.IoResourceRequirementList;
101 PIO_RESOURCE_DESCRIPTOR CurrentDescriptor;
103
104 DriverObject = DeviceObject->DriverObject;
106 DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
107
108 Status = IntVideoPortGetLegacyResources(DriverExtension, DeviceExtension, &AccessRanges, &AccessRangeCount);
109 if (!NT_SUCCESS(Status))
110 return Status;
111 if (!AccessRangeCount)
112 {
113 /* No legacy resources to report */
114 return Irp->IoStatus.Status;
115 }
116
117 /* OK, we've got the access ranges now. Let's set up the resource requirements list */
118
119 if (OldResList)
120 {
121 /* Already one there so let's add to it */
122 ListSize = OldResList->ListSize + sizeof(IO_RESOURCE_DESCRIPTOR) * AccessRangeCount;
124 ListSize);
125 if (!ResList) return STATUS_NO_MEMORY;
126
127 RtlCopyMemory(ResList, OldResList, OldResList->ListSize);
128
129 ASSERT(ResList->AlternativeLists == 1);
130
131 ResList->ListSize = ListSize;
132 ResList->List[0].Count += AccessRangeCount;
133
134 CurrentDescriptor = (PIO_RESOURCE_DESCRIPTOR)((PUCHAR)ResList + OldResList->ListSize);
135
136 ExFreePool(OldResList);
137 Irp->IoStatus.Information = 0;
138 }
139 else
140 {
141 /* We need to make a new one */
142 ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) + sizeof(IO_RESOURCE_DESCRIPTOR) * (AccessRangeCount - 1);
144 ListSize);
145 if (!ResList) return STATUS_NO_MEMORY;
146
147 RtlZeroMemory(ResList, ListSize);
148
149 /* We need to initialize some fields */
150 ResList->ListSize = ListSize;
151 ResList->InterfaceType = DeviceExtension->AdapterInterfaceType;
152 ResList->BusNumber = DeviceExtension->SystemIoBusNumber;
153 ResList->SlotNumber = DeviceExtension->SystemIoSlotNumber;
154 ResList->AlternativeLists = 1;
155 ResList->List[0].Version = 1;
156 ResList->List[0].Revision = 1;
157 ResList->List[0].Count = AccessRangeCount;
158
159 CurrentDescriptor = ResList->List[0].Descriptors;
160 }
161
162 for (i = 0; i < AccessRangeCount; i++)
163 {
164 /* This is a required resource */
165 CurrentDescriptor->Option = 0;
166
167 if (AccessRanges[i].RangeInIoSpace)
168 CurrentDescriptor->Type = CmResourceTypePort;
169 else
170 CurrentDescriptor->Type = CmResourceTypeMemory;
171
172 CurrentDescriptor->ShareDisposition =
174
175 CurrentDescriptor->Flags = 0;
176
177 if (CurrentDescriptor->Type == CmResourceTypePort)
178 {
179 CurrentDescriptor->u.Port.Length = AccessRanges[i].RangeLength;
180 CurrentDescriptor->u.Port.MinimumAddress = AccessRanges[i].RangeStart;
181 CurrentDescriptor->u.Port.MaximumAddress.QuadPart = AccessRanges[i].RangeStart.QuadPart + AccessRanges[i].RangeLength - 1;
182 CurrentDescriptor->u.Port.Alignment = 1;
183 if (AccessRanges[i].RangePassive & VIDEO_RANGE_PASSIVE_DECODE)
184 CurrentDescriptor->Flags |= CM_RESOURCE_PORT_PASSIVE_DECODE;
185 if (AccessRanges[i].RangePassive & VIDEO_RANGE_10_BIT_DECODE)
186 CurrentDescriptor->Flags |= CM_RESOURCE_PORT_10_BIT_DECODE;
187 }
188 else
189 {
190 CurrentDescriptor->u.Memory.Length = AccessRanges[i].RangeLength;
191 CurrentDescriptor->u.Memory.MinimumAddress = AccessRanges[i].RangeStart;
192 CurrentDescriptor->u.Memory.MaximumAddress.QuadPart = AccessRanges[i].RangeStart.QuadPart + AccessRanges[i].RangeLength - 1;
193 CurrentDescriptor->u.Memory.Alignment = 1;
194 CurrentDescriptor->Flags |= CM_RESOURCE_MEMORY_READ_WRITE;
195 }
196
197 CurrentDescriptor++;
198 }
199
200 Irp->IoStatus.Information = (ULONG_PTR)ResList;
201
202 return STATUS_SUCCESS;
203}
204
205VOID
207 _In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
208{
210 BOOLEAN ConflictDetected;
211 // An empty CM_RESOURCE_LIST
212 UCHAR EmptyResourceList[FIELD_OFFSET(CM_RESOURCE_LIST, List)] = {0};
213
214 if (DeviceExtension->IsLegacyDevice || DeviceExtension->IsLegacyDetect || DeviceExtension->IsVgaDetect)
215 {
217 DeviceExtension->DriverObject,
218 NULL, 0, /* Driver List */
219 DeviceExtension->PhysicalDeviceObject,
220 (PCM_RESOURCE_LIST)EmptyResourceList,
221 sizeof(EmptyResourceList),
222 &ConflictDetected);
223
224 if (!NT_SUCCESS(Status))
225 {
226 ERR_(VIDEOPRT,
227 "VideoPortReleaseResources (Detect) failed with 0x%08lx ; ConflictDetected: %s\n",
228 Status, ConflictDetected ? "TRUE" : "FALSE");
229 }
230 }
231 else
232 {
234 DeviceExtension->DriverObject,
235 NULL,
236 0,
237 DeviceExtension->PhysicalDeviceObject,
238 (PCM_RESOURCE_LIST)EmptyResourceList,
239 sizeof(EmptyResourceList),
240 FALSE,
241 &ConflictDetected);
242 if (!NT_SUCCESS(Status))
243 {
244 ERR_(VIDEOPRT,
245 "VideoPortReleaseResources (Usage) failed with 0x%08lx ; ConflictDetected: %s\n",
246 Status, ConflictDetected ? "TRUE" : "FALSE");
247 }
248 }
249}
250
255 IN ULONG SizeInBytes,
258{
259 OBJECT_ATTRIBUTES ObjAttribs;
261 HANDLE hMemObj;
263 SIZE_T Size;
264
265 /* Initialize object attribs */
266 RtlInitUnicodeString(&UnicodeString, L"\\Device\\PhysicalMemory");
267 InitializeObjectAttributes(&ObjAttribs,
270 NULL, NULL);
271
272 /* Open physical memory section */
273 Status = ZwOpenSection(&hMemObj, SECTION_ALL_ACCESS, &ObjAttribs);
274 if (!NT_SUCCESS(Status))
275 {
276 WARN_(VIDEOPRT, "ZwOpenSection() failed! (0x%x)\n", Status);
277 return Status;
278 }
279
280 /* Map view of section */
281 Size = SizeInBytes;
282 Status = ZwMapViewOfSection(hMemObj,
283 Process,
285 0,
286 Size,
288 &Size,
289 ViewUnmap,
290 0,
291 Protect);
292 ZwClose(hMemObj);
293 if (!NT_SUCCESS(Status))
294 {
295 WARN_(VIDEOPRT, "ZwMapViewOfSection() failed! (0x%x)\n", Status);
296 }
297
298 return Status;
299}
300
301static BOOLEAN
303 _In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
305{
306 CM_RESOURCE_LIST *Res = DeviceExtension->AllocatedResources;
309
310 if (!Res || Res->Count == 0)
311 return FALSE;
312 Full = &Res->List[0];
313 for (Desc = Full->PartialResourceList.PartialDescriptors;
314 Desc < Full->PartialResourceList.PartialDescriptors + Full->PartialResourceList.Count;
315 ++Desc)
316 {
317 if (Range->RangeInIoSpace && Desc->Type == CmResourceTypePort)
318 {
319 if (Desc->u.Port.Start.QuadPart == Range->RangeStart.QuadPart &&
320 Desc->u.Port.Length == Range->RangeLength)
321 return TRUE;
322 }
323 else if (!Range->RangeInIoSpace && Desc->Type == CmResourceTypeMemory)
324 {
325 if (Desc->u.Memory.Start.QuadPart == Range->RangeStart.QuadPart &&
326 Desc->u.Memory.Length == Range->RangeLength)
327 return TRUE;
328 }
329 }
330 return FALSE;
331}
332
333
336 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
337 IN PHYSICAL_ADDRESS IoAddress,
338 IN ULONG NumberOfUchars,
339 IN ULONG InIoSpace,
342{
344 PVIDEO_PORT_ADDRESS_MAPPING AddressMapping;
346 PVOID MappedAddress;
348
349 INFO_(VIDEOPRT, "- IoAddress: %lx\n", IoAddress.u.LowPart);
350 INFO_(VIDEOPRT, "- NumberOfUchars: %lx\n", NumberOfUchars);
351 INFO_(VIDEOPRT, "- InIoSpace: %x\n", InIoSpace);
352
353 InIoSpace &= ~VIDEO_MEMORY_SPACE_DENSE;
354
355 if (ProcessHandle != NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0)
356 {
357 INFO_(VIDEOPRT, "ProcessHandle is not NULL (0x%x) but InIoSpace does not have "
358 "VIDEO_MEMORY_SPACE_USER_MODE set! Setting "
359 "VIDEO_MEMORY_SPACE_USER_MODE.\n",
361 InIoSpace |= VIDEO_MEMORY_SPACE_USER_MODE;
362 }
363 else if (ProcessHandle == NULL && (InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
364 {
365 INFO_(VIDEOPRT, "ProcessHandle is NULL (0x%x) but InIoSpace does have "
366 "VIDEO_MEMORY_SPACE_USER_MODE set! Setting ProcessHandle "
367 "to NtCurrentProcess()\n",
370 }
371
372 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0 &&
373 !IsListEmpty(&DeviceExtension->AddressMappingListHead))
374 {
375 Entry = DeviceExtension->AddressMappingListHead.Flink;
376 while (Entry != &DeviceExtension->AddressMappingListHead)
377 {
378 AddressMapping = CONTAINING_RECORD(
379 Entry,
381 List);
382 if (IoAddress.QuadPart == AddressMapping->IoAddress.QuadPart &&
383 NumberOfUchars <= AddressMapping->NumberOfUchars)
384 {
385 {
386 AddressMapping->MappingCount++;
387 if (Status)
388 *Status = NO_ERROR;
389 return AddressMapping->MappedAddress;
390 }
391 }
392 Entry = Entry->Flink;
393 }
394 }
395
396 AddressSpace = (ULONG)InIoSpace;
399 DeviceExtension->AdapterInterfaceType,
400 DeviceExtension->SystemIoBusNumber,
401 IoAddress,
404 {
405 if (Status)
407
408 return NULL;
409 }
410
411 /* I/O space */
412 if (AddressSpace != 0)
413 {
414 ASSERT(0 == TranslatedAddress.u.HighPart);
415 if (Status)
416 *Status = NO_ERROR;
417
418 return (PVOID)(ULONG_PTR)TranslatedAddress.u.LowPart;
419 }
420
421 /* user space */
422 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) != 0)
423 {
424 NTSTATUS NtStatus;
426 if (InIoSpace & VIDEO_MEMORY_SPACE_P6CACHE)
428 else
430 MappedAddress = NULL;
433 NumberOfUchars,
434 Protect,
435 &MappedAddress);
436 if (!NT_SUCCESS(NtStatus))
437 {
438 ERR_(VIDEOPRT, "IntVideoPortMapPhysicalMemory() failed! (0x%x)\n", NtStatus);
439 if (Status)
441 return NULL;
442 }
443 INFO_(VIDEOPRT, "Mapped user address = 0x%08x\n", MappedAddress);
444 }
445 else /* kernel space */
446 {
447 MappedAddress = MmMapIoSpace(
449 NumberOfUchars,
451 }
452
453 if (MappedAddress != NULL)
454 {
455 if (Status)
456 {
457 *Status = NO_ERROR;
458 }
459 if ((InIoSpace & VIDEO_MEMORY_SPACE_USER_MODE) == 0)
460 {
461 AddressMapping = ExAllocatePoolWithTag(
462 PagedPool,
465
466 if (AddressMapping == NULL)
467 return MappedAddress;
468
469 RtlZeroMemory(AddressMapping, sizeof(VIDEO_PORT_ADDRESS_MAPPING));
470 AddressMapping->NumberOfUchars = NumberOfUchars;
471 AddressMapping->IoAddress = IoAddress;
472 AddressMapping->SystemIoBusNumber = DeviceExtension->SystemIoBusNumber;
473 AddressMapping->MappedAddress = MappedAddress;
474 AddressMapping->MappingCount = 1;
476 &DeviceExtension->AddressMappingListHead,
477 &AddressMapping->List);
478 }
479
480 return MappedAddress;
481 }
482
483 ERR_(VIDEOPRT,
484 "Couldn't map video memory. IoAddress: 0x%lx, NumberOfUchars: 0x%lx, InIoSpace: 0x%x\n",
485 IoAddress.u.LowPart, NumberOfUchars, InIoSpace);
486 if (Status)
488
489 return NULL;
490}
491
494 IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension,
495 IN PVOID MappedAddress)
496{
497 PVIDEO_PORT_ADDRESS_MAPPING AddressMapping;
500
501 Entry = DeviceExtension->AddressMappingListHead.Flink;
502 while (Entry != &DeviceExtension->AddressMappingListHead)
503 {
504 AddressMapping = CONTAINING_RECORD(
505 Entry,
507 List);
508 if (AddressMapping->MappedAddress == MappedAddress)
509 {
510 ASSERT(AddressMapping->MappingCount > 0);
511 AddressMapping->MappingCount--;
512 if (AddressMapping->MappingCount == 0)
513 {
515 AddressMapping->MappedAddress,
516 AddressMapping->NumberOfUchars);
518 ExFreePool(AddressMapping);
519 }
520 return;
521 }
522
523 Entry = Entry->Flink;
524 }
525
526 /* If there was no kernelmode mapping for the given address found we assume
527 * that the given address is a usermode mapping and try to unmap it.
528 *
529 * FIXME: Is it ok to use NtCurrentProcess?
530 */
531 Status = ZwUnmapViewOfSection(NtCurrentProcess(), MappedAddress);
532 if (!NT_SUCCESS(Status))
533 {
534 WARN_(VIDEOPRT, "Warning: Mapping for address 0x%p not found!\n", MappedAddress);
535 }
536}
537
538/* PUBLIC FUNCTIONS ***********************************************************/
539
540/*
541 * @implemented
542 */
543
546 IN PVOID HwDeviceExtension,
547 IN PHYSICAL_ADDRESS IoAddress,
548 IN ULONG NumberOfUchars,
549 IN UCHAR InIoSpace)
550{
551 TRACE_(VIDEOPRT, "VideoPortGetDeviceBase\n");
553 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
554 IoAddress,
555 NumberOfUchars,
556 InIoSpace,
557 NULL,
558 NULL);
559}
560
561/*
562 * @implemented
563 */
564
567 IN PVOID HwDeviceExtension,
568 IN PVOID MappedAddress)
569{
570 TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
572 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
573 MappedAddress);
574}
575
576/*
577 * @unimplemented
578 */
579
582 IN PVOID HwDeviceExtension,
585 IN PULONG InIoSpace,
587 IN ULONG BankLength,
588 IN UCHAR ReadWriteBank,
589 IN PBANKED_SECTION_ROUTINE BankRoutine,
591{
592 TRACE_(VIDEOPRT, "VideoPortMapBankedMemory\n");
595}
596
597
598/*
599 * @implemented
600 */
601
604 IN PVOID HwDeviceExtension,
607 IN PULONG InIoSpace,
609{
610 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
612
613 TRACE_(VIDEOPRT, "VideoPortMapMemory\n");
614 INFO_(VIDEOPRT, "- *VirtualAddress: 0x%x\n", *VirtualAddress);
615
616 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
618 DeviceExtension,
620 *Length,
621 *InIoSpace,
623 &Status);
624
625 return Status;
626}
627
628/*
629 * @implemented
630 */
631
634 IN PVOID HwDeviceExtension,
637{
638 TRACE_(VIDEOPRT, "VideoPortFreeDeviceBase\n");
639
641 VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension),
643
644 return NO_ERROR;
645}
646
693NTAPI
695 _In_ PVOID HwDeviceExtension,
696 _In_opt_ ULONG NumRequestedResources,
697 _In_reads_opt_(NumRequestedResources)
698 PIO_RESOURCE_DESCRIPTOR RequestedResources,
699 _In_ ULONG NumAccessRanges,
700 _Out_writes_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges,
701 _In_ PVOID VendorId,
702 _In_ PVOID DeviceId,
703 _Out_ PULONG Slot)
704{
705 PCI_SLOT_NUMBER PciSlotNumber;
707 ULONG FunctionNumber;
711 UINT AssignedCount = 0;
714 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
716 USHORT VendorIdToFind;
717 USHORT DeviceIdToFind;
719 PVIDEO_ACCESS_RANGE LegacyAccessRanges;
720 ULONG LegacyAccessRangeCount;
722 ULONG ListSize;
724 BOOLEAN DeviceAndVendorFound = FALSE;
725
726 TRACE_(VIDEOPRT, "VideoPortGetAccessRanges(%d, %p, %d, %p)\n",
727 NumRequestedResources, RequestedResources, NumAccessRanges, AccessRanges);
728
729 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
730 DriverObject = DeviceExtension->DriverObject;
732
733 if (NumRequestedResources == 0)
734 {
735 AllocatedResources = DeviceExtension->AllocatedResources;
736 if (AllocatedResources == NULL &&
737 DeviceExtension->AdapterInterfaceType == PCIBus)
738 {
739 if (DeviceExtension->PhysicalDeviceObject != NULL)
740 {
741 PciSlotNumber.u.AsULONG = DeviceExtension->SystemIoSlotNumber;
742
744 DeviceExtension->SystemIoBusNumber,
745 PciSlotNumber.u.AsULONG,
746 &Config,
747 sizeof(Config));
748
749 if (ReturnedLength != sizeof(Config))
750 {
752 }
753 }
754 else
755 {
756 VendorIdToFind = VendorId != NULL ? *(PUSHORT)VendorId : 0;
757 DeviceIdToFind = DeviceId != NULL ? *(PUSHORT)DeviceId : 0;
758
759 if (VendorIdToFind == 0 && DeviceIdToFind == 0)
760 {
761 /* We're screwed */
762 return ERROR_DEV_NOT_EXIST;
763 }
764
765 INFO_(VIDEOPRT, "Looking for VendorId 0x%04x DeviceId 0x%04x\n",
766 VendorIdToFind, DeviceIdToFind);
767
768 /*
769 * Search for the device id and vendor id on this bus.
770 */
771 PciSlotNumber.u.bits.Reserved = 0;
773 {
774 PciSlotNumber.u.bits.DeviceNumber = DeviceNumber;
775 for (FunctionNumber = 0; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++)
776 {
777 INFO_(VIDEOPRT, "- Function number: %d\n", FunctionNumber);
778 PciSlotNumber.u.bits.FunctionNumber = FunctionNumber;
780 DeviceExtension->SystemIoBusNumber,
781 PciSlotNumber.u.AsULONG,
782 &Config,
783 sizeof(Config));
784
785 INFO_(VIDEOPRT, "- Length of data: %x\n", ReturnedLength);
786
787 if (ReturnedLength == sizeof(Config))
788 {
789 INFO_(VIDEOPRT, "- Slot 0x%02x (Device %d Function %d) VendorId 0x%04x "
790 "DeviceId 0x%04x\n",
791 PciSlotNumber.u.AsULONG,
792 PciSlotNumber.u.bits.DeviceNumber,
793 PciSlotNumber.u.bits.FunctionNumber,
794 Config.VendorID,
795 Config.DeviceID);
796
797 if ((VendorIdToFind == 0 || Config.VendorID == VendorIdToFind) &&
798 (DeviceIdToFind == 0 || Config.DeviceID == DeviceIdToFind))
799 {
800 DeviceAndVendorFound = TRUE;
801 break;
802 }
803 }
804 }
805 if (DeviceAndVendorFound)
806 break;
807 }
808 if (FunctionNumber == PCI_MAX_FUNCTION)
809 {
810 WARN_(VIDEOPRT, "Didn't find device.\n");
811 return ERROR_DEV_NOT_EXIST;
812 }
813 }
814
815 Status = HalAssignSlotResources(&DeviceExtension->RegistryPath,
816 NULL,
817 DeviceExtension->DriverObject,
818 DeviceExtension->DriverObject->DeviceObject,
819 DeviceExtension->AdapterInterfaceType,
820 DeviceExtension->SystemIoBusNumber,
821 PciSlotNumber.u.AsULONG,
823 if (!NT_SUCCESS(Status))
824 {
825 WARN_(VIDEOPRT, "HalAssignSlotResources failed with status %x.\n",Status);
826 return Status;
827 }
828 DeviceExtension->AllocatedResources = AllocatedResources;
829 DeviceExtension->SystemIoSlotNumber = PciSlotNumber.u.AsULONG;
830
831 /* Add legacy resources to the resources from HAL */
833 &LegacyAccessRanges, &LegacyAccessRangeCount);
834 if (!NT_SUCCESS(Status))
835 return ERROR_DEV_NOT_EXIST;
836
837 if (NumAccessRanges < LegacyAccessRangeCount)
838 {
839 ERR_(VIDEOPRT, "Too many legacy access ranges found\n");
840 return ERROR_NOT_ENOUGH_MEMORY; // ERROR_MORE_DATA;
841 }
842
843 RtlCopyMemory(AccessRanges, LegacyAccessRanges, LegacyAccessRangeCount * sizeof(VIDEO_ACCESS_RANGE));
844 AssignedCount = LegacyAccessRangeCount;
845 }
846 }
847 else
848 {
849 ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) + (NumRequestedResources - 1) * sizeof(IO_RESOURCE_DESCRIPTOR);
850 ResReqList = ExAllocatePool(NonPagedPool, ListSize);
851 if (!ResReqList)
853
854 ResReqList->ListSize = ListSize;
855 ResReqList->InterfaceType = DeviceExtension->AdapterInterfaceType;
856 ResReqList->BusNumber = DeviceExtension->SystemIoBusNumber;
857 ResReqList->SlotNumber = DeviceExtension->SystemIoSlotNumber;
858 ResReqList->AlternativeLists = 1;
859 ResReqList->List[0].Version = 1;
860 ResReqList->List[0].Revision = 1;
861 ResReqList->List[0].Count = NumRequestedResources;
862
863 /* Copy in the caller's resource list */
864 RtlCopyMemory(ResReqList->List[0].Descriptors,
865 RequestedResources,
866 NumRequestedResources * sizeof(IO_RESOURCE_DESCRIPTOR));
867
868 Status = IoAssignResources(&DeviceExtension->RegistryPath,
869 NULL,
870 DeviceExtension->DriverObject,
871 DeviceExtension->PhysicalDeviceObject ?
872 DeviceExtension->PhysicalDeviceObject :
873 DeviceExtension->DriverObject->DeviceObject,
874 ResReqList,
876
877 if (!NT_SUCCESS(Status))
878 return Status;
879
880 if (!DeviceExtension->AllocatedResources)
881 DeviceExtension->AllocatedResources = AllocatedResources;
882 }
883
886
887 /* Return the slot number if the caller wants it */
888 if (Slot != NULL) *Slot = DeviceExtension->SystemIoBusNumber;
889
890 FullList = AllocatedResources->List;
891 ASSERT(AllocatedResources->Count == 1);
892 INFO_(VIDEOPRT, "InterfaceType %u BusNumber List %u Device BusNumber %u Version %u Revision %u\n",
893 FullList->InterfaceType, FullList->BusNumber, DeviceExtension->SystemIoBusNumber,
895
896 ASSERT(FullList->InterfaceType == PCIBus);
897 ASSERT(FullList->BusNumber == DeviceExtension->SystemIoBusNumber);
898 ASSERT(1 == FullList->PartialResourceList.Version);
899 ASSERT(1 == FullList->PartialResourceList.Revision);
900
902 Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count;
903 Descriptor++)
904 {
905 if ((Descriptor->Type == CmResourceTypeMemory ||
906 Descriptor->Type == CmResourceTypePort) &&
907 AssignedCount >= NumAccessRanges)
908 {
909 ERR_(VIDEOPRT, "Too many access ranges found\n");
910 return ERROR_MORE_DATA;
911 }
912 else if (Descriptor->Type == CmResourceTypeMemory)
913 {
914 INFO_(VIDEOPRT, "Memory range starting at 0x%08x length 0x%08x\n",
915 Descriptor->u.Memory.Start.u.LowPart, Descriptor->u.Memory.Length);
916 AccessRanges[AssignedCount].RangeStart = Descriptor->u.Memory.Start;
917 AccessRanges[AssignedCount].RangeLength = Descriptor->u.Memory.Length;
918 AccessRanges[AssignedCount].RangeInIoSpace = 0;
919 AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */
920 AccessRanges[AssignedCount].RangeShareable =
921 (Descriptor->ShareDisposition == CmResourceShareShared);
922 AccessRanges[AssignedCount].RangePassive = 0;
923 AssignedCount++;
924 }
925 else if (Descriptor->Type == CmResourceTypePort)
926 {
927 INFO_(VIDEOPRT, "Port range starting at 0x%04x length %d\n",
928 Descriptor->u.Port.Start.u.LowPart, Descriptor->u.Port.Length);
929 AccessRanges[AssignedCount].RangeStart = Descriptor->u.Port.Start;
930 AccessRanges[AssignedCount].RangeLength = Descriptor->u.Port.Length;
931 AccessRanges[AssignedCount].RangeInIoSpace = 1;
932 AccessRanges[AssignedCount].RangeVisible = 0; /* FIXME: Just guessing */
933 AccessRanges[AssignedCount].RangeShareable =
934 (Descriptor->ShareDisposition == CmResourceShareShared);
935 AccessRanges[AssignedCount].RangePassive = 0;
937 AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_10_BIT_DECODE;
939 AccessRanges[AssignedCount].RangePassive |= VIDEO_RANGE_PASSIVE_DECODE;
940 AssignedCount++;
941 }
942 else if (Descriptor->Type == CmResourceTypeInterrupt)
943 {
944 DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level;
945 DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector;
946 if (Descriptor->ShareDisposition == CmResourceShareShared)
947 DeviceExtension->InterruptShared = TRUE;
948 else
949 DeviceExtension->InterruptShared = FALSE;
950 }
951 // else if (Descriptor->Type == CmResourceTypeDma) // TODO!
952 else
953 {
954 ASSERT(FALSE);
956 }
957 }
958
959 return NO_ERROR;
960}
961
983NTAPI
985 _In_ PVOID HwDeviceExtension,
986 _In_opt_ ULONG NumAccessRanges,
987 _In_reads_opt_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges)
988{
989 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
990 BOOLEAN ConflictDetected;
991 ULONG ResourceListSize;
993 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
994 ULONG i;
996
997 TRACE_(VIDEOPRT, "VideoPortVerifyAccessRanges\n");
998
999 /* Verify parameters */
1000 if (NumAccessRanges && !AccessRanges)
1002
1003 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
1004
1005 if (NumAccessRanges == 0)
1006 {
1007 /* Release the resources and do nothing more for now... */
1008 IntVideoPortReleaseResources(DeviceExtension);
1009 /* If releasing VGA device resources, clear tracked ranges */
1010 if (DeviceExtension->IsVgaDriver)
1011 {
1013 if (VgaRanges)
1014 {
1016 VgaRanges = NULL;
1017 }
1018 NumOfVgaRanges = 0;
1021 }
1022 return NO_ERROR;
1023 }
1024
1025 /*
1026 * For non-legacy PCI devices, validate that the relevant I/O or memory
1027 * decoding bits are enabled in the PCI command register before claiming
1028 */
1029 if (!DeviceExtension->IsLegacyDevice && DeviceExtension->AdapterInterfaceType == PCIBus)
1030 {
1031 USHORT PciCommand;
1033
1035 DeviceExtension->SystemIoBusNumber,
1036 DeviceExtension->SystemIoSlotNumber,
1037 &PciCommand,
1039 sizeof(PciCommand));
1040 if (BytesRead == sizeof(PciCommand))
1041 {
1042 for (i = 0; i < NumAccessRanges; i++)
1043 {
1044 if (AccessRanges[i].RangeInIoSpace)
1045 {
1046 if ((PciCommand & PCI_ENABLE_IO_SPACE) == 0)
1047 {
1048 WARN_(VIDEOPRT, "PCI I/O space disabled; refusing access range claim\n");
1050 }
1051 }
1052 else
1053 {
1054 if ((PciCommand & PCI_ENABLE_MEMORY_SPACE) == 0)
1055 {
1056 WARN_(VIDEOPRT, "PCI memory space disabled; refusing access range claim\n");
1058 }
1059 }
1060 }
1061 }
1062 }
1063
1064 /* Determine which ranges need to be claimed (exclude PnP-assigned ones) */
1065 ULONG Needed = 0;
1066 for (i = 0; i < NumAccessRanges; ++i)
1067 {
1068 if (DeviceExtension->PhysicalDeviceObject && !DeviceExtension->IsLegacyDevice)
1069 {
1070 if (IntAccessRangeIsInAllocatedResources(DeviceExtension, &AccessRanges[i]))
1071 continue;
1072 }
1073 ++Needed;
1074 }
1075
1076 if (Needed == 0)
1077 {
1078 /* Nothing to report/claim */
1079 return NO_ERROR;
1080 }
1081
1082 /* Create the resource list for the non-PnP-assigned ranges */
1083 ResourceListSize = sizeof(CM_RESOURCE_LIST)
1084 + (Needed - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
1086 if (!ResourceList)
1087 {
1088 WARN_(VIDEOPRT, "ExAllocatePool() failed\n");
1090 }
1091
1092 /* Fill resource list */
1093 ResourceList->Count = 1;
1094 ResourceList->List[0].InterfaceType = DeviceExtension->AdapterInterfaceType;
1095 ResourceList->List[0].BusNumber = DeviceExtension->SystemIoBusNumber;
1096 ResourceList->List[0].PartialResourceList.Version = 1;
1097 ResourceList->List[0].PartialResourceList.Revision = 1;
1098 ResourceList->List[0].PartialResourceList.Count = Needed;
1099
1100 ULONG j = 0;
1101 for (i = 0; i < NumAccessRanges; ++i)
1102 {
1103 if (DeviceExtension->PhysicalDeviceObject && !DeviceExtension->IsLegacyDevice)
1104 {
1105 if (IntAccessRangeIsInAllocatedResources(DeviceExtension, &AccessRanges[i]))
1106 continue;
1107 }
1108
1109 PartialDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[j++];
1110 if (AccessRanges[i].RangeInIoSpace)
1111 {
1112 PartialDescriptor->Type = CmResourceTypePort;
1113 PartialDescriptor->u.Port.Start = AccessRanges[i].RangeStart;
1114 PartialDescriptor->u.Port.Length = AccessRanges[i].RangeLength;
1115 }
1116 else
1117 {
1118 PartialDescriptor->Type = CmResourceTypeMemory;
1119 PartialDescriptor->u.Memory.Start = AccessRanges[i].RangeStart;
1120 PartialDescriptor->u.Memory.Length = AccessRanges[i].RangeLength;
1121 }
1122 PartialDescriptor->ShareDisposition = AccessRanges[i].RangeShareable ?
1124 PartialDescriptor->Flags = 0;
1125 if (AccessRanges[i].RangePassive & VIDEO_RANGE_PASSIVE_DECODE)
1126 PartialDescriptor->Flags |= CM_RESOURCE_PORT_PASSIVE_DECODE;
1127 if (AccessRanges[i].RangePassive & VIDEO_RANGE_10_BIT_DECODE)
1128 PartialDescriptor->Flags |= CM_RESOURCE_PORT_10_BIT_DECODE;
1129 }
1130
1131 if (DeviceExtension->IsLegacyDevice || DeviceExtension->IsLegacyDetect || DeviceExtension->IsVgaDetect)
1132 {
1134 DeviceExtension->DriverObject,
1135 NULL, 0, /* Driver List */
1136 DeviceExtension->PhysicalDeviceObject,
1137 ResourceList, ResourceListSize,
1138 &ConflictDetected);
1139
1140 /* IntIsVgaSaveDriver() will later ignore STATUS_CONFLICTING_ADDRESSES, but we still claim it */
1141 if (!NT_SUCCESS(Status) && IntIsVgaSaveDriver(DeviceExtension))
1142 {
1143 NTSTATUS fbStatus;
1144 BOOLEAN fbConflict = FALSE;
1146 DeviceExtension->DriverObject,
1147 NULL,
1148 0,
1149 DeviceExtension->PhysicalDeviceObject,
1151 ResourceListSize,
1152 FALSE,
1153 &fbConflict);
1154 INFO_(VIDEOPRT, "VGA detect->usage fallback: Status=0x%lx Conflict=%d fbStatus=0x%lx fbConflict=%d\n",
1155 Status, ConflictDetected, fbStatus, fbConflict);
1156 Status = fbStatus;
1157 ConflictDetected = fbConflict;
1158 }
1159 }
1160 else
1161 {
1163 DeviceExtension->DriverObject,
1164 NULL,
1165 0,
1166 DeviceExtension->PhysicalDeviceObject,
1168 ResourceListSize,
1169 FALSE,
1170 &ConflictDetected);
1171 }
1173
1174 /* If VgaSave driver is conflicting and we don't explicitely want
1175 * to use it, ignore the problem (because win32k will try to use
1176 * this driver only if all other ones are failing). */
1177 if ((Status == STATUS_CONFLICTING_ADDRESSES || ConflictDetected) &&
1178 IntIsVgaSaveDriver(DeviceExtension) &&
1179 !VpBaseVideo)
1180 {
1181 return NO_ERROR;
1182 }
1183
1184 if (!NT_SUCCESS(Status) || ConflictDetected)
1186 else
1187 {
1188 /* Track VGA access ranges on success for fallback handling */
1189 if (DeviceExtension->IsVgaDriver)
1190 {
1192 if (VgaRanges)
1193 {
1195 VgaRanges = NULL;
1196 NumOfVgaRanges = 0;
1197 }
1198 if (NumAccessRanges)
1199 {
1200 SIZE_T sz = NumAccessRanges * sizeof(VIDEO_ACCESS_RANGE);
1202 if (VgaRanges)
1203 {
1204 RtlCopyMemory(VgaRanges, AccessRanges, sz);
1205 NumOfVgaRanges = NumAccessRanges;
1206 VgaDeviceExtension = DeviceExtension;
1207 }
1208 }
1210 }
1211 /* Leave VGA detect phase after first successful claim */
1212 DeviceExtension->IsVgaDetect = FALSE;
1213 return NO_ERROR;
1214 }
1215}
1216
1217/*
1218 * @unimplemented
1219 */
1220
1223 IN PVOID HwDeviceExtension,
1224 IN VIDEO_DEVICE_DATA_TYPE DeviceDataType,
1227{
1228 TRACE_(VIDEOPRT, "VideoPortGetDeviceData\n");
1231}
1232
1233/*
1234 * @implemented
1235 */
1236
1239 IN PVOID HwDeviceExtension,
1242 IN ULONG Tag)
1243{
1244 TRACE_(VIDEOPRT, "VideoPortAllocatePool\n");
1246}
1247
1248/*
1249 * @implemented
1250 */
1251
1252VOID NTAPI
1254 IN PVOID HwDeviceExtension,
1255 IN PVOID Ptr)
1256{
1257 ExFreePool(Ptr);
1258}
1259
1260/*
1261 * @implemented
1262 */
1263
1266 IN PVOID HwDeviceExtension,
1267 IN ULONG Size,
1268 OUT PVOID *Buffer)
1269{
1270 TRACE_(VIDEOPRT, "VideoPortAllocateBuffer\n");
1273}
1274
1275/*
1276 * @implemented
1277 */
1278
1279VOID NTAPI
1281 IN PVOID HwDeviceExtension,
1282 IN PVOID Ptr)
1283{
1284 TRACE_(VIDEOPRT, "VideoPortReleaseBuffer\n");
1285 ExFreePool(Ptr);
1286}
1287
1288/*
1289 * @implemented
1290 */
1291
1294 IN PVOID HwDeviceExtension,
1296 IN ULONG Length,
1298{
1299 PMDL Mdl;
1300
1302 if (!Mdl)
1303 {
1304 return NULL;
1305 }
1306 /* FIXME use seh */
1308 return Mdl;
1309}
1310
1311/*
1312 * @implemented
1313 */
1314
1315BOOLEAN
1316NTAPI
1318 IN PVOID HwDeviceExtension,
1320 IN PEVENT pUEvent,
1321 IN PEVENT pDisplayEvent,
1322 IN DMA_FLAGS DmaFlags)
1323{
1324 PVOID Buffer;
1325
1326 /* clear output buffer */
1327 pVrp->OutputBuffer = NULL;
1328
1329 if (DmaFlags != VideoPortDmaInitOnly)
1330 {
1331 /* VideoPortKeepPagesLocked / VideoPortUnlockAfterDma is no-op */
1332 return FALSE;
1333 }
1334
1335 /* lock the buffer */
1336 Buffer = VideoPortLockBuffer(HwDeviceExtension, pVrp->InputBuffer, pVrp->InputBufferLength, IoModifyAccess);
1337
1338 if (Buffer)
1339 {
1340 /* store result buffer & length */
1341 pVrp->OutputBuffer = Buffer;
1342 pVrp->OutputBufferLength = pVrp->InputBufferLength;
1343
1344 /* operation succeeded */
1345 return TRUE;
1346 }
1347
1348 /* operation failed */
1349 return FALSE;
1350}
1351
1352
1353/*
1354 * @implemented
1355 */
1356
1357VOID NTAPI
1359 IN PVOID HwDeviceExtension,
1360 IN PVOID Mdl)
1361{
1362 if (Mdl)
1363 {
1365 IoFreeMdl(Mdl);
1366 }
1367}
1368
1369/*
1370 * @unimplemented
1371 */
1372
1375 IN PVOID HwDeviceExtension,
1376 IN ULONG NumAccessRanges,
1377 IN PVIDEO_ACCESS_RANGE AccessRange)
1378{
1380 /* Should store the ranges in the device extension for use by ntvdm. */
1381 return NO_ERROR;
1382}
1383
1384/*
1385 * @implemented
1386 */
1387
1390 IN PVOID HwDeviceExtension,
1391 IN BUS_DATA_TYPE BusDataType,
1394 IN ULONG Offset,
1395 IN ULONG Length)
1396{
1397 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
1398
1399 TRACE_(VIDEOPRT, "VideoPortGetBusData\n");
1400
1401 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
1402
1403 if (BusDataType != Cmos)
1404 {
1405 /* Legacy vs. PnP behaviour */
1406 if (DeviceExtension->PhysicalDeviceObject != NULL)
1407 SlotNumber = DeviceExtension->SystemIoSlotNumber;
1408 }
1409
1410 return HalGetBusDataByOffset(
1411 BusDataType,
1412 DeviceExtension->SystemIoBusNumber,
1413 SlotNumber,
1414 Buffer,
1415 Offset,
1416 Length);
1417}
1418
1419/*
1420 * @implemented
1421 */
1422
1425 IN PVOID HwDeviceExtension,
1426 IN BUS_DATA_TYPE BusDataType,
1428 IN PVOID Buffer,
1429 IN ULONG Offset,
1430 IN ULONG Length)
1431{
1432 PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
1433
1434 TRACE_(VIDEOPRT, "VideoPortSetBusData\n");
1435
1436 DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
1437
1438 if (BusDataType != Cmos)
1439 {
1440 /* Legacy vs. PnP behaviour */
1441 if (DeviceExtension->PhysicalDeviceObject != NULL)
1442 SlotNumber = DeviceExtension->SystemIoSlotNumber;
1443 }
1444
1445 return HalSetBusDataByOffset(
1446 BusDataType,
1447 DeviceExtension->SystemIoBusNumber,
1448 SlotNumber,
1449 Buffer,
1450 Offset,
1451 Length);
1452}
ULONG ReadLength
unsigned char BOOLEAN
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 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
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
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:120
#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)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#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
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
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
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@432::@437 Memory
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@432::@434 Port
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@432 u
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::@2250::@2251 Port
struct _IO_RESOURCE_DESCRIPTOR::@2250::@2252 Memory
union _IO_RESOURCE_DESCRIPTOR::@2250 u
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
struct _PCI_SLOT_NUMBER::@4345::@4346 bits
union _PCI_SLOT_NUMBER::@4345 u
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
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
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::@2502 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:566
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:694
NTSTATUS NTAPI IntVideoPortMapPhysicalMemory(IN HANDLE Process, IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG SizeInBytes, IN ULONG Protect, IN OUT PVOID *VirtualAddress OPTIONAL)
Definition: resource.c:252
VOID NTAPI VideoPortUnlockBuffer(IN PVOID HwDeviceExtension, IN PVOID Mdl)
Definition: resource.c:1358
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:1424
static BOOLEAN IntAccessRangeIsInAllocatedResources(_In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_ACCESS_RANGE Range)
Definition: resource.c:302
VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN PULONG Length, IN PULONG InIoSpace, OUT PVOID *VirtualAddress)
Definition: resource.c:603
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:581
PVOID NTAPI VideoPortLockBuffer(IN PVOID HwDeviceExtension, IN PVOID BaseAddress, IN ULONG Length, IN VP_LOCK_OPERATION Operation)
Definition: resource.c:1293
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:335
VOID NTAPI VideoPortFreePool(IN PVOID HwDeviceExtension, IN PVOID Ptr)
Definition: resource.c:1253
static BOOLEAN IntIsVgaSaveDriver(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: resource.c:34
VOID NTAPI IntVideoPortUnmapMemory(IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension, IN PVOID MappedAddress)
Definition: resource.c:493
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:1389
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:1222
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:984
PVOID NTAPI VideoPortAllocatePool(IN PVOID HwDeviceExtension, IN VP_POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
Definition: resource.c:1238
VP_STATUS NTAPI VideoPortSetTrappedEmulatorPorts(IN PVOID HwDeviceExtension, IN ULONG NumAccessRanges, IN PVIDEO_ACCESS_RANGE AccessRange)
Definition: resource.c:1374
NTSTATUS NTAPI IntVideoPortFilterResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpStack, IN PIRP Irp)
Definition: resource.c:89
BOOLEAN VpBaseVideo
Definition: videoprt.c:36
VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN PVOID VirtualAddress, IN HANDLE ProcessHandle)
Definition: resource.c:633
VP_STATUS NTAPI VideoPortAllocateBuffer(IN PVOID HwDeviceExtension, IN ULONG Size, OUT PVOID *Buffer)
Definition: resource.c:1265
VOID NTAPI VideoPortReleaseBuffer(IN PVOID HwDeviceExtension, IN PVOID Ptr)
Definition: resource.c:1280
VOID IntVideoPortReleaseResources(_In_ PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
Definition: resource.c:206
PVOID NTAPI VideoPortGetDeviceBase(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfUchars, IN UCHAR InIoSpace)
Definition: resource.c:545
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:1317
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:42
@ 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