⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 event.c

📁 winNT技术操作系统,国外开放的原代码和LIUX一样
💻 C
字号:
/*
 * VideoPort driver
 *
 * Copyright (C) 2002, 2003, 2004 ReactOS Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; see the file COPYING.LIB.
 * If not, write to the Free Software Foundation,
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * $Id: event.c 21844 2006-05-07 19:34:23Z ion $
 */

#include "videoprt.h"

/* PUBLIC FUNCTIONS ***********************************************************/

/*
 * @implemented
 */

VP_STATUS NTAPI
VideoPortCreateEvent(
   IN PVOID HwDeviceExtension,
   IN ULONG EventFlag,
   IN PVOID Unused,
   OUT PEVENT *Event)
{
   EVENT_TYPE Type;

   (*Event) = ExAllocatePoolWithTag(
      NonPagedPool,
      sizeof(KEVENT),
      TAG_VIDEO_PORT);

   if ((*Event) == NULL)
      return ERROR_NOT_ENOUGH_MEMORY;

   if (EventFlag & NOTIFICATION_EVENT)
      Type = NotificationEvent;
   else
      Type = SynchronizationEvent;

   KeInitializeEvent((PKEVENT)*Event, Type, EventFlag & INITIAL_EVENT_SIGNALED);
   return NO_ERROR;
}

/*
 * @implemented
 */

VP_STATUS NTAPI
VideoPortDeleteEvent(
   IN PVOID HwDeviceExtension,
   IN PEVENT Event)
{
   ExFreePool(Event);
   return NO_ERROR;
}

/*
 * @implemented
 */

LONG NTAPI
VideoPortSetEvent(
   IN PVOID HwDeviceExtension,
   IN PEVENT Event)
{
   return KeSetEvent((PKEVENT)Event, IO_NO_INCREMENT, FALSE);
}

/*
 * @implemented
 */

VOID NTAPI
VideoPortClearEvent(
   IN PVOID HwDeviceExtension,
   IN PEVENT Event)
{
   KeClearEvent((PKEVENT)Event);
}

/*
 * @implemented
 */

VP_STATUS NTAPI
VideoPortWaitForSingleObject(
   IN PVOID HwDeviceExtension,
   IN PVOID Object,
   IN PLARGE_INTEGER Timeout OPTIONAL)
{
   return KeWaitForSingleObject(
      Object,
      Executive,
      KernelMode,
      FALSE,
      Timeout);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -