Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Handles and Objects
 SetHandleInformation Function
SetHandleInformation Function

Sets certain properties of an object handle.

Syntax

BOOL WINAPI SetHandleInformation(
  __in  HANDLE hObject,
  __in  DWORD dwMask,
  __in  DWORD dwFlags
);

Parameters

hObject [in]

A handle to an object whose information is to be set.

You can specify a handle to one of the following types of objects: access token, console input buffer, console screen buffer, event, file, file mapping, job, mailslot, mutex, pipe, printer, process, registry key, semaphore, serial communication device, socket, thread, or waitable timer.

dwMask [in]

A mask that specifies the bit flags to be changed. Use the same constants shown in the description of dwFlags.

dwFlags [in]

Set of bit flags that specifies properties of the object handle. This parameter can be 0 or one or more of the following values.

ValueMeaning

HANDLE_FLAG_INHERIT
0x00000001

If this flag is set, a child process created with the bInheritHandles parameter of CreateProcess set to TRUE will inherit the object handle.

HANDLE_FLAG_PROTECT_FROM_CLOSE
0x00000002

If this flag is set, calling the CloseHandle function will not close the object handle.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

To set or clear the associated bit flag in dwFlags, you must set a change mask bit flag in dwMask.

Requirements

ClientRequires Windows Vista, Windows XP, or Windows 2000 Professional.
ServerRequires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
HeaderDeclared in Winbase.h; include Windows.h.
LibraryUse Kernel32.lib.
DLLRequires Kernel32.dll.

See Also

CreateProcess
CloseHandle
GetHandleInformation
Handle and Object Functions


Send comments about this topic to Microsoft

Build date: 10/2/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker