#![allow(non_snake_case)]
use crate::advapi_shell::ffi;
use crate::co;
use crate::decl::*;
use crate::kernel::privs::*;
use crate::ole::privs::*;
pub fn ShellExecuteEx(exec_info: &SHELLEXECUTEINFO) -> SysResult<()> {
let mut buf = exec_info.to_raw();
BoolRet(unsafe { ffi::ShellExecuteExW(pvoid(&mut buf.raw)) }).to_sysresult()
}
#[must_use]
pub fn SHGetKnownFolderPath(
folder_id: &co::KNOWNFOLDERID,
flags: co::KF,
token: Option<&HACCESSTOKEN>,
) -> HrResult<String> {
let mut pstr = std::ptr::null_mut::<u16>();
HrRet(unsafe {
ffi::SHGetKnownFolderPath(
pcvoid(folder_id),
flags.raw(),
token.map_or(std::ptr::null_mut(), |t| t.ptr()),
&mut pstr,
)
})
.to_hrresult()
.map(|_| htaskmem_ptr_to_str(pstr))
}