#[cfg(windows)]
use glib::translate::*;
#[cfg(windows)]
use std::path::PathBuf;
#[cfg(windows)]
use crate::ffi;
#[doc(alias = "g_win32_get_package_installation_directory_of_module")]
#[doc(alias = "get_package_installation_directory_of_module")]
#[cfg(any(windows, docsrs))]
pub fn package_installation_directory_of_module(
hmodule: std::os::windows::raw::HANDLE,
) -> Result<PathBuf, std::io::Error> {
match unsafe {
from_glib_full::<_, Option<PathBuf>>(
ffi::g_win32_get_package_installation_directory_of_module(hmodule),
)
} {
Some(pb) => Ok(pb),
None => Err(std::io::Error::last_os_error()),
}
}