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