4 * Copyright (C) 2002, 2003, 2004 ReactOS Team
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.
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.
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
24 /* PUBLIC FUNCTIONS ***********************************************************/
32 IN PVOID HwDeviceExtension
,
37 PVIDEO_PORT_EVENT VpEvent
;
38 EVENT_TYPE Type
= SynchronizationEvent
;
40 /* Allocate storage for the event structure */
41 VpEvent
= ExAllocatePoolWithTag(
43 sizeof(VIDEO_PORT_EVENT
),
46 /* Fail if not enough memory */
47 if (!VpEvent
) return ERROR_NOT_ENOUGH_MEMORY
;
49 /* Initialize the event structure */
50 RtlZeroMemory(VpEvent
, sizeof(VIDEO_PORT_EVENT
));
51 VpEvent
->pKEvent
= &VpEvent
->Event
;
53 /* Determine the event type */
54 if (EventFlag
& NOTIFICATION_EVENT
)
55 Type
= NotificationEvent
;
57 /* Initialize kernel event */
58 KeInitializeEvent(VpEvent
->pKEvent
, Type
, EventFlag
& INITIAL_EVENT_SIGNALED
);
60 /* Indicate success */
70 IN PVOID HwDeviceExtension
,
76 /* Indicate success */
86 IN PVOID HwDeviceExtension
,
89 return KeSetEvent(Event
->pKEvent
, IO_NO_INCREMENT
, FALSE
);
98 IN PVOID HwDeviceExtension
,
101 KeClearEvent(Event
->pKEvent
);
109 VideoPortWaitForSingleObject(
110 IN PVOID HwDeviceExtension
,
112 IN PLARGE_INTEGER Timeout OPTIONAL
)
114 return KeWaitForSingleObject(