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.

58 lines
1.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: server.c
  7. //
  8. // Contents: Server (DC) side of XTCB authentication
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 3-12-97 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #include "xtcbpkg.h"
  18. #include "md5.h"
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Function: XtcbGetMessageSize
  22. //
  23. // Synopsis: Determines the size of the message when serialized.
  24. //
  25. // Arguments: [Message] --
  26. //
  27. // History: 3-25-97 RichardW Created
  28. //
  29. // Notes:
  30. //
  31. //----------------------------------------------------------------------------
  32. DWORD
  33. XtcbGetMessageSize(
  34. PXTCB_SERVER_MESSAGE Message
  35. )
  36. {
  37. DWORD Size ;
  38. switch ( Message->Code )
  39. {
  40. case XtcbSrvAuthReq:
  41. Size = Message->Message.AuthReq.Challenge.Length + 1 +
  42. Message->Message.AuthReq.Response.Length + 1 +
  43. Message->Message.AuthReq.UserName.Length + 1 ;
  44. break;
  45. case XtcbSrvAuthResp:
  46. Size = Message->Message.AuthResp.AuthInfoLength ;
  47. break;
  48. default:
  49. Size = 0 ;
  50. }
  51. return Size ;
  52. }