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.

69 lines
1.7 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: processcmdln.h
  4. //
  5. // Module: CMSETUP.LIB
  6. //
  7. // Synopsis: Definition of the CProcessCmdLn class.
  8. //
  9. // Copyright (c) 1998 Microsoft Corporation
  10. //
  11. // Author: quintinb Created Header 08/19/99
  12. //
  13. //+----------------------------------------------------------------------------
  14. #ifndef _CM_PROCESSCMDLN_H_
  15. #define _CM_PROCESSCMDLN_H_
  16. #include <windows.h>
  17. #include "cfilename.h"
  18. #include "mutex.h"
  19. //
  20. // Command Line struct for storing cmd line flags
  21. //
  22. typedef struct _ArgStruct
  23. {
  24. TCHAR* pszArgString;
  25. DWORD dwFlagModifier;
  26. } ArgStruct;
  27. //
  28. // Command Line State enumeration taken from Icm.h
  29. //
  30. typedef enum _CMDLN_STATE
  31. {
  32. CS_END_SPACE, // done handling a space
  33. CS_BEGIN_QUOTE, // we've encountered a begin quote
  34. CS_END_QUOTE, // we've encountered a end quote
  35. CS_CHAR, // we're scanning chars
  36. CS_DONE
  37. } CMDLN_STATE;
  38. class CProcessCmdLn
  39. {
  40. public:
  41. CProcessCmdLn(UINT NumSwitches, ArgStruct* pArrayOfArgStructs, BOOL bSkipFirstToken, BOOL bBlankCmdLnOkay);
  42. ~CProcessCmdLn();
  43. BOOL GetCmdLineArgs(IN LPTSTR pszCmdln, OUT LPDWORD pdwFlags, OUT LPTSTR pszPath, UINT uPathStrLimit);
  44. private:
  45. UINT m_NumSwitches;
  46. BOOL m_bSkipFirstToken;
  47. BOOL m_bBlankCmdLnOkay;
  48. ArgStruct* m_CommandLineSwitches;
  49. BOOL IsValidSwitch(LPCTSTR pszSwitch, LPDWORD pdwFlags);
  50. BOOL IsValidFilePath(LPCTSTR pszFile);
  51. BOOL EnsureFullFilePath(LPTSTR pszFile, UINT uNumChars);
  52. BOOL CheckIfValidSwitchOrPath(LPCTSTR pszToken, LPDWORD pdwFlags,
  53. BOOL* pbFoundPath, LPTSTR pszPath);
  54. };
  55. #endif //_CM_PROCESSCMDLN_H_