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.

188 lines
3.7 KiB

  1. /* (C) 1997 Microsoft Corp.
  2. *
  3. * file : Token.c
  4. * author : Erik Mavrinac
  5. *
  6. * description: MCSMUX API entry points for MCS T.122 API token functions.
  7. *
  8. */
  9. #include "precomp.h"
  10. #pragma hdrstop
  11. #include "mcsmux.h"
  12. /*
  13. * Grabs the specified token ID. Grabbing is like taking out a critical
  14. * section in the kernel, except that it's network-based and handled at
  15. * the Top Provider (that's us). An inhibited token cannot be grabbed.
  16. */
  17. MCSError APIENTRY MCSTokenGrabRequest(
  18. UserHandle hUser,
  19. TokenID TokenID)
  20. {
  21. CheckInitialized("TokenGrabReq()");
  22. ErrOut("TokenGrabReq(): Not implemented");
  23. return MCS_COMMAND_NOT_SUPPORTED;
  24. /* Implementation notes:
  25. 1. Verify hUser.
  26. 2. if (TokenID == 0)
  27. return MCS_INVALID_PARAMETER;
  28. ...
  29. */
  30. }
  31. /*
  32. * Inhibits the specified token ID. Inhibiting is like increasing a count
  33. * which prevents grabbing the token.
  34. */
  35. MCSError APIENTRY MCSTokenInhibitRequest(
  36. UserHandle hUser,
  37. TokenID TokenID)
  38. {
  39. CheckInitialized("TokenInhibitReq()");
  40. ErrOut("TokenInhibitReq(): Not implemented");
  41. return MCS_COMMAND_NOT_SUPPORTED;
  42. /* Implementation notes:
  43. 1. Verify hUser.
  44. 2. if (TokenID == 0)
  45. return MCS_INVALID_PARAMETER;
  46. ...
  47. */
  48. }
  49. /*
  50. * Allows a user attachment to give a token it has grabbed to another user.
  51. */
  52. MCSError APIENTRY MCSTokenGiveRequest(
  53. UserHandle hUser,
  54. TokenID TokenID,
  55. UserID ReceiverID)
  56. {
  57. CheckInitialized("TokenGiveReq()");
  58. ErrOut("TokenGiveReq(): Not implemented");
  59. return MCS_COMMAND_NOT_SUPPORTED;
  60. /* Implementation notes:
  61. 1. Verify hUser.
  62. 2. if (TokenID == 0)
  63. return MCS_INVALID_PARAMETER;
  64. 3. if (ReceiverID < MinDynamicChannel)
  65. return MCS_INVALID_PARAMETER;
  66. ...
  67. */
  68. }
  69. /*
  70. * Allows a user to respond to a token-give offer from another user.
  71. */
  72. MCSError APIENTRY MCSTokenGiveResponse(
  73. UserHandle hUser,
  74. TokenID TokenID,
  75. MCSResult Result)
  76. {
  77. CheckInitialized("TokenGiveResponse()");
  78. ErrOut("TokenGiveResponse(): Not implemented");
  79. return MCS_COMMAND_NOT_SUPPORTED;
  80. /* Implementation notes:
  81. 1. Verify hUser.
  82. 2. if (TokenID == 0)
  83. return MCS_INVALID_PARAMETER;
  84. 3. verify token is pending a give response.
  85. ...
  86. */
  87. }
  88. /*
  89. * Allows a user to request a token from the current grabber.
  90. */
  91. MCSError APIENTRY MCSTokenPleaseRequest(
  92. UserHandle hUser,
  93. TokenID TokenID)
  94. {
  95. CheckInitialized("TokenPleaseReq()");
  96. ErrOut("TokenPleaseReq(): Not implemented");
  97. return MCS_COMMAND_NOT_SUPPORTED;
  98. /* Implementation notes:
  99. 1. Verify hUser.
  100. 2. if (TokenID == 0)
  101. return MCS_INVALID_PARAMETER;
  102. 3. verify token is pending a give response.
  103. ...
  104. */
  105. }
  106. /*
  107. * Releases a currently grabbed or inhibited token.
  108. */
  109. MCSError APIENTRY MCSTokenReleaseRequest(
  110. UserHandle hUser,
  111. TokenID TokenID)
  112. {
  113. CheckInitialized("TokenReleaseReq()");
  114. ErrOut("TokenReleaseReq(): Not implemented");
  115. return MCS_COMMAND_NOT_SUPPORTED;
  116. /* Implementation notes:
  117. 1. Verify hUser.
  118. 2. if (TokenID == 0)
  119. return MCS_INVALID_PARAMETER;
  120. 3. verify token is grabbed or inhibited by this user.
  121. ...
  122. */
  123. }
  124. /*
  125. * Tests the current state of a token.
  126. */
  127. MCSError APIENTRY MCSTokenTestRequest(
  128. UserHandle hUser,
  129. TokenID TokenID)
  130. {
  131. CheckInitialized("TokenTestReq()");
  132. ErrOut("TokenTestReq(): Not implemented");
  133. return MCS_COMMAND_NOT_SUPPORTED;
  134. /* Implementation notes:
  135. 1. Verify hUser.
  136. 2. if (TokenID == 0)
  137. return MCS_INVALID_PARAMETER;
  138. ...
  139. */
  140. }