{"id":18248695,"url":"https://github.com/gabrielmajeri/comptr-rs","last_synced_at":"2026-04-30T14:36:58.514Z","repository":{"id":65427558,"uuid":"97243673","full_name":"GabrielMajeri/comptr-rs","owner":"GabrielMajeri","description":"Smart pointer for COM interfaces.","archived":false,"fork":false,"pushed_at":"2018-08-14T09:01:08.000Z","size":19,"stargazers_count":0,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T19:55:12.630Z","etag":null,"topics":["component-object-model","rust","windows"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GabrielMajeri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-14T14:41:35.000Z","updated_at":"2018-08-14T09:01:09.000Z","dependencies_parsed_at":"2023-01-23T04:25:10.899Z","dependency_job_id":null,"html_url":"https://github.com/GabrielMajeri/comptr-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GabrielMajeri/comptr-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielMajeri%2Fcomptr-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielMajeri%2Fcomptr-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielMajeri%2Fcomptr-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielMajeri%2Fcomptr-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabrielMajeri","download_url":"https://codeload.github.com/GabrielMajeri/comptr-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielMajeri%2Fcomptr-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component-object-model","rust","windows"],"created_at":"2024-11-05T09:38:04.171Z","updated_at":"2026-04-30T14:36:58.498Z","avatar_url":"https://github.com/GabrielMajeri.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comptr-rs\nSmart pointer for [Component Object Model](https://msdn.microsoft.com/en-us/library/windows/desktop/ms680573(v=vs.85).aspx) interfaces.\n\nThis crate is designed to be used together with `winapi-rs`. You can use the COM interfaces declared by it or use\n`RIDL!` macro from that same crate to declare your COM interfaces.\n\n## Non-null guarantee\nThe `ComPtr` type is built around the invariant that the pointer it manages will **never** be null. Since memory in COM is only freed when the last reference is released, and `ComPtr` only releases its reference when the destructor is run, the invariant is maintained.\n\n## Example\nThe following (not actually real) example shows how you would use the library:\n\n```rust\n// Import the crate.\nextern crate comptr;\nuse comptr::ComPtr;\n\n// This function is exported from some DLL.\nextern \"system\" {\n    fn CreateInterface(*mut *mut IUnknown);\n}\n\nlet interface = ComPtr::new({\n    let mut ptr = ptr::null_mut();\n\n    unsafe {\n        CreateInterface(\u0026mut ptr);\n    }\n\n    // The pointer must be non-null or undefined behaviour could occur.\n    if ptr == std::ptr::null_mut() {\n        panic!(\"Failed to create COM interface.\");\n    }\n\n    ptr\n});\n\n// Now you can use the interface, with 100% guarantee it is not null.\nunsafe {\n    interface.CallFunction();\n}\n```\n\n## Contributing\nIssues (i.e. feature requests and bug reports) and pull-requests are welcome!\n\nYou can also help by writing code that uses this crate. The more users it has,\nthe better tested in real-life scenarios it will be.\n\n## License\nThis crate is dual licensed under either of MIT / Apache 2.0, at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielmajeri%2Fcomptr-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielmajeri%2Fcomptr-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielmajeri%2Fcomptr-rs/lists"}