ReactOS 0.4.15-dev-8191-gbc6c731
xboxvmp.h File Reference
#include "ntdef.h"
#include "dderror.h"
#include "devioctl.h"
#include "miniport.h"
#include "ioaccess.h"
#include "video.h"
Include dependency graph for xboxvmp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XBOXVMP_DEVICE_EXTENSION
 

Macros

#define PAGE_SIZE   4096
 

Typedefs

typedef struct XBOXVMP_DEVICE_EXTENSIONPXBOXVMP_DEVICE_EXTENSION
 

Functions

VP_STATUS NTAPI XboxVmpFindAdapter (IN PVOID HwDeviceExtension, IN PVOID HwContext, IN PWSTR ArgumentString, IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, OUT PUCHAR Again)
 
BOOLEAN NTAPI XboxVmpInitialize (PVOID HwDeviceExtension)
 
BOOLEAN NTAPI XboxVmpStartIO (PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
 
BOOLEAN NTAPI XboxVmpResetHw (PVOID DeviceExtension, ULONG Columns, ULONG Rows)
 
VP_STATUS NTAPI XboxVmpGetPowerState (PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
 
VP_STATUS NTAPI XboxVmpSetPowerState (PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
 
BOOLEAN FASTCALL XboxVmpSetCurrentMode (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpResetDevice (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpMapVideoMemory (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpUnmapVideoMemory (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpQueryNumAvailModes (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpQueryAvailModes (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION ReturnedModes, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpQueryCurrentMode (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoModeInfo, PSTATUS_BLOCK StatusBlock)
 
BOOLEAN FASTCALL XboxVmpSetColorRegisters (PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_CLUT ColorLookUpTable, PSTATUS_BLOCK StatusBlock)
 

Macro Definition Documentation

◆ PAGE_SIZE

#define PAGE_SIZE   4096

Definition at line 19 of file xboxvmp.h.

Typedef Documentation

◆ PXBOXVMP_DEVICE_EXTENSION

Function Documentation

◆ XboxVmpFindAdapter()

VP_STATUS NTAPI XboxVmpFindAdapter ( IN PVOID  HwDeviceExtension,
IN PVOID  HwContext,
IN PWSTR  ArgumentString,
IN OUT PVIDEO_PORT_CONFIG_INFO  ConfigInfo,
OUT PUCHAR  Again 
)

Definition at line 56 of file xboxvmp.c.

62{
63 PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
65 /* 3 access ranges: for MMIO, VRAM, and Indirect memory access IO ports */
66 VIDEO_ACCESS_RANGE AccessRanges[3];
67 USHORT VendorId = 0x10DE; /* NVIDIA Corporation */
68 USHORT DeviceId = 0x02A0; /* NV2A XGPU */
69 ULONG Slot = 0;
70
71 TRACE_(IHVVIDEO, "XboxVmpFindAdapter\n");
72
73 XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
74
75 VideoPortZeroMemory(&AccessRanges, sizeof(AccessRanges));
76 Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL,
77 RTL_NUMBER_OF(AccessRanges), AccessRanges,
78 &VendorId, &DeviceId, &Slot);
79 if (Status == NO_ERROR)
80 {
81 XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
82 XboxVmpDeviceExtension->ControlLength = AccessRanges[0].RangeLength;
83 XboxVmpDeviceExtension->PhysFrameBufferStart = AccessRanges[1].RangeStart;
84 }
85
86 return Status;
87}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define NO_ERROR
Definition: dderror.h:5
#define NULL
Definition: types.h:112
#define TRACE_(x)
Definition: compat.h:76
Status
Definition: gdiplustypes.h:25
unsigned short USHORT
Definition: pedump.c:61
VPAPI VOID NTAPI VideoPortZeroMemory(IN PVOID Destination, IN ULONG Length)
LONG VP_STATUS
Definition: video.h:153
VPAPI 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:626
PHYSICAL_ADDRESS PhysFrameBufferStart
Definition: xboxvmp.h:31
PHYSICAL_ADDRESS PhysControlStart
Definition: xboxvmp.h:28
ULONG RangeLength
Definition: video.h:216
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215
uint32_t ULONG
Definition: typedefs.h:59
struct XBOXVMP_DEVICE_EXTENSION * PXBOXVMP_DEVICE_EXTENSION

Referenced by DriverEntry().

◆ XboxVmpGetPowerState()

VP_STATUS NTAPI XboxVmpGetPowerState ( PVOID  HwDeviceExtension,
ULONG  HwId,
PVIDEO_POWER_MANAGEMENT  VideoPowerControl 
)

Definition at line 310 of file xboxvmp.c.

314{
315 ERR_(IHVVIDEO, "XboxVmpGetPowerState is not supported\n");
316
318}
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define ERR_(ch,...)
Definition: debug.h:156

Referenced by DriverEntry().

◆ XboxVmpInitialize()

BOOLEAN NTAPI XboxVmpInitialize ( PVOID  HwDeviceExtension)

Definition at line 98 of file xboxvmp.c.

100{
101 PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
104
105 TRACE_(IHVVIDEO, "XboxVmpInitialize\n");
106
107 XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
108
109 Length = XboxVmpDeviceExtension->ControlLength;
110 XboxVmpDeviceExtension->VirtControlStart = NULL;
111
112 if (VideoPortMapMemory(HwDeviceExtension,
113 XboxVmpDeviceExtension->PhysControlStart,
114 &Length,
115 &inIoSpace,
116 &XboxVmpDeviceExtension->VirtControlStart) != NO_ERROR)
117 {
118 ERR_(IHVVIDEO, "Failed to map control memory\n");
119 return FALSE;
120 }
121
122 INFO_(IHVVIDEO, "Mapped 0x%x bytes of control mem at 0x%x to virt addr 0x%x\n",
123 XboxVmpDeviceExtension->ControlLength,
124 XboxVmpDeviceExtension->PhysControlStart.u.LowPart,
125 XboxVmpDeviceExtension->VirtControlStart);
126
127 return TRUE;
128}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
VPAPI VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN OUT PULONG Length, IN PULONG InIoSpace, IN OUT PVOID *VirtualAddress)
#define VIDEO_MEMORY_SPACE_MEMORY
Definition: video.h:132
#define INFO_(ch,...)
Definition: debug.h:159
struct _LARGE_INTEGER::@2304 u

Referenced by DriverEntry().

◆ XboxVmpMapVideoMemory()

BOOLEAN FASTCALL XboxVmpMapVideoMemory ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_MEMORY  RequestedAddress,
PVIDEO_MEMORY_INFORMATION  MapInformation,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 389 of file xboxvmp.c.

394{
397
398 StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
399
400 /* Reuse framebuffer that was set up by firmware */
402 /* Framebuffer address offset value is coming from the GPU within
403 * memory mapped I/O address space, so we're comparing only low
404 * 28 bits of the address within actual RAM address space */
405 FrameBuffer.QuadPart &= 0x0FFFFFFF;
406 if (FrameBuffer.QuadPart != 0x3C00000 && FrameBuffer.QuadPart != 0x7C00000)
407 {
408 /* Check framebuffer address (high 4 MB of either 64 or 128 MB RAM) */
409 WARN_(IHVVIDEO, "Non-standard framebuffer address 0x%p\n", FrameBuffer.QuadPart);
410 }
411 /* Verify that framebuffer address is page-aligned */
412 ASSERT(FrameBuffer.QuadPart % PAGE_SIZE == 0);
413
414 /* Return the address back to GPU memory mapped I/O */
415 FrameBuffer.QuadPart += DeviceExtension->PhysFrameBufferStart.QuadPart;
416 MapInformation->VideoRamBase = RequestedAddress->RequestedVirtualAddress;
417 /* FIXME: obtain fb size from firmware somehow (Cromwell reserves high 4 MB of RAM) */
418 MapInformation->VideoRamLength = NV2A_VIDEO_MEMORY_SIZE;
419
421 DeviceExtension,
423 &MapInformation->VideoRamLength,
424 &inIoSpace,
425 &MapInformation->VideoRamBase);
426
427 MapInformation->FrameBufferBase = MapInformation->VideoRamBase;
428 MapInformation->FrameBufferLength = MapInformation->VideoRamLength;
429
430 /* Tell the nVidia controller about the framebuffer */
432
433 INFO_(IHVVIDEO, "Mapped 0x%x bytes of phys mem at 0x%lx to virt addr 0x%p\n",
434 MapInformation->VideoRamLength, FrameBuffer.u.LowPart, MapInformation->VideoRamBase);
435
436 return TRUE;
437}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
#define PAGE_SIZE
Definition: env_spec_w32.h:49
PVOID FrameBuffer
Definition: xboxvideo.c:28
#define ASSERT(a)
Definition: mode.c:44
struct _VIDEO_MEMORY_INFORMATION VIDEO_MEMORY_INFORMATION
#define WARN_(ch,...)
Definition: debug.h:157
ULONG_PTR Information
Definition: video.h:326
PVOID RequestedVirtualAddress
Definition: ntddvdeo.h:344
uint32_t ULONG_PTR
Definition: typedefs.h:65
LONGLONG QuadPart
Definition: typedefs.h:114
#define NV2A_VIDEO_MEMORY_SIZE
Definition: xgpu.h:16
#define NV2A_CRTC_FRAMEBUFFER_START
Definition: xgpu.h:21

Referenced by XboxVmpStartIO().

◆ XboxVmpQueryAvailModes()

BOOLEAN FASTCALL XboxVmpQueryAvailModes ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_MODE_INFORMATION  ReturnedModes,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 490 of file xboxvmp.c.

494{
495 return XboxVmpQueryCurrentMode(DeviceExtension, VideoMode, StatusBlock);
496}
BOOLEAN FASTCALL XboxVmpQueryCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:537

Referenced by XboxVmpStartIO().

◆ XboxVmpQueryCurrentMode()

BOOLEAN FASTCALL XboxVmpQueryCurrentMode ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_MODE_INFORMATION  VideoModeInfo,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 537 of file xboxvmp.c.

541{
543
544 VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
545 VideoMode->ModeIndex = 0;
546
547 VideoMode->VisScreenWidth = READ_REGISTER_ULONG((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_HVALID_END) + 1;
548 VideoMode->VisScreenHeight = READ_REGISTER_ULONG((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_VVALID_END) + 1;
549
550 if (VideoMode->VisScreenWidth <= 1 || VideoMode->VisScreenHeight <= 1)
551 {
552 ERR_(IHVVIDEO, "Cannot obtain current screen resolution!\n");
553 return FALSE;
554 }
555
556 BytesPerPixel = NvGetBytesPerPixel(DeviceExtension, VideoMode->VisScreenWidth);
557 ASSERT(BytesPerPixel >= 1 && BytesPerPixel <= 4);
558
559 VideoMode->ScreenStride = VideoMode->VisScreenWidth * BytesPerPixel;
560 VideoMode->NumberOfPlanes = 1;
561 VideoMode->BitsPerPlane = BytesPerPixel * 8;
562 VideoMode->Frequency = 1;
563 VideoMode->XMillimeter = 0; /* FIXME */
564 VideoMode->YMillimeter = 0; /* FIXME */
565 if (BytesPerPixel >= 3)
566 {
567 VideoMode->NumberRedBits = 8;
568 VideoMode->NumberGreenBits = 8;
569 VideoMode->NumberBlueBits = 8;
570 VideoMode->RedMask = 0xFF0000;
571 VideoMode->GreenMask = 0x00FF00;
572 VideoMode->BlueMask = 0x0000FF;
573 }
574 else
575 {
576 /* FIXME: not implemented */
577 WARN_(IHVVIDEO, "BytesPerPixel %d - not implemented\n", BytesPerPixel);
578 }
579 VideoMode->VideoMemoryBitmapWidth = VideoMode->VisScreenWidth;
580 VideoMode->VideoMemoryBitmapHeight = VideoMode->VisScreenHeight;
583 VideoMode->DriverSpecificAttributeFlags = 0;
584
585 StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
586
587 /* Verify that screen fits framebuffer size */
588 if (VideoMode->VisScreenWidth * VideoMode->VisScreenHeight * (VideoMode->BitsPerPlane / 8) > NV2A_VIDEO_MEMORY_SIZE)
589 {
590 ERR_(IHVVIDEO, "Current screen resolution exceeds video memory bounds!\n");
591 return FALSE;
592 }
593
594 return TRUE;
595}
#define VIDEO_MODE_GRAPHICS
Definition: ntddvdeo.h:364
#define VIDEO_MODE_COLOR
Definition: ntddvdeo.h:363
#define VIDEO_MODE_NO_OFF_SCREEN
Definition: ntddvdeo.h:368
struct _VIDEO_MODE_INFORMATION VIDEO_MODE_INFORMATION
static ULONG BytesPerPixel
Definition: xboxvideo.c:32
UCHAR NvGetBytesPerPixel(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, ULONG ScreenWidth)
Definition: xboxvmp.c:508
#define NV2A_RAMDAC_FP_VVALID_END
Definition: xgpu.h:26
#define NV2A_RAMDAC_FP_HVALID_END
Definition: xgpu.h:25
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by XboxVmpQueryAvailModes(), and XboxVmpStartIO().

◆ XboxVmpQueryNumAvailModes()

BOOLEAN FASTCALL XboxVmpQueryNumAvailModes ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_NUM_MODES  Modes,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 471 of file xboxvmp.c.

475{
476 Modes->NumModes = 1;
477 Modes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
478 StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
479 return TRUE;
480}
struct _VIDEO_NUM_MODES VIDEO_NUM_MODES
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189

Referenced by XboxVmpStartIO().

◆ XboxVmpResetDevice()

BOOLEAN FASTCALL XboxVmpResetDevice ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 371 of file xboxvmp.c.

374{
375 /* There is nothing to be done here */
376
377 return TRUE;
378}

Referenced by XboxVmpResetHw(), and XboxVmpStartIO().

◆ XboxVmpResetHw()

BOOLEAN NTAPI XboxVmpResetHw ( PVOID  DeviceExtension,
ULONG  Columns,
ULONG  Rows 
)

Definition at line 287 of file xboxvmp.c.

291{
292 TRACE_(IHVVIDEO, "XboxVmpResetHw\n");
293
294 if (!XboxVmpResetDevice((PXBOXVMP_DEVICE_EXTENSION)DeviceExtension, NULL))
295 {
296 return FALSE;
297 }
298
299 return TRUE;
300}
BOOLEAN FASTCALL XboxVmpResetDevice(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:371

Referenced by DriverEntry().

◆ XboxVmpSetColorRegisters()

BOOLEAN FASTCALL XboxVmpSetColorRegisters ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_CLUT  ColorLookUpTable,
PSTATUS_BLOCK  StatusBlock 
)

◆ XboxVmpSetCurrentMode()

BOOLEAN FASTCALL XboxVmpSetCurrentMode ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_MODE  RequestedMode,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 346 of file xboxvmp.c.

350{
351 if (RequestedMode->RequestedMode != 0)
352 {
353 return FALSE;
354 }
355
356 /* Nothing to do, really. We only support a single mode and we're already
357 * in that mode
358 */
359 return TRUE;
360}
ULONG RequestedMode
Definition: ntddvdeo.h:359

Referenced by XboxVmpStartIO().

◆ XboxVmpSetPowerState()

VP_STATUS NTAPI XboxVmpSetPowerState ( PVOID  HwDeviceExtension,
ULONG  HwId,
PVIDEO_POWER_MANAGEMENT  VideoPowerControl 
)

Definition at line 328 of file xboxvmp.c.

332{
333 ERR_(IHVVIDEO, "XboxVmpSetPowerState not supported\n");
334
336}

Referenced by DriverEntry().

◆ XboxVmpStartIO()

BOOLEAN NTAPI XboxVmpStartIO ( PVOID  HwDeviceExtension,
PVIDEO_REQUEST_PACKET  RequestPacket 
)

Definition at line 138 of file xboxvmp.c.

141{
143
145
146 switch (RequestPacket->IoControlCode)
147 {
149 {
150 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_SET_CURRENT_MODE\n");
151
152 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
153 {
155 return TRUE;
156 }
157
159 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
160 (PVIDEO_MODE)RequestPacket->InputBuffer,
161 RequestPacket->StatusBlock);
162 break;
163 }
164
166 {
167 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_RESET_DEVICE\n");
168
170 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
171 RequestPacket->StatusBlock);
172 break;
173 }
174
176 {
177 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_MAP_VIDEO_MEMORY\n");
178
179 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
180 RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
181 {
183 return TRUE;
184 }
185
187 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
188 (PVIDEO_MEMORY)RequestPacket->InputBuffer,
190 RequestPacket->StatusBlock);
191 break;
192 }
193
195 {
196 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_UNMAP_VIDEO_MEMORY\n");
197
198 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
199 {
201 return TRUE;
202 }
203
205 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
206 (PVIDEO_MEMORY)RequestPacket->InputBuffer,
207 RequestPacket->StatusBlock);
208 break;
209 }
210
212 {
213 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES\n");
214
215 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
216 {
218 return TRUE;
219 }
220
222 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
223 (PVIDEO_NUM_MODES)RequestPacket->OutputBuffer,
224 RequestPacket->StatusBlock);
225 break;
226 }
227
229 {
230 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_AVAIL_MODES\n");
231
232 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
233 {
235 return TRUE;
236 }
237
239 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
241 RequestPacket->StatusBlock);
242 break;
243 }
244
246 {
247 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_CURRENT_MODE\n");
248
249 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
250 {
252 return TRUE;
253 }
254
256 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
258 RequestPacket->StatusBlock);
259 break;
260 }
261
262 default:
263 {
264 WARN_(IHVVIDEO, "XboxVmpStartIO 0x%x not implemented\n", RequestPacket->IoControlCode);
265
266 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
267 return FALSE;
268 }
269 }
270
271 if (Result)
272 {
273 RequestPacket->StatusBlock->Status = NO_ERROR;
274 }
275
276 return TRUE;
277}
unsigned char BOOLEAN
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:173
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:248
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:182
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:221
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:206
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:176
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:191
VP_STATUS Status
Definition: video.h:323
ULONG InputBufferLength
Definition: video.h:333
PSTATUS_BLOCK StatusBlock
Definition: video.h:331
ULONG OutputBufferLength
Definition: video.h:335
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
BOOLEAN FASTCALL XboxVmpQueryAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:490
BOOLEAN FASTCALL XboxVmpMapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:389
BOOLEAN FASTCALL XboxVmpUnmapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:448
BOOLEAN FASTCALL XboxVmpSetCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:346
BOOLEAN FASTCALL XboxVmpQueryNumAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:471

Referenced by DriverEntry().

◆ XboxVmpUnmapVideoMemory()

BOOLEAN FASTCALL XboxVmpUnmapVideoMemory ( PXBOXVMP_DEVICE_EXTENSION  DeviceExtension,
PVIDEO_MEMORY  VideoMemory,
PSTATUS_BLOCK  StatusBlock 
)

Definition at line 448 of file xboxvmp.c.

452{
454 DeviceExtension,
455 VideoMemory->RequestedVirtualAddress,
456 NULL);
457
458 return TRUE;
459}
VPAPI VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN OUT PVOID VirtualAddress, IN HANDLE ProcessHandle)

Referenced by XboxVmpStartIO().