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.

93 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. lsarpcmm.c
  5. Abstract:
  6. LSA - Common Client/Server RPC Memory Management Routines
  7. Author:
  8. Scott Birrell (ScottBi) April 8, 1992
  9. Environment:
  10. Revision History:
  11. --*/
  12. #include <lsacomp.h>
  13. PVOID
  14. MIDL_user_allocate (
  15. size_t NumBytes
  16. )
  17. /*++
  18. Routine Description:
  19. Allocates storage for RPC server transactions. The RPC stubs will
  20. either call MIDL_user_allocate when it needs to un-marshall data into a
  21. buffer that the user must free. RPC servers will use MIDL_user_allocate to
  22. allocate storage that the RPC server stub will free after marshalling
  23. the data.
  24. Arguments:
  25. NumBytes - The number of bytes to allocate.
  26. Return Value:
  27. none
  28. Note:
  29. --*/
  30. {
  31. PVOID Buffer = (PVOID) LocalAlloc(LPTR, NumBytes);
  32. return( Buffer );
  33. }
  34. VOID
  35. MIDL_user_free (
  36. void *MemPointer
  37. )
  38. /*++
  39. Routine Description:
  40. Frees storage used in RPC transactions. The RPC client can call this
  41. function to free buffer space that was allocated by the RPC client
  42. stub when un-marshalling data that is to be returned to the client.
  43. The Client calls MIDL_user_free when it is finished with the data and
  44. desires to free up the storage.
  45. The RPC server stub calls MIDL_user_free when it has completed
  46. marshalling server data that is to be passed back to the client.
  47. Arguments:
  48. MemPointer - This points to the memory block that is to be released.
  49. Return Value:
  50. none.
  51. Note:
  52. --*/
  53. {
  54. LocalFree(MemPointer);
  55. }