AllocADsStr function

The AllocADsStr function allocates memory for and copies a specified string.

Syntax


LPWSTR AllocADsStr(
  _In_  LPWSTR pStr
);

Parameters

pStr [in]

Type: LPWSTR

Pointer to a null-terminated Unicode string to be copied.

Return value

Type: LPWSTR

When successful, the function returns a non-NULL pointer to the allocated memory. The string in pStr is copied to this buffer and null-terminated. The caller must free this memory when it is no longer required by passing the returned pointer to FreeADsStr.

Returns NULL if not successful. Call ADsGetLastError to obtain the extended error status. For more information about error code values, see ADSI Error Codes.

Remarks

For more information and a code example that shows how to use the AllocADsStr function, see ReallocADsStr.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Adshlp.h

Library

Activeds.lib

DLL

Activeds.dll

See also

FreeADsStr
ReallocADsStr
ADsGetLastError
ADSI Functions

 

 

Show:
© 2014 Microsoft