remove whitespace from end of lines
[reactos.git] / reactos / drivers / video / videoprt / event.c
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 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 * $Id$
22 */
23
24 #include "videoprt.h"
25
26 /* PUBLIC FUNCTIONS ***********************************************************/
27
28 /*
29 * @implemented
30 */
31
32 VP_STATUS STDCALL
33 VideoPortCreateEvent(
34 IN PVOID HwDeviceExtension,
35 IN ULONG EventFlag,
36 IN PVOID Unused,
37 OUT PEVENT *Event)
38 {
39 EVENT_TYPE Type;
40
41 (*Event) = ExAllocatePoolWithTag(
42 NonPagedPool,
43 sizeof(KEVENT),
44 TAG_VIDEO_PORT);
45
46 if ((*Event) == NULL)
47 return ERROR_NOT_ENOUGH_MEMORY;
48
49 if (EventFlag & NOTIFICATION_EVENT)
50 Type = NotificationEvent;
51 else
52 Type = SynchronizationEvent;
53
54 KeInitializeEvent((PKEVENT)*Event, Type, EventFlag & INITIAL_EVENT_SIGNALED);
55 return NO_ERROR;
56 }
57
58 /*
59 * @implemented
60 */
61
62 VP_STATUS STDCALL
63 VideoPortDeleteEvent(
64 IN PVOID HwDeviceExtension,
65 IN PEVENT Event)
66 {
67 ExFreePool(Event);
68 return NO_ERROR;
69 }
70
71 /*
72 * @implemented
73 */
74
75 LONG STDCALL
76 VideoPortSetEvent(
77 IN PVOID HwDeviceExtension,
78 IN PEVENT Event)
79 {
80 return KeSetEvent((PKEVENT)Event, IO_NO_INCREMENT, FALSE);
81 }
82
83 /*
84 * @implemented
85 */
86
87 VOID STDCALL
88 VideoPortClearEvent(
89 IN PVOID HwDeviceExtension,
90 IN PEVENT Event)
91 {
92 KeClearEvent((PKEVENT)Event);
93 }
94
95 /*
96 * @implemented
97 */
98
99 VP_STATUS STDCALL
100 VideoPortWaitForSingleObject(
101 IN PVOID HwDeviceExtension,
102 IN PVOID Object,
103 IN PLARGE_INTEGER Timeout OPTIONAL)
104 {
105 return KeWaitForSingleObject(
106 Object,
107 Executive,
108 KernelMode,
109 FALSE,
110 Timeout);
111 }