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.

100 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1990,91 Microsoft Corporation
  3. Module Name:
  4. MidlUser.c
  5. Abstract:
  6. This file contains common functions and utilities that the API
  7. DLLs can use in making remote calls. This includes the
  8. MIDL_USER_ALLOCATE functions.
  9. Author:
  10. Dan Lafferty danl 06-Feb-1991
  11. Environment:
  12. User Mode - Win32
  13. Revision History:
  14. 06-Feb-1991 danl
  15. Created
  16. 25-Apr-1991 JohnRo
  17. Split out MIDL user (allocate,free) into seperate source file, so
  18. linker doesn't get confused.
  19. --*/
  20. #include "precomp.h"
  21. PVOID
  22. MIDL_user_allocate (
  23. IN size_t NumBytes
  24. )
  25. /*++
  26. Routine Description:
  27. Allocates storage for RPC transactions. The RPC stubs will either call
  28. MIDL_user_allocate when it needs to un-marshall data into a buffer
  29. that the user must free. RPC servers will use MIDL_user_allocate to
  30. allocate storage that the RPC server stub will free after marshalling
  31. the data.
  32. Arguments:
  33. NumBytes - The number of bytes to allocate.
  34. Return Value:
  35. none
  36. Note:
  37. --*/
  38. {
  39. return MIDL_user_allocate1(NumBytes);
  40. }
  41. VOID
  42. MIDL_user_free (
  43. IN void *MemPointer
  44. )
  45. /*++
  46. Routine Description:
  47. Frees storage used in RPC transactions. The RPC client can call this
  48. function to free buffer space that was allocated by the RPC client
  49. stub when un-marshalling data that is to be returned to the client.
  50. The Client calls MIDL_user_free when it is finished with the data and
  51. desires to free up the storage.
  52. The RPC server stub calls MIDL_user_free when it has completed
  53. marshalling server data that is to be passed back to the client.
  54. Arguments:
  55. MemPointer - This points to the memory block that is to be released.
  56. Return Value:
  57. none.
  58. Note:
  59. --*/
  60. {
  61. MIDL_user_free1(MemPointer);
  62. }