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.

39 lines
1.3 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft Corporation 1991-1993
  4. //
  5. // File: vdate.h - Debug argument validation helpers
  6. //
  7. // History:
  8. // 06-16-94 Davepl Created
  9. //
  10. //---------------------------------------------------------------------------
  11. #ifdef DEBUG
  12. __inline void FUNC_VDATEINPUTBUF(void * pBuffer,
  13. size_t cElementSize,
  14. size_t cCount,
  15. int iLine,
  16. char * pszFile)
  17. {
  18. if (IsBadWritePtr(pBuffer, cElementSize * cCount))
  19. {
  20. char sazOutput[MAX_PATH * 2];
  21. wnsprintfA(sazOutput, SIZECHARS(sazOutput), "Buffer failed validation at line %d in %s\n", iLine, pszFile);
  22. OutputDebugStringA(sazOutput);
  23. RIP(FALSE);
  24. }
  25. }
  26. #define VDATEINPUTBUF(ptr, type, count) FUNC_VDATEINPUTBUF(ptr, \
  27. sizeof(type), \
  28. count, \
  29. __LINE__, \
  30. __FILE__)
  31. #else
  32. #define VDATEINPUTBUF(ptr, type, const)
  33. #endif