Skip to content

Commit

Permalink
fix(junowen): crash
Browse files Browse the repository at this point in the history
  • Loading branch information
progre committed May 14, 2024
1 parent baaa507 commit feb1df3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions junowen/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use tracing::error;
use windows::{
core::PCWSTR,
Win32::{
Foundation::{HANDLE, HMODULE},
Foundation::{HANDLE, HMODULE, MAX_PATH},
System::LibraryLoader::GetModuleFileNameW,
UI::Shell::{FOLDERID_RoamingAppData, SHGetKnownFolderPath, KNOWN_FOLDER_FLAG},
},
};

pub fn to_dll_path(module: HMODULE) -> PathBuf {
let mut buf = [0u16; u16::MAX as usize];
let mut buf = [0u16; MAX_PATH as usize];
if unsafe { GetModuleFileNameW(module, &mut buf) } == 0 {
panic!();
}
Expand Down

0 comments on commit feb1df3

Please sign in to comment.