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.

44 lines
946 B

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File:
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. ///////////////////////////////////////////////////////////////////////////////
  13. LICENSE_STATUS
  14. LicenseMemoryAllocate( ULONG Length, PVOID UNALIGNED * ppMemory )
  15. {
  16. if( 0 == Length )
  17. {
  18. return( LICENSE_STATUS_INVALID_INPUT );
  19. }
  20. *ppMemory = LocalAlloc( LMEM_ZEROINIT, Length );
  21. if( NULL == *ppMemory )
  22. {
  23. return( LICENSE_STATUS_OUT_OF_MEMORY );
  24. }
  25. return( LICENSE_STATUS_OK );
  26. }
  27. ///////////////////////////////////////////////////////////////////////////////
  28. VOID
  29. LicenseMemoryFree( PVOID UNALIGNED * ppMemory )
  30. {
  31. if( NULL == *ppMemory )
  32. {
  33. return;
  34. }
  35. LocalFree( *ppMemory );
  36. *ppMemory = NULL;
  37. }