ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

P/Invoke各种总结(九、如何快速获取P/Invoke方法签名)

2021-01-31 09:32:44  阅读:288  来源: 互联网

标签:Cryptography Invoke Windows dll 获取 API 签名 PInvoke Interface


使用API函数已经好几年了,封装函数签名基本是参照MSDN上的文档,然后再做数据类型对应。

虽然有 pinvoke.net 这个网站,但基本很少使用。一方面是想多动手,另一方面是因为各种数据类型基本都用过了,都能自己在C#中 对应 起来。

 

最近在逛github时,发现了一个官方的项目,https://github.com/dotnet/pinvoke,这个项目是流行操作系统的所有P/Invoke方法签名的库集合。

 

LibraryPackage nameDescription
advapi32.dll PInvoke.AdvApi32 Windows Advanced Services
bcrypt.dll PInvoke.BCrypt Windows Cryptography API: Next Generation
cabinet.dll PInvoke.Cabinet Cabinet API Functions
cfgmgr32.dll PInvoke.CfgMgr32 Device and Driver Installation
crypt32.dll PInvoke.Crypt32 Windows Cryptography API
DwmApi.dll PInvoke.DwmApi Desktop Window Manager
fusion.dll PInvoke.Fusion .NET Framework Fusion
gdi32.dll PInvoke.Gdi32 Windows Graphics Device Interface
hid.dll PInvoke.Hid Windows Human Interface Devices
iphlpapi.dll PInvoke.IPHlpApi IP Helper
kernel32.dll PInvoke.Kernel32 Windows Kernel API
magnification.dll PInvoke.Magnification Windows Magnification API
mscoree.dll PInvoke.MSCorEE .NET Framework CLR host
msi.dll PInvoke.Msi Microsoft Installer
ncrypt.dll PInvoke.NCrypt Windows Cryptography API: Next Generation
netapi32.dll PInvoke.NetApi32 Network Management
newdev.dll PInvoke.NewDev Device and Driver Installation
ntdll.dll PInvoke.NTDll Windows NTDll
psapi.dll PInvoke.Psapi Windows Process Status API
setupapi.dll PInvoke.SetupApi Windows setup API
SHCore.dll PInvoke.SHCore Windows Shell
shell32.dll PInvoke.Shell32 Windows Shell
user32.dll PInvoke.User32 Windows User Interface
userenv.dll PInvoke.Userenv Windows User Environment
uxtheme.dll PInvoke.UxTheme Windows Visual Styles
winusb.dll PInvoke.WinUsb USB Driver
WtsApi32.dll PInvoke.WtsApi32 Windows Remote Desktop Services

例如要使用User32中的ShowWindow函数

1、导入Nuget包(PInvoke.User32)

 

2、使用

标签:Cryptography,Invoke,Windows,dll,获取,API,签名,PInvoke,Interface
来源: https://www.cnblogs.com/zhaotianff/p/14351598.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有