Skip to content

Commit b3e58d5

Browse files
committed
Support casted OSData reads
1 parent 9dd645c commit b3e58d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lilu/Headers/kern_iokit.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ namespace WIOKit {
5050
return false;
5151
}
5252

53+
template <typename AS, typename T>
54+
inline bool getOSDataValue(const OSObject *obj, const char *name, T &value) {
55+
AS tmp;
56+
if (getOSDataValue(obj, name, tmp)) {
57+
value = static_cast<T>(tmp);
58+
return true;
59+
}
60+
61+
return false;
62+
}
63+
5364
/**
5465
* Read typed OSData from IORegistryEntry
5566
*

0 commit comments

Comments
 (0)