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.

181 lines
8.1 KiB

  1. /*** proto.h - Local function prototypes
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 09/07/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _PROTO_H
  10. #define _PROTO_H
  11. // asl.c
  12. int LOCAL ReadBinFile(PSZ pszFile, PBYTE *ppb, PDWORD pdwTableSig);
  13. int LOCAL InitNameSpace(VOID);
  14. VOID LOCAL PrintLogo(VOID);
  15. int LOCAL PrintHelp(char **ppszArg, PARGTYPE pAT);
  16. VOID LOCAL PrintUsage(VOID);
  17. // parseasl.c
  18. int LOCAL ParseASLFile(PSZ pszFile);
  19. int LOCAL ParseASLTerms(PTOKEN ptoken, int iNestLevel);
  20. BOOL LOCAL ValidateTermClass(DWORD dwTermClass, PCODEOBJ pcParent);
  21. int LOCAL ParseASLTerm(PTOKEN ptoken, int iNestLevel);
  22. int LOCAL ParseFieldList(PTOKEN ptoken);
  23. int LOCAL ParsePackageList(PTOKEN ptoken);
  24. int LOCAL ParseBuffList(PTOKEN ptoken);
  25. int LOCAL ParseDataList(PTOKEN ptoken, int icbDataSize);
  26. int LOCAL ParseArgs(PTOKEN ptoken, PASLTERM pterm, int iNumArgs);
  27. int LOCAL ParseUserTerm(PTOKEN ptoken, BOOL fNonMethodOK);
  28. int LOCAL ParseName(PTOKEN ptoken, BOOL fEncode);
  29. int LOCAL ParseSuperName(PTOKEN ptoken);
  30. int LOCAL MakeIntData(DWORD dwData, PCODEOBJ pc);
  31. int LOCAL GetIntData(PCODEOBJ pc, PDWORD pdwData);
  32. int LOCAL ParseData(PTOKEN ptoken);
  33. int LOCAL ParseInteger(PTOKEN ptoken, char c);
  34. int LOCAL ParseOpcode(PTOKEN ptoken, char c);
  35. int LOCAL ParseKeyword(PTOKEN ptoken, char chExpectType);
  36. int LOCAL ParseString(PTOKEN ptoken);
  37. int LOCAL CreateObject(PTOKEN ptoken, PSZ pszName, char c, PNSOBJ *ppns);
  38. #ifdef __UNASM
  39. int LOCAL CreateScopeObj(PSZ pszName, PNSOBJ *ppns);
  40. #endif
  41. int LOCAL ValidateObject(PTOKEN ptoken, PSZ pszName, char chActType,
  42. char chArgType);
  43. int LOCAL ValidateNSChkList(PNSCHK pnschkHead);
  44. int LOCAL QueueNSChk(PTOKEN ptoken, PSZ pszObjName, ULONG dwExpectedType,
  45. ULONG dwChkData);
  46. // aslterms.c
  47. int LOCAL DefinitionBlock(PTOKEN ptoken, BOOL fActionFL);
  48. int LOCAL Include(PTOKEN ptoken, BOOL fActionFL);
  49. int LOCAL External(PTOKEN ptoken, BOOL fActionFL);
  50. int LOCAL Method(PTOKEN ptoken, BOOL fActionFL);
  51. int LOCAL Alias(PTOKEN ptoken, BOOL fActionFL);
  52. int LOCAL Name(PTOKEN ptoken, BOOL fActionFL);
  53. int LOCAL Scope(PTOKEN ptoken, BOOL fActionFL);
  54. int LOCAL Field(PTOKEN ptoken, BOOL fActionFL);
  55. int LOCAL IndexField(PTOKEN ptoken, BOOL fActionFL);
  56. int LOCAL BankField(PTOKEN ptoken, BOOL fActionFL);
  57. int LOCAL OpRegion(PTOKEN ptoken, BOOL fActionFL);
  58. int LOCAL EISAID(PTOKEN ptoken, BOOL fActionFL);
  59. int LOCAL Match(PTOKEN ptoken, BOOL fActionFL);
  60. int LOCAL AccessAs(PTOKEN ptoken, BOOL fActionFL);
  61. int LOCAL Else(PTOKEN ptoken, BOOL fActionFL);
  62. // pnpmacro.c
  63. int LOCAL XferCodeToBuff(PBYTE pbBuff, PDWORD pdwcb, PCODEOBJ pcCode);
  64. int LOCAL ResourceTemplate(PTOKEN ptoken, BOOL fActionFL);
  65. int LOCAL AddSmallOffset(PTOKEN ptoken, BOOL fActionFL);
  66. int LOCAL StartDependentFn(PTOKEN ptoken, BOOL fActionFL);
  67. int LOCAL IRQDesc(PTOKEN ptoken, BOOL fActionFL);
  68. int LOCAL DMADesc(PTOKEN ptoken, BOOL fActionFL);
  69. int LOCAL IODesc(PTOKEN ptoken, BOOL fActionFL);
  70. int LOCAL FixedIODesc(PTOKEN ptoken, BOOL fActionFL);
  71. int LOCAL VendorDesc(PTOKEN ptoken, DWORD dwMaxSize);
  72. int LOCAL VendorShort(PTOKEN ptoken, BOOL fActionFL);
  73. int LOCAL InsertDescLength(PCODEOBJ pcode, DWORD dwDescLen);
  74. int LOCAL Memory24Desc(PTOKEN ptoken, BOOL fActionFL);
  75. int LOCAL VendorLong(PTOKEN ptoken, BOOL fActionFL);
  76. int LOCAL Memory32Desc(PTOKEN ptoken, BOOL fActionFL);
  77. int LOCAL FixedMemory32Desc(PTOKEN ptoken, BOOL fActionFL);
  78. int LOCAL MemSpaceDesc(PTOKEN ptoken, DWORD dwMinLen, PRESFIELD ResFields);
  79. int LOCAL IOSpaceDesc(PTOKEN ptoken, DWORD dwMinLen, PRESFIELD ResFields);
  80. int LOCAL DWordMemDesc(PTOKEN ptoken, BOOL fActionFL);
  81. int LOCAL DWordIODesc(PTOKEN ptoken, BOOL fActionFL);
  82. int LOCAL WordIODesc(PTOKEN ptoken, BOOL fActionFL);
  83. int LOCAL WordBusNumDesc(PTOKEN ptoken, BOOL fActionFL);
  84. int LOCAL InterruptDesc(PTOKEN ptoken, BOOL fActionFL);
  85. int LOCAL QWordMemDesc(PTOKEN ptoken, BOOL fActionFL);
  86. int LOCAL QWordIODesc(PTOKEN ptoken, BOOL fActionFL);
  87. int LOCAL CreateResFields(PTOKEN ptoken, PNSOBJ pnsParent, PRESFIELD prf);
  88. // acpins.c
  89. int LOCAL GetNameSpaceObj(PSZ pszObjPath, PNSOBJ pnsScope, PPNSOBJ ppns,
  90. DWORD dwfNS);
  91. int LOCAL CreateNameSpaceObj(PTOKEN ptoken, PSZ pszName, PNSOBJ pnsScope,
  92. PNSOBJ pnsOwner, PPNSOBJ ppns, DWORD dwfNS);
  93. VOID LOCAL DumpNameSpacePaths(PNSOBJ pnsObj, FILE *pfileOut);
  94. PSZ LOCAL GetObjectPath(PNSOBJ pns);
  95. PSZ LOCAL GetObjectTypeName(DWORD dwObjType);
  96. // misc.c
  97. BOOL LOCAL ValidASLNameSeg(PTOKEN ptoken, PSZ pszToken, int icbLen);
  98. BOOL LOCAL ValidASLName(PTOKEN ptoken, PSZ pszToken);
  99. int LOCAL EncodeName(PSZ pszName, PBYTE pbBuff, PDWORD pdwLen);
  100. int LOCAL EncodePktLen(DWORD dwCodeLen, PDWORD pdwPktLen, PINT picbEncoding);
  101. VOID LOCAL EncodeKeywords(PCODEOBJ pArgs, DWORD dwSrcArgs, int iDstArgNum);
  102. int LOCAL DecodeName(PBYTE pb, PSZ pszName, int iLen);
  103. int LOCAL SetDefMissingKW(PCODEOBJ pArg, DWORD dwDefID);
  104. VOID LOCAL SetIntObject(PCODEOBJ pc, DWORD dwData, DWORD dwLen);
  105. VOID LOCAL ComputeChildChkSumLen(PCODEOBJ pcParent, PCODEOBJ pcChild);
  106. VOID LOCAL ComputeArgsChkSumLen(PCODEOBJ pcode);
  107. VOID LOCAL ComputeChkSumLen(PCODEOBJ pcode);
  108. BYTE LOCAL ComputeDataChkSum(PBYTE pb, DWORD dwLen);
  109. int LOCAL ComputeEISAID(PSZ pszID, PDWORD pdwEISAID);
  110. int LOCAL LookupIDIndex(LONG lID, PDWORD pdwTermIndex);
  111. int LOCAL WriteAMLFile(int fhAML, PCODEOBJ pcode, PDWORD pdwOffset);
  112. VOID LOCAL FreeCodeObjs(PCODEOBJ pcodeRoot);
  113. // unasm.c
  114. int LOCAL UnAsmFile(PSZ pszAMLName, FILE *pfileOut);
  115. int LOCAL BuildNameSpace(PSZ pszAMLName, DWORD dwAddr, PBYTE pb);
  116. int LOCAL UnAsmAML(PSZ pszAMLName, DWORD dwAddr, PBYTE pb, FILE *pfileOut);
  117. int LOCAL UnAsmHeader(PSZ pszAMLName, PDESCRIPTION_HEADER pdh, FILE *pfileOut);
  118. VOID LOCAL DumpBytes(PBYTE pb, DWORD dwLen, FILE *pfileOut);
  119. VOID LOCAL DumpCode(PBYTE pbOp, FILE *pfileOut);
  120. VOID LOCAL PrintIndent(int iLevel, FILE *pfileOut);
  121. BYTE LOCAL FindOpClass(BYTE bOp, POPMAP pOpTable);
  122. PASLTERM LOCAL FindOpTerm(DWORD dwOpcode);
  123. PASLTERM LOCAL FindKeywordTerm(char cKWGroup, BYTE bDate);
  124. int LOCAL UnAsmScope(PBYTE *ppbOp, PBYTE pbEnd, FILE *pfileOut);
  125. int LOCAL UnAsmOpcode(PBYTE *ppbOp, FILE *pfileOut);
  126. int LOCAL UnAsmDataObj(PBYTE *ppbOp, FILE *pfileOut);
  127. int LOCAL UnAsmNameObj(PBYTE *ppbOp, FILE *pfileOut, PNSOBJ *ppns, char c);
  128. int LOCAL ParseNameTail(PBYTE *ppbOp, PSZ pszBuff, int iLen);
  129. int LOCAL UnAsmTermObj(PASLTERM pterm, PBYTE *ppbOp, FILE *pfileOut);
  130. int LOCAL UnAsmSuperName(PBYTE *ppbOp, FILE *pfileOut);
  131. int LOCAL UnAsmArgs(PSZ pszUnAsmArgTypes, PSZ pszArgActions, DWORD dwTermData,
  132. PBYTE *ppbOp, PNSOBJ *ppns, FILE *pfileOut);
  133. DWORD LOCAL ParsePackageLen(PBYTE *ppbOp, PBYTE *ppbOpNext);
  134. int LOCAL UnAsmDataList(PBYTE *ppbOp, PBYTE pbEnd, FILE *pfileOut);
  135. int LOCAL UnAsmPkgList(PBYTE *ppbOp, PBYTE pbEnd, FILE *pfileOut);
  136. int LOCAL UnAsmFieldList(PBYTE *ppbOp, PBYTE pbEnd, FILE *pfileOut);
  137. int LOCAL UnAsmField(PBYTE *ppbOp, FILE *pfileOut, PDWORD pdwBitPos);
  138. #ifdef __UNASM
  139. // tables.c
  140. BOOL LOCAL IsWinNT(VOID);
  141. #ifndef WINNT
  142. HANDLE LOCAL OpenVxD(VOID);
  143. VOID LOCAL CloseVxD(HANDLE hVxD);
  144. PBYTE LOCAL VxDGetTableBySig(DWORD dwTabSig, PDWORD pdwTableAddr);
  145. PBYTE LOCAL VxDGetTableByAddr(DWORD dwTableAddr, PDWORD pdwTableSig);
  146. #endif
  147. PBYTE LOCAL GetNTTable(DWORD dwTabSig);
  148. PBYTE LOCAL GetTableBySig(DWORD dwTabSig, PDWORD pdwTableAddr);
  149. PBYTE LOCAL GetTableByAddr(DWORD dwTableAddr, PDWORD pdwTableSig);
  150. int LOCAL DumpAllTables(FILE *pfileOut);
  151. int LOCAL DumpTableBySig(FILE *pfileOut, DWORD dwTableSig);
  152. int LOCAL DumpTableByAddr(FILE *pfileOut, DWORD dwTableAddr);
  153. int LOCAL DumpRSDP(FILE *pfileOut, PBYTE pb, DWORD dwAddr);
  154. int LOCAL DumpTable(FILE *pfileOut, PBYTE pb, DWORD dwTableAddr,
  155. DWORD dwTableSig);
  156. int LOCAL DumpTableTxt(FILE *pfileOut, PBYTE pb, DWORD dwTableAddr,
  157. DWORD dwTableSig);
  158. int LOCAL DumpTableBin(DWORD dwTableSig, DWORD dwAddr, PBYTE pb, DWORD dwLen);
  159. int LOCAL FindTableFmt(DWORD dwTableSig, PFMT *ppfmt, PDWORD pdwFlags);
  160. PSZ LOCAL GetTableSigStr(DWORD dwTableSig);
  161. #endif
  162. // debug.c
  163. VOID CDECL ErrPrintf(char *pszFormat, ...);
  164. #ifdef TRACING
  165. VOID LOCAL OpenTrace(char *pszTraceOut);
  166. VOID LOCAL CloseTrace(VOID);
  167. VOID CDECL EnterProc(int n, char *pszFormat, ...);
  168. VOID CDECL ExitProc(int n, char *pszForamt, ...);
  169. #endif
  170. #endif //ifndef _PROTO_H