关键是GetHandleInformation函数
GetHandleInformation函数原型:
BOOLGetHandleInformation(HANDLEhObject,PDWORDpdwFlags);
Thisfunctionreturnsthecurrentflagsettingsforthespecifiedhandlein
theDWORDpointedtobypdwFlags.Toseeifahandleisinheritable,
dothefollowing:
DWORD dwFlags;
GetHandleInformation(hObj, &dwFlags);
BOOL fHandleIsInheritable = (0 != (dwFlags & HANDLE_FLAG_INHERIT));
深入理解GetHandleInformation函数
本文详细解析了GetHandleInformation函数的使用方法及关键特性,包括如何检查句柄的继承属性。
1927

被折叠的 条评论
为什么被折叠?



