Leaked source code of windows server 2003
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.

109 lines
3.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. FileDate.h
  5. Abstract:
  6. Contains function prototypes , structure and macros.
  7. Author:
  8. V Vijaya Bhaskar
  9. Revision History:
  10. 14-Jun-2001 : Created by V Vijaya Bhaskar ( Wipro Technologies ).
  11. --*/
  12. #ifndef __FILE_DATE__H
  13. #define __FILE_DATE__H
  14. // Character Found In The Start Of A Specified Date .
  15. #define PLUS _T( '+' )
  16. #define MINUS _T( '-' )
  17. /* Date Specified In <+|->MM/DD/YYYY , Which Are Nine Characters . */
  18. #define LENGTH_DDMMYYYY 11
  19. /* Month In A Year */
  20. #define JAN 1
  21. #define FEB 2
  22. #define MAR 3
  23. #define APR 4
  24. #define MAY 5
  25. #define JUN 6
  26. #define JUL 7
  27. #define AUG 8
  28. #define SEP 9
  29. #define OCT 10
  30. #define NOV 11
  31. #define DEC 12
  32. /* Constants And Max And Min Dates */
  33. #define MOD_LEAP_YEAR 4 // Leap Year Has 29 Days .
  34. // Days In Feb Month In A Lep Year .
  35. #define DAYS_INFEB_LEAP_YEAR 29
  36. // Days In Feb When It Is Not A Leap Year .
  37. #define DAYS_INFEB 28
  38. // Normay A Month Have Either 31 Or 30 Days .
  39. #define THIRTYONE 31
  40. #define THIRTY 30
  41. // Year Considered When Date Is To Be Calculated From A Given Date .
  42. #define YEAR 1900
  43. // Days In An Year , Except A Leap Year Where There Are 366 Days .
  44. #define DAY_IN_A_YEAR 365
  45. #define MIN_DATE_LENGTH 9
  46. #define MAX_DATE_LENGTH 11
  47. //
  48. #define LEAP_YEAR 4
  49. // If File Creation Date Should Be Less Than The Date Specified .
  50. #define SMALLER_DATE 0
  51. // If File Creation Date Should Be Greater Than The Date Specified .
  52. #define GREATER_DATE 1
  53. #define NO_RESTRICTION_DATE 2
  54. // Condition for a leap year.
  55. #define IS_A_LEAP_YEAR( DATE ) ( 0 == ( DATE % 400 ) ) || \
  56. ( ( 0 == ( DATE % 4 ) ) && \
  57. ( 0 != ( DATE % 100 ) ) )
  58. //Errors .
  59. #define ERROR_INVALID_DATE GetResString( IDS_ERROR_INVALID_DATE )
  60. // Structure Used To Store A Date From Which Files Are To Be Displayed .
  61. typedef struct __VALID_FILE_DATE
  62. {
  63. DWORD m_dwDay ;
  64. DWORD m_dwMonth ;
  65. DWORD m_dwYear ;
  66. } Valid_File_Date , *PValid_File_Date ;
  67. /* Function Prototypes For World . */
  68. BOOL
  69. FileDateValid(
  70. IN DWORD dwDateGreater ,
  71. IN Valid_File_Date vfdValidFileDate ,
  72. IN FILETIME ftFileCreation
  73. ) ;
  74. BOOL ValidDateForFile(
  75. OUT DWORD *dwDateGreater ,
  76. OUT PValid_File_Date pvfdValidFileDate ,
  77. IN LPWSTR lpszDate
  78. ) ;
  79. #endif // __FILE_DATE__H