Skip to content

Commit

Permalink
Support casted OSData reads
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Jul 17, 2018
1 parent 9dd645c commit b3e58d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Lilu/Headers/kern_iokit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ namespace WIOKit {
return false;
}

template <typename AS, typename T>
inline bool getOSDataValue(const OSObject *obj, const char *name, T &value) {
AS tmp;
if (getOSDataValue(obj, name, tmp)) {
value = static_cast<T>(tmp);
return true;
}

return false;
}

/**
* Read typed OSData from IORegistryEntry
*
Expand Down

0 comments on commit b3e58d5

Please sign in to comment.