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.

56 lines
1.0 KiB

  1. // $Header: G:/SwDev/WDM/Video/bt848/rcs/Pspagebl.h 1.7 1998/04/29 22:43:36 tomz Exp $
  2. #ifndef __PSPAGEBL_H
  3. #define __PSPAGEBL_H
  4. #ifndef __MYTYPES_H
  5. #include "mytypes.h"
  6. #endif
  7. #ifndef __PHYSADDR_H
  8. #include "physaddr.h"
  9. #endif
  10. // unlike things in ks.h, this is a real forward declaration
  11. extern PVOID gpHwDeviceExtension;
  12. /* Class: PsPageBlock
  13. * Purpose: Encapsulates memory allocations for the data buffers and RISC programs
  14. */
  15. class PsPageBlock
  16. {
  17. protected:
  18. DWORD PhysAddr_;
  19. PVOID LinAddr_;
  20. void AllocateSpace( DWORD dwSize );
  21. void FreeSpace();
  22. public:
  23. PsPageBlock( DWORD dwSize );
  24. ~PsPageBlock();
  25. DWORD GetPhysAddr();
  26. DWORD getLinearBase();
  27. };
  28. inline PsPageBlock::PsPageBlock( DWORD dwSize )
  29. {
  30. AllocateSpace( dwSize );
  31. }
  32. inline PsPageBlock::~PsPageBlock()
  33. {
  34. FreeSpace();
  35. }
  36. inline DWORD PsPageBlock::GetPhysAddr()
  37. {
  38. return PhysAddr_;
  39. }
  40. inline DWORD PsPageBlock::getLinearBase()
  41. {
  42. return (DWORD)LinAddr_;
  43. }
  44. #endif