|
1 | 1 | use windows::Abi;
|
2 | 2 |
|
3 | 3 | use tests::{
|
| 4 | + windows::win32::com::CreateUri, |
| 5 | + windows::win32::debug::{MiniDumpWriteDump, MINIDUMP_TYPE}, |
| 6 | + windows::win32::direct3d11::D3DDisassemble11Trace, |
4 | 7 | windows::win32::direct3d12::D3D12_DEFAULT_BLEND_FACTOR_ALPHA,
|
5 | 8 | windows::win32::direct3d_hlsl::D3DCOMPILER_DLL,
|
6 | 9 | windows::win32::display_devices::RECT,
|
7 | 10 | windows::win32::dxgi::{
|
8 | 11 | CreateDXGIFactory1, IDXGIFactory7, DXGI_ADAPTER_FLAG, DXGI_FORMAT, DXGI_MODE_DESC,
|
9 | 12 | DXGI_MODE_SCALING, DXGI_MODE_SCANLINE_ORDER, DXGI_RATIONAL,
|
10 | 13 | },
|
| 14 | + windows::win32::game_mode::HasExpandedResources, |
11 | 15 | windows::win32::ldap::ldapsearch,
|
12 | 16 | windows::win32::security::ACCESS_MODE,
|
13 | 17 | windows::win32::structured_storage::{CreateStreamOnHGlobal, STREAM_SEEK},
|
@@ -246,6 +250,45 @@ fn com_inheritance() {
|
246 | 250 | }
|
247 | 251 | }
|
248 | 252 |
|
| 253 | +// Tests for https://github.com/microsoft/windows-rs/issues/463 |
| 254 | +#[test] |
| 255 | +fn onecore_imports() -> windows::Result<()> { |
| 256 | + unsafe { |
| 257 | + let mut has_expanded_resources = 0; |
| 258 | + HasExpandedResources(&mut has_expanded_resources).ok()?; |
| 259 | + |
| 260 | + let mut uri = None; |
| 261 | + let uri = CreateUri( |
| 262 | + windows::HString::from("http://kennykerr.ca") |
| 263 | + .as_wide() |
| 264 | + .as_ptr(), |
| 265 | + 0, |
| 266 | + 0, |
| 267 | + &mut uri, |
| 268 | + ) |
| 269 | + .and_some(uri)?; |
| 270 | + |
| 271 | + let mut port = 0; |
| 272 | + uri.GetPort(&mut port).ok()?; |
| 273 | + assert!(port == 80); |
| 274 | + |
| 275 | + let result = MiniDumpWriteDump( |
| 276 | + HANDLE(0), |
| 277 | + 0, |
| 278 | + HANDLE(0), |
| 279 | + MINIDUMP_TYPE::MiniDumpNormal, |
| 280 | + std::ptr::null_mut(), |
| 281 | + std::ptr::null_mut(), |
| 282 | + std::ptr::null_mut(), |
| 283 | + ); |
| 284 | + assert!(result.is_err()); |
| 285 | + |
| 286 | + assert!(D3DDisassemble11Trace(std::ptr::null_mut(), 0, None, 0, 0, 0, &mut None).is_err()); |
| 287 | + |
| 288 | + Ok(()) |
| 289 | + } |
| 290 | +} |
| 291 | + |
249 | 292 | // TODO: light up BSTR as windows::BString
|
250 | 293 |
|
251 | 294 | // #[test]
|
|
0 commit comments