Export (0) Print
Expand All

GetUserObjectInformation function

Retrieves information about the specified window station or desktop object.

Syntax


BOOL WINAPI GetUserObjectInformation(
  _In_       HANDLE hObj,
  _In_       int nIndex,
  _Out_opt_  PVOID pvInfo,
  _In_       DWORD nLength,
  _Out_opt_  LPDWORD lpnLengthNeeded
);

Parameters

hObj [in]

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

nIndex [in]

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

ValueMeaning
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 [out, optional]

A pointer to a buffer to receive the object information.

nLength [in]

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

lpnLengthNeeded [out, optional]

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]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

Unicode and ANSI names

GetUserObjectInformationW (Unicode) and GetUserObjectInformationA (ANSI)

See also

CreateDesktop
CreateWindowStation
GetUserObjectSecurity
OpenDesktop
OpenWindowStation
SetUserObjectInformation
SetUserObjectSecurity
SID
USEROBJECTFLAGS
Window Station and Desktop Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft