feat: add wrapper for WFHasPrivilege in c++ header

This commit is contained in:
2026-08-17 10:22:37 +08:00
parent 36330437de
commit d2e5bcf2ed
+12
View File
@@ -79,6 +79,18 @@ inline void _Check(wfassoc::WFError result) {
} }
} }
/**
* @brief Check if the current process has administrative privileges
*
* @return true if the current process has administrative privileges, false otherwise
* @throws std::runtime_error if the operation fails
*/
inline bool HasPrivilege() {
bool result = false;
_Check(wfassoc::WFHasPrivilege(&result));
return result;
}
/** /**
* @brief Schema object for defining a program's file association configuration * @brief Schema object for defining a program's file association configuration
* *