{"id":32945906,"url":"https://github.com/CodefoundryDE/LegacyWrapper","last_synced_at":"2025-11-12T20:00:43.868Z","repository":{"id":56637615,"uuid":"42547458","full_name":"CodefoundryDE/LegacyWrapper","owner":"CodefoundryDE","description":"LegacyWrapper uses a x86 wrapper to call legacy dlls from a 64 bit process (or vice versa).","archived":false,"fork":false,"pushed_at":"2022-04-12T08:24:08.000Z","size":482,"stargazers_count":83,"open_issues_count":19,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-21T10:51:27.396Z","etag":null,"topics":["csharp","dll","dotnet","hacktoberfest","interop","nuget"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodefoundryDE.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-15T21:24:33.000Z","updated_at":"2025-06-03T09:38:12.000Z","dependencies_parsed_at":"2022-08-15T22:20:47.013Z","dependency_job_id":null,"html_url":"https://github.com/CodefoundryDE/LegacyWrapper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/CodefoundryDE/LegacyWrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodefoundryDE%2FLegacyWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodefoundryDE%2FLegacyWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodefoundryDE%2FLegacyWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodefoundryDE%2FLegacyWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodefoundryDE","download_url":"https://codeload.github.com/CodefoundryDE/LegacyWrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodefoundryDE%2FLegacyWrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284100246,"owners_count":26947309,"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","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csharp","dll","dotnet","hacktoberfest","interop","nuget"],"created_at":"2025-11-12T18:00:25.874Z","updated_at":"2025-11-12T20:00:43.863Z","avatar_url":"https://github.com/CodefoundryDE.png","language":"C#","funding_links":[],"categories":["Interoperability","互操作"],"sub_categories":[],"readme":"# LegacyWrapper\n\n## About\n\nLegacyWrapper uses a wrapper process to call dlls from a process of the opposing architecture (X86 or AMD64).\n\nSince you can't load a dll of another architecture directly, the wrapper utilizes a named pipe to abstract the call. You won't notice this though, because all the magic is hidden behind a single static method.\n\n## NuGet Package\n\nThere is a NuGet package available here: [Codefoundry.LegacyWrapper @ nuget.org](https://www.nuget.org/packages/Codefoundry.LegacyWrapper/)\n\n## Usage\n\nIf you want to compile the LegacyWrapper yourself, make sure to place both the wrapper executable, LegacyWrapperClient.dll and LegacyWrapper.Common.dll in your directory.\n\n```csharp\n// Define a proxy interface with matching method names and signatures\n// The interface must be derived from IDisposable!\n[LegacyDllImport(\"User32.dll\")]\npublic interface IUser32Dll : IDisposable\n{\n    [LegacyDllMethod(CallingConvention = CallingConvention.Winapi)]\n    int GetSystemMetrics(int nIndex);\n}\n\n// Create configuration\nIWrapperConfig configuration = WrapperConfigBuilder.Create()\n        .TargetArchitecture(TargetArchitecture.X86)\n        .Build();\n\n// Create new Wrapper client providing the proxy interface\n// Remember to ensure a call to the Dispose()-Method!\nusing (var client = WrapperProxyFactory\u003cIUser32Dll\u003e.GetInstance(configuration))\n{\n    // Make calls - it's that simple!\n    int x = client.GetSystemMetrics(0);\n    int y = client.GetSystemMetrics(1);\n}\n```\n\nPlease note that loading a 64bit dll will only work on 64bit operating systems.\n\n## Further reading\n\nView [this blog post](https://codefoundry.de/programming/2015/09/28/legacy-wrapper-invoking-an-unmanaged-32bit-library-out-of-a-64bit-process.html) to obtain a basic understanding of how the library works internally. \n\n* [There is also a blog post about the dynamic method call feature in LegacyWrapper 3.0](https://codefoundry.de/programming/2019/02/03/legacywrapper-3-0-released.html).\n* [There is also a blog post about the new 64bit feature in LegacyWrapper 2.1](https://codefoundry.de/programming/2017/08/20/legacywrapper-2-1-is-out.html).\n\n## Contributing\n\nFeel free to submit any [suggestions/issues](https://github.com/CodefoundryDE/LegacyWrapper/issues) and contribute to LegacyWrapper.\n\n## License\n\nCopyright (c) 2019, Franz Wimmer. (MIT License)\n\nSee LICENSE for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodefoundryDE%2FLegacyWrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodefoundryDE%2FLegacyWrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodefoundryDE%2FLegacyWrapper/lists"}