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.

94 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. StrucSiz.c
  5. Abstract:
  6. This module contains Remote Admin Protocol (RAP) routines. These routines
  7. are shared between XactSrv and RpcXlate.
  8. Author:
  9. David Treadwell (davidtr) 07-Jan-1991
  10. Environment:
  11. Portable to any flat, 32-bit environment. (Uses Win32 typedefs.)
  12. Requires ANSI C extensions: slash-slash comments, long external names.
  13. Revision History:
  14. 04-Mar-1991 JohnRo
  15. Converted from Xs (XactSrv) to Rap (Remote Admin Protocol) names.
  16. 15-Mar-1991 W-Shanku
  17. Moved auxiliary data count support elsewhere.
  18. 14-Apr-1991 JohnRo
  19. Reduce recompiles.
  20. 15-May-1991 JohnRo
  21. Added native vs. RAP handling.
  22. 10-Jul-1991 JohnRo
  23. RapExamineDescriptor() has yet another parameter.
  24. --*/
  25. // These must be included first:
  26. #include <windef.h> // IN, LPDWORD, NULL, OPTIONAL, DWORD, etc.
  27. #include <lmcons.h> // NET_API_STATUS
  28. // These may be included in any order:
  29. #include <rap.h> // My prototype, LPDESC.
  30. DWORD
  31. RapStructureSize (
  32. IN LPDESC Descriptor,
  33. IN RAP_TRANSMISSION_MODE TransmissionMode,
  34. IN BOOL Native
  35. )
  36. /*++
  37. Routine Description:
  38. This routine determines size of the fixed structure described by the
  39. descriptor string.
  40. Arguments:
  41. Descriptor - the format of the structure.
  42. Transmission Mode - Indicates whether this array is part of a response,
  43. a request, or both.
  44. Native - TRUE iff the descriptor defines a native structure. (This flag is
  45. used to decide whether or not to align fields.)
  46. Return Value:
  47. DWORD - The number of bytes in the fixed part of the structure.
  48. --*/
  49. {
  50. DWORD structureSize;
  51. RapExamineDescriptor(
  52. Descriptor,
  53. NULL,
  54. &structureSize,
  55. NULL,
  56. NULL,
  57. NULL,
  58. NULL, // don't need to know structure alignment
  59. TransmissionMode,
  60. Native
  61. );
  62. return structureSize;
  63. } // RapStructureSize