Source code of Windows XP (NT5)
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

  1. #pragma once
  2. #include <nt.h>
  3. #include <ntrtl.h>
  4. #include <nturtl.h>
  5. #include <windows.h>
  6. #include <stdio.h>
  7. #include <limits.h>
  8. #include "fusionlastwin32error.h"
  9. #include "fusionunused.h"
  10. #if !defined(NUMBER_OF)
  11. #define NUMBER_OF(x) (sizeof(x)/sizeof((x)[0]))
  12. #endif
  13. #include "fusionwin32.h"
  14. static inline bool
  15. IsWin32ErrorInList(
  16. DWORD dwLastError,
  17. ULONG cELEV,
  18. va_list ap
  19. )
  20. {
  21. ULONG i;
  22. for (i=0; i<cELEV; i++)
  23. {
  24. const DWORD dwCandidate = va_arg(ap, DWORD);
  25. if (dwCandidate == dwLastError)
  26. return true;
  27. }
  28. return false;
  29. }
  30. static inline bool
  31. IsLastErrorInList(
  32. ULONG cELEV,
  33. va_list ap,
  34. DWORD &rdwLastError
  35. )
  36. {
  37. const DWORD dwLastError = ::GetLastError();
  38. rdwLastError = dwLastError;
  39. return ::IsWin32ErrorInList(dwLastError, cELEV, ap);
  40. }