SiddiqSoft.acw32h 2.7.1

Install-Package SiddiqSoft.acw32h -Version 2.7.1
dotnet add package SiddiqSoft.acw32h --version 2.7.1
<PackageReference Include="SiddiqSoft.acw32h" Version="2.7.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.acw32h --version 2.7.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SiddiqSoft.acw32h, 2.7.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SiddiqSoft.acw32h as a Cake Addin
#addin nuget:?package=SiddiqSoft.acw32h&version=2.7.1

// Install SiddiqSoft.acw32h as a Cake Tool
#tool nuget:?package=SiddiqSoft.acw32h&version=2.7.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Auto Closing/Releasing Win32 Handle Objects

CodeQL Build Status

Objective

Make 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. Use only when you're holding objects that your application is required to close/release.

Requirements

  • C++17
  • Useful for Windows projects

Usage

  • Use the nuget SiddiqSoft.acw32h
  • 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.
  • 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).

Example (when using nuget to add the header in the solution)

#include <windows.h>
#include "siddiqsoft/acw32handle.hpp"
#include <winhttp.h>
#include "siddiqsoft/acw32hinternet.hpp"

void foo()
{
   // Use the object
   siddiqsoft::ACW32HANDLE h( ::CreateFileA(...) );

   // or
   HANDLE mh = ::CreateFile(.....);
   // A std::move is required since the implementation requires
   // the transfer of ownership in order to close the handle.
   ACW32HANDLE myHandle( std::move(mh) );

   // C++ will cleanup the handle if it was properly allocated!
}

<small align="right">

© 2021 Siddiq Software LLC. All rights reserved. Refer to LICENSE.

</small>

Product Versions
native native
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SiddiqSoft.acw32h:

Package Downloads
SiddiqSoft.restcl

Focussed REST Client for modern C++

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.7.1 496 11/20/2021
2.7.0 836 9/10/2021