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.

218 lines
5.0 KiB

  1. #pragma warning(push)
  2. #pragma warning(disable:4201) // nameless struct/union
  3. // Defines
  4. #define ERROR_CONTEXT_SWITCH 0x55aa
  5. #define ERROR_CONNECT_REMOTE_CONFIG (ERROR_CONTEXT_SWITCH + 1)
  6. // Flags
  7. enum NS_CMD_FLAGS_PRIV
  8. {
  9. CMD_FLAG_IMMEDIATE = 0x04, // not valid from ancestor contexts
  10. };
  11. // Callbacks
  12. typedef
  13. DWORD
  14. (WINAPI NS_CONTEXT_ENTRY_FN)(
  15. IN LPCWSTR pwszMachine,
  16. IN OUT LPWSTR *ppwcArguments,
  17. IN DWORD dwArgCount,
  18. IN DWORD dwFlags,
  19. IN LPCVOID pvData,
  20. OUT LPWSTR pwcNewContext
  21. );
  22. typedef NS_CONTEXT_ENTRY_FN *PNS_CONTEXT_ENTRY_FN;
  23. typedef
  24. DWORD
  25. (WINAPI NS_CONTEXT_SUBENTRY_FN)(
  26. IN const NS_CONTEXT_ATTRIBUTES *pSubContext,
  27. IN LPCWSTR pwszMachine,
  28. IN OUT LPWSTR *ppwcArguments,
  29. IN DWORD dwArgCount,
  30. IN DWORD dwFlags,
  31. IN LPCVOID pvData,
  32. OUT LPWSTR pwcNewContext
  33. );
  34. typedef NS_CONTEXT_SUBENTRY_FN *PNS_CONTEXT_SUBENTRY_FN;
  35. typedef
  36. BOOL
  37. (WINAPI *PNS_EVENT_FILTER)(
  38. IN EVENTLOGRECORD *pRecord,
  39. IN LPCWSTR pwszLogName,
  40. IN LPCWSTR pwszComponent,
  41. IN LPCWSTR pwszSubComponent,
  42. IN LPCVOID pvFilterContext
  43. );
  44. typedef
  45. DWORD
  46. (WINAPI *PNS_GET_EVENT_IDS_FN)(
  47. IN LPCWSTR pwszComponent,
  48. IN LPCWSTR pwszSubComponent,
  49. OUT PDWORD pdwEventIds,
  50. OUT PULONG pulEventCount
  51. );
  52. // Macros
  53. #define NUM_VALUES_IN_TABLE(TokenArray) sizeof(TokenArray)/sizeof(VALUE_STRING)
  54. // Structures
  55. typedef struct _NS_PRIV_CONTEXT_ATTRIBUTES
  56. {
  57. PNS_CONTEXT_ENTRY_FN pfnEntryFn;
  58. PNS_CONTEXT_SUBENTRY_FN pfnSubEntryFn;
  59. PVOID pfnHelpFn;
  60. } NS_PRIV_CONTEXT_ATTRIBUTES, *PNS_PRIV_CONTEXT_ATTRIBUTES;
  61. typedef struct _NS_DLL_ATTRIBUTES
  62. {
  63. union
  64. {
  65. struct
  66. {
  67. DWORD dwVersion;
  68. DWORD dwReserved;
  69. };
  70. ULONGLONG _ullAlign;
  71. };
  72. PNS_DLL_STOP_FN pfnStopFn;
  73. } NS_DLL_ATTRIBUTES, *PNS_DLL_ATTRIBUTES;
  74. typedef struct _VALUE_TOKEN
  75. {
  76. DWORD dwValue;
  77. LPCWSTR pwszToken;
  78. } VALUE_TOKEN, *PVALUE_TOKEN;
  79. typedef struct _VALUE_STRING
  80. {
  81. DWORD dwValue;
  82. DWORD dwStringId;
  83. } VALUE_STRING, *PVALUE_STRING;
  84. // Exports
  85. VOID WINAPI ConvertGuidToString(
  86. IN CONST GUID *pGuid,
  87. OUT LPWSTR pwszBuffer
  88. );
  89. DWORD WINAPI ConvertStringToGuid(
  90. IN LPCWSTR pwszGuid,
  91. IN USHORT usStringLen,
  92. OUT GUID *pGuid
  93. );
  94. DWORD DisplayMessageToConsole(
  95. IN HANDLE hModule,
  96. IN HANDLE hConsole,
  97. IN DWORD dwMsgId,
  98. ...
  99. );
  100. DWORD
  101. DisplayMessageM(
  102. IN HANDLE hModule,
  103. IN DWORD dwMsgId,
  104. ...
  105. );
  106. VOID WINAPI FreeQuotedString(
  107. IN LPWSTR pwszMadeString
  108. );
  109. VOID WINAPI FreeString(
  110. IN LPWSTR pwszMadeString
  111. );
  112. DWORD WINAPI GenericMonitor(
  113. IN PCNS_CONTEXT_ATTRIBUTES pContext,
  114. IN LPCWSTR pwszMachine,
  115. IN OUT LPWSTR *ppwcArguments,
  116. IN DWORD dwArgCount,
  117. IN DWORD dwFlags,
  118. IN LPCVOID pvData,
  119. OUT LPWSTR pwcNewContext
  120. );
  121. LPWSTR WINAPI GetEnumString(
  122. IN HANDLE hModule,
  123. IN DWORD dwValue,
  124. IN DWORD dwNumVal,
  125. IN PTOKEN_VALUE pEnumTable
  126. );
  127. BOOL WINAPI InitializeConsole(
  128. IN OUT PDWORD pdwRR,
  129. OUT HANDLE *phMib,
  130. OUT HANDLE *phConsole
  131. );
  132. LPWSTR WINAPI MakeQuotedString(
  133. IN LPCWSTR pwszString
  134. );
  135. LPWSTR WINAPI MakeString(
  136. IN HANDLE hModule,
  137. IN DWORD dwMsgId,
  138. ...
  139. );
  140. BOOL WINAPI MatchCmdLine(
  141. IN OUT LPWSTR *ppwcArguments,
  142. IN DWORD dwArgCount,
  143. IN LPCWSTR pwszCmdToken,
  144. OUT PDWORD pdwNumMatched
  145. );
  146. DWORD WINAPI MatchTagsInCmdLine(
  147. IN HANDLE hModule,
  148. IN OUT LPWSTR *ppwcArguments,
  149. IN DWORD dwCurrentIndex,
  150. IN DWORD dwArgCount,
  151. IN OUT PTAG_TYPE pEnumTable,
  152. IN DWORD dwNumTags,
  153. OUT PDWORD pdwOut
  154. );
  155. DWORD WINAPI NsGetFriendlyNameFromIfName(
  156. IN HANDLE hMprConfig,
  157. IN LPCWSTR pwszName,
  158. OUT LPWSTR pwszBuffer,
  159. IN PDWORD pdwBufSize
  160. );
  161. DWORD WINAPI NsGetIfNameFromFriendlyName(
  162. IN HANDLE hMprConfig,
  163. IN LPCWSTR pwszName,
  164. OUT LPWSTR pwszBuffer,
  165. IN PDWORD pdwBufSize
  166. );
  167. DWORD WINAPI RefreshConsole(
  168. IN HANDLE hMib,
  169. IN HANDLE hConsole,
  170. IN DWORD dwRR
  171. );
  172. DWORD WINAPI ProcessCommand(
  173. IN LPCWSTR pwszCmdLine,
  174. OUT BOOL *pbDone
  175. );
  176. #define DisplayError PrintError
  177. #define DisplayMessageT PrintMessage
  178. #define DisplayMessage PrintMessageFromModule
  179. #pragma warning(pop)