Create a branch for network fixes.
[reactos.git] / drivers / video / videoprt / funclist.c
1 /*
2 * VideoPort driver
3 *
4 * Copyright (C) 2007 ReactOS Team
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 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 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; see the file COPYING.LIB.
18 * If not, write to the Free Software Foundation,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 */
22
23
24 #include "videoprt.h"
25
26 typedef struct _VIDEO_PORT_FUNCTION_TABLE {
27 PVOID Address;
28 PUCHAR Name;
29 } *PVIDEO_PORT_FUNCTION_TABLE, VIDEO_PORT_FUNCTION_TABLE;
30
31 /* GLOBAL VARIABLES ***********************************************************/
32
33 #define VP_EXPORTED_FUNCS 6
34
35 UCHAR FN_VideoPortClearEvent[] = "VideoPortClearEvent";
36 UCHAR FN_VideoPortCreateEvent[] = "VideoPortCreateEvent";
37 UCHAR FN_VideoPortCreateSecondaryDisplay[] = "VideoPortCreateSecondaryDisplay";
38 UCHAR FN_VideoPortDeleteEvent[] = "VideoPortDeleteEvent";
39 UCHAR FN_VideoPortQueueDpc[] = "VideoPortQueueDpc";
40 UCHAR FN_VideoPortSetEvent[] = "VideoPortSetEvent";
41
42 VIDEO_PORT_FUNCTION_TABLE VideoPortExports[] = {
43 {VideoPortClearEvent, FN_VideoPortClearEvent},
44 {VideoPortCreateEvent, FN_VideoPortCreateEvent},
45 {VideoPortCreateSecondaryDisplay, FN_VideoPortCreateSecondaryDisplay},
46 {VideoPortDeleteEvent, FN_VideoPortDeleteEvent},
47 {VideoPortQueueDpc, FN_VideoPortQueueDpc},
48 {VideoPortSetEvent, FN_VideoPortSetEvent}
49 };
50
51 PVOID NTAPI
52 IntVideoPortGetProcAddress(
53 IN PVOID HwDeviceExtension,
54 IN PUCHAR FunctionName)
55 {
56 ULONG i = 0;
57
58 TRACE_(VIDEOPRT, "VideoPortGetProcAddress(%s)\n", FunctionName);
59
60 /* Search by name */
61 for (i = 0; i < VP_EXPORTED_FUNCS; i++)
62 {
63 if (!_strnicmp((PCHAR)FunctionName, (PCHAR)VideoPortExports[i].Name,
64 strlen((PCHAR)FunctionName)))
65 {
66 return (PVOID)VideoPortExports[i].Address;
67 }
68 }
69
70 WARN_(VIDEOPRT, "VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName);
71
72 return NULL;
73 }