public void DRSR_DRSGetNCChanges_Access_Denied() { DrsrTestChecker.Check(); uint ret = drsTestClient.DrsBind( EnvironmentConfig.Machine.WritableDC1, EnvironmentConfig.User.ParentDomainUser, DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE | DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_GETCHGREPLY_V6); /* comments from TD */ /* * if IsGetNCChangesPermissionGranted(msgIn) == FALSE then * return ERROR_DRA_ACCESS_DENIED * endif * */ /* comments from likezh */ /* * IsGetNCChangesPermissionGranted(msgIn) == FALSE */ //throw new NotImplementedException(); /* Create request message */ DRS_MSG_GETCHGREQ msgIn = drsTestClient.CreateDrsGetNcChangesV8Request(); uint dwInVersion = 8; uint?dwOutVersion = 0; DRS_MSG_GETCHGREPLY?reply; /* Setting param #1 */ /*msgIn.V8.pNC = DefaultNC()*/ // NC DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1]; RootDSE rootDse = LdapUtility.GetRootDSE(srv); DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.configurationNamingContext); msgIn.V8.pNC = ncDsname; if (EnvironmentConfig.TestDS == false) { // ADAM requires a DSA GUID msgIn.V8.uuidDsaObjDest = srv.NtdsDsaObjectGuid; } /* Issue the request */ ret = drsTestClient.DRSClient.DrsGetNcChanges( EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1], dwInVersion, msgIn, out dwOutVersion, out reply); BaseTestSite.Assert.AreEqual <uint>( (uint)Win32ErrorCode_32.ERROR_DS_DRA_ACCESS_DENIED, ret, "DrsGetNcChanges: return code mismatch." ); }
public void DRSR_DRSGetNCChanges_Invalid_NC() { DrsrTestChecker.Check(); uint ret = drsTestClient.DrsBind( EnvironmentConfig.Machine.WritableDC1, EnvironmentConfig.User.ParentDomainAdmin, DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE | DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_GETCHGREPLY_V6); /* comments from TD */ /* * if ncRoot = null then * return ERROR_DS_CANT_FIND_EXPECTED_NC * endif * */ /* Create request message */ DRS_MSG_GETCHGREQ msgIn = drsTestClient.CreateDrsGetNcChangesV8Request(); uint dwInVersion = 8; uint?dwOutVersion = 0; DRS_MSG_GETCHGREPLY?reply; /* Setting param #1 */ /*msgIn.V8.pNC = new DSNAME();*/ if (EnvironmentConfig.TestDS == false) { // ADAM requires a DSA GUID DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1]; msgIn.V8.uuidDsaObjDest = srv.NtdsDsaObjectGuid; } /* Issue the request */ ret = drsTestClient.DRSClient.DrsGetNcChanges( EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1], dwInVersion, msgIn, out dwOutVersion, out reply); BaseTestSite.Assert.AreEqual <uint>( (uint)Win32ErrorCode_32.ERROR_DS_DRA_BAD_NC, ret, "DrsGetNcChanges: return code mismatch." ); }
public DRS_MSG_GETCHGREQ CreateDrsGetNcChangesV8Request() { DRS_MSG_GETCHGREQ req = new DRS_MSG_GETCHGREQ(); req.V8 = new DRS_MSG_GETCHGREQ_V8(); req.V8.uuidDsaObjDest = Guid.Empty; req.V8.uuidInvocIdSrc = Guid.Empty; req.V8.pNC = DrsuapiClient.CreateDsName(null, Guid.Empty, null); req.V8.usnvecFrom = new USN_VECTOR(); req.V8.pUpToDateVecDest = new UPTODATE_VECTOR_V1_EXT[1]; req.V8.pUpToDateVecDest[0].dwVersion = UPTODATE_VECTOR_V1_EXT_dwVersion_Values.V1; req.V8.pUpToDateVecDest[0].cNumCursors = 1; req.V8.pUpToDateVecDest[0].rgCursors = new UPTODATE_CURSOR_V1[1]; req.V8.pPartialAttrSet = null; req.V8.pPartialAttrSetEx = null; req.V8.PrefixTableDest = OIDUtility.CreatePrefixTable(); return(req); }