Chapter03验证一个句柄是否是继承的

关键是GetHandleInformation 函数

GetHandleInformation 函数原型:

BOOL GetHandleInformation(HANDLE hObject, PDWORD pdwFlags); 

This function returns the current flag settings for the specified handle in 

the DWORD pointed to by pdwFlags. To see if a handle is inheritable, 

do the following: 

	DWORD dwFlags; 
	GetHandleInformation(hObj, &dwFlags); 
	BOOL fHandleIsInheritable = (0 != (dwFlags & HANDLE_FLAG_INHERIT)); 

原文地址:https://www.cnblogs.com/java20130722/p/3207228.html