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.

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