Platform SDK: Active Directory, ADSI, and Directory Services

ADsBuildVarArrayInt

The ADsBuildVarArrayInt function builds a variant array of integers from an array of DWORD values.

HRESULT ADsBuildVarArrayInt(
  LPDWORD lpdwObjectTypes, 
  DWORD dwObjectTypes, 
  VARIANT *pVar 
);

Parameters

lpdwObjectTypes
[in] Array of DWORD values.
dwObjectTypes
[in] Number of DWORD entries in the given array.
pVar
[out] Pointer to the resulting variant array of integers.

Return Values

This method supports the standard return values, as well as the following:

S_OK
The array has been built successfully.
E_FAIL
The array could not be created.

For other return values, see ADSI Error Codes.

Remarks

Use the ADsBuildVarArrayInt function to convert the integer array into a variant array of the integers. The following code snippet provides an example.

DWORD dwArray[5]={0,1,2,3,4};
VARINT varArray[5];
HRESULT hr = ADsBuildVarArrayInt(dwArray, 5, varArray);
if (hr = E_FAIL) exit(1);
 
//You can continue to work with the data in varArray.
. . .
 

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Adshlp.h.
  Library: Included as a resource in ActiveDs.dll.

See Also

ADSI Error Codes, ADSI Functions, ADsBuildVarArrayStr