Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d621d21

Browse files
committedJul 15, 2024
Remove LPWSTR
1 parent 0b22ecb commit d621d21

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed
 

‎std/src/sys/pal/windows/c.rs

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub type LPCVOID = *const c_void;
2828
pub type LPOVERLAPPED = *mut OVERLAPPED;
2929
pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
3030
pub type LPVOID = *mut c_void;
31-
pub type LPWCH = *mut WCHAR;
32-
pub type LPWSTR = *mut WCHAR;
3331

3432
#[cfg(target_vendor = "win7")]
3533
pub type PSRWLOCK = *mut SRWLOCK;

‎std/src/sys/pal/windows/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn error_string(mut errnum: i32) -> String {
8181
}
8282

8383
pub struct Env {
84-
base: c::LPWCH,
84+
base: *mut c::WCHAR,
8585
iter: EnvIterator,
8686
}
8787

@@ -126,7 +126,7 @@ impl Iterator for Env {
126126
}
127127

128128
#[derive(Clone)]
129-
struct EnvIterator(c::LPWCH);
129+
struct EnvIterator(*mut c::WCHAR);
130130

131131
impl Iterator for EnvIterator {
132132
type Item = (OsString, OsString);

‎std/src/sys/pal/windows/stdio.rs

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

0 commit comments

Comments
 (0)
Failed to load comments.