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.

103 lines
3.5 KiB

  1. /*
  2. (C) Copyright 1998
  3. All rights reserved.
  4. Portions of this software are:
  5. (C) Copyright 1995 TriplePoint, Inc. -- http://www.TriplePoint.com
  6. License to use this software is granted under the same terms
  7. outlined in the Microsoft Windows Device Driver Development Kit.
  8. (C) Copyright 1992 Microsoft Corp. -- http://www.Microsoft.com
  9. License to use this software is granted under the terms outlined in
  10. the Microsoft Windows Device Driver Development Kit.
  11. @doc INTERNAL TpiMem TpiMem_h
  12. @module TpiMem.h |
  13. This module defines the interface to the memory allocation wrappers.
  14. @head3 Contents |
  15. @index class,mfunc,func,msg,mdata,struct,enum | TpiMem_h
  16. @end
  17. */
  18. #ifndef _TPIMEM_H
  19. #define _TPIMEM_H
  20. #include <ndis.h>
  21. #define TPIMEMORY_OBJECT_TYPE ((ULONG)'T')+\
  22. ((ULONG)'M'<<8)+\
  23. ((ULONG)'E'<<16)+\
  24. ((ULONG)'M'<<24)
  25. #define ALLOCATE_MEMORY(pObject, dwSize, MiniportAdapterHandle)\
  26. TpiAllocateMemory((PVOID *)&(pObject), dwSize,\
  27. __FILEID__, __FILE__, __LINE__,\
  28. MiniportAdapterHandle)
  29. #define FREE_MEMORY(pObject, dwSize)\
  30. TpiFreeMemory((PVOID *)&(pObject), dwSize,\
  31. __FILEID__, __FILE__, __LINE__)
  32. #define ALLOCATE_OBJECT(pObject, MiniportAdapterHandle)\
  33. ALLOCATE_MEMORY(pObject, sizeof(*(pObject)), MiniportAdapterHandle)
  34. #define FREE_OBJECT(pObject)\
  35. FREE_MEMORY(pObject, sizeof(*(pObject)))
  36. #define FREE_NDISSTRING(ndisString)\
  37. FREE_MEMORY(ndisString.Buffer, ndisString.MaximumLength)
  38. NDIS_STATUS TpiAllocateMemory(
  39. OUT PVOID * ppObject,
  40. IN ULONG dwSize,
  41. IN ULONG dwFileID,
  42. IN LPSTR szFileName,
  43. IN ULONG dwLineNumber,
  44. IN NDIS_HANDLE MiniportAdapterHandle
  45. );
  46. void TpiFreeMemory(
  47. IN OUT PVOID * ppObject,
  48. IN ULONG dwSize,
  49. IN ULONG dwFileID,
  50. IN LPSTR szFileName,
  51. IN ULONG dwLineNumber
  52. );
  53. NDIS_STATUS TpiAllocateSharedMemory(
  54. IN NDIS_HANDLE MiniportAdapterHandle,
  55. IN ULONG dwSize,
  56. IN BOOLEAN bCached,
  57. OUT PVOID * pVirtualAddress,
  58. OUT NDIS_PHYSICAL_ADDRESS * pPhysicalAddress,
  59. IN ULONG dwFileID,
  60. IN LPSTR szFileName,
  61. IN ULONG dwLineNumber
  62. );
  63. void TpiFreeSharedMemory(
  64. IN NDIS_HANDLE MiniportAdapterHandle,
  65. IN ULONG dwSize,
  66. IN BOOLEAN bCached,
  67. OUT PVOID * pVirtualAddress,
  68. OUT NDIS_PHYSICAL_ADDRESS * pPhysicalAddress,
  69. IN ULONG dwFileID,
  70. IN LPSTR szFileName,
  71. IN ULONG dwLineNumber
  72. );
  73. extern NDIS_PHYSICAL_ADDRESS g_HighestAcceptableAddress;
  74. #endif // _TPIMEM_H