internal static void ThrowExceptionForResultCodeError(ResultCode resultCode, string message, string serverErrorMessage, Exception innerException) { if (resultCode != ResultCode.Success) { throw ExceptionHelper.GetExceptionFromErrorCode(ADStoreAccess.MapResultCodeToErrorCode(resultCode), message, serverErrorMessage, innerException); } else { return; } }
ADSearchResponse Microsoft.ActiveDirectory.Management.IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request) { ADSearchResponse aDSearchResponse = null; ADDirectoryServiceConnection internalHandle = this.GetInternalHandle(handle); if (internalHandle != null) { aDSearchResponse = internalHandle.Search(request); this.CheckAndThrowReferralException(aDSearchResponse); ADStoreAccess.ThrowExceptionForResultCodeError(aDSearchResponse.ResultCode, aDSearchResponse.ErrorMessage, null); } return(aDSearchResponse); }
private void ProcessAsqResponse(ADSearchResponse response) { if (!string.IsNullOrEmpty(this._attributeScopedQuery)) { DirectoryControl[] controls = response.Controls; int num = 0; while (num < (int)controls.Length) { ADAsqResponseControl aDAsqResponseControl = controls[num] as ADAsqResponseControl; if (aDAsqResponseControl == null) { num++; } else { if (aDAsqResponseControl.Result == ResultCode.Success) { break; } int errorCode = ADStoreAccess.MapResultCodeToErrorCode(aDAsqResponseControl.Result); Win32Exception win32Exception = new Win32Exception(errorCode); object[] message = new object[3]; message[0] = this._searchRoot; message[1] = this._attributeScopedQuery; message[2] = win32Exception.Message; string str = string.Format(CultureInfo.CurrentCulture, StringResources.AsqResponseError, message); throw ExceptionHelper.GetExceptionFromErrorCode(errorCode, str, null); } } return; } else { return; } }
protected ADSession(ADSessionInfo info) { this._handleLock = new object(); this._info = info.Copy(); this._storeAccess = ADServiceStoreAccessFactory.GetObject(); }
internal static void ThrowExceptionForResultCodeError(ResultCode resultCode, string message, Exception innerException) { ADStoreAccess.ThrowExceptionForResultCodeError(resultCode, message, null, innerException); }