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.

91 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. Pointer.c
  5. Abstract:
  6. This module contains Remote Admin Protocol (RAP) routines. These routines
  7. are shared between XactSrv and RpcXlate.
  8. Author:
  9. Shanku Niyogi (w-shanku) 15-Feb-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. 14-Apr-1991 JohnRo
  15. Reduce recompiles.
  16. 15-May-1991 JohnRo
  17. Added native vs. RAP handling.
  18. 10-Jul-1991 JohnRo
  19. RapExamineDescriptor() has yet another parameter.
  20. --*/
  21. // These must be included first:
  22. #include <windef.h> // IN, LPDWORD, NULL, OPTIONAL, DWORD, etc.
  23. #include <lmcons.h> // NET_API_STATUS
  24. // These may be included in any order:
  25. #include <rap.h> // My prototype, LPDESC.
  26. DWORD
  27. RapLastPointerOffset (
  28. IN LPDESC Descriptor,
  29. IN RAP_TRANSMISSION_MODE TransmissionMode,
  30. IN BOOL Native
  31. )
  32. /*++
  33. Routine Description:
  34. This routine determines the offset from the start of the structure to
  35. the last pointer in the structure.
  36. Arguments:
  37. Descriptor - the format of the structure.
  38. Transmission Mode - Indicates whether this array is part of a response,
  39. a request, or both.
  40. Native - TRUE iff the descriptor defines a native structure. (This flag is
  41. used to decide whether or not to align fields.)
  42. Return Value:
  43. DWORD - The offset from the start of the structure to the last pointer
  44. in the structure, or the value NO_POINTER_IN_STRUCTURE if there are
  45. no pointers in the structure.
  46. --*/
  47. {
  48. DWORD lastPointerOffset;
  49. RapExamineDescriptor(
  50. Descriptor,
  51. NULL,
  52. NULL,
  53. &lastPointerOffset,
  54. NULL,
  55. NULL,
  56. NULL, // don't need to know structure alignment
  57. TransmissionMode,
  58. Native
  59. );
  60. return lastPointerOffset;
  61. } // RapLastPointerOffset