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.

64 lines
2.0 KiB

  1. #include "resource.h"
  2. #include <direct.h>
  3. #define MAX_OPTIONS 6
  4. #define CMDOPTION_SERVER L"S"
  5. #define CMDOPTION_USER L"U"
  6. #define CMDOPTION_PASSWORD L"P"
  7. #define CMDOPTION_DRIVE L"D"
  8. #define CMDOPTION_DEFAULT L""
  9. #define CMDOPTION_USAGE L"?"
  10. #define CMDOPTION_OTHERS L"S|U|P|D|?"
  11. #define OI_SERVER 0
  12. #define OI_USER 1
  13. #define OI_PASSWORD 2
  14. #define OI_DRIVE 3
  15. #define OI_DEFAULT 4
  16. #define OI_USAGE 5
  17. #define OI_OTHERS 6
  18. #define KB L"KB"
  19. #define MB L"MB"
  20. #define GB L"GB"
  21. #define TB L"TB"
  22. #define PB L"PB"
  23. #define EB L"EB"
  24. #define ZB L"ZB"
  25. #define YB L"YB"
  26. #define EMPTY_SPACE L" "
  27. #define NEWLINE L"\n"
  28. #define SAFE_CLOSE_CONNECTION(szServer, bFlag ) \
  29. if( StringLengthW(szServer, 0)!=0 && !bLocalSystem && FALSE == bFlagRmtConnectin) \
  30. { \
  31. CloseConnection( szServer ); \
  32. } \
  33. 1
  34. #define SIZE_OF_ARRAY_IN_CHARS(x) \
  35. GetBufferSize((LPVOID)x)/sizeof(WCHAR)
  36. DWORD ValidateDriveType( LPWSTR lpszPathName );
  37. ULONGLONG GetDriveFreeSpace( LPCWSTR lpszRootPathName);
  38. DWORD ProcessValue( IN LPWSTR szValue, OUT long double *dfValue );
  39. DWORD ConvertintoLocale( IN LPWSTR szNumber, OUT LPWSTR szOutputStr );
  40. DWORD DisplayHelpUsage();
  41. DWORD ProcessOptions( IN DWORD argc,
  42. IN LPCWSTR argv[],
  43. OUT LPWSTR *lpszServer,
  44. OUT LPWSTR *lpszUser,
  45. OUT LPWSTR lpszPasswd,
  46. OUT LPWSTR *szDrive,
  47. OUT LPWSTR szValue,
  48. OUT PBOOL pbUsage,
  49. OUT PBOOL pbNeedPasswd
  50. );
  51. DWORD DisplayOutput( IN long double AllowedDisk,
  52. IN ULONGLONG lfTotalNumberofFreeBytes,
  53. IN LPWSTR szDrive
  54. );