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.

79 lines
1.9 KiB

  1. /*******************************************************************************
  2. * MEMORY.C
  3. *
  4. * Memory allocation routines
  5. *
  6. * Copyright Citrix Systems Inc. 1996
  7. * Copyright (C) 1997-1999 Microsoft Corp.
  8. *
  9. * Author: Brad Pedersen
  10. ******************************************************************************/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. /*=============================================================================
  14. == External Functions Defined
  15. =============================================================================*/
  16. NTSTATUS IcaMemoryAllocate( ULONG, PVOID * );
  17. VOID IcaMemoryFree( PVOID );
  18. /*=============================================================================
  19. == Internal Functions Defined
  20. =============================================================================*/
  21. /*******************************************************************************
  22. *
  23. * IcaMemoryAllocate
  24. *
  25. * This routine allocate a block of memory
  26. *
  27. * ENTRY:
  28. * Length (input)
  29. * length of memory to allocate
  30. * ppMemory (output)
  31. * address to return pointer to memory
  32. *
  33. * EXIT:
  34. * STATUS_SUCCESS - no error
  35. *
  36. ******************************************************************************/
  37. NTSTATUS
  38. IcaMemoryAllocate( ULONG Length, PVOID * ppMemory )
  39. {
  40. ASSERT( Length > 0 );
  41. *ppMemory = LocalAlloc( 0, Length );
  42. if ( *ppMemory == NULL )
  43. return( STATUS_NO_MEMORY );
  44. return( STATUS_SUCCESS );
  45. }
  46. /*******************************************************************************
  47. *
  48. * IcaMemoryFree
  49. *
  50. * This routine frees a block of memory allocated by "MemoryAllocate"
  51. *
  52. * ENTRY:
  53. * pMemory (output)
  54. * pointer to memory to free
  55. *
  56. * EXIT:
  57. * nothing
  58. *
  59. ******************************************************************************/
  60. VOID
  61. IcaMemoryFree( PVOID pMemory )
  62. {
  63. LocalFree( pMemory );
  64. }