- Update to r53061
[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 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
23 #include "videoprt.h"
24
25 typedef struct _VIDEO_PORT_FUNCTION_TABLE {
26 PVOID Address;
27 PUCHAR Name;
28 } *PVIDEO_PORT_FUNCTION_TABLE, VIDEO_PORT_FUNCTION_TABLE;
29
30 /* GLOBAL VARIABLES ***********************************************************/
31
32 #define VP_EXPORTED_FUNCS 6
33
34 UCHAR FN_VideoPortClearEvent[] = "VideoPortClearEvent";
35 UCHAR FN_VideoPortCreateEvent[] = "VideoPortCreateEvent";
36 UCHAR FN_VideoPortCreateSecondaryDisplay[] = "VideoPortCreateSecondaryDisplay";
37 UCHAR FN_VideoPortDeleteEvent[] = "VideoPortDeleteEvent";
38 UCHAR FN_VideoPortQueueDpc[] = "VideoPortQueueDpc";
39 UCHAR FN_VideoPortSetEvent[] = "VideoPortSetEvent";
40
41 VIDEO_PORT_FUNCTION_TABLE VideoPortExports[] = {
42 {VideoPortClearEvent, FN_VideoPortClearEvent},
43 {VideoPortCreateEvent, FN_VideoPortCreateEvent},
44 {VideoPortCreateSecondaryDisplay, FN_VideoPortCreateSecondaryDisplay},
45 {VideoPortDeleteEvent, FN_VideoPortDeleteEvent},
46 {VideoPortQueueDpc, FN_VideoPortQueueDpc},
47 {VideoPortSetEvent, FN_VideoPortSetEvent}
48 };
49
50 PVOID NTAPI
51 IntVideoPortGetProcAddress(
52 IN PVOID HwDeviceExtension,
53 IN PUCHAR FunctionName)
54 {
55 ULONG i = 0;
56
57 TRACE_(VIDEOPRT, "VideoPortGetProcAddress(%s)\n", FunctionName);
58
59 /* Search by name */
60 for (i = 0; i < VP_EXPORTED_FUNCS; i++)
61 {
62 if (!_strnicmp((PCHAR)FunctionName, (PCHAR)VideoPortExports[i].Name,
63 strlen((PCHAR)FunctionName)))
64 {
65 return (PVOID)VideoPortExports[i].Address;
66 }
67 }
68
69 WARN_(VIDEOPRT, "VideoPortGetProcAddress: Can't resolve symbol %s\n", FunctionName);
70
71 return NULL;
72 }