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.

73 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. downlevl.h
  5. Abstract:
  6. Includes all headers required by LM down-level functions
  7. Author:
  8. Richard Firth (rfirth) 22-May-1991
  9. Revision History:
  10. 17-Jul-1991 JohnRo
  11. Extracted RxpDebug.h from Rxp.h.
  12. 18-Sep-1991 JohnRo
  13. Correct UNICODE use. (Added POSSIBLE_WCSLEN() macro.)
  14. 21-Nov-1991 JohnRo
  15. Removed NT dependencies to reduce recompiles.
  16. --*/
  17. #include <windef.h> // IN, LPTSTR, etc.
  18. #include <lmcons.h>
  19. #include <lmerr.h>
  20. #include <rx.h>
  21. #include <rxp.h>
  22. #include <rxpdebug.h>
  23. #include <remdef.h>
  24. #include <lmremutl.h>
  25. #include <apinums.h>
  26. #include <netdebug.h>
  27. #include <netlib.h>
  28. #include <lmapibuf.h>
  29. #include <tstring.h>
  30. #include <stdlib.h> // wcslen().
  31. //
  32. // a couple of macros to read pointer checks more easily - NULL_REFERENCE
  33. // is TRUE if either the pointer or pointed-at thing are 0, VALID_STRING
  34. // is TRUE if both the pointer and pointed-at thing are NOT 0
  35. //
  36. #define NULL_REFERENCE(p) (!(p) || !*(p))
  37. #define VALID_STRING(s) ((s) && *(s)) // same as !NULL_REFERENCE(s)
  38. //
  39. // when working out buffer requirements, we round up to the next dword amount
  40. //
  41. #define DWORD_ROUNDUP(n) ((((n) + 3) / 4) * 4)
  42. //
  43. // Check there is a pointer to a string before getting the size. Note that
  44. // these return the number of BYTES required to store the string.
  45. // Use POSSIBLE_STRSIZE() for TCHARs and POSSIBLE_WCSSIZE() for WCHARs.
  46. //
  47. #define POSSIBLE_STRSIZE(s) ((s) ? STRSIZE(s) : 0)
  48. #define POSSIBLE_WCSSIZE(s) ((s) ? WCSSIZE(s) : 0)
  49. //
  50. // Check that there is a pointer to a string before getting the size. Note that
  51. // these return the number of CHARACTERS required to store the string.
  52. // Use POSSIBLE_STRLEN() for TCHARs and POSSIBLE_WCSLEN() for WCHARs.
  53. //
  54. #define POSSIBLE_STRLEN(s) ((s) ? STRLEN(s) : 0)
  55. #define POSSIBLE_WCSLEN(s) ((s) ? wcslen(s) : 0)