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.

35 lines
833 B

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: N C V A L I D . H
  7. //
  8. // Contents: Generic validation functions.
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 19 Mar 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _NCVALID_H_
  17. #define _NCVALID_H_
  18. #define FBadInPtr(_p) IsBadReadPtr(_p, sizeof(*_p))
  19. #define FBadOutPtr(_p) IsBadWritePtr(_p, sizeof(*_p))
  20. #define FBadInPtrOptional(_p) ((NULL != _p) && IsBadReadPtr(_p, sizeof(*_p)))
  21. #define FBadOutPtrOptional(_p) ((NULL != _p) && IsBadWritePtr(_p, sizeof(*_p)))
  22. inline BOOL FBadInRefiid (REFIID riid)
  23. {
  24. return IsBadReadPtr(&riid, sizeof(IID));
  25. }
  26. #endif // _NCVALID_H_