Dave's Brain

Browse - programming tips - win32 set inherit file

Date: 2010may10
OS: Windows

Q.  How can I set whether a file handle is inherits by a child process?

A.  Use this function:

	BOOL SetInherit(HANDLE h, const BOOL bInherit)
	{
		return SetHandleInformation(h, HANDLE_FLAG_INHERIT, bInherit ? HANDLE_FLAG_INHERIT : 0);
	}
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: