Skip to content

Commit

Permalink
Registry buffer may shrink; #148.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigocfd committed Feb 11, 2025
1 parent a8f5d3a commit 886cf5a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/advapi/handles/hkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,12 @@ pub trait advapi_Hkey: Handle {
) as _,
)
} {
co::ERROR::SUCCESS => return Ok(
unsafe {
co::ERROR::SUCCESS => {
buf.resize(data_len as _, 0x00); // data length may have shrunk
return Ok(unsafe {
RegistryValue::from_raw(buf, co::REG::from_raw(data_type))
},
),
})
},
co::ERROR::MORE_DATA => continue, // value changed in a concurrent operation; retry
e => return Err(e),
}
Expand Down

0 comments on commit 886cf5a

Please # to comment.