[This is preliminary documentation and subject to change.]
The UserHandleGrantAccess function grants or denies access to a USER handle 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.
BOOL UserHandleGrantAccess(
HANDLE hUserHandle,
HANDLE hJob,
BOOL bGrant
);
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.
The UserHandleGrantAccess function can be called only from a process not associated with the job object specified by the hJob parameter. The USER handle must not be owned by a process or thread associated with the job object.
To create user-interface restrictions, call the SetInformationJobObject function with the JobObjectBasicUIRestrictions job object information class.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, CreateJobObject, OpenJobObject, SetInformationJobObject