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.

55 lines
1.5 KiB

  1. #include "os.h"
  2. // Read single byte from I/O.
  3. BYTE UL_READ_BYTE_IO(PVOID BaseAddress, DWORD OffSet)
  4. {
  5. return READ_PORT_UCHAR((PUCHAR)BaseAddress + OffSet)
  6. }
  7. // Write single byte to I/O.
  8. void UL_WRITE_BYTE_IO(PVOID BaseAddress, DWORD OffSet, BYTE Data)
  9. {
  10. WRITE_PORT_UCHAR((PUCHAR)BaseAddress + OffSet, Data);
  11. }
  12. // Read single byte from Memory.
  13. BYTE UL_READ_BYTE_MEM(PVOID BaseAddress, DWORD OffSet)
  14. {
  15. return READ_REGISTER_UCHAR((PUCHAR)BaseAddress + OffSet);
  16. }
  17. // Write single byte to Memory.
  18. void UL_WRITE_BYTE_MEM(PVOID BaseAddress, DWORD OffSet, BYTE Data)
  19. {
  20. WRITE_REGISTER_UCHAR((PUCHAR)BaseAddress + OffSet, Data);
  21. }
  22. // Read multiple bytes to I/O.
  23. void UL_READ_MULTIBYTES_IO(PVOID BaseAddress, DWORD OffSet, PBYTE pDest, DWORD NumberOfBytes)
  24. {
  25. READ_PORT_BUFFER_UCHAR((PUCHAR)BaseAddress + OffSet, pDest, NumberOfBytes);
  26. }
  27. // Write multiple bytes to I/O.
  28. void UL_WRITE_MULTIBYTES_IO(PVOID BaseAddress, DWORD OffSet, PBYTE pData, DWORD NumberOfBytes)
  29. {
  30. WRITE_PORT_BUFFER_UCHAR((PUCHAR)BaseAddress + OffSet, pData, NumberOfBytes);
  31. }
  32. // Read multiple bytes to Memory.
  33. void UL_READ_MULTIBYTES_MEM(PVOID BaseAddress, DWORD OffSet, PBYTE pDest, DWORD NumberOfBytes)
  34. {
  35. READ_REGISTER_BUFFER_UCHAR((PUCHAR)BaseAddress + OffSet, pDest, NumberOfBytes);
  36. }
  37. // Write multiple bytes to Memory.
  38. void UL_WRITE_MULTIBYTES_MEM(PVOID BaseAddress, DWORD OffSet, PBYTE pData, DWORD NumberOfBytes)
  39. {
  40. WRITE_REGISTER_BUFFER_UCHAR((PUCHAR)BaseAddress + OffSet, pData, NumberOfBytes);
  41. }