1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Thin safe wrappers around Win32 / WinHTTP / ICU FFI calls.
//!
//! Every raw `windows_sys` call used by wrest lives in this module tree.
//! The rest of the crate never touches `unsafe` Win32 FFI directly -- it
//! calls these helpers instead. Each wrapper:
//!
//! * returns `Result<T, Error>` so callers decide how to handle failures,
//! * performs any `&str` → null-terminated wide string conversions, and
//! * hides pointer arithmetic and `std::mem::size_of` boilerplate.
//!
//! The module is split into:
//!
//! * [`winhttp`] -- WinHTTP session, request, query, and I/O wrappers
//! * [`encoding`] -- `MultiByteToWideChar` (NLS) and ICU charset decoding
// Re-export everything so callers use `crate::abi::winhttp_open_session` etc.
pub use *;
pub use *;
use crateError;
use GetLastError;
// ---------------------------------------------------------------------------
// Low-level result helpers
// ---------------------------------------------------------------------------
/// Build an [`Error`] from the calling thread's last Win32 error.
/// Map a Win32 `BOOL` (`i32`) return value to `Result`.
// ---------------------------------------------------------------------------
// Wide-string helpers
// ---------------------------------------------------------------------------
/// Encode a Rust `&str` as a null-terminated UTF-16 wide string.
// ---------------------------------------------------------------------------
// Tests
// ---------------------------------------------------------------------------