惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
Simon Willison's Weblog
Simon Willison's Weblog
H
Help Net Security
F
Fortinet All Blogs
H
Heimdal Security Blog
S
Schneier on Security
L
LangChain Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
J
Java Code Geeks
博客园 - 【当耐特】
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
I
InfoQ
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
腾讯CDC
C
Check Point Blog
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
小众软件
小众软件
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
V2EX - 技术
V2EX - 技术
T
Threatpost
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
T
Tailwind CSS Blog
S
Securelist
The Cloudflare Blog
博客园 - 叶小钗
L
LINUX DO - 最新话题
T
Troy Hunt's Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿

博客园 - Sherrys

Content-Type 参数 Sql 2000 中行转列的查询方法 DotNet Framework 小技巧 通过 INotifyPropertyChanged 实现观察者模式 使用 .NET 2.0 SecureString 类保护敏感数据 C#中调用Windows API的要点 - Sherrys - 博客园 SQL 处理简单的 Xml Special Considerations When Using Query Notifications 利用.NET Framework使用RSS feed SQL远程连接 SQL 事务的隔离 SELECT 语句收藏(2000 & 2005) 自动处理 SQL 2005 表格数据 SQL事务的使用 用JS让文章内容指定的关键字加亮 - Sherrys - 博客园 查询SQL连接数的方法 对象的继承方案 使用 ICallbackEventHandler aspx页面中的DropDownList 的 SelectValue 出现中文导致不回调方法的问题 如何利用SQL Server 2005数据库快照形成报表
API参数说明符前缀详解
Sherrys · 2007-06-17 · via 博客园 - Sherrys

使用MASM写Windows程序,其实就是和Windows API打交道,而一个人是不可能记住所有的API用法的,所以API参考手册是必不可少的,API的参考手册中函数原型是按匈牙利表示法表示的,下面这个表就是API原型中那些前缀的详细解释
资料来源:MicroSoft MSDN Platform SDK 参考
a Array 数组
b BOOL (int) 布尔(整数)
by Unsigned Char (Byte) 无符号字符(字节)
c Char 字符(字节)
cb Count of bytes 字节数
cr Color reference value 颜色(参考)值
cx Count of x (Short) x的集合(短整数)
dw DWORD (unsigned long) 双字(无符号长整数)
f Flags (usually multiple bit values) 标志(一般是有多位的数值)
fn Function 函数
g_ global 全局的
h Handle 句柄
i Integer 整数
l Long 长整数
lp Long pointer 长指针
m_ Data member of a class 一个类的数据成员
n Short int 短整数
p Pointer 指针
s String 字符串
sz Zero terminated String 以0结尾的字符串
tm Text metric 文本规则
u Unsigned int 无符号整数
ul Unsigned long (ULONG) 无符号长整数
w WORD (unsigned short) 无符号短整数
x,y x, y coordinates (short) 坐标值/短整数
v void 空

比如说API函数CreateWindowsEx,API原型如下:
HWND CreateWindowEx(
DWORD
dwExStyle, // extended window style
LPCTSTR
lpClassName, // pointer to registered class name
LPCTSTR
lpWindowName, // pointer to window name
DWORD
dwStyle, // window style
int
x, // horizontal position of window
int
y, // vertical position of window
int
nWidth, // window width
int
nHeight, // window height
HWND
hWndParent, // handle to parent or owner window
HMENU
hMenu, // handle to menu, or child-window identifier
HINSTANCE
hInstance, // handle to application instance
LPVOID
lpParam // pointer to window-creation data
);
那么根据上述前缀表可以得出,dwExStyle需要一个双字值,lpClassNamelpWindowName需要一个指向字符串的长指针(在MASM中则是偏移地址),xy表示需传递整数值,nWidthnHeight表示传递短整数,hWndParent表示需要一个窗口句柄,hMenu表示传递一个菜单句柄,hInstance表示传递的是程序实例句柄,lpParam表示可以传递长指针(地址)。
注意看前缀时请不要看前面的类型说明符,而是要看词的前缀,如DWORD dwExStyle,只需要看dwExStyle就知道传递的是双字数。
另外还有其它的组合,只要稍注意就能行,比如说lpfn表示指向函数的长指针,在MASM中则是一个函数的地址,,还有像lpSecurityAttributes之类的,则是指向SECURITY_ATTRIBUTES结构的长指针(地址),lpvBuffer表示传递一个缓存(Buffer)长指针(lp)或者为空(void),还有一些没有前缀的则是这个词已经足够说明它的意思了。等等,熟悉这些前缀的含义可以让你在学习API的时候进行快速的掌握。并能排除一些错误。