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.

219 lines
5.0 KiB

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