ReactOS 0.4.15-dev-7924-g5949c20
services.c
Go to the documentation of this file.
1/*
2 * VideoPort driver
3 *
4 * Copyright (C) 2002, 2003, 2004 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
29{
30 /* Do nothing */
31}
32
35{
36 /* Do nothing */
37}
38
41 IN PVOID HwDeviceExtension,
42 IN VIDEO_PORT_SERVICES ServicesType,
44{
45 TRACE_(VIDEOPRT, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType);
46
47 switch (ServicesType)
48 {
52 {
53 VIDEO_PORT_INT10_INTERFACE *Int10Interface =
55
57 Interface->InterfaceDereference = IntInterfaceDereference;
59 Int10Interface->Int10FreeBuffer = IntInt10FreeBuffer;
60 Int10Interface->Int10ReadMemory = IntInt10ReadMemory;
61 Int10Interface->Int10WriteMemory = IntInt10WriteMemory;
62 Int10Interface->Int10CallBios = IntInt10CallBios;
63 return NO_ERROR;
64 }
65 break;
66
69 Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) ||
71 Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE)))
72 {
73 if (NT_SUCCESS(IntAgpGetInterface(HwDeviceExtension, Interface)))
74 {
75 return NO_ERROR;
76 }
77 }
78 break;
79
83
87
88 default:
89 break;
90 }
91
93}
94
97 IN PVOID HwDeviceExtension,
98 OUT PVIDEO_PORT_AGP_SERVICES AgpServices)
99{
102
103 TRACE_(VIDEOPRT, "VideoPortGetAgpServices\n");
104
105 Interface.Size = sizeof(Interface);
107
110 if (Status != NO_ERROR)
111 {
112 WARN_(VIDEOPRT, "VideoPortQueryServices() failed!\n");
113 return FALSE;
114 }
115
116 RtlCopyMemory(AgpServices, &Interface.AgpReservePhysical, sizeof(VIDEO_PORT_AGP_SERVICES));
117 return TRUE;
118}
unsigned char BOOLEAN
NTSTATUS NTAPI IntAgpGetInterface(IN PVOID HwDeviceExtension, IN OUT PINTERFACE Interface)
Definition: agp.c:496
#define UNIMPLEMENTED
Definition: debug.h:115
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACE_(x)
Definition: compat.h:76
Status
Definition: gdiplustypes.h:25
VP_STATUS NTAPI IntInt10ReadMemory(IN PVOID Context, IN USHORT Seg, IN USHORT Off, OUT PVOID Buffer, IN ULONG Length)
Definition: int10.c:306
VP_STATUS NTAPI IntInt10WriteMemory(IN PVOID Context, IN USHORT Seg, IN USHORT Off, IN PVOID Buffer, IN ULONG Length)
Definition: int10.c:344
VP_STATUS NTAPI IntInt10FreeBuffer(IN PVOID Context, IN USHORT Seg, IN USHORT Off)
Definition: int10.c:273
VP_STATUS NTAPI IntInt10AllocateBuffer(IN PVOID Context, OUT PUSHORT Seg, OUT PUSHORT Off, IN OUT PULONG Length)
Definition: int10.c:210
VP_STATUS NTAPI IntInt10CallBios(IN PVOID Context, IN OUT PINT10_BIOS_ARGUMENTS BiosArguments)
Definition: int10.c:380
LONG VP_STATUS
Definition: video.h:153
struct _VIDEO_PORT_AGP_INTERFACE VIDEO_PORT_AGP_INTERFACE
#define VIDEO_PORT_AGP_INTERFACE_VERSION_1
Definition: video.h:123
#define VIDEO_PORT_INT10_INTERFACE_VERSION_1
Definition: video.h:127
enum _VIDEO_PORT_SERVICES VIDEO_PORT_SERVICES
#define VIDEO_PORT_AGP_INTERFACE_VERSION_2
Definition: video.h:124
@ VideoPortServicesAGP
Definition: video.h:713
@ VideoPortServicesI2C
Definition: video.h:714
@ VideoPortServicesHeadless
Definition: video.h:715
@ VideoPortServicesInt10
Definition: video.h:716
#define WARN_(ch,...)
Definition: debug.h:157
OUT PINT10_FREE_BUFFER Int10FreeBuffer
Definition: video.h:787
OUT PINT10_READ_MEMORY Int10ReadMemory
Definition: video.h:788
OUT PINT10_CALL_BIOS Int10CallBios
Definition: video.h:790
OUT PINTERFACE_REFERENCE InterfaceReference
Definition: video.h:784
OUT PINT10_ALLOCATE_BUFFER Int10AllocateBuffer
Definition: video.h:786
OUT PINT10_WRITE_MEMORY Int10WriteMemory
Definition: video.h:789
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
VOID NTAPI IntInterfaceReference(PVOID Context)
Definition: services.c:28
VOID NTAPI IntInterfaceDereference(PVOID Context)
Definition: services.c:34
VP_STATUS NTAPI VideoPortQueryServices(IN PVOID HwDeviceExtension, IN VIDEO_PORT_SERVICES ServicesType, IN OUT PINTERFACE Interface)
Definition: services.c:40
BOOLEAN NTAPI VideoPortGetAgpServices(IN PVOID HwDeviceExtension, OUT PVIDEO_PORT_AGP_SERVICES AgpServices)
Definition: services.c:96