mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Remove LPWSTR
This commit is contained in:
parent
b107cfa73c
commit
e70cc28831
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user