mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
834 B
47 lines
834 B
#pragma once
|
|
#include <nt.h>
|
|
#include <ntrtl.h>
|
|
#include <nturtl.h>
|
|
#include <windows.h>
|
|
#include <stdio.h>
|
|
#include <limits.h>
|
|
#include "fusionlastwin32error.h"
|
|
#include "fusionunused.h"
|
|
|
|
#if !defined(NUMBER_OF)
|
|
#define NUMBER_OF(x) (sizeof(x)/sizeof((x)[0]))
|
|
#endif
|
|
|
|
#include "fusionwin32.h"
|
|
|
|
static inline bool
|
|
IsWin32ErrorInList(
|
|
DWORD dwLastError,
|
|
ULONG cELEV,
|
|
va_list ap
|
|
)
|
|
{
|
|
ULONG i;
|
|
|
|
for (i=0; i<cELEV; i++)
|
|
{
|
|
const DWORD dwCandidate = va_arg(ap, DWORD);
|
|
if (dwCandidate == dwLastError)
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
static inline bool
|
|
IsLastErrorInList(
|
|
ULONG cELEV,
|
|
va_list ap,
|
|
DWORD &rdwLastError
|
|
)
|
|
{
|
|
const DWORD dwLastError = ::GetLastError();
|
|
rdwLastError = dwLastError;
|
|
return ::IsWin32ErrorInList(dwLastError, cELEV, ap);
|
|
}
|
|
|