指定窗口释放内存 - VirtualFreeEx
函数简介
释放指定的内存。
接口名称
VirtualFreeEx
DLL调用
int VirtualFreeEx(long instance, long hwnd, long addr);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| hwnd | 长整数型 | 窗口句柄或进程ID |
| addr | 长整数型 | 要释放的内存地址 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// hwnd 为目标窗口句柄
// 先分配内存
long memAddr = VirtualAllocEx(instance, hwnd, 0, 4096, 0);
// 使用完毕后释放
int ret = VirtualFreeEx(instance, hwnd, memAddr);
printf("释放结果: %d\n", ret); // 1成功 0失败
Python
# 待补充
返回值
1 成功,0 失败。
