Remove LPWSTR

This commit is contained in:
Chris Denton 2024-07-14 06:45:15 +00:00
parent b107cfa73c
commit e70cc28831
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE
3 changed files with 8 additions and 10 deletions

View File

@ -28,8 +28,6 @@ pub type LPCVOID = *const c_void;
pub type LPOVERLAPPED = *mut OVERLAPPED;
pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
pub type LPVOID = *mut c_void;
pub type LPWCH = *mut WCHAR;
pub type LPWSTR = *mut WCHAR;
#[cfg(target_vendor = "win7")]
pub type PSRWLOCK = *mut SRWLOCK;

View File

@ -81,7 +81,7 @@ pub fn error_string(mut errnum: i32) -> String {
}
pub struct Env {
base: c::LPWCH,
base: *mut c::WCHAR,
iter: EnvIterator,
}
@ -126,7 +126,7 @@ impl Iterator for Env {
}
#[derive(Clone)]
struct EnvIterator(c::LPWCH);
struct EnvIterator(*mut c::WCHAR);
impl Iterator for EnvIterator {
type Item = (OsString, OsString);

View File

@ -182,12 +182,12 @@ fn write_valid_utf8_to_console(handle: c::HANDLE, utf8: &str) -> io::Result<usiz
// Note that this theoretically checks validity twice in the (most common) case
// where the underlying byte sequence is valid utf-8 (given the check in `write()`).
let result = c::MultiByteToWideChar(
c::CP_UTF8, // CodePage
c::MB_ERR_INVALID_CHARS, // dwFlags
utf8.as_ptr(), // lpMultiByteStr
utf8.len() as c::c_int, // cbMultiByte
utf16.as_mut_ptr() as c::LPWSTR, // lpWideCharStr
utf16.len() as c::c_int, // cchWideChar
c::CP_UTF8, // CodePage
c::MB_ERR_INVALID_CHARS, // dwFlags
utf8.as_ptr(), // lpMultiByteStr
utf8.len() as c::c_int, // cbMultiByte
utf16.as_mut_ptr() as *mut c::WCHAR, // lpWideCharStr
utf16.len() as c::c_int, // cchWideChar
);
assert!(result != 0, "Unexpected error in MultiByteToWideChar");