GetUserObjectInformationW function

Retrieves information about the specified window station or desktop object.

Syntax

BOOL GetUserObjectInformationW(
  HANDLE  hObj,
  int     nIndex,
  PVOID   pvInfo,
  DWORD   nLength,
  LPDWORD lpnLengthNeeded
);

Parameters

hObj

A handle to the window station or desktop object. This handle is returned by the CreateWindowStation, OpenWindowStation, CreateDesktop, or OpenDesktop function.

nIndex

The information to be retrieved. The parameter can be one of the following values.

Value Meaning
UOI_FLAGS
1
The handle flags. The pvInfo parameter must point to a USEROBJECTFLAGS structure.
UOI_HEAPSIZE
5
The size of the desktop heap, in KB, as a ULONG value. The hObj parameter must be a handle to a desktop object, otherwise, the function fails.

Windows Server 2003 and Windows XP/2000:  This value is not supported.

UOI_IO
6
TRUE if the hObj parameter is a handle to the desktop object that is receiving input from the user. FALSE otherwise.

Windows Server 2003 and Windows XP/2000:  This value is not supported.

UOI_NAME
2
The name of the object, as a string.
UOI_TYPE
3
The type name of the object, as a string.
UOI_USER_SID
4
The SID structure that identifies the user that is currently associated with the specified object. If no user is associated with the object, the value returned in the buffer pointed to by lpnLengthNeeded is zero. Note that SID is a variable length structure. You will usually make a call to GetUserObjectInformation to determine the length of the SID before retrieving its value.

pvInfo

A pointer to a buffer to receive the object information.

nLength

The size of the buffer pointed to by the pvInfo parameter, in bytes.

lpnLengthNeeded

A pointer to a variable receiving the number of bytes required to store the requested information. If this variable's value is greater than the value of the nLength parameter when the function returns, the function returns FALSE, and none of the information is copied to the pvInfo buffer. If the value of the variable pointed to by lpnLengthNeeded is less than or equal to the value of nLength, the entire information block is copied.

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.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

CreateDesktop

CreateWindowStation

GetUserObjectSecurity

OpenDesktop

OpenWindowStation

SID

SetUserObjectInformation

SetUserObjectSecurity

USEROBJECTFLAGS

Window Station and Desktop Functions