Windows NT 4.0 source code leak
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
1.6 KiB

4 years ago
  1. /*** nmtime.h - defines DOS packed date and time types
  2. *
  3. * Copyright (c) 1987-1990, Microsoft Corporation. All rights reserved.
  4. *
  5. * Purpose:
  6. * This file defines the DOS packed date and time types.
  7. *
  8. * Revision History:
  9. * 19-May-1993 HV Changed _dtoxtime() to _dostotime_t() so that we can
  10. * use the standard llibce.lib instead of the private
  11. * llibcer.lib.
  12. * 04-Dec-1989 SB added proper fn proto for _dtoxtime() (c6 -W3 reqmemt)
  13. * 05-Dec-1988 SB added CDECL for _dtoxtime()
  14. * ??-???-???? ?? Taken from dostypes.h
  15. *
  16. *******************************************************************************/
  17. #define MASK4 0xf /* 4 bit mask */
  18. #define MASK5 0x1f /* 5 bit mask */
  19. #define MASK6 0x3f /* 6 bit mask */
  20. #define MASK7 0x7f /* 7 bit mask */
  21. #define DAYLOC 0 /* day value starts in bit 0 */
  22. #define MONTHLOC 5 /* month value starts in bit 5 */
  23. #define YEARLOC 9 /* year value starts in bit 9 */
  24. #define SECLOC 0 /* seconds value starts in bit 0 */
  25. #define MINLOC 5 /* minutes value starts in bit 5 */
  26. #define HOURLOC 11 /* hours value starts in bit 11 */
  27. #define DOS_DAY(dword) (((dword) >> DAYLOC) & MASK5)
  28. #define DOS_MONTH(dword) (((dword) >> MONTHLOC) & MASK4)
  29. #define DOS_YEAR(dword) (((dword) >> YEARLOC) & MASK7)
  30. #define DOS_HOUR(tword) (((tword) >> HOURLOC) & MASK5)
  31. #define DOS_MIN(tword) (((tword) >> MINLOC) & MASK6)
  32. #define DOS_SEC(tword) (((tword) >> SECLOC) & MASK5)
  33. extern time_t CDECL _dostotime_t(int, int, int, int, int, int);
  34. #define XTIME(d,t) _dostotime_t(DOS_YEAR(d), \
  35. DOS_MONTH(d), \
  36. DOS_DAY(d), \
  37. DOS_HOUR(t), \
  38. DOS_MIN(t), \
  39. DOS_SEC(t)*2)