{"id":18406501,"url":"https://github.com/georgiifirsov/dllhandler","last_synced_at":"2026-04-30T13:34:27.954Z","repository":{"id":159273948,"uuid":"223491514","full_name":"GeorgiiFirsov/DllHandler","owner":"GeorgiiFirsov","description":"Class that provides automatic DLL handle release and allow you to use exported functions much more easily in comparison to standard WinAPI way.","archived":false,"fork":false,"pushed_at":"2019-11-26T09:58:47.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-30T13:34:26.563Z","etag":null,"topics":["cplusplus","cplusplus-14","dll","library","winapi","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeorgiiFirsov.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}},"created_at":"2019-11-22T21:44:30.000Z","updated_at":"2019-11-26T09:58:49.000Z","dependencies_parsed_at":"2023-06-11T12:45:10.684Z","dependency_job_id":null,"html_url":"https://github.com/GeorgiiFirsov/DllHandler","commit_stats":null,"previous_names":["georgiifirsov/dllhandler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeorgiiFirsov/DllHandler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FDllHandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FDllHandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FDllHandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FDllHandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeorgiiFirsov","download_url":"https://codeload.github.com/GeorgiiFirsov/DllHandler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FDllHandler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"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":["cplusplus","cplusplus-14","dll","library","winapi","windows"],"created_at":"2024-11-06T03:09:20.558Z","updated_at":"2026-04-30T13:34:27.937Z","avatar_url":"https://github.com/GeorgiiFirsov.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DllHandler\n[![Version][]]() [![Tests][]]() [![License][]]()\n\n[Version]:\t\t   https://img.shields.io/badge/Version-v1.0-blue\n[Tests]:\t\t   https://img.shields.io/badge/Tests-passed-brightgreen\n[License]:\t\t   https://img.shields.io/badge/License-GNU%20GPL%20v.3-blue\n\nThis is a wrapper over Windows' dll `HMODULE`. This class provides automatic release of handle at exit from scope.\n\n### Usage\nThis class has really simple usage:\n\n```cpp\nCDllHandler hDll;\n\nhDll = LoadLibraryW( L\"Ntdll.dll\" );\n\n// Here you can use it as normal HMODULE handle\n\n// No need to release\n```\n\nBut the main feature of this small library is possibility to easily use exported functions.\nHere is an example:\n\n```cpp\n// ...\n\nusing PRtlComputeCrc32 = DWORD(__stdcall *)( DWORD, const BYTE*, INT );\n\n// It is a class declaration.\n// This class can be local - it contains no static members\nDLL_BEGIN( CNtLib, L\"Ntdll.dll\" )\n    DLL_FUNCTION( PRtlComputeCrc32, RtlComputeCrc32 )\nDLL_END;\n\ntry\n{\n    CNtLib NtLib;  // \u003c- this object contains dll\n    DWORD dwHash = NtLib.RtlComputeCrc32( 0, pData, GetSize( pData ) );\n    // That's it! Nothing more to do to use exported functions!\n    // ...\n}\ncatch( const CWin32Error\u0026 e )\n{\n    // Handle error\n}\n```\n\nThe main goal is to write code like above (just 5 lines) to call a dll's function instead of this:\n```cpp\nusing PRtlComputeCrc32 = DWORD(__stdcall *)( DWORD, const BYTE*, INT );\n\nHMODULE hDll = LoadLibrary( L\"Ntdll.dll\" );\nif(!hDll) {\n    // Handle error\n}\n\nauto pRtlComputeCrc32 = reinterpret_cast\u003cPRtlComputeCrc32\u003e(\n    GetProcAddress( hDll, \"RtlComputeCrc32\" )\n);\nif(pRtlComputeCrc32) {\n    // Handle error\n}\n\nDWORD dwHash = pRtlComputeCrc32( 0, pData, GetSize( pData ) );\n```\nThis solution is less memory-leak-safe and more complicated to use.\n\nIn case of any error during library loading or function search this class (and helper template) generates a `CWin32Error` exception, \nthat contains an error code and its description:\n\n```cpp\ntry\n{\n    // ...\n}\n\ncatch( const CWin32Error\u0026 e )\n{\n    e.Code()         // Obtain error code\n    e.Description()  // Obtain error description (available only for system errors)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiifirsov%2Fdllhandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgiifirsov%2Fdllhandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiifirsov%2Fdllhandler/lists"}