#define WIN32_LEAN_AND_MEAN #include #include #include #include "portwell.hpp" int main() { if (!portwell::init()) return 1; constexpr std::uint64_t target = 0x1000; std::uint32_t value{}; if (!portwell::read_phys(target, &value, sizeof(value))) { std::println("[portwell] read_phys failed (GLE={})", GetLastError()); return 1; } std::println("[portwell] read_phys @ {:#x} -> {:#x}", target, value); value = 0x1337; if (!portwell::write_phys(target, &value, sizeof(value))) { std::println("[portwell] write_phys failed (GLE={})", GetLastError()); return 1; } std::println("[portwell] write_phys done!"); std::uint32_t result{}; if (!portwell::read_phys(target, &result, sizeof(result))) { std::println("[portwell] read_phys failed (GLE={})", GetLastError()); return 1; } std::println("[portwell] read_phys @ {:#x} -> {:#x}", target, result); return 0; }