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.

166 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. routing\netsh\shell\shell.h
  5. Abstract:
  6. Include for shell.c
  7. Revision History:
  8. Anand Mahalingam 7/6/98 Created
  9. --*/
  10. extern HANDLE g_hModule;
  11. extern WCHAR g_pwszContext[MAX_CMD_LEN];
  12. extern BOOL g_bInteractive;
  13. extern BOOL g_bDone;
  14. extern HANDLE g_hLogFile;
  15. extern LPWSTR g_pwszRouterName;
  16. //
  17. // The entry in the argument list.
  18. //
  19. typedef struct _ARG_ENTRY
  20. {
  21. LIST_ENTRY le;
  22. LPWSTR pwszArg; // Argument String
  23. }ARG_ENTRY, *PARG_ENTRY;
  24. //
  25. // Macro to free memory allocated for the argument list
  26. //
  27. #define FREE_ARG_LIST(ple) \
  28. { \
  29. PLIST_ENTRY ple1 = ple->Flink, pleTmp; \
  30. PARG_ENTRY pae; \
  31. \
  32. while (ple1 != ple) \
  33. { \
  34. pae = CONTAINING_RECORD(ple1, ARG_ENTRY, le); \
  35. if (pae->pwszArg) \
  36. HeapFree(GetProcessHeap(), 0, pae->pwszArg); \
  37. pleTmp = ple1->Flink; \
  38. RemoveEntryList(ple1); \
  39. HeapFree(GetProcessHeap(), 0, pae); \
  40. ple1 = pleTmp; \
  41. } \
  42. HeapFree(GetProcessHeap(), 0, ple); \
  43. }
  44. //
  45. // Function Prototypes
  46. //
  47. DWORD
  48. WINAPI
  49. ExecuteHandler(
  50. IN HANDLE hModule,
  51. IN CMD_ENTRY *pCmdEntry,
  52. IN OUT LPWSTR *argv,
  53. IN DWORD dwNumMatched,
  54. IN DWORD dwArgCount,
  55. IN DWORD dwFlags,
  56. IN LPCVOID pvData,
  57. IN LPCWSTR pwszGroupName,
  58. OUT BOOL *pbDone);
  59. DWORD
  60. ParseCommand(
  61. IN PLIST_ENTRY ple,
  62. IN BOOL bAlias
  63. );
  64. DWORD
  65. ParseCommandLine(
  66. IN LPCWSTR pwszCmdLine,
  67. OUT PLIST_ENTRY *pple
  68. );
  69. DWORD
  70. ProcessCommand(
  71. IN LPCWSTR pwszCmdLine,
  72. OUT BOOL *pbDone
  73. );
  74. DWORD
  75. LoadScriptFile(
  76. IN LPCWSTR pwszFileName
  77. );
  78. DWORD
  79. ConvertBufferToArgList(
  80. PLIST_ENTRY *ppleHead,
  81. LPCWSTR pwszBuffer
  82. );
  83. DWORD
  84. ConvertArgListToBuffer(
  85. IN PLIST_ENTRY pleHead,
  86. OUT LPWSTR pwszBuffer
  87. );
  88. VOID
  89. ConvertArgArrayToBuffer(
  90. IN DWORD dwArgCount,
  91. IN LPCWSTR *argv,
  92. OUT LPWSTR *ppwszBuffer
  93. );
  94. BOOL
  95. IsLocalCommand(
  96. IN LPCWSTR pwszCmd,
  97. IN DWORD dwSkipFlags
  98. );
  99. extern ULONG g_ulNumUbiqCmds;
  100. extern ULONG g_ulNumShellCmds;
  101. extern ULONG g_ulNumGroups;
  102. extern CMD_GROUP_ENTRY g_ShellCmdGroups[];
  103. extern CMD_ENTRY g_ShellCmds[];
  104. extern CMD_ENTRY g_UbiqCmds[];
  105. BOOL
  106. IsImmediate(
  107. IN DWORD dwCmdFlags,
  108. IN DWORD dwRemainingArgs
  109. );
  110. DWORD
  111. SetMachine(
  112. LPCWSTR pwszNewRouter
  113. );
  114. DWORD
  115. AppendString(
  116. IN OUT LPWSTR *ppwszBuffer,
  117. IN LPCWSTR pwszString
  118. );
  119. DWORD
  120. WINAPI
  121. UpdateNewContext(
  122. IN OUT LPWSTR pwszBuffer,
  123. IN LPCWSTR pwszNewToken,
  124. IN DWORD dwArgs
  125. );
  126. HRESULT WINAPI
  127. UpdateVersionInfoGlobals(LPCWSTR pwszMachine);
  128. extern UINT g_CIMOSType;
  129. extern UINT g_CIMOSProductSuite;
  130. extern WCHAR g_CIMOSVersion[MAX_PATH];
  131. extern WCHAR g_CIMOSBuildNumber[MAX_PATH];
  132. extern WCHAR g_CIMServicePackMajorVersion[MAX_PATH];
  133. extern WCHAR g_CIMServicePackMinorVersion[MAX_PATH];
  134. extern UINT g_CIMProcessorArchitecture;
  135. extern BOOL g_CIMAttempted;
  136. extern BOOL g_CIMSucceeded;