none
HRESULT differs between windows server 2008 and other versions RRS feed

  • General discussion

  • While removing objects which are not members of a group, we receive the error code 80072035 in windows server 2008.
    But Server 2012, 2016 does not return the error code but returns the success status(0).

    code is:

    IDirectoryObject *pdoGroups = NULL;
    HRESULT hr = ADsOpenObject(ldapPathOfGroup, userName, pwd, ADS_SECURE_AUTHENTICATION, IID_IDirectoryObject, (LPVOID*)&pdoGroups);
    ADS_ATTR_INFO *attrInfo = NULL;
    attrInfo = (ADS_ATTR_INFO*)AllocADsMem(sizeof(ADS_ATTR_INFO) * 1);
    ADSVALUE *adsValues = NULL;
    DWORD dw;
    adsValues = (ADSVALUE*)malloc(sizeof(ADSVALUE) * 1);
    LPWSTR wattributeValue = new WCHAR[wcslen(objectDN) + 1];
    wcscpy(wattributeValue, objectDN);      //object not member of group
    adsValues[0].dwType = ADSTYPE_DN_STRING;
    adsValues[0].DNString = (ADS_DN_STRING)wattributeValue;
    LPWSTR wattributeName = new WCHAR[10];
    wcscpy(wattributeName, L"member");
    attrInfo->pszAttrName = wattributeName;
    attrInfo->pADsValues = adsValues;
    attrInfo->dwControlCode = 4;
    attrInfo->dwADsType = (ADSTYPE)1;
    attrInfo->dwNumValues = 1;
    //HR returned is 0 for Server 2012, 2016 but 2008 server return 80072035
    hr = pdoGroups->SetObjectAttributes(attrInfo, 1, &dw);
    //dw is 0 in case of 2008 version and dw is 1 in case of 2012 and 2016 versions.

    [we tested in server 2008, 2012 and server 2016.. but 2008 returned hr as 80072035 whereas 0 is returned by 2012 and 2016]

    dw is 0 in case of 2008 version and dw is 1 in case of 2012 and 2016 versions.

    • Changed type Bill_Stewart Monday, May 7, 2018 10:02 PM
    • Moved by Bill_Stewart Monday, May 7, 2018 10:03 PM This is not "teach me how to interpret HRESULT codes returned from Win32 API" forum
    Tuesday, March 6, 2018 10:46 AM

All replies

  • You are posting in the wrong forum. This is not a C++ forum.

    0x80072035 = "The server is unable to process the request."



    \_(ツ)_/

    Tuesday, March 6, 2018 10:57 AM
  • Actually the error is "the server is unwilling" (not "unable") "to process the request."

    The HRESULT is a DWORD. To get the Win32 error code, drop the high word (most significant 32 bits, 0x8007). The low word (least signficiant 32 bits) is the Win32 error code. 0x2035 is decimal 8245.


    C:\> net helpmsg 8245
    The server is unwilling to process the request.

    But jrv is correct. This is not a C++/Win32 development forum.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, March 6, 2018 4:03 PM