Exemplo n.º 1
0
#include <execinfo.h>
#endif

#include "e2fsck.h"

struct str_table {
	int	num;
	const char	*name;
};

#define DEFINE_ENTRY(SYM)	{ SYM, #SYM },
#define END_TABLE		{ 0, 0 }

static struct str_table sig_table[] = {
#ifdef SIGHUP
	DEFINE_ENTRY(SIGHUP)
#endif
#ifdef SIGINT
	DEFINE_ENTRY(SIGINT)
#endif
#ifdef SIGQUIT
	DEFINE_ENTRY(SIGQUIT)
#endif
#ifdef SIGILL
	DEFINE_ENTRY(SIGILL)
#endif
#ifdef SIGTRAP
	DEFINE_ENTRY(SIGTRAP)
#endif
#ifdef SIGABRT
	DEFINE_ENTRY(SIGABRT)
Exemplo n.º 2
0
DEFINE_HANDLER(EMULATED_INTERFACE_VERSION, Emulated)
DEFINE_HANDLER(UNPLUG_INTERFACE_VERSION, Unplug)

struct _INTERFACE_ENTRY {
    const GUID  *Guid;
    const CHAR  *Name;
    NTSTATUS    (*Handler)(PXENFILT_PDO, PIRP);
};

#define HANDLER(_Interface) PdoQuery ## _Interface ## Interface

#define DEFINE_ENTRY(_Guid, _Interface)   \
    { &GUID_ ## _Guid, #_Guid, HANDLER(_Interface) }

struct _INTERFACE_ENTRY PdoInterfaceTable[] = {
    DEFINE_ENTRY(EMULATED_INTERFACE, Emulated),
    DEFINE_ENTRY(UNPLUG_INTERFACE, Unplug),
    { NULL, NULL, NULL }
};

static DECLSPEC_NOINLINE NTSTATUS
PdoQueryInterface(
    IN  PXENFILT_PDO        Pdo,
    IN  PIRP                Irp
    )
{
    PIO_STACK_LOCATION      StackLocation;
    const GUID              *InterfaceType;
    struct _INTERFACE_ENTRY *Entry;
    NTSTATUS                status;