From b3e58d54211b4a92ac9916f2a0a969197a0fbb71 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Tue, 17 Jul 2018 21:46:58 +0300 Subject: [PATCH] Support casted OSData reads --- Lilu/Headers/kern_iokit.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Lilu/Headers/kern_iokit.hpp b/Lilu/Headers/kern_iokit.hpp index ea407d70..1fa4e3af 100644 --- a/Lilu/Headers/kern_iokit.hpp +++ b/Lilu/Headers/kern_iokit.hpp @@ -50,6 +50,17 @@ namespace WIOKit { return false; } + template + inline bool getOSDataValue(const OSObject *obj, const char *name, T &value) { + AS tmp; + if (getOSDataValue(obj, name, tmp)) { + value = static_cast(tmp); + return true; + } + + return false; + } + /** * Read typed OSData from IORegistryEntry *