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.

46 lines
778 B

  1. // modified to spew out Month/Day as in 0509
  2. #include <windows.h>
  3. #include <stdio.h>
  4. int _CRTAPI1 main(int argc, char* argv[])
  5. {
  6. char achValue[128];
  7. char *szName = "BUILDNO";
  8. SYSTEMTIME st;
  9. FILETIME ft ;
  10. LARGE_INTEGER lt ;
  11. GetLocalTime(&st);
  12. SystemTimeToFileTime (&st, &ft) ;
  13. lt.LowPart = ft.dwLowDateTime ;
  14. lt.HighPart = ft.dwHighDateTime ;
  15. // Add 24hrs in 100ns units = 864000000000 100ns
  16. // if you want to add a day use lt.QuadPart = lt.QuadPart + (LONGLONG) 864000000000 ;
  17. ft.dwLowDateTime = lt.LowPart ;
  18. ft.dwHighDateTime = lt.HighPart ;
  19. FileTimeToSystemTime (&ft, &st) ;
  20. sprintf( achValue
  21. , "%02i%02i\n"
  22. , st.wMonth
  23. , st.wDay );
  24. printf("Set %s=%s\n", szName, achValue);
  25. return 1;
  26. }