BUG: IADs::PutEx Method Causes -2147467259 (0x80004005) Error (257999)
The information in this article applies to:
- Microsoft Active Directory Service Interfaces 2.5
This article was previously published under Q257999 SYMPTOMS
When you use the Active Directory Service Interfaces (ADSI) IADs::PutEx method (with the LDAP provider) to set a multi-valued integer property, you may receive a -2147467259 error or 0x80004005 "Unspecified Error". This problem occurs when you load multi-value integers into a DWORD array.
RESOLUTION
To work around this problem, load the multi-value integers into an LPWSTR array as demonstrated here:
#include <activeds.h>
void main(){
HRESULT hr;
IADs *pIADsObject=NULL;
LPWSTR pszADsPath = L"LDAP://SiteServer600:1239/o=AccessTest/ou=Members/cn=MyUser";
LPWSTR pszAdminPath = L"cn=Administrator, ou=Members, o=AccessTest";
LPWSTR pszAdminPass = L"password";
CoInitialize(NULL);
hr = ADsOpenObject (pszADsPath,pszAdminPath, pszAdminPass,0,IID_IADs,
(void**)&pIADsObject);
VARIANT var;
VariantInit(&var);
LPWSTR dwArray[5]={L"0",L"1",L"2",L"3",L"4"};
VARIANT varArray;
hr = ADsBuildVarArrayStr(dwArray, 5, &varArray);
if (FAILED(hr)) {
exit(1);
}
hr = pIADsObject->PutEx (ADS_PROPERTY_APPEND, L"OtherInts",varArray);
VariantClear(&varArray);
hr = pIADsObject->SetInfo();
VariantClear(&var);
CoUninitialize();
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft Windows 2000.
Modification Type: | Minor | Last Reviewed: | 3/4/2004 |
---|
Keywords: | kbbug kbMsg KB257999 |
---|
|