wdc_err.h

来自「WinDriver目录下的源码」· C头文件 代码 · 共 51 行

H
51
字号
#ifndef _WDC_ERR_H_
#define _WDC_ERR_H_

/****************************************************************
*  File: wdc_err.h - WD card (WDC) internal error handling API  *
*        (for use only by the WDC library)                      *
*                                                               *
*  Copyright (c) 2005 Jungo Ltd.  http://www.jungo.com          *
*****************************************************************/

#if !defined (__KERNEL__)
    #include <stdio.h>
#else
    #include "kpstdlib.h"
#endif
#include <stdarg.h>
#include "utils.h"
#include "wdc_lib.h"

/*************************************************************
  Static inline functions implementations
 **************************************************************/
/* -----------------------------------------------
    Debugging and error handling
   ----------------------------------------------- */
void WdcSetLastErrStr(const CHAR *format, ...);
const CHAR *WdcGetLastErrStr(void);

/* [Additional error handling function prototypes are declared in wdc_lib.h] */

/* -----------------------------------------------
    Variables validation
   ----------------------------------------------- */
static inline BOOL WdcIsValidPtr(PVOID ptr, const CHAR *sErrMssg)
{
    if (!ptr)
    {
        WdcSetLastErrStr("Error - %s\n", sErrMssg);
        return FALSE;
    }

    return TRUE;
}

static inline BOOL WdcIsValidDevHandle(WDC_DEVICE_HANDLE hDev)
{
    return WdcIsValidPtr(hDev, "Invalid device handle");
}

#endif

⌨️ 快捷键说明

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