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.

117 lines
3.4 KiB

  1. /*** nsmod.c - Parse name space modifier instructions
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 11/12/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #include "pch.h"
  10. #ifdef LOCKABLE_PRAGMA
  11. #pragma ACPI_LOCKABLE_DATA
  12. #pragma ACPI_LOCKABLE_CODE
  13. #endif
  14. /***LP Alias - Parse and execute the Alias instruction
  15. *
  16. * ENTRY
  17. * pctxt -> CTXT
  18. * pterm -> TERM
  19. *
  20. * EXIT-SUCCESS
  21. * returns STATUS_SUCCESS
  22. * EXIT-FAILURE
  23. * returns AMLIERR_ code
  24. */
  25. NTSTATUS LOCAL Alias(PCTXT pctxt, PTERM pterm)
  26. {
  27. TRACENAME("ALIAS")
  28. NTSTATUS rc = STATUS_SUCCESS;
  29. PNSOBJ pnsSrc;
  30. ENTER(2, ("Alias(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
  31. ASSERT(pterm->pdataArgs[0].dwDataType == OBJTYPE_STRDATA);
  32. ASSERT(pterm->pdataArgs[1].dwDataType == OBJTYPE_STRDATA);
  33. if (((rc = GetNameSpaceObject((PSZ)pterm->pdataArgs[0].pbDataBuff,
  34. pctxt->pnsScope, &pnsSrc, NSF_WARN_NOTFOUND))
  35. == STATUS_SUCCESS) &&
  36. ((rc = CreateNameSpaceObject(pctxt->pheapCurrent,
  37. (PSZ)pterm->pdataArgs[1].pbDataBuff,
  38. pctxt->pnsScope, pctxt->powner,
  39. &pterm->pnsObj, 0)) == STATUS_SUCCESS))
  40. {
  41. pterm->pnsObj->ObjData.dwDataType = OBJTYPE_OBJALIAS;
  42. pterm->pnsObj->ObjData.uipDataValue = (ULONG_PTR)pnsSrc;
  43. }
  44. EXIT(2, ("Alias=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
  45. return rc;
  46. } //Alias
  47. /***LP Name - Parse and execute the Name instruction
  48. *
  49. * ENTRY
  50. * pctxt -> CTXT
  51. * pterm -> TERM
  52. *
  53. * EXIT-SUCCESS
  54. * returns STATUS_SUCCESS
  55. * EXIT-FAILURE
  56. * returns AMLIERR_ code
  57. */
  58. NTSTATUS LOCAL Name(PCTXT pctxt, PTERM pterm)
  59. {
  60. TRACENAME("NAME")
  61. NTSTATUS rc = STATUS_SUCCESS;
  62. ENTER(2, ("Name(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
  63. ASSERT(pterm->pdataArgs[0].dwDataType == OBJTYPE_STRDATA);
  64. if ((rc = CreateNameSpaceObject(pctxt->pheapCurrent,
  65. (PSZ)pterm->pdataArgs[0].pbDataBuff,
  66. pctxt->pnsScope, pctxt->powner,
  67. &pterm->pnsObj, 0)) == STATUS_SUCCESS)
  68. {
  69. MoveObjData(&pterm->pnsObj->ObjData, &pterm->pdataArgs[1]);
  70. }
  71. EXIT(2, ("Name=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
  72. return rc;
  73. } //Name
  74. /***LP Scope - Parse and execute the Scope instruction
  75. *
  76. * ENTRY
  77. * pctxt -> CTXT
  78. * pterm -> TERM
  79. *
  80. * EXIT-SUCCESS
  81. * returns STATUS_SUCCESS
  82. * EXIT-FAILURE
  83. * returns AMLIERR_ code
  84. */
  85. NTSTATUS LOCAL Scope(PCTXT pctxt, PTERM pterm)
  86. {
  87. TRACENAME("SCOPE")
  88. NTSTATUS rc = STATUS_SUCCESS;
  89. ENTER(2, ("Scope(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
  90. ASSERT(pterm->pdataArgs[0].dwDataType == OBJTYPE_STRDATA);
  91. if ((rc = GetNameSpaceObject((PSZ)pterm->pdataArgs[0].pbDataBuff,
  92. pctxt->pnsScope, &pterm->pnsObj,
  93. NSF_WARN_NOTFOUND)) == STATUS_SUCCESS)
  94. {
  95. rc = PushScope(pctxt, pctxt->pbOp, pterm->pbOpEnd, NULL, pterm->pnsObj,
  96. pctxt->powner, pctxt->pheapCurrent, pterm->pdataResult);
  97. }
  98. EXIT(2, ("Scope=%x\n", rc));
  99. return rc;
  100. } //Scope