Partager via


4.1.10.5.1 TransformInput

 procedure TransformInput(
   hDrs: DRS_HANDLE,
   requestVersion: DWORD,
   requestUnion: DRS_MSG_GETCHGREQ,
   var nativeRequest: DRS_MSG_GETCHGREQ_V10,
   pdwOutVersion: ADDRESS OF DWORD,
   var responseSmtpAddress: unicodestring): ULONG

Informative summary of behavior: The TransformInput procedure transforms the received request message into a V10 request, which is a superset of the supported request messages.

 optionalFeatures: sequence of msDS-OptionalFeature objects /* [MS-ADSC] */
 extClient: DRS_EXTENSIONS_INT
 extServer: DRS_EXTENSIONS_INT
 optionalFeatureBit: integer
  
 extClient := ClientExtensions(hDrs)
 responseSmtpAddress := null
  
 if requestVersion < dc.minimumGetChangesRequestVersion 
     return ERROR_REVISION_MISMATCH
  
 if requestVersion = 10
   /* Windows Server 2008 R2 RPC request. */
   nativeRequest := requestUnion.V10
   if DRS_EXT_GETCHGREPLY_V9 in extClient.dwFlags then
     pdwOutVersion^ = 9
   else if DRS_EXT_GETCHGREPLY_V6 in extClient.dwFlags then
     pdwOutVersion^ = 6
   else
     return ERROR_REVISION_MISMATCH
   endif
  
 else if requestVersion = 8
   /* Windows Server 2003 RPC request. */
   nativeRequest := requestUnion.V8
   nativeRequest.ulMoreFlags := 0
   if not DRS_EXT_GETCHGREPLY_V6 in extClient.dwFlags then
     return ERROR_REVISION_MISMATCH
   else
     pdwOutVersion^ := 6
   endif
  
 else if requestVersion = 7 then
   /* Windows Server 2003 SMTP request. */
   responseSmtpAddress := requestUnion.V7.pmtxReturnAddress^.mtx_name
   nativeRequest := requestUnion.V7.V3
   nativeRequest.pUpToDateVecDest :=
       requestUnion.V7.V3.pUpToDateVecDestV1
   nativeRequest.pPartialAttrSet := requestUnion.V7.pPartialAttrSet
   nativeRequest.pPartialAttrSetEx :=
       requestUnion.V7.pPartialAttrSetEx
   nativeRequest.PrefixTableDest := requestUnion.V7.PrefixTableDest
   nativeRequest.ulMoreFlags := 0
   if not DRS_EXT_GETCHGREPLY_V6 in extClient.dwFlags then
     return ERROR_REVISION_MISMATCH
   else
     pdwOutVersion^ := 6
   endif
  
 else if requestVersion = 5 then
   /* Windows 2000 RPC request. */
   nativeRequest := requestUnion.V5
   nativeRequest.pUpToDateVecDest := 
       requestUnion.V5.pUpToDateVecDestV1
   nativeRequest.pPartialAttrSetEx := null
   nativeRequest.PrefixTableDest :=
       ConcretePTFromAbstractPT(dc.prefixTable)
   nativeRequest.ulMoreFlags := 0
   if ({DRS_WRIT_REP} ∩ requestUnion.V5.ulFlags) = null then
     nativeRequest.pPartialAttrSet := GCPAS()
   endif
   pdwOutVersion^ := 1
  
 else if requestVersion = 4 then
   /* Windows 2000 SMTP request. */
   responseSmtpAddress := requestUnion.V4.pmtxReturnAddress^.mtx_name
   nativeRequest := requestUnion.V4.V3
   nativeRequest.pUpToDateVecDest :=
       requestUnion.V4.V3.pUpToDateVecDestV1
   if ({DRS_WRIT_REP} ∩ requestUnion.V4.V3.ulFlags) = null then
     nativeRequest.pPartialAttrSet := GCPAS()
   endif
   nativeRequest.pPartialAttrSetEx := null
   nativeRequest.ulMoreFlags := 0
   pdwOutVersion^ := 1
 else
   /* Unsupported request. */
   return ERROR_REVISION_MISMATCH
 endif
  
 if ({DRS_WRIT_REP} ∩ nativeRequest.ulFlags) ≠ null then
   nativeRequest.ulFlags := 
       nativeRequest.ulFlags + {DRS_GET_ALL_GROUP_MEMBERSHIP}
 endif
  
 if (responseSmtpAddress = null) ≠ (not DRS_MAIL_REP in
     nativeRequest.ulFlags) then
   return ERROR_INVALID_PARAMETER
 endif
  
 extServer := ServerExtensions(hDrs)
 optionalFeatures := list of msDS-OptionalFeature objects from the
                     Optional Features container /* [MS-ADTS] section 6.1.1.2.4.1.3 */
  
 foreach feature in optionalFeatures
     if (GetOptionalFeatureBit(feature!msDS-OptionalFeatureGUID, optionalFeatureBit))
         if (optionalFeatureBit in extServer.dwFlagsEx) and
           optionalFeatureBit not in extClient.dwExtCaps then
             /* Feature is enabled on the server but the client
                is not capable of supporting it */
             return ERROR_REVISION_MISMATCH
         endif
     endif
     /* NOTE: The behavior of the server is undefined if */
     /* procedure GetOptionalFeatureBit() returns false. */
 endfor
 return 0