{"id":21327882,"url":"https://github.com/SiddiqSoft/acw32h","last_synced_at":"2025-07-12T07:31:42.501Z","repository":{"id":142736448,"uuid":"383629151","full_name":"SiddiqSoft/acw32h","owner":"SiddiqSoft","description":"Auto Close Win32 Handles such as HANDLE and HINTERNET. Use nuget package https://www.nuget.org/packages/SiddiqSoft.acw32h/","archived":false,"fork":false,"pushed_at":"2024-12-07T09:22:36.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T06:47:57.952Z","etag":null,"topics":["handle","hinternet","win32"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiddiqSoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-07T00:19:32.000Z","updated_at":"2024-12-07T09:20:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"3817fc6f-a526-429c-ab72-131f19d541c7","html_url":"https://github.com/SiddiqSoft/acw32h","commit_stats":null,"previous_names":["siddiqsoft/acw32h","siddiqsoft/acw32handle"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/SiddiqSoft/acw32h","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddiqSoft%2Facw32h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddiqSoft%2Facw32h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddiqSoft%2Facw32h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddiqSoft%2Facw32h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiddiqSoft","download_url":"https://codeload.github.com/SiddiqSoft/acw32h/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiddiqSoft%2Facw32h/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958135,"owners_count":23689006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["handle","hinternet","win32"],"created_at":"2024-11-21T21:20:22.406Z","updated_at":"2025-07-12T07:31:42.494Z","avatar_url":"https://github.com/SiddiqSoft.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Auto Closing/Releasing Win32 Handle Objects\n-------------------------------------------\n\n[![CodeQL](https://github.com/SiddiqSoft/acw32handle/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/SiddiqSoft/acw32handle/actions/workflows/codeql-analysis.yml)\n[![Build Status](https://dev.azure.com/siddiqsoft/siddiqsoft/_apis/build/status/SiddiqSoft.acw32handle?branchName=main)](https://dev.azure.com/siddiqsoft/siddiqsoft/_build/latest?definitionId=4\u0026branchName=main)\n![](https://img.shields.io/nuget/v/SiddiqSoft.acw32h)\n![](https://img.shields.io/github/v/tag/SiddiqSoft/acw32handle)\n![](https://img.shields.io/azure-devops/tests/siddiqsoft/siddiqsoft/4)\n![](https://img.shields.io/azure-devops/coverage/siddiqsoft/siddiqsoft/4)\n\n# Objective\nMake it easy to track the Win32 `HANDLE` and `HINTERNET` objects while keeping their use as drop-in replacement for their respective `HANDLE` or `HINTERNET` objects.\nUse only when you're holding objects that your application is required to close/release.\n\n# Requirements\n- C++17\n- Useful for Windows projects\n\n# Usage\n\n- Use the nuget [SiddiqSoft.acw32h](https://www.nuget.org/packages/SiddiqSoft.acw32h/)\n- Be sure to use the proper class `ACW32HANDLE` or `ACW32HINTERNET`. The underlying types of `HANDLE` and `HINTERNET` end up the same so it is not possible to template them into a single class.\n- Make sure to include the relevant file for your case: `acw32handle.hpp` or `acw32hinternet.hpp` as windows headers occasionally have peculiar ordering (notably when WinHTTP, WinINET, WinSock are in the mix).\n\nExample (when using nuget to add the header in the solution)\n\n```cpp\n#include \u003cwindows.h\u003e\n#include \"siddiqsoft/acw32handle.hpp\"\n#include \u003cwinhttp.h\u003e\n#include \"siddiqsoft/acw32hinternet.hpp\"\n\nvoid foo()\n{\n   // Use the object\n   siddiqsoft::ACW32HANDLE h( ::CreateFileA(...) );\n\n   // or\n   HANDLE mh = ::CreateFile(.....);\n   // A std::move is required since the implementation requires\n   // the transfer of ownership in order to close the handle.\n   ACW32HANDLE myHandle( std::move(mh) );\n\n   // C++ will cleanup the handle if it was properly allocated!\n}\n\n```\n\n\u003csmall align=\"right\"\u003e\n\n\u0026copy; 2021 Siddiq Software LLC. All rights reserved. Refer to [LICENSE](LICENSE).\n\n\u003c/small\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiddiqSoft%2Facw32h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSiddiqSoft%2Facw32h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSiddiqSoft%2Facw32h/lists"}