Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
 UserHandleGrantAccess Function
UserHandleGrantAccess Function

Grants or denies access to a handle to a User object to a job that has a user-interface restriction. When access is granted, all processes associated with the job can subsequently recognize and use the handle. When access is denied, the processes can no longer use the handle. For more information see User Objects.

Syntax

C++
BOOL WINAPI UserHandleGrantAccess(
  __in  HANDLE hUserHandle,
  __in  HANDLE hJob,
  __in  BOOL bGrant
);

Parameters

hUserHandle [in]

A handle to the User object.

hJob [in]

A handle to the job to be granted access to the User handle. The CreateJobObject or OpenJobObject function returns this handle.

bGrant [in]

If this parameter is TRUE, all processes associated with the job can recognize and use the handle. If the parameter is FALSE, the processes cannot use the 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

The UserHandleGrantAccess function can be called only from a process not associated with the job specified by the hJob parameter. The User handle must not be owned by a process or thread associated with the job.

To create user-interface restrictions, call the SetInformationJobObject function with the JobObjectBasicUIRestrictions job information class.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll

See Also

CreateJobObject
OpenJobObject
Job Objects
Process and Thread Functions
SetInformationJobObject

Send comments about this topic to Microsoft

Build date: 11/19/2009

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