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.

77 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1999 Intel Corporation
  3. ModuleName:
  4. libBufferImage.c
  5. Abstract:
  6. Defines the routines to handle the image of the buffer in memory and
  7. provides access to handle whatever type it is - a file, disk, or memory
  8. image
  9. --*/
  10. #ifndef _LIB_BUFFER_IMAGE
  11. #define _LIB_BUFFER_IMAGE
  12. #include "libMisc.h"
  13. extern EE_FILE_IMAGE FileImage;
  14. extern EE_DISK_IMAGE DiskImage;
  15. extern EE_MEM_IMAGE MemImage;
  16. STATIC EFI_STATUS BufferImageInit (VOID);
  17. STATIC EFI_STATUS BufferImageCleanup (VOID);
  18. EE_BUFFER_IMAGE BufferImage = {
  19. NULL,
  20. NO_BUFFER,
  21. 0,
  22. BufferImageInit,
  23. BufferImageCleanup,
  24. Nothing,
  25. Nothing,
  26. Nothing,
  27. Nothing,
  28. Nothing,
  29. &FileImage,
  30. &DiskImage,
  31. &MemImage
  32. };
  33. STATIC
  34. EFI_STATUS
  35. BufferImageInit (
  36. VOID
  37. )
  38. {
  39. BufferImage.ListHead = AllocatePool(sizeof(LIST_ENTRY));
  40. InitializeListHead(BufferImage.ListHead);
  41. return EFI_SUCCESS;
  42. }
  43. STATIC
  44. EFI_STATUS
  45. BufferImageCleanup (
  46. VOID
  47. )
  48. {
  49. EE_LINE *Blank;
  50. BufferImage.Close();
  51. BufferImage.ImageCleanup();
  52. BufferImage.BufferType = NO_BUFFER;
  53. Blank = LineCurrent();
  54. RemoveEntryList(&Blank->Link);
  55. FreePool(Blank);
  56. FreePool(BufferImage.ListHead);
  57. return EFI_SUCCESS;
  58. }
  59. #endif /* _LIB_BUFFER_IMAGE */