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.

79 lines
1.8 KiB

  1. // CMDINT.H
  2. #ifndef _CMDINT_H
  3. #define _CMDINT_H
  4. #include <windows.h>
  5. #include <itcc.h>
  6. #include <iterror.h>
  7. #include <atlinc.h>
  8. #include "verinfo.h"
  9. #include "cistream.h"
  10. #define WSTRCB(wstr) (WSTRLEN (wstr) * 2 + sizeof (WCHAR))
  11. #define MAX_HELPER_INSTANCE 50
  12. #define TOKEN_DELIM L','
  13. #define TOKEN_QUOTE L'"'
  14. #define TOKEN_SPACE L'\x20'
  15. #define TOKEN_NULL L'\0'
  16. #define TOKEN_EQUAL L'='
  17. struct KEYVAL
  18. {
  19. LPWSTR pwstrKey;
  20. VARARG vaValue;
  21. };
  22. // Command Interpreter class
  23. class CITCmdInt :
  24. public IITCmdInt,
  25. public CComObjectRoot,
  26. public CComCoClass<CITCmdInt,&CLSID_IITCmdInt>
  27. {
  28. public:
  29. CITCmdInt () : m_fInit(FALSE) {}
  30. ~CITCmdInt ();
  31. BEGIN_COM_MAP(CITCmdInt)
  32. COM_INTERFACE_ENTRY(IITCmdInt)
  33. END_COM_MAP()
  34. DECLARE_REGISTRY (CLSID_IITCmdInt,
  35. "ITIR.CmdInt.4", "ITIR.CmdInt", 0, THREADFLAGS_APARTMENT)
  36. public:
  37. STDMETHOD(Initiate)(IITSvMgr *piitsvs);
  38. STDMETHOD(Dispose)(void);
  39. STDMETHOD(LoadFromStream)(IStream *pMVPStream, IStream *pLogStream);
  40. // Data members
  41. private:
  42. STDMETHOD(ParseConfigStream)(void);
  43. STDMETHOD(ParseHelperSz)(LPWSTR);
  44. STDMETHOD(ParseBogusSz)(LPWSTR);
  45. STDMETHOD(ParseIndexSz)(LPWSTR);
  46. STDMETHOD(GetFunctionFromSection)(LPWSTR pwstrLine, void **ppfparse);
  47. STDMETHOD(IsSectionHeading)(LPWSTR pwstrSection);
  48. BOOL m_fInit;
  49. ERRC m_errc;
  50. IStream *m_piistmLog;
  51. IITSvMgr *m_piitsv;
  52. IITDatabase *m_piitdb;
  53. CStreamParseLine m_ConfigParser;
  54. WCHAR m_wstrSection[1024]; // Keep DWORD aligned!
  55. LPVOID m_pBlockMgr;
  56. DWORD m_dwMaxInstance;
  57. struct tagHELPERSTUFF
  58. {
  59. LPWSTR pwstrName;
  60. DWORD dwCodePage;
  61. LCID lcid;
  62. VARARG kvDword;
  63. VARARG kvString;
  64. } m_wstrHelper[MAX_HELPER_INSTANCE + 1];
  65. }; /* class CITCmdInt */
  66. typedef HRESULT (WINAPI CITCmdInt ::* PFPARSE2) (LPWSTR);
  67. #endif /* _CMDINT_H */