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

📄 mfcintrnotification.c

📁 Samsung公司S3C6400芯片的BSP源码包
💻 C
字号:
/*
 * Project Name MFC DRIVER
 * Copyright (c) Samsung Electronics 
 * All right reserved.
 *
 * This software is the confidential and proprietary information
 * of Samsung Electronics  ("Confidential Information").   
 * you shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Samsung Electronics 
 *
 * This file implements MUTEX to gurad MFC multi instance operation..
 *
 * @name MFC DRIVER MODULE Module (MfcIntrNotification.c)
 * @author Simon Chun (simon.chun@samsung.com)
 */

#include <windows.h>

#include "MfcIntrNotification.h"


static HANDLE gMfcDoneEvent = NULL;
static unsigned int  gIntrType = 0;

BOOL CreateInterruptNotification(void)
{
	if (gMfcDoneEvent != NULL)
		return TRUE;

	gMfcDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
	if (gMfcDoneEvent == NULL)
		return FALSE;

	return TRUE;
}

void DeleteInterruptNotification(void)
{
	CloseHandle(gMfcDoneEvent);
	gMfcDoneEvent = NULL;
}

int SendInterruptNotification(int intr_type)
{
	if (gMfcDoneEvent == NULL)
		return -1;

	SetEvent(gMfcDoneEvent);
	gIntrType = intr_type;

	return 0;
}

int WaitInterruptNotification(void)
{
	DWORD ret;

	if (gMfcDoneEvent == NULL)
		return -1;

	ret = WaitForSingleObject(gMfcDoneEvent, 1000);
	if (ret == WAIT_TIMEOUT)
		return WAIT_INT_NOTI_TIMEOUT;

	return gIntrType;
}

⌨️ 快捷键说明

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