6个版本

0.2.1 2021年2月25日
0.2.0 2021年1月14日
0.1.3 2020年1月22日
0.1.2 2019年7月12日
0.1.1 2019年6月9日

#244Windows API

Download history 25/week @ 2024-02-26 8/week @ 2024-03-11 15/week @ 2024-04-01

每月145次下载
dxplr 中使用

MIT/Apache

10KB
197

com_ptr

Windows COM接口的智能指针

示例

CreateDXGIFactory1 函数创建 ComPtr。

use winapi::shared::dxgi::*;
use winapi::um::winnt::HRESULT;
use winapi::Interface;
use com_ptr::{ComPtr, hresult};

fn create_dxgi_factory<T: Interface>() -> Result<ComPtr<T>, HRESULT> {
    ComPtr::new(|| {
        let mut obj = std::ptr::null_mut();
        let res = unsafe { CreateDXGIFactory1(&T::uuidof(), &mut obj) };
        hresult(obj as *mut T, res)
    })
}

许可证

在以下任一许可证下授权:

任选其一。

贡献

除非您明确声明,否则您提交给作品以供包含在内的任何贡献,根据Apache-2.0许可证的定义,应如上双授权,不附加任何额外条款或条件。

依赖项

~225KB