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.

232 lines
6.8 KiB

  1. //THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. //ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. //THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  7. //
  8. // MODULE: proj.h
  9. //
  10. // PURPOSE: Global header files, data types and function prototypes
  11. //
  12. // PLATFORMS: Windows 95
  13. //
  14. // FUNCTIONS: N/A
  15. //
  16. // SPECIAL INSTRUCTIONS: N/A
  17. //
  18. #ifndef _SMMSCRIPT_PROJ_H_
  19. #define _SMMSCRIPT_PROJ_H_
  20. //****************************************************************************
  21. // Global Include File
  22. //****************************************************************************
  23. #include <windows.h> // also includes windowsx.h
  24. #include <windowsx.h>
  25. #include <regstr.h>
  26. #include <ras.h> // Dial-Up Networking Session API
  27. #include <raserror.h> // Dial-Up Networking Session API
  28. #ifdef WINNT_RAS
  29. //
  30. // The following header is included before all the Win9x Dial-Up definitions,
  31. // since it provides definitions used in the scripting headers.
  32. //
  33. #include "nthdr1.h"
  34. #endif // WINNT_RAS
  35. #include <rnaspi.h> // Service Provider Interface
  36. #include <rnap.h>
  37. #define NORTL
  38. #define NOFILEINFO
  39. #define NOCOLOR
  40. #define NODRAWTEXT
  41. #define NODIALOGHELPER
  42. #define NOPATH
  43. #define NOSHAREDHEAP
  44. #define SZ_MODULE "SMMSCRPT"
  45. #define SZ_DEBUGINI "rover.ini"
  46. #define SZ_DEBUGSECTION "SMM Script"
  47. #include "common.h"
  48. //
  49. // Error codes - we use HRESULT. See winerror.h.
  50. //
  51. #define RSUCCEEDED(res) SUCCEEDED(res)
  52. #define RFAILED(res) FAILED(res)
  53. #define RFACILITY(res) HRESULT_FACILITY(res)
  54. typedef HRESULT RES;
  55. #define RES_OK S_OK
  56. #define RES_FALSE S_FALSE
  57. #define RES_HALT 0x00000002L
  58. #define FACILITY_SCRIPT 0x70
  59. #define RES_E_FAIL E_FAIL
  60. #define RES_E_OUTOFMEMORY E_OUTOFMEMORY
  61. #define RES_E_INVALIDPARAM E_INVALIDARG
  62. #define RES_E_EOF 0x80700000
  63. #define RES_E_MOREDATA 0x80700001
  64. #define FACILITY_PARSE 0x71
  65. #define RES_E_SYNTAXERROR 0x80710000
  66. #define RES_E_EOFUNEXPECTED 0x80710001
  67. #define RES_E_REDEFINED 0x80710002
  68. #define RES_E_UNDEFINED 0x80710003
  69. #define RES_E_DIVBYZERO 0x80710004
  70. #define RES_E_MAINMISSING 0x80710020
  71. #define RES_E_IDENTMISSING 0x80710021
  72. #define RES_E_STRINGMISSING 0x80710022
  73. #define RES_E_INTMISSING 0x80710023
  74. #define RES_E_RPARENMISSING 0x80710024
  75. #define RES_E_INVALIDTYPE 0x80710040
  76. #define RES_E_INVALIDIPPARAM 0x80710041
  77. #define RES_E_INVALIDSETPARAM 0x80710042
  78. #define RES_E_INVALIDPORTPARAM 0x80710043
  79. #define RES_E_INVALIDRANGE 0x80710044
  80. #define RES_E_INVALIDSCRNPARAM 0x80710045
  81. #define RES_E_REQUIREINT 0x80710050
  82. #define RES_E_REQUIRESTRING 0x80710051
  83. #define RES_E_REQUIREBOOL 0x80710052
  84. #define RES_E_REQUIREINTSTRING 0x80710053
  85. #define RES_E_REQUIRELABEL 0x80710054
  86. #define RES_E_REQUIREINTSTRBOOL 0x80710055
  87. #define RES_E_TYPEMISMATCH 0x80710060
  88. #include "scanner.h"
  89. #include "symtab.h"
  90. #include "ast.h"
  91. //****************************************************************************
  92. // Macros
  93. //****************************************************************************
  94. #define IS_DIGIT(ch) InRange(ch, '0', '9')
  95. #define IS_ESCAPE(ch) ('%' == (ch))
  96. #define IS_BACKSLASH(ch) ('\\' == (ch))
  97. #define ENTERCRITICALSECTION(x) EnterCriticalSection(&x)
  98. #define LEAVECRITICALSECTION(x) LeaveCriticalSection(&x)
  99. #define TIMER_DELAY 1
  100. // Trace flags
  101. #define TF_ASTEXEC 0x00010000
  102. #define TF_BUFFER 0x00020000
  103. #ifdef DEBUG
  104. // DBG_EXIT_RES(fn, res) -- Generates a function exit debug spew for
  105. // functions that return a RES.
  106. //
  107. #define DBG_EXIT_RES(fn, res) DBG_EXIT_TYPE(fn, res, Dbg_GetRes)
  108. LPCSTR PUBLIC Dbg_GetRes(RES res);
  109. // Dump flags
  110. #define DF_ATOMS 0x00000001
  111. #define DF_STACK 0x00000002
  112. #define DF_READBUFFER 0x00000004
  113. #define DF_TOKEN 0x00000008
  114. #define DF_AST 0x00000010
  115. #define DF_PGM 0x00000020
  116. #else
  117. #define DBG_EXIT_RES(fn, res)
  118. #endif
  119. //****************************************************************************
  120. // Type definitions
  121. //****************************************************************************
  122. typedef struct tagSCRIPT
  123. {
  124. char szPath[MAX_PATH];
  125. UINT uMode;
  126. } SCRIPT;
  127. DECLARE_STANDARD_TYPES(SCRIPT);
  128. //****************************************************************************
  129. // SMM error
  130. //****************************************************************************
  131. #define SESS_GETERROR_FUNC "RnaSessGetErrorString"
  132. typedef DWORD (WINAPI * SESSERRORPROC)(UINT, LPSTR, DWORD);
  133. //****************************************************************************
  134. // Global Parameters
  135. //****************************************************************************
  136. extern HANDLE g_hinst;
  137. //****************************************************************************
  138. // Function Prototypes
  139. //****************************************************************************
  140. RES PUBLIC CreateFindFormat(PHANDLE phFindFmt);
  141. RES PUBLIC AddFindFormat(HANDLE hFindFmt, LPCSTR pszFindFmt, DWORD dwFlags, LPSTR pszBuf, DWORD cbBuf);
  142. // Flags for FINDFMT
  143. #define FFF_DEFAULT 0x0000
  144. #define FFF_MATCHEDONCE 0x0001 // (private)
  145. #define FFF_MATCHCASE 0x0002
  146. RES PUBLIC DestroyFindFormat(HANDLE hFindFmt);
  147. RES PUBLIC FindFormat(HWND hwnd, HANDLE hFindFmt, LPDWORD piFound);
  148. BOOL PUBLIC FindStringInBuffer(HWND hwnd, LPCSTR pszFind);
  149. RES PUBLIC CopyToDelimiter(HWND hwnd, LPSTR pszBuf, UINT cbBuf, LPCSTR pszTok);
  150. void PUBLIC SendByte(HWND hwnd, BYTE byte);
  151. DWORD NEAR PASCAL TerminalSetIP(HWND hwnd, LPCSTR szIPAddr);
  152. void NEAR PASCAL TerminalSetInput(HWND hwnd, BOOL fEnable);
  153. BOOL PUBLIC GetScriptInfo(LPCSTR pszConnection, PSCRIPT pscriptBuf);
  154. BOOL PUBLIC GetSetTerminalPlacement(LPCSTR pszConnection,
  155. LPWINDOWPLACEMENT pwp, BOOL fGet);
  156. LPCSTR PUBLIC MyNextChar(LPCSTR psz, char * pch, DWORD * pdwFlags);
  157. // Flags for MyNextChar
  158. #define MNC_ISLEADBYTE 0x00000001
  159. #define MNC_ISTAILBYTE 0x00000002
  160. UINT PUBLIC IdsFromRes(RES res);
  161. BOOL PUBLIC TransferData(HWND hwnd, HANDLE hComm, PSESS_CONFIGURATION_INFO psci);
  162. DWORD NEAR PASCAL AssignIPAddress (LPCSTR szEntryName, LPCSTR szIPAddress);
  163. #ifdef WINNT_RAS
  164. //
  165. // The following header is included after the Win9x scripting definitions.
  166. // It changes some definitions set up by the headers, and provides
  167. // other definitions needed for the Win9x->NT port.
  168. //
  169. #include "nthdr2.h"
  170. #endif // WINNT_RAS
  171. #endif //_SMMSCRIPT_PROJ_H_