Changeset 745 for trunk/server/librpc
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 143 deleted
- 52 edited
- 33 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/librpc/build_idl.sh
r414 r745 1 #!/ bin/sh1 #!/@unixroot/usr/bin/sh 2 2 3 3 if [ "$1" = "--full" ]; then … … 8 8 fi 9 9 10 ARGS="--outputdir $PIDL_OUTPUTDIR --header --ndr-parser --samba3-ndr-server --s amba3-ndr-client --server --client --python --dcom-proxy --com-header $PIDL_ARGS --"10 ARGS="--outputdir $PIDL_OUTPUTDIR --header --ndr-parser --samba3-ndr-server --server --client --python --dcom-proxy --com-header $PIDL_ARGS --" 11 11 IDL_FILES="$*" 12 12 … … 30 30 list="" 31 31 for f in ${IDL_FILES}; do 32 basename=`basename $f .idl` 33 ndr="$PIDL_OUTPUTDIR/py_$basename.c" 32 b=`basename $f .idl` 33 outfiles="$b.h ndr_${b}_c.c ndr_$b.h ndr_${b}_s.c srv_$b.c" 34 outfiles="$outfiles ndr_$b.c ndr_${b}_c.h py_$b.c srv_$b.h" 34 35 35 if [ -f $ndr ]; then 36 if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then 37 list="$list $f" 38 fi 39 else 36 for o in $outfiles; do 37 [ -f $PIDL_OUTPUTDIR/$o ] || { 40 38 list="$list $f" 41 fi 39 break 40 } 41 test "`find $f -newer $PIDL_OUTPUTDIR/$o`" != "" && { 42 list="$list $f" 43 break 44 } 45 done 42 46 done 43 47 -
trunk/server/librpc/idl/dcerpc.idl
r596 r745 20 20 } dcerpc_ctx_list; 21 21 22 typedef struct {22 typedef [public] struct { 23 23 uint16 max_xmit_frag; 24 24 uint16 max_recv_frag; … … 26 26 uint8 num_contexts; 27 27 dcerpc_ctx_list ctx_list[num_contexts]; 28 [flag(NDR_ALIGN4)] DATA_BLOB _pad;29 28 [flag(NDR_REMAINING)] DATA_BLOB auth_info; 30 29 } dcerpc_bind; … … 97 96 } dcerpc_response; 98 97 98 typedef [v1_enum] enum { 99 DCERPC_NCA_S_COMM_FAILURE = 0x1C010001, 100 DCERPC_NCA_S_OP_RNG_ERROR = 0x1C010002, 101 DCERPC_NCA_S_UNKNOWN_IF = 0x1C010003, 102 DCERPC_NCA_S_WRONG_BOOT_TIME = 0x1C010006, 103 DCERPC_NCA_S_YOU_CRASHED = 0x1C010009, 104 DCERPC_NCA_S_PROTO_ERROR = 0x1C01000B, 105 DCERPC_NCA_S_OUT_ARGS_TOO_BIG = 0x1C010013, 106 DCERPC_NCA_S_SERVER_TOO_BUSY = 0x1C010014, 107 DCERPC_NCA_S_FAULT_STRING_TOO_LARGE = 0x1C010015, 108 DCERPC_NCA_S_UNSUPPORTED_TYPE = 0x1C010017, 109 DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO = 0x1C000001, 110 DCERPC_NCA_S_FAULT_ADDR_ERROR = 0x1C000002, 111 DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO = 0x1C000003, 112 DCERPC_NCA_S_FAULT_FP_UNDERFLOW = 0x1C000004, 113 DCERPC_NCA_S_FAULT_FP_OVERRFLOW = 0x1C000005, 114 DCERPC_NCA_S_FAULT_INVALID_TAG = 0x1C000006, 115 DCERPC_NCA_S_FAULT_INVALID_BOUND = 0x1C000007, 116 DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH = 0x1C000008, 117 DCERPC_NCA_S_FAULT_UNSPEC_REJECT = 0x1C000009, 118 DCERPC_NCA_S_FAULT_BAD_ACTID = 0x1C00000A, 119 DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED = 0x1C00000B, 120 DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED = 0x1C00000C, 121 DCERPC_NCA_S_FAULT_CANCEL = 0x1C00000D, 122 DCERPC_NCA_S_FAULT_ILL_INST = 0x1C00000E, 123 DCERPC_NCA_S_FAULT_FP_ERROR = 0x1C00000F, 124 DCERPC_NCA_S_FAULT_INT_OVERFLOW = 0x1C000010, 125 DCERPC_NCA_S_UNUSED_1C000011 = 0x1C000011, 126 DCERPC_NCA_S_FAULT_UNSPEC = 0x1C000012, 127 DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE = 0x1C000013, 128 DCERPC_NCA_S_FAULT_PIPE_EMPTY = 0x1C000014, 129 DCERPC_NCA_S_FAULT_PIPE_CLOSED = 0x1C000015, 130 DCERPC_NCA_S_FAULT_PIPE_ORDER = 0x1C000016, 131 DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE = 0x1C000017, 132 DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR = 0x1C000018, 133 DCERPC_NCA_S_FAULT_PIPE_MEMORY = 0x1C000019, 134 DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH = 0x1C00001A, 135 DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY = 0x1C00001B, 136 DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID = 0x1C00001C, 137 DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL = 0x1C00001D, 138 DCERPC_NCA_S_UNUSED_1C00001E = 0x1C00001E, 139 DCERPC_NCA_S_INVALID_CHECKSUM = 0x1C00001F, 140 DCERPC_NCA_S_INVALID_CRC = 0x1C000020, 141 DCERPC_NCA_S_FAULT_USER_DEFINED = 0x1C000021, 142 DCERPC_NCA_S_FAULT_TX_OPEN_FAILED = 0x1C000022, 143 DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR = 0x1C000023, 144 DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND = 0x1C000024, 145 DCERPC_NCA_S_FAULT_NO_CLIENT_STUB = 0x1C000025 146 } dcerpc_nca_status; 99 147 100 148 const int DCERPC_FAULT_OP_RNG_ERROR = 0x1c010002; … … 116 164 uint16 context_id; 117 165 uint8 cancel_count; 118 uint32status;166 dcerpc_nca_status status; 119 167 [flag(NDR_REMAINING)] DATA_BLOB _pad; 120 168 } dcerpc_fault; … … 132 180 DCERPC_AUTH_TYPE_DIGEST = 21, 133 181 DCERPC_AUTH_TYPE_SCHANNEL = 68, 134 DCERPC_AUTH_TYPE_MSMQ = 100 182 DCERPC_AUTH_TYPE_MSMQ = 100, 183 DCERPC_AUTH_TYPE_NCALRPC_AS_SYSTEM = 200 135 184 } dcerpc_AuthType; 136 185 … … 158 207 159 208 typedef [public] struct { 160 uint32_pad;209 [value(0)] uint32 _pad; 161 210 [flag(NDR_REMAINING)] DATA_BLOB auth_info; 162 211 } dcerpc_auth3; 163 212 164 213 typedef [public] struct { 165 uint32_pad;214 [value(0)] uint32 _pad; 166 215 [flag(NDR_REMAINING)] DATA_BLOB auth_info; 167 216 } dcerpc_orphaned; 168 217 169 218 typedef [public] struct { 170 uint32_pad;219 [value(0)] uint32 _pad; 171 220 [flag(NDR_REMAINING)] DATA_BLOB auth_info; 172 221 } dcerpc_co_cancel; … … 205 254 typedef [public] struct { 206 255 } dcerpc_working; 256 257 /* RTS data structures */ 258 typedef [public] struct { 259 GUID Cookie; 260 } RTSCookie; 261 262 typedef [v1_enum,public] enum { 263 RTS_IPV4 = 0, 264 RTS_IPV6 = 1 265 } AddressType; 266 267 typedef [nodiscriminant] union { 268 [case(RTS_IPV4)] ipv4address ClientAddressIPV4; 269 [case(RTS_IPV6)] ipv6address ClientAddressIPV6; 270 } ClientAddressType; 271 272 typedef [public] struct { 273 AddressType AddressType; 274 [switch_is(AddressType)] ClientAddressType ClientAddress; 275 uint8 Padding[12]; 276 } ClientAddress; 277 278 typedef [v1_enum, public] enum { 279 FDClient = 0, 280 FDInProxy = 1, 281 FDServer = 2, 282 FDOutProxy = 3 283 } ForwardDestination; 284 285 typedef [public] struct { 286 uint32 BytesReceived; 287 uint32 AvailableWindow; 288 RTSCookie ChannelCookie; 289 } FlowControlAcknowledgment; 290 291 /* RTS commands */ 292 293 /* RTS command: 0x0 */ 294 typedef [public] struct { 295 [range(0x2000,0x40000)] uint32 ReceiveWindowSize; 296 } dcerpc_rts_cmd_ReceiveWindowSize; 297 298 /* RTS command: 0x1 */ 299 typedef [public] struct { 300 FlowControlAcknowledgment Ack; 301 } dcerpc_rts_cmd_FlowControlAck; 302 303 /* RTS command: 0x2 */ 304 typedef [public] struct { 305 [range(0x1D4C0,0xDBBA00)] uint32 ConnectionTimeout; 306 } dcerpc_rts_cmd_ConnectionTimeout; 307 308 /* RTS command: 0x3 */ 309 typedef [public] struct { 310 RTSCookie Cookie; 311 } dcerpc_rts_cmd_Cookie; 312 313 /* RTS command: 0x4 */ 314 typedef [public] struct { 315 [range(0x20000,0x80000000)] uint32 ChannelLifetime; 316 } dcerpc_rts_cmd_ChannelLifetime; 317 318 /* RTS command: 0x5 */ 319 typedef [public] struct { 320 uint32 ClientKeepalive; 321 } dcerpc_rts_cmd_ClientKeepalive; 322 323 /* RTS command: 0x6 */ 324 typedef [public] struct { 325 uint32 Version; 326 } dcerpc_rts_cmd_Version; 327 328 /* RTS command: 0x7 */ 329 typedef [public] struct { 330 } dcerpc_rts_cmd_Empty; 331 332 /* RTS command: 0x8 */ 333 typedef [public] struct { 334 [range(0x0,0xFFFF)] uint32 ConformanceCount; 335 uint8 Padding[ConformanceCount]; 336 } dcerpc_rts_cmd_Padding; 337 338 /* RTS command: 0x9 */ 339 typedef [public] struct { 340 } dcerpc_rts_cmd_NegativeANCE; 341 342 /* RTS Command: 0xA */ 343 typedef [public] struct { 344 } dcerpc_rts_cmd_ANCE; 345 346 /* RTS command: 0xB */ 347 typedef [public] struct { 348 ClientAddress ClientAddress; 349 } dcerpc_rts_cmd_ClientAddress; 350 351 /* RTS command: 0xC */ 352 typedef [public] struct { 353 RTSCookie AssociationGroupId; 354 } dcerpc_rts_cmd_AssociationGroupId; 355 356 /* RTS command: 0xD */ 357 typedef [public] struct { 358 ForwardDestination ForwardDestination; 359 } dcerpc_rts_cmd_Destination; 360 361 /* RTS command: 0xE */ 362 typedef [public] struct { 363 uint32 PingTrafficSent; 364 } dcerpc_rts_cmd_PingTrafficSentNotify; 365 366 typedef [nodiscriminant] union { 367 [case(0x0)] dcerpc_rts_cmd_ReceiveWindowSize ReceiveWindowSize; 368 [case(0x1)] dcerpc_rts_cmd_FlowControlAck FlowControlAck; 369 [case(0x2)] dcerpc_rts_cmd_ConnectionTimeout ConnectionTimeout; 370 [case(0x3)] dcerpc_rts_cmd_Cookie Cookie; 371 [case(0x4)] dcerpc_rts_cmd_ChannelLifetime ChannelLifetime; 372 [case(0x5)] dcerpc_rts_cmd_ClientKeepalive ClientKeepalive; 373 [case(0x6)] dcerpc_rts_cmd_Version Version; 374 [case(0x7)] dcerpc_rts_cmd_Empty Empty; 375 [case(0x8)] dcerpc_rts_cmd_Padding Padding; 376 [case(0x9)] dcerpc_rts_cmd_NegativeANCE NegativeANCE; 377 [case(0xA)] dcerpc_rts_cmd_ANCE ANCE; 378 [case(0xB)] dcerpc_rts_cmd_ClientAddress ClientAddress; 379 [case(0xC)] dcerpc_rts_cmd_AssociationGroupId AssociationGroupId; 380 [case(0xD)] dcerpc_rts_cmd_Destination Destination; 381 [case(0xE)] dcerpc_rts_cmd_PingTrafficSentNotify PingTrafficSentNotify; 382 } dcerpc_rts_cmds; 383 384 typedef [public] struct { 385 uint32 CommandType; 386 [switch_is(CommandType)] dcerpc_rts_cmds Command; 387 } dcerpc_rts_cmd; 388 389 /* The RTS flags */ 390 typedef [public, bitmap16bit] bitmap { 391 RTS_FLAG_NONE = 0x0000, 392 RTS_FLAG_PING = 0x0001, 393 RTS_FLAG_OTHER_CMD = 0x0002, 394 RTS_FLAG_RECYCLE_CHANNEL = 0x0004, 395 RTS_FLAG_IN_CHANNEL = 0x0008, 396 RTS_FLAG_OUT_CHANNEL = 0x0010, 397 RTS_FLAG_EOF = 0x0020, 398 RTS_FLAG_ECHO = 0x0040 399 } dcerpc_rts_flags; 400 401 typedef [public] struct { 402 dcerpc_rts_flags Flags; 403 uint16 NumberOfCommands; 404 dcerpc_rts_cmd Commands[NumberOfCommands]; 405 } dcerpc_rts; 207 406 208 407 typedef [enum8bit] enum { … … 226 425 DCERPC_PKT_SHUTDOWN = 17, /* Server to client request to shutdown. */ 227 426 DCERPC_PKT_CO_CANCEL = 18, /* Connection-oriented cancel request. */ 228 DCERPC_PKT_ORPHANED = 19 /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */ 427 DCERPC_PKT_ORPHANED = 19, /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */ 428 DCERPC_PKT_RTS = 20 /* RTS packets used in ncacn_http */ 229 429 } dcerpc_pkt_type; 230 430 … … 250 450 [case(DCERPC_PKT_ORPHANED)] dcerpc_orphaned orphaned; 251 451 [case(DCERPC_PKT_AUTH3)] dcerpc_auth3 auth3; 452 [case(DCERPC_PKT_RTS)] dcerpc_rts rts; 252 453 } dcerpc_payload; 253 454 -
trunk/server/librpc/idl/drsblobs.idl
r414 r745 1 1 #include "idl_types.h" 2 2 3 import "drsuapi.idl", "misc.idl", "samr.idl", "lsa.idl" ;3 import "drsuapi.idl", "misc.idl", "samr.idl", "lsa.idl", "security.idl"; 4 4 5 5 [ … … 11 11 ] 12 12 interface drsblobs { 13 typedef bitmap drsuapi_DsReplicaSyncOptions drsuapi_DsReplicaSyncOptions; 14 typedef bitmap drsuapi_DsReplicaNeighbourFlags drsuapi_DsReplicaNeighbourFlags; 13 typedef bitmap drsuapi_DrsOptions drsuapi_DrsOptions; 15 14 typedef [v1_enum] enum drsuapi_DsAttributeId drsuapi_DsAttributeId; 16 15 typedef [v1_enum] enum lsa_TrustAuthType lsa_TrustAuthType; … … 31 30 typedef struct { 32 31 uint32 count; 33 uint32 reserved;32 [value(0)] uint32 reserved; 34 33 replPropertyMetaData1 array[count]; 35 34 } replPropertyMetaDataCtr1; … … 41 40 typedef [public] struct { 42 41 uint32 version; 43 uint32 reserved;42 [value(0)] uint32 reserved; 44 43 [switch_is(version)] replPropertyMetaDataCtr ctr; 45 44 } replPropertyMetaDataBlob; … … 56 55 typedef struct { 57 56 uint32 count; 58 uint32 reserved;57 [value(0)] uint32 reserved; 59 58 drsuapi_DsReplicaCursor cursors[count]; 60 59 } replUpToDateVectorCtr1; … … 62 61 typedef struct { 63 62 uint32 count; 64 uint32 reserved;63 [value(0)] uint32 reserved; 65 64 drsuapi_DsReplicaCursor2 cursors[count]; 66 65 } replUpToDateVectorCtr2; … … 73 72 typedef [public] struct { 74 73 uint32 version; 75 uint32 reserved;74 [value(0)] uint32 reserved; 76 75 [switch_is(version)] replUpToDateVectorCtr ctr; 77 76 } replUpToDateVectorBlob; … … 94 93 typedef [public,gensize,flag(NDR_PAHEX)] struct { 95 94 /* this includes the 8 bytes of the repsFromToBlob header */ 96 [value(ndr_size_repsFromTo1(this, ndr-> iconv_convenience, ndr->flags)+8)] uint32 blobsize;95 [value(ndr_size_repsFromTo1(this, ndr->flags)+8)] uint32 blobsize; 97 96 uint32 consecutive_sync_failures; 98 97 NTTIME_1sec last_success; … … 100 99 WERROR result_last_attempt; 101 100 [relative] repsFromTo1OtherInfo *other_info; 102 [value(ndr_size_repsFromTo1OtherInfo(other_info, ndr-> iconv_convenience, ndr->flags))] uint32 other_info_length;103 drsuapi_D sReplicaNeighbourFlags replica_flags;101 [value(ndr_size_repsFromTo1OtherInfo(other_info, ndr->flags))] uint32 other_info_length; 102 drsuapi_DrsOptions replica_flags; 104 103 uint8 schedule[84]; 105 uint32 reserved;104 [value(0)] uint32 reserved; 106 105 drsuapi_DsReplicaHighWaterMark highwatermark; 107 106 GUID source_dsa_obj_guid; /* the 'objectGuid' field of the CN=NTDS Settings object */ … … 111 110 112 111 typedef [public,relative_base,gensize] struct { 113 [value(ndr_size_repsFromTo2OtherInfo(this,ndr-> iconv_convenience, ndr->flags))]112 [value(ndr_size_repsFromTo2OtherInfo(this,ndr->flags))] 114 113 uint32 __ndr_size; 115 114 [relative] nstring *dns_name1; … … 121 120 typedef [public,gensize,flag(NDR_PAHEX)] struct { 122 121 /* this includes the 8 bytes of the repsFromToBlob header */ 123 [value(ndr_size_repsFromTo2(this, ndr-> iconv_convenience, ndr->flags)+8)] uint32 blobsize;122 [value(ndr_size_repsFromTo2(this, ndr->flags)+8)] uint32 blobsize; 124 123 uint32 consecutive_sync_failures; 125 124 NTTIME_1sec last_success; … … 127 126 WERROR result_last_attempt; 128 127 [relative] repsFromTo2OtherInfo *other_info; 129 [value(ndr_size_repsFromTo2OtherInfo(other_info, ndr-> iconv_convenience, ndr->flags))] uint32 other_info_length;130 drsuapi_D sReplicaNeighbourFlags replica_flags;128 [value(ndr_size_repsFromTo2OtherInfo(other_info, ndr->flags))] uint32 other_info_length; 129 drsuapi_DrsOptions replica_flags; 131 130 uint8 schedule[84]; 132 uint32 reserved;131 [value(0)] uint32 reserved; 133 132 drsuapi_DsReplicaHighWaterMark highwatermark; 134 133 GUID source_dsa_obj_guid; /* the 'objectGuid' field of the CN=NTDS Settings object */ … … 145 144 typedef [public] struct { 146 145 uint32 version; 147 uint32 reserved;146 [value(0)] uint32 reserved; 148 147 [switch_is(version)] repsFromTo ctr; 149 148 } repsFromToBlob; … … 169 168 typedef [public] struct { 170 169 uint32 version; 171 uint32 reserved;170 [value(0)] uint32 reserved; 172 171 [switch_is(version)] partialAttributeSetCtr ctr; 173 172 } partialAttributeSetBlob; … … 176 175 [in] partialAttributeSetBlob blob 177 176 ); 177 178 179 /* 180 * schemaInfo attribute 181 * 182 * Used as an attribute on Schema. 183 * Also during replication as part of 184 * prefixMap to identify what revision 185 * of Schema source DC has 186 */ 187 typedef [public,flag(NDR_NOALIGN)] struct { 188 [value(0xFF)] uint8 marker; 189 [flag(NDR_BIG_ENDIAN)] uint32 revision; 190 GUID invocation_id; 191 } schemaInfoBlob; 192 193 194 /* 195 * MS w2k3 and w2k8 prefixMap format 196 * There is no version number. Format is: 197 * uint32 - number of entries in the map 198 * uint32 - total bytes that structure occupies 199 * ENTRIES: 200 * uint16 - prefix ID (OID's last sub-id encoded. see prefixMap) 201 * uint16 - number of bytes in prefix N 202 * uint8[N] - BER encoded prefix 203 */ 204 typedef [noprint,flag(NDR_NOALIGN)] struct { 205 uint16 entryID; 206 uint16 length; 207 uint8 binary_oid[length]; 208 } drsuapi_MSPrefixMap_Entry; 209 210 typedef [public,gensize] struct { 211 uint32 num_entries; 212 [value(ndr_size_drsuapi_MSPrefixMap_Ctr(r, ndr->flags))] uint32 __ndr_size; 213 drsuapi_MSPrefixMap_Entry entries[num_entries]; 214 } drsuapi_MSPrefixMap_Ctr; 178 215 179 216 /* … … 197 234 typedef [public] struct { 198 235 prefixMapVersion version; 199 uint32 reserved;236 [value(0)] uint32 reserved; 200 237 [switch_is(version)] prefixMapCtr ctr; 201 238 } prefixMapBlob; … … 219 256 uint32 u2; 220 257 uint32 u3; 221 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, ndr->iconv_convenience,0))]258 [value(ndr_size_ldapControlDirSyncExtra(&extra, extra.uptodateness_vector.version, 0))] 222 259 uint32 extra_length; 223 260 drsuapi_DsReplicaHighWaterMark highwatermark; … … 280 317 typedef [public] struct { 281 318 [value(0)] uint32 unknown1; 282 [value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr-> iconv_convenience, ndr->flags))] uint32 __ndr_size;319 [value(ndr_size_supplementalCredentialsSubBlob(&sub, ndr->flags))] uint32 __ndr_size; 283 320 [value(0)] uint32 unknown2; 284 321 [subcontext(0),subcontext_size(__ndr_size)] supplementalCredentialsSubBlob sub; … … 432 469 NTTIME LastUpdateTime; 433 470 lsa_TrustAuthType AuthType; 434 435 471 [switch_is(AuthType)] AuthInfo AuthInfo; 436 472 [flag(NDR_ALIGN4)] DATA_BLOB _pad; 437 473 } AuthenticationInformation; 438 474 439 typedef [nopull,nopush,noprint] struct { 440 /* sizeis here is bogus, but this is here just for the structure */ 441 [size_is(1)] AuthenticationInformation array[]; 475 /* count is not on the wire */ 476 typedef [public,nopull,nopush,gensize] struct { 477 uint32 count; 478 AuthenticationInformation array[count]; 442 479 } AuthenticationInformationArray; 443 480 444 /* This is nopull,nopush because we pass count down to the 445 * manual parser of AuthenticationInformationArray */ 446 typedef [public,nopull,nopush,noprint,gensize] struct { 481 /* we cannot use [relative] pointers here because Windows expects the 482 * previous_offset to match the total size of the struct in case 483 * the previous array is empty, see MS-LSAD 2.2.7.16 - gd */ 484 typedef [public,gensize,nopush] struct { 447 485 uint32 count; 448 [relative] AuthenticationInformationArray *current; 449 [relative] AuthenticationInformationArray *previous; 486 [value((count > 0) ? 12 : 0)] uint32 current_offset; 487 [value((count > 0) ? 12 + ndr_size_AuthenticationInformationArray(¤t, ndr->flags) : 0)] uint32 previous_offset; 488 [subcontext(0),subcontext_size((previous_offset)-(current_offset))] AuthenticationInformationArray current; 489 [subcontext(0)] [flag(NDR_REMAINING)] AuthenticationInformationArray previous; 450 490 } trustAuthInOutBlob; 451 491 452 void decode_trustAuthInOut(492 [nopython] void decode_trustAuthInOut( 453 493 [in] trustAuthInOutBlob blob 454 494 ); 455 456 typedef [public,gensize] struct {457 uint32 count;458 [relative] AuthenticationInformation *current[count];459 } trustCurrentPasswords;460 495 461 496 typedef [public,nopull] struct { 462 497 uint8 confounder[512]; 463 [subcontext(0),subcontext_size(outgoing_size)] trust CurrentPasswordsoutgoing;464 [subcontext(0),subcontext_size(incoming_size)] trust CurrentPasswordsincoming;465 [value(ndr_size_trust CurrentPasswords(&outgoing, ndr->iconv_convenience, ndr->flags))] uint32 outgoing_size;466 [value(ndr_size_trust CurrentPasswords(&incoming, ndr->iconv_convenience, ndr->flags))] uint32 incoming_size;498 [subcontext(0),subcontext_size(outgoing_size)] trustAuthInOutBlob outgoing; 499 [subcontext(0),subcontext_size(incoming_size)] trustAuthInOutBlob incoming; 500 [value(ndr_size_trustAuthInOutBlob(&outgoing, ndr->flags))] uint32 outgoing_size; 501 [value(ndr_size_trustAuthInOutBlob(&incoming, ndr->flags))] uint32 incoming_size; 467 502 } trustDomainPasswords; 468 503 469 void decode_trustDomainPasswords(504 [nopython] void decode_trustDomainPasswords( 470 505 [in] trustDomainPasswords blob 471 506 ); … … 548 583 } ExtendedErrorInfoPtr; 549 584 550 void decode_ExtendedErrorInfo (585 [nopython] void decode_ExtendedErrorInfo ( 551 586 [in,subcontext(0xFFFFFC01)] ExtendedErrorInfoPtr ptr 552 587 ); 588 589 /* MS-ADTS 7.1.6.9.3 msDS-TrustForestTrustInfo Attribute */ 590 591 typedef struct { 592 [value(strlen_m(string))] uint32 size; 593 [charset(UTF8)] uint8 string[size]; 594 } ForestTrustString; 595 596 typedef [flag(NDR_NOALIGN)] struct { 597 [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; 598 [subcontext(0),subcontext_size(sid_size)] dom_sid sid; 599 ForestTrustString dns_name; 600 ForestTrustString netbios_name; 601 } ForestTrustDataDomainInfo; 602 603 typedef [flag(NDR_NOALIGN)] struct { 604 uint32 size; 605 uint8 data[size]; 606 } ForestTrustDataBinaryData; 607 608 typedef [nodiscriminant] union { 609 [case(FOREST_TRUST_TOP_LEVEL_NAME)] ForestTrustString name; 610 [case(FOREST_TRUST_TOP_LEVEL_NAME_EX)] ForestTrustString name; 611 [case(FOREST_TRUST_DOMAIN_INFO)] ForestTrustDataDomainInfo info; 612 [default] ForestTrustDataBinaryData data; 613 } ForestTrustData; 614 615 /* same as lsa_ForestTrustRecordType */ 616 typedef [enum8bit] enum { 617 FOREST_TRUST_TOP_LEVEL_NAME = 0, 618 FOREST_TRUST_TOP_LEVEL_NAME_EX = 1, 619 FOREST_TRUST_DOMAIN_INFO = 2 620 } ForestTrustInfoRecordType; 621 622 /* meaning of flags depends on record type and values are 623 the same as in lsa.idl, see collision record types */ 624 typedef [public,gensize,flag(NDR_NOALIGN)] struct { 625 uint32 flags; 626 NTTIME timestamp; 627 ForestTrustInfoRecordType type; 628 [switch_is(type)] ForestTrustData data; 629 } ForestTrustInfoRecord; 630 631 typedef [flag(NDR_NOALIGN)] struct { 632 [value(ndr_size_ForestTrustInfoRecord(&record, ndr->flags))] uint32 record_size; 633 ForestTrustInfoRecord record; 634 } ForestTrustInfoRecordArmor; 635 636 typedef [public,flag(NDR_NOALIGN)] struct { 637 uint32 version; 638 uint32 count; 639 ForestTrustInfoRecordArmor records[count]; 640 } ForestTrustInfo; 641 642 [nopython] void decode_ForestTrustInfo( 643 [in] ForestTrustInfo blob 644 ); 553 645 } -
trunk/server/librpc/idl/drsuapi.idl
r414 r745 1 1 #include "idl_types.h" 2 2 3 import "security.idl", "misc.idl", " samr.idl";3 import "security.idl", "misc.idl", "lsa.idl", "samr.idl"; 4 4 5 5 [ … … 16 16 typedef bitmap samr_GroupAttrs samr_GroupAttrs; 17 17 18 /* see MS-DRSR section 5.39 */ 19 typedef [public,bitmap32bit] bitmap { 20 DRSUAPI_DRS_ASYNC_OP = 0x00000001, 21 DRSUAPI_DRS_GETCHG_CHECK = 0x00000002, 22 DRSUAPI_DRS_UPDATE_NOTIFICATION = 0x00000002, 23 DRSUAPI_DRS_ADD_REF = 0x00000004, 24 DRSUAPI_DRS_SYNC_ALL = 0x00000008, 25 DRSUAPI_DRS_DEL_REF = 0x00000008, 26 DRSUAPI_DRS_WRIT_REP = 0x00000010, 27 DRSUAPI_DRS_INIT_SYNC = 0x00000020, 28 DRSUAPI_DRS_PER_SYNC = 0x00000040, 29 DRSUAPI_DRS_MAIL_REP = 0x00000080, 30 DRSUAPI_DRS_ASYNC_REP = 0x00000100, 31 DRSUAPI_DRS_IGNORE_ERROR = 0x00000100, 32 DRSUAPI_DRS_TWOWAY_SYNC = 0x00000200, 33 DRSUAPI_DRS_CRITICAL_ONLY = 0x00000400, 34 DRSUAPI_DRS_GET_ANC = 0x00000800, 35 DRSUAPI_DRS_GET_NC_SIZE = 0x00001000, 36 DRSUAPI_DRS_LOCAL_ONLY = 0x00001000, 37 DRSUAPI_DRS_NONGC_RO_REP = 0x00002000, 38 DRSUAPI_DRS_SYNC_BYNAME = 0x00004000, 39 DRSUAPI_DRS_REF_OK = 0x00004000, 40 DRSUAPI_DRS_FULL_SYNC_NOW = 0x00008000, 41 DRSUAPI_DRS_NO_SOURCE = 0x00008000, 42 DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS = 0x00010000, 43 DRSUAPI_DRS_FULL_SYNC_PACKET = 0x00020000, 44 DRSUAPI_DRS_SYNC_REQUEUE = 0x00040000, 45 DRSUAPI_DRS_SYNC_URGENT = 0x00080000, 46 DRSUAPI_DRS_REF_GCSPN = 0x00100000, 47 DRSUAPI_DRS_NO_DISCARD = 0x00100000, 48 DRSUAPI_DRS_NEVER_SYNCED = 0x00200000, 49 DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING = 0x00400000, 50 DRSUAPI_DRS_INIT_SYNC_NOW = 0x00800000, 51 DRSUAPI_DRS_PREEMPTED = 0x01000000, 52 DRSUAPI_DRS_SYNC_FORCED = 0x02000000, 53 DRSUAPI_DRS_DISABLE_AUTO_SYNC = 0x04000000, 54 DRSUAPI_DRS_DISABLE_PERIODIC_SYNC = 0x08000000, 55 DRSUAPI_DRS_USE_COMPRESSION = 0x10000000, 56 DRSUAPI_DRS_NEVER_NOTIFY = 0x20000000, 57 DRSUAPI_DRS_SYNC_PAS = 0x40000000, 58 DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP = 0x80000000 59 } drsuapi_DrsOptions; 60 18 61 /*****************/ 19 62 /* Function 0x00 */ … … 26 69 DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1 = 0x00000020, 27 70 DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION = 0x00000040, 28 DRSUAPI_SUPPORTED_EXTENSION_ 00000080= 0x00000080,71 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY = 0x00000080, 29 72 DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE = 0x00000100, 30 73 DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2 = 0x00000200, … … 39 82 DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY = 0x00040000, 40 83 DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3 = 0x00080000, 41 DRSUAPI_SUPPORTED_EXTENSION_ 00100000= 0x00100000,84 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V5 = 0x00100000, 42 85 DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2 = 0x00200000, 43 86 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6 = 0x00400000, … … 54 97 DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT = 0x08000000, 55 98 DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS = 0x10000000, 56 DRSUAPI_SUPPORTED_EXTENSION_ 20000000= 0x20000000,57 DRSUAPI_SUPPORTED_EXTENSION_ 40000000= 0x40000000,58 DRSUAPI_SUPPORTED_EXTENSION_ 80000000= 0x8000000099 DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V10 = 0x20000000, 100 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART2 = 0x40000000, 101 DRSUAPI_SUPPORTED_EXTENSION_RESERVED_PART3 = 0x80000000 59 102 } drsuapi_SupportedExtensions; 60 103 61 104 typedef [bitmap32bit] bitmap { 62 105 DRSUAPI_SUPPORTED_EXTENSION_ADAM = 0x00000001, 63 DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 = 0x00000002 106 DRSUAPI_SUPPORTED_EXTENSION_LH_BETA2 = 0x00000002, 107 DRSUAPI_SUPPORTED_EXTENSION_RECYCLE_BIN = 0x00000004 64 108 } drsuapi_SupportedExtensionsExt; 65 109 … … 143 187 /* Function 0x02 */ 144 188 typedef [public,gensize] struct { 145 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr-> iconv_convenience, ndr->flags)-4)] uint32 __ndr_size;189 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier(r, ndr->flags)-4)] uint32 __ndr_size; 146 190 [value(ndr_size_dom_sid28(&sid, ndr->flags))] uint32 __ndr_size_sid; 147 191 GUID guid; … … 151 195 } drsuapi_DsReplicaObjectIdentifier; 152 196 153 typedef [public] bitmap { 154 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_OPERATION = 0x00000001, 155 DRSUAPI_DS_REPLICA_SYNC_WRITEABLE = 0x00000002, 156 DRSUAPI_DS_REPLICA_SYNC_PERIODIC = 0x00000004, 157 DRSUAPI_DS_REPLICA_SYNC_INTERSITE_MESSAGING = 0x00000008, 158 DRSUAPI_DS_REPLICA_SYNC_ALL_SOURCES = 0x00000010, 159 DRSUAPI_DS_REPLICA_SYNC_FULL = 0x00000020, 160 DRSUAPI_DS_REPLICA_SYNC_URGENT = 0x00000040, 161 DRSUAPI_DS_REPLICA_SYNC_NO_DISCARD = 0x00000080, 162 DRSUAPI_DS_REPLICA_SYNC_FORCE = 0x00000100, 163 DRSUAPI_DS_REPLICA_SYNC_ADD_REFERENCE = 0x00000200, 164 DRSUAPI_DS_REPLICA_SYNC_NEVER_COMPLETED = 0x00000400, 165 DRSUAPI_DS_REPLICA_SYNC_TWO_WAY = 0x00000800, 166 DRSUAPI_DS_REPLICA_SYNC_NEVER_NOTIFY = 0x00001000, 167 DRSUAPI_DS_REPLICA_SYNC_INITIAL = 0x00002000, 168 DRSUAPI_DS_REPLICA_SYNC_USE_COMPRESSION = 0x00004000, 169 DRSUAPI_DS_REPLICA_SYNC_ABANDONED = 0x00008000, 170 DRSUAPI_DS_REPLICA_SYNC_INITIAL_IN_PROGRESS = 0x00010000, 171 DRSUAPI_DS_REPLICA_SYNC_PARTIAL_ATTRIBUTE_SET = 0x00020000, 172 DRSUAPI_DS_REPLICA_SYNC_REQUEUE = 0x00040000, 173 DRSUAPI_DS_REPLICA_SYNC_NOTIFICATION = 0x00080000, 174 DRSUAPI_DS_REPLICA_SYNC_ASYNCHRONOUS_REPLICA = 0x00100000, 175 DRSUAPI_DS_REPLICA_SYNC_CRITICAL = 0x00200000, 176 DRSUAPI_DS_REPLICA_SYNC_FULL_IN_PROGRESS = 0x00400000, 177 DRSUAPI_DS_REPLICA_SYNC_PREEMPTED = 0x00800000 178 } drsuapi_DsReplicaSyncOptions; 179 180 typedef struct { 181 drsuapi_DsReplicaObjectIdentifier *naming_context; 197 typedef struct { 198 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; 182 199 GUID source_dsa_guid; 183 astring * other_info; /* I assume this is related to the repsFromTo1OtherInfo dns_name*/184 drsuapi_D sReplicaSyncOptions options;200 astring *source_dsa_dns; /* Source DSA dns_name in <guid>._msdcs.<domain_dns> form */ 201 drsuapi_DrsOptions options; 185 202 } drsuapi_DsReplicaSyncRequest1; 186 203 187 typedef [switch_type( int32)] union {204 typedef [switch_type(uint32)] union { 188 205 [case(1)] drsuapi_DsReplicaSyncRequest1 req1; 189 206 } drsuapi_DsReplicaSyncRequest; … … 191 208 WERROR drsuapi_DsReplicaSync( 192 209 [in] policy_handle *bind_handle, 193 [in] int32 level,194 [in,switch_is(level)] drsuapi_DsReplicaSyncRequest req210 [in] uint32 level, 211 [in,switch_is(level)] drsuapi_DsReplicaSyncRequest *req 195 212 ); 196 213 … … 215 232 [size_is(count)] drsuapi_DsReplicaCursor cursors[]; 216 233 } drsuapi_DsReplicaCursorCtrEx; 217 218 typedef [public] bitmap {219 /* the _WRITEABLE flag indicates a replication with all attributes220 *221 * --metze222 */223 DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE = 0x00000010,224 DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP = 0x00000020,225 DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS = 0x00000040,226 DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT = 0x00000080,227 DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP = 0x00000100,228 DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR = 0x00000100,229 DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC = 0x00000200,230 DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY = 0x00000400,231 DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS = 0x00000800,/*Include updates to ancestor objects before updates to their descendants*/232 DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS = 0x00010000,233 DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET = 0x00020000,234 DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED = 0x00200000,235 DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING = 0x00800000,236 DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED = 0x01000000,237 DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS = 0x04000000,238 DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC = 0x08000000,239 /*240 * the following NOTE applies to DsGetNCChangesRequest5:241 * - the data is only compressed when 10 or more objects are replicated242 * - but there could also be a size limit of 35 KBytes or something like that243 * - the reply is DsGetNCChangesCtr2244 * - maybe the same applies to DsGetNCChangesRequest8...245 *246 * --metze247 */248 DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES = 0x10000000,249 DRSUAPI_DS_REPLICA_NEIGHBOUR_NO_CHANGE_NOTIFICATIONS = 0x20000000,250 DRSUAPI_DS_REPLICA_NEIGHBOUR_PARTIAL_ATTRIBUTE_SET = 0x40000000251 } drsuapi_DsReplicaNeighbourFlags;252 234 253 235 typedef [flag(NDR_PAHEX),v1_enum] enum { … … 288 270 drsuapi_DsReplicaHighWaterMark highwatermark; 289 271 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; 290 drsuapi_D sReplicaNeighbourFlags replica_flags;272 drsuapi_DrsOptions replica_flags; 291 273 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ 292 274 uint32 max_ndr_size; /* w2k3 seems to ignore this */ … … 379 361 * 2.5.5.17 => dom_sid 380 362 */ 381 typedef [nop ush,nopull] struct {382 [range(0,10000) ,value(ndr_size_drsuapi_DsReplicaOID_oid(oid, 0))] uint32 __ndr_size;383 [size_is( __ndr_size),charset(DOS)] uint8 *oid; /* it's encoded with asn1_write_OID_String() */363 typedef [noprint] struct { 364 [range(0,10000)] uint32 length; 365 [size_is(length)] uint8 *binary_oid; /* partial-binary-OID encoded with asn1_write_partial_OID_String() */ 384 366 } drsuapi_DsReplicaOID; 385 367 … … 401 383 402 384 typedef [flag(NDR_PAHEX),v1_enum,public] enum { 403 DRSUAPI_ATTRIBUTE_objectClass = 0x00000000, 404 DRSUAPI_ATTRIBUTE_description = 0x0000000d, 405 DRSUAPI_ATTRIBUTE_member = 0x0000001f, 406 DRSUAPI_ATTRIBUTE_instanceType = 0x00020001, 407 DRSUAPI_ATTRIBUTE_whenCreated = 0x00020002, 408 DRSUAPI_ATTRIBUTE_possSuperiors = 0x00020008, 409 DRSUAPI_ATTRIBUTE_hasMasterNCs = 0x0002000e, 410 DRSUAPI_ATTRIBUTE_subClassOf = 0x00020015, 411 DRSUAPI_ATTRIBUTE_governsID = 0x00020016, 412 DRSUAPI_ATTRIBUTE_mustContain = 0x00020018, 413 DRSUAPI_ATTRIBUTE_mayContain = 0x00020019, 414 DRSUAPI_ATTRIBUTE_attributeID = 0x0002001e, 415 DRSUAPI_ATTRIBUTE_attributeSyntax = 0x00020020, 416 DRSUAPI_ATTRIBUTE_isSingleValued = 0x00020021, 417 DRSUAPI_ATTRIBUTE_rangeLower = 0x00020022, 418 DRSUAPI_ATTRIBUTE_rangeUpper = 0x00020023, 419 DRSUAPI_ATTRIBUTE_dMDLocation = 0x00020024, 420 DRSUAPI_ATTRIBUTE_objectVersion = 0x0002004c, 421 DRSUAPI_ATTRIBUTE_invocationId = 0x00020073, 422 DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly = 0x000200a9, 423 DRSUAPI_ATTRIBUTE_adminDisplayName = 0x000200c2, 424 DRSUAPI_ATTRIBUTE_adminDescription = 0x000200e2, 425 DRSUAPI_ATTRIBUTE_oMSyntax = 0x000200e7, 426 DRSUAPI_ATTRIBUTE_ntSecurityDescriptor = 0x00020119, 427 DRSUAPI_ATTRIBUTE_searchFlags = 0x0002014e, 428 DRSUAPI_ATTRIBUTE_auxiliaryClass = 0x0002015f, 429 DRSUAPI_ATTRIBUTE_lDAPDisplayName = 0x000201cc, 430 DRSUAPI_ATTRIBUTE_name = 0x00090001, 431 DRSUAPI_ATTRIBUTE_userAccountControl = 0x00090008, 432 DRSUAPI_ATTRIBUTE_currentValue = 0x0009001b, 433 DRSUAPI_ATTRIBUTE_homeDirectory = 0x0009002c, 434 DRSUAPI_ATTRIBUTE_homeDrive = 0x0009002d, 435 DRSUAPI_ATTRIBUTE_scriptPath = 0x0009003e, 436 DRSUAPI_ATTRIBUTE_profilePath = 0x0009008b, 437 DRSUAPI_ATTRIBUTE_objectSid = 0x00090092, 438 DRSUAPI_ATTRIBUTE_schemaIDGUID = 0x00090094, 439 DRSUAPI_ATTRIBUTE_dBCSPwd = 0x00090037,/* lmPwdHash */ 440 DRSUAPI_ATTRIBUTE_logonHours = 0x00090040, 441 DRSUAPI_ATTRIBUTE_userWorkstations = 0x00090056, 442 DRSUAPI_ATTRIBUTE_unicodePwd = 0x0009005a,/* ntPwdHash */ 443 DRSUAPI_ATTRIBUTE_ntPwdHistory = 0x0009005e, 444 DRSUAPI_ATTRIBUTE_priorValue = 0x00090064, 445 DRSUAPI_ATTRIBUTE_supplementalCredentials = 0x0009007d, 446 DRSUAPI_ATTRIBUTE_trustAuthIncoming = 0x00090081, 447 DRSUAPI_ATTRIBUTE_trustAuthOutgoing = 0x00090087, 448 DRSUAPI_ATTRIBUTE_lmPwdHistory = 0x000900a0, 449 DRSUAPI_ATTRIBUTE_systemPossSuperiors = 0x000900c3, 450 DRSUAPI_ATTRIBUTE_systemMayContain = 0x000900c4, 451 DRSUAPI_ATTRIBUTE_systemMustContain = 0x000900c5, 452 DRSUAPI_ATTRIBUTE_sAMAccountName = 0x000900dd, 453 DRSUAPI_ATTRIBUTE_sAMAccountType = 0x0009012e, 454 DRSUAPI_ATTRIBUTE_fSMORoleOwner = 0x00090171, 455 DRSUAPI_ATTRIBUTE_systemFlags = 0x00090177, 456 DRSUAPI_ATTRIBUTE_serverReference = 0x00090203, 457 DRSUAPI_ATTRIBUTE_serverReferenceBL = 0x00090204, 458 DRSUAPI_ATTRIBUTE_initialAuthIncoming = 0x0009021b, 459 DRSUAPI_ATTRIBUTE_initialAuthOutgoing = 0x0009021c, 460 DRSUAPI_ATTRIBUTE_wellKnownObjects = 0x0009026a, 461 DRSUAPI_ATTRIBUTE_dNSHostName = 0x0009026b, 462 DRSUAPI_ATTRIBUTE_isMemberOfPartialAttributeSet = 0x0009027f, 463 DRSUAPI_ATTRIBUTE_userPrincipalName = 0x00090290, 464 DRSUAPI_ATTRIBUTE_groupType = 0x000902ee, 465 DRSUAPI_ATTRIBUTE_servicePrincipalName = 0x00090303, 466 DRSUAPI_ATTRIBUTE_objectCategory = 0x0009030e, 467 DRSUAPI_ATTRIBUTE_gPLink = 0x0009037b, 468 DRSUAPI_ATTRIBUTE_msDS_Behavior_Version = 0x000905b3, 469 DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber = 0x000906f6, 470 DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs = 0x0009071c, 471 DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c 385 DRSUAPI_ATTID_objectClass = 0x00000000, 386 DRSUAPI_ATTID_cn = 0x00000003, 387 DRSUAPI_ATTID_ou = 0x0000000b, 388 DRSUAPI_ATTID_description = 0x0000000d, 389 DRSUAPI_ATTID_member = 0x0000001f, 390 DRSUAPI_ATTID_instanceType = 0x00020001, 391 DRSUAPI_ATTID_whenCreated = 0x00020002, 392 DRSUAPI_ATTID_possSuperiors = 0x00020008, 393 DRSUAPI_ATTID_displayName = 0x0002000d, 394 DRSUAPI_ATTID_hasMasterNCs = 0x0002000e, 395 DRSUAPI_ATTID_subClassOf = 0x00020015, 396 DRSUAPI_ATTID_governsID = 0x00020016, 397 DRSUAPI_ATTID_mustContain = 0x00020018, 398 DRSUAPI_ATTID_mayContain = 0x00020019, 399 DRSUAPI_ATTID_rDNAttId = 0x0002001A, 400 DRSUAPI_ATTID_attributeID = 0x0002001e, 401 DRSUAPI_ATTID_attributeSyntax = 0x00020020, 402 DRSUAPI_ATTID_isSingleValued = 0x00020021, 403 DRSUAPI_ATTID_rangeLower = 0x00020022, 404 DRSUAPI_ATTID_rangeUpper = 0x00020023, 405 DRSUAPI_ATTID_dMDLocation = 0x00020024, 406 DRSUAPI_ATTID_isDeleted = 0x00020030, 407 DRSUAPI_ATTID_objectVersion = 0x0002004c, 408 DRSUAPI_ATTID_invocationId = 0x00020073, 409 DRSUAPI_ATTID_showInAdvancedViewOnly = 0x000200a9, 410 DRSUAPI_ATTID_adminDisplayName = 0x000200c2, 411 DRSUAPI_ATTID_adminDescription = 0x000200e2, 412 DRSUAPI_ATTID_oMSyntax = 0x000200e7, 413 DRSUAPI_ATTID_ntSecurityDescriptor = 0x00020119, 414 DRSUAPI_ATTID_searchFlags = 0x0002014e, 415 DRSUAPI_ATTID_auxiliaryClass = 0x0002015f, 416 DRSUAPI_ATTID_lDAPDisplayName = 0x000201cc, 417 DRSUAPI_ATTID_name = 0x00090001, 418 DRSUAPI_ATTID_userAccountControl = 0x00090008, 419 DRSUAPI_ATTID_badPwdCount = 0x0009000c, 420 DRSUAPI_ATTID_codePage = 0x00090010, 421 DRSUAPI_ATTID_countryCode = 0x00090019, 422 DRSUAPI_ATTID_currentValue = 0x0009001b, 423 DRSUAPI_ATTID_homeDirectory = 0x0009002c, 424 DRSUAPI_ATTID_homeDrive = 0x0009002d, 425 DRSUAPI_ATTID_lastLogoff = 0x00090033, 426 DRSUAPI_ATTID_lastLogon = 0x00090034, 427 DRSUAPI_ATTID_dBCSPwd = 0x00090037,/* lmPwdHash */ 428 DRSUAPI_ATTID_scriptPath = 0x0009003e, 429 DRSUAPI_ATTID_logonHours = 0x00090040, 430 DRSUAPI_ATTID_userWorkstations = 0x00090056, 431 DRSUAPI_ATTID_unicodePwd = 0x0009005a,/* ntPwdHash */ 432 DRSUAPI_ATTID_ntPwdHistory = 0x0009005e, 433 DRSUAPI_ATTID_pwdLastSet = 0x00090060, 434 DRSUAPI_ATTID_primaryGroupID = 0x00090062, 435 DRSUAPI_ATTID_priorValue = 0x00090064, 436 DRSUAPI_ATTID_supplementalCredentials = 0x0009007d, 437 DRSUAPI_ATTID_trustAuthIncoming = 0x00090081, 438 DRSUAPI_ATTID_trustAuthOutgoing = 0x00090087, 439 DRSUAPI_ATTID_userParameters = 0x0009008a, 440 DRSUAPI_ATTID_profilePath = 0x0009008b, 441 DRSUAPI_ATTID_objectSid = 0x00090092, 442 DRSUAPI_ATTID_schemaIDGUID = 0x00090094, 443 DRSUAPI_ATTID_comment = 0x0009009C,/* User-Comment */ 444 DRSUAPI_ATTID_accountExpires = 0x0009009f, 445 DRSUAPI_ATTID_lmPwdHistory = 0x000900a0, 446 DRSUAPI_ATTID_logonCount = 0x000900a9, 447 DRSUAPI_ATTID_systemPossSuperiors = 0x000900c3, 448 DRSUAPI_ATTID_systemMayContain = 0x000900c4, 449 DRSUAPI_ATTID_systemMustContain = 0x000900c5, 450 DRSUAPI_ATTID_systemAuxiliaryClass = 0x000900c6, 451 DRSUAPI_ATTID_sAMAccountName = 0x000900dd, 452 DRSUAPI_ATTID_sAMAccountType = 0x0009012e, 453 DRSUAPI_ATTID_options = 0x00090133, 454 DRSUAPI_ATTID_fSMORoleOwner = 0x00090171, 455 DRSUAPI_ATTID_systemFlags = 0x00090177, 456 DRSUAPI_ATTID_serverReference = 0x00090203, 457 DRSUAPI_ATTID_serverReferenceBL = 0x00090204, 458 DRSUAPI_ATTID_initialAuthIncoming = 0x0009021b, 459 DRSUAPI_ATTID_initialAuthOutgoing = 0x0009021c, 460 DRSUAPI_ATTID_wellKnownObjects = 0x0009026a, 461 DRSUAPI_ATTID_dNSHostName = 0x0009026b, 462 DRSUAPI_ATTID_isMemberOfPartialAttributeSet = 0x0009027f, 463 DRSUAPI_ATTID_userPrincipalName = 0x00090290, 464 DRSUAPI_ATTID_groupType = 0x000902ee, 465 DRSUAPI_ATTID_servicePrincipalName = 0x00090303, 466 DRSUAPI_ATTID_lastKnownParent = 0x0009030d, 467 DRSUAPI_ATTID_objectCategory = 0x0009030e, 468 DRSUAPI_ATTID_gPLink = 0x0009037b, 469 DRSUAPI_ATTID_transportAddressAttribute = 0x0009037f, 470 DRSUAPI_ATTID_msDS_Behavior_Version = 0x000905b3, 471 DRSUAPI_ATTID_msDS_KeyVersionNumber = 0x000906f6, 472 DRSUAPI_ATTID_msDS_HasDomainNCs = 0x0009071c, 473 DRSUAPI_ATTID_msDS_hasMasterNCs = 0x0009072c, 474 DRSUAPI_ATTID_isRecycled = 0x0009080a, 475 476 DRSUAPI_ATTID_INVALID = 0xFFFFFFFF 472 477 } drsuapi_DsAttributeId; 473 478 … … 485 490 drsuapi_DsReplicaHighWaterMark highwatermark; 486 491 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; 487 drsuapi_D sReplicaNeighbourFlags replica_flags;492 drsuapi_DrsOptions replica_flags; 488 493 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ 489 494 uint32 max_ndr_size; /* w2k3 seems to ignore this */ … … 501 506 drsuapi_DsReplicaHighWaterMark highwatermark; 502 507 drsuapi_DsReplicaCursorCtrEx *uptodateness_vector; 503 drsuapi_D sReplicaNeighbourFlags replica_flags;508 drsuapi_DrsOptions replica_flags; 504 509 uint32 max_object_count; /* w2k3 uses min(133,max(100,max_object_count)) */ 505 510 uint32 max_ndr_size; /* w2k3 seems to ignore this */ … … 512 517 } drsuapi_DsGetNCChangesRequest10; 513 518 514 typedef [switch_type( int32)] union {519 typedef [switch_type(uint32)] union { 515 520 [case(5)] drsuapi_DsGetNCChangesRequest5 req5; 516 521 [case(8)] drsuapi_DsGetNCChangesRequest8 req8; … … 545 550 /* DN String values */ 546 551 typedef [public,gensize] struct { 547 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr-> iconv_convenience, ndr->flags))] uint32 __ndr_size;552 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(r, ndr->flags))] uint32 __ndr_size; 548 553 [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid; 549 554 GUID guid; … … 554 559 555 560 typedef [public] struct { 556 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr-> iconv_convenience, ndr->flags))] uint32 __ndr_size;561 [value(ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(r, ndr->flags))] uint32 __ndr_size; 557 562 [value(ndr_size_dom_sid28(&sid,ndr->flags))] uint32 __ndr_size_sid; 558 563 GUID guid; … … 564 569 } drsuapi_DsReplicaObjectIdentifier3Binary; 565 570 566 typedef [public ] struct {571 typedef [public,noprint] struct { 567 572 drsuapi_DsAttributeId attid; 568 573 drsuapi_DsAttributeValueCtr value_ctr; … … 617 622 uint32 object_count; 618 623 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */ 619 [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr-> iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;624 [value(ndr_size_drsuapi_DsGetNCChangesCtr1(r,ndr->flags)+55)] uint32 __ndr_size; 620 625 drsuapi_DsReplicaObjectListItemEx *first_object; 621 626 boolean32 more_data; … … 651 656 uint32 object_count; 652 657 /* this +55 is sometimes +56, so I don't know where this comes from... --metze */ 653 [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr-> iconv_convenience,ndr->flags)+55)] uint32 __ndr_size;658 [value(ndr_size_drsuapi_DsGetNCChangesCtr6(r,ndr->flags)+55)] uint32 __ndr_size; 654 659 drsuapi_DsReplicaObjectListItemEx *first_object; 655 660 boolean32 more_data; … … 718 723 719 724 typedef struct { 720 [range(0,6)] int32 level;725 [range(0,6)] uint32 level; 721 726 [range(2,3)] drsuapi_DsGetNCChangesCompressionType type; 722 727 [switch_is(level | (type<<16))] drsuapi_DsGetNCChangesCompressedCtr ctr; 723 728 } drsuapi_DsGetNCChangesCtr7; 724 729 725 typedef [switch_type( int32)] union {730 typedef [switch_type(uint32)] union { 726 731 [case(1)] drsuapi_DsGetNCChangesCtr1 ctr1; 727 732 [case(2)] drsuapi_DsGetNCChangesCtr2 ctr2; … … 732 737 WERROR drsuapi_DsGetNCChanges( 733 738 [in] policy_handle *bind_handle, 734 [in] int32 level,739 [in] uint32 level, 735 740 [in,ref,switch_is(level)] drsuapi_DsGetNCChangesRequest *req, 736 [out,ref] int32 *level_out,741 [out,ref] uint32 *level_out, 737 742 [out,ref,switch_is(*level_out)] drsuapi_DsGetNCChangesCtr *ctr 738 743 ); … … 741 746 /* Function 0x04 */ 742 747 /* [MS-DRSR] 4.1.26 */ 743 typedef bitmap {744 DRSUAPI_DS_REPLICA_UPDATE_ASYNCHRONOUS_OPERATION = 0x00000001,745 DRSUAPI_DS_REPLICA_UPDATE_GETCHG_CHECK = 0x00000002,746 DRSUAPI_DS_REPLICA_UPDATE_ADD_REFERENCE = 0x00000004,747 DRSUAPI_DS_REPLICA_UPDATE_DELETE_REFERENCE = 0x00000008,748 DRSUAPI_DS_REPLICA_UPDATE_WRITEABLE = 0x00000010749 } drsuapi_DsReplicaUpdateRefsOptions;750 748 751 749 typedef struct { … … 753 751 [ref,charset(DOS),string] uint8 *dest_dsa_dns_name; 754 752 GUID dest_dsa_guid; 755 drsuapi_D sReplicaUpdateRefsOptions options;753 drsuapi_DrsOptions options; 756 754 } drsuapi_DsReplicaUpdateRefsRequest1; 757 755 758 typedef [switch_type( int32)] union {756 typedef [switch_type(uint32)] union { 759 757 [case(1)] drsuapi_DsReplicaUpdateRefsRequest1 req1; 760 758 } drsuapi_DsReplicaUpdateRefsRequest; … … 762 760 WERROR drsuapi_DsReplicaUpdateRefs( 763 761 [in] policy_handle *bind_handle, 764 [in] int32 level,762 [in] uint32 level, 765 763 [in,switch_is(level)] drsuapi_DsReplicaUpdateRefsRequest req 766 764 ); … … 768 766 /*****************/ 769 767 /* Function 0x05 */ 770 typedef bitmap {771 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,772 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002773 /* TODO ... */774 } drsuapi_DsReplicaAddOptions;775 776 768 777 769 typedef struct { … … 779 771 [charset(UTF16),string] uint16 *source_dsa_address; 780 772 uint8 schedule[84]; 781 drsuapi_D sReplicaAddOptions options;773 drsuapi_DrsOptions options; 782 774 } drsuapi_DsReplicaAddRequest1; 783 775 … … 788 780 [charset(UTF16),string] uint16 *source_dsa_address; 789 781 uint8 schedule[84]; 790 drsuapi_D sReplicaAddOptions options;782 drsuapi_DrsOptions options; 791 783 } drsuapi_DsReplicaAddRequest2; 792 784 793 typedef [switch_type( int32)] union {785 typedef [switch_type(uint32)] union { 794 786 [case(1)] drsuapi_DsReplicaAddRequest1 req1; 795 787 [case(2)] drsuapi_DsReplicaAddRequest2 req2; … … 798 790 WERROR drsuapi_DsReplicaAdd( 799 791 [in] policy_handle *bind_handle, 800 [in] int32 level,792 [in] uint32 level, 801 793 [in,switch_is(level)] drsuapi_DsReplicaAddRequest req 802 794 ); … … 805 797 /*****************/ 806 798 /* Function 0x06 */ 807 typedef bitmap {808 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,809 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002810 /* TODO ... */811 } drsuapi_DsReplicaDeleteOptions;812 813 814 799 typedef struct { 815 800 [ref] drsuapi_DsReplicaObjectIdentifier *naming_context; 816 801 [charset(UTF16),string] uint16 *source_dsa_address; 817 drsuapi_D sReplicaDeleteOptions options;802 drsuapi_DrsOptions options; 818 803 } drsuapi_DsReplicaDelRequest1; 819 804 820 typedef [switch_type( int32)] union {805 typedef [switch_type(uint32)] union { 821 806 [case(1)] drsuapi_DsReplicaDelRequest1 req1; 822 807 } drsuapi_DsReplicaDelRequest; … … 824 809 WERROR drsuapi_DsReplicaDel( 825 810 [in] policy_handle *bind_handle, 826 [in] int32 level,811 [in] uint32 level, 827 812 [in,switch_is(level)] drsuapi_DsReplicaDelRequest req 828 813 ); … … 830 815 /*****************/ 831 816 /* Function 0x07 */ 832 typedef bitmap {833 DRSUAPI_DS_REPLICA_ADD_ASYNCHRONOUS_OPERATION = 0x00000001,834 DRSUAPI_DS_REPLICA_ADD_WRITEABLE = 0x00000002835 /* TODO ... */836 } drsuapi_DsReplicaModifyOptions;837 838 817 839 818 typedef struct { … … 842 821 [charset(UTF16),string] uint16 *source_dra_address; 843 822 uint8 schedule[84]; 844 uint32replica_flags;823 drsuapi_DrsOptions replica_flags; 845 824 uint32 modify_fields; 846 drsuapi_D sReplicaModifyOptions options;825 drsuapi_DrsOptions options; 847 826 } drsuapi_DsReplicaModRequest1; 848 827 849 typedef [switch_type( int32)] union {828 typedef [switch_type(uint32)] union { 850 829 [case(1)] drsuapi_DsReplicaModRequest1 req1; 851 830 } drsuapi_DsReplicaModRequest; … … 853 832 WERROR drsuapi_DsReplicaMod( 854 833 [in] policy_handle *bind_handle, 855 [in] int32 level,834 [in] uint32 level, 856 835 [in,switch_is(level)] drsuapi_DsReplicaModRequest req 857 836 ); … … 884 863 } drsuapi_DsGetMembershipsCtr1; 885 864 886 typedef [switch_type( int32)] union {865 typedef [switch_type(uint32)] union { 887 866 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1; 888 867 } drsuapi_DsGetMembershipsCtr; … … 894 873 [size_is(count)] drsuapi_DsReplicaObjectIdentifier **info_array; 895 874 uint32 flags; 896 drsuapi_DsMembershipType type;875 [range(1,7)] drsuapi_DsMembershipType type; 897 876 drsuapi_DsReplicaObjectIdentifier *domain; 898 877 } drsuapi_DsGetMembershipsRequest1; 899 878 900 typedef [switch_type( int32)] union {879 typedef [switch_type(uint32)] union { 901 880 [case(1)] drsuapi_DsGetMembershipsRequest1 req1; 902 881 } drsuapi_DsGetMembershipsRequest; 903 882 904 [todo]WERROR drsuapi_DsGetMemberships(883 WERROR drsuapi_DsGetMemberships( 905 884 [in] policy_handle *bind_handle, 906 [in] int32 level,885 [in] uint32 level, 907 886 [in,ref] [switch_is(level)] drsuapi_DsGetMembershipsRequest *req, 908 [out,ref] int32 *level_out,887 [out,ref] uint32 *level_out, 909 888 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMembershipsCtr *ctr 910 889 ); … … 916 895 /*****************/ 917 896 /* Function 0x0b */ 918 typedef struct { 919 uint32 unknown1; 920 uint32 unknown2; 921 [range(0,0x00A00000)] uint32 length; 922 [size_is(length)] uint8 *data; 897 typedef [bitmap32bit] bitmap { 898 DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG = 0x00000001, 899 DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS = 0x00000002 900 } drsuapi_DsGetNT4ChangeLogFlags; 901 902 typedef struct { 903 drsuapi_DsGetNT4ChangeLogFlags flags; 904 uint32 preferred_maximum_length; 905 [range(0,0x00A00000)] uint32 restart_length; 906 [size_is(restart_length)] uint8 *restart_data; 923 907 } drsuapi_DsGetNT4ChangeLogRequest1; 924 908 … … 928 912 929 913 typedef struct { 930 [range(0,0x00A00000)] uint32 length1;931 [range(0,0x00A00000)] uint32 l ength2;932 hyper unknown1;933 NTTIME time2;934 hyper unknown3;935 NTTIME time4;936 hyper unknown5;937 NTTIME time6;914 [range(0,0x00A00000)] uint32 restart_length; 915 [range(0,0x00A00000)] uint32 log_length; 916 hyper sam_serial_number; 917 NTTIME sam_creation_time; 918 hyper builtin_serial_number; 919 NTTIME builtin_creation_time; 920 hyper lsa_serial_number; 921 NTTIME lsa_creation_time; 938 922 NTSTATUS status; 939 [size_is( length1)] uint8 *data1;940 [size_is(l ength2)] uint8 *data2;923 [size_is(restart_length)] uint8 *restart_data; 924 [size_is(log_length)] uint8 *log_data; 941 925 } drsuapi_DsGetNT4ChangeLogInfo1; 942 926 … … 945 929 } drsuapi_DsGetNT4ChangeLogInfo; 946 930 947 [todo]WERROR drsuapi_DsGetNT4ChangeLog(931 WERROR drsuapi_DsGetNT4ChangeLog( 948 932 [in] policy_handle *bind_handle, 949 933 [in] uint32 level, … … 975 959 976 960 typedef [v1_enum] enum { 977 DRSUAPI_DS_NAME_FORMAT_UNKNOWN = 0, 978 DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 1, 979 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 2, 980 DRSUAPI_DS_NAME_FORMAT_DISPLAY = 3, 981 DRSUAPI_DS_NAME_FORMAT_GUID = 6, 982 DRSUAPI_DS_NAME_FORMAT_CANONICAL = 7, 983 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 8, 984 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 9, 985 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 10, 986 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 11, 987 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 12 961 DRSUAPI_DS_NAME_FORMAT_UNKNOWN = 0x00000000, 962 DRSUAPI_DS_NAME_FORMAT_FQDN_1779 = 0x00000001, 963 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT = 0x00000002, 964 DRSUAPI_DS_NAME_FORMAT_DISPLAY = 0x00000003, 965 DRSUAPI_DS_NAME_FORMAT_GUID = 0x00000006, 966 DRSUAPI_DS_NAME_FORMAT_CANONICAL = 0x00000007, 967 DRSUAPI_DS_NAME_FORMAT_USER_PRINCIPAL = 0x00000008, 968 DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX = 0x00000009, 969 DRSUAPI_DS_NAME_FORMAT_SERVICE_PRINCIPAL = 0x0000000A, 970 DRSUAPI_DS_NAME_FORMAT_SID_OR_SID_HISTORY = 0x0000000B, 971 DRSUAPI_DS_NAME_FORMAT_DNS_DOMAIN = 0x0000000C, 972 DRSUAPI_DS_NAME_FORMAT_UPN_AND_ALTSECID = 0xFFFFFFEF, 973 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN_EX = 0xFFFFFFF0, 974 DRSUAPI_DS_NAME_FORMAT_LIST_GLOBAL_CATALOG_SERVERS = 0xFFFFFFF1, 975 DRSUAPI_DS_NAME_FORMAT_UPN_FOR_LOGON = 0xFFFFFFF2, 976 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_WITH_DCS_IN_SITE = 0xFFFFFFF3, 977 DRSUAPI_DS_NAME_FORMAT_STRING_SID_NAME = 0xFFFFFFF4, 978 DRSUAPI_DS_NAME_FORMAT_ALT_SECURITY_IDENTITIES_NAME = 0xFFFFFFF5, 979 DRSUAPI_DS_NAME_FORMAT_LIST_NCS = 0xFFFFFFF6, 980 DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS = 0xFFFFFFF7, 981 DRSUAPI_DS_NAME_FORMAT_MAP_SCHEMA_GUID = 0xFFFFFFF8, 982 DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN = 0xFFFFFFF9, 983 DRSUAPI_DS_NAME_FORMAT_LIST_ROLES = 0xFFFFFFFA, 984 DRSUAPI_DS_NAME_FORMAT_LIST_INFO_FOR_SERVER = 0xFFFFFFFB, 985 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_FOR_DOMAIN_IN_SITE = 0xFFFFFFFC, 986 DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS_IN_SITE = 0xFFFFFFFD, 987 DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_IN_SITE = 0xFFFFFFFE, 988 DRSUAPI_DS_NAME_FORMAT_LIST_SITES = 0xFFFFFFFF 988 989 } drsuapi_DsNameFormat; 989 990 … … 1002 1003 } drsuapi_DsNameRequest1; 1003 1004 1004 typedef [switch_type( int32)] union {1005 typedef [switch_type(uint32)] union { 1005 1006 [case(1)] drsuapi_DsNameRequest1 req1; 1006 1007 } drsuapi_DsNameRequest; … … 1017 1018 } drsuapi_DsNameCtr1; 1018 1019 1019 typedef [switch_type( int32)] union {1020 typedef [switch_type(uint32)] union { 1020 1021 [case(1)] drsuapi_DsNameCtr1 *ctr1; 1021 1022 } drsuapi_DsNameCtr; … … 1023 1024 WERROR drsuapi_DsCrackNames( 1024 1025 [in] policy_handle *bind_handle, 1025 [in] int32 level,1026 [in] uint32 level, 1026 1027 [in,ref,switch_is(level)] drsuapi_DsNameRequest *req, 1027 [out,ref] int32 *level_out,1028 [out,ref] uint32 *level_out, 1028 1029 [out,ref,switch_is(*level_out)] drsuapi_DsNameCtr *ctr 1029 1030 ); … … 1045 1046 } drsuapi_DsWriteAccountSpnRequest1; 1046 1047 1047 typedef [switch_type( int32)] union {1048 typedef [switch_type(uint32)] union { 1048 1049 [case(1)] drsuapi_DsWriteAccountSpnRequest1 req1; 1049 1050 } drsuapi_DsWriteAccountSpnRequest; … … 1053 1054 } drsuapi_DsWriteAccountSpnResult1; 1054 1055 1055 typedef [switch_type( int32)] union {1056 typedef [switch_type(uint32)] union { 1056 1057 [case(1)] drsuapi_DsWriteAccountSpnResult1 res1; 1057 1058 } drsuapi_DsWriteAccountSpnResult; … … 1059 1060 WERROR drsuapi_DsWriteAccountSpn( 1060 1061 [in] policy_handle *bind_handle, 1061 [in] int32 level,1062 [in] uint32 level, 1062 1063 [in,ref,switch_is(level)] drsuapi_DsWriteAccountSpnRequest *req, 1063 [out,ref] int32 *level_out,1064 [out,ref] uint32 *level_out, 1064 1065 [out,ref,switch_is(*level_out)] drsuapi_DsWriteAccountSpnResult *res 1065 1066 ); … … 1073 1074 } drsuapi_DsRemoveDSServerRequest1; 1074 1075 1075 typedef [switch_type( int32)] union {1076 typedef [switch_type(uint32)] union { 1076 1077 [case(1)] drsuapi_DsRemoveDSServerRequest1 req1; 1077 1078 } drsuapi_DsRemoveDSServerRequest; … … 1081 1082 } drsuapi_DsRemoveDSServerResult1; 1082 1083 1083 typedef [switch_type( int32)] union {1084 typedef [switch_type(uint32)] union { 1084 1085 [case(1)] drsuapi_DsRemoveDSServerResult1 res1; 1085 1086 } drsuapi_DsRemoveDSServerResult; … … 1087 1088 WERROR drsuapi_DsRemoveDSServer( 1088 1089 [in] policy_handle *bind_handle, 1089 [in] int32 level,1090 [in] uint32 level, 1090 1091 [in,ref,switch_is(level)] drsuapi_DsRemoveDSServerRequest *req, 1091 [out,ref] int32 *level_out,1092 [out,ref] uint32 *level_out, 1092 1093 [out,ref,switch_is(*level_out)] drsuapi_DsRemoveDSServerResult *res 1093 1094 ); … … 1237 1238 const char *DRSUAPI_NTDSDSA_KRB5_SERVICE_GUID = "E3514235-4B06-11D1-AB04-00C04FC2DCD2"; 1238 1239 1240 /* Error codes to classify an error that occurs 1241 * during a search for, or the update of, 1242 * a directory object */ 1243 typedef [v1_enum] enum { 1244 DRSUAPI_DIRERR_OK = 0, 1245 DRSUAPI_DIRERR_ATTRIBUTE = 1, 1246 DRSUAPI_DIRERR_NAME = 2, 1247 DRSUAPI_DIRERR_REFERRAL = 3, 1248 DRSUAPI_DIRERR_SECURITY = 4, 1249 DRSUAPI_DIRERR_SERVICE = 5, 1250 DRSUAPI_DIRERR_UPDATE = 6, 1251 DRSUAPI_DIRERR_SYSTEM = 7 1252 } drsuapi_DsAddEntry_DirErr; 1253 1239 1254 /* 1240 * please note the the current idl 1241 * for DsAddEntry does only parse 1242 * what I saw between 2 w2k3 boxes 1243 * in my dssync experiments I got some other replies 1244 * so all I want to say is that this is very incomplete yet... 1245 * --metze 1255 * Ref: DRS_MSG_ADDENTRYREQ_V2, [MS-DRSR]: 4.1.1.1.3 1246 1256 */ 1247 1257 typedef struct { … … 1249 1259 } drsuapi_DsAddEntryRequest2; 1250 1260 1251 typedef [switch_type(int32)] union { 1261 /* Buffer type is actually more 1262 * like a semi Flags 1263 * Ref: DRS_SecBuffer, [MS-DRSR]: 5.41 */ 1264 typedef [v1_enum,noprint] enum { 1265 DRSUAPI_SECBUFFER_EMPTY = 0x00000000, 1266 DRSUAPI_SECBUFFER_DATA = 0x00000001, 1267 DRSUAPI_SECBUFFER_TOKEN = 0x00000002, 1268 DRSUAPI_SECBUFFER_PKG_PARAMS = 0x00000003, 1269 DRSUAPI_SECBUFFER_MISSING = 0x00000004, 1270 DRSUAPI_SECBUFFER_EXTRA = 0x00000005, 1271 DRSUAPI_SECBUFFER_STREAM_TRAILER = 0x00000006, 1272 DRSUAPI_SECBUFFER_STREAM_HEADER = 0x00000007, 1273 DRSUAPI_SECBUFFER_READONLY = 0x80000000 1274 } drsuapi_SecBufferType; 1275 1276 typedef struct { 1277 [range(0,10000)] uint32 buf_size; 1278 drsuapi_SecBufferType buf_type; 1279 [size_is(buf_size)] uint8 *buffer; 1280 } drsuapi_SecBuffer; 1281 1282 typedef struct { 1283 [value(0)] uint32 version; 1284 [range(0,10000)] uint32 buff_count; 1285 [size_is(buff_count)] drsuapi_SecBuffer *buffers; 1286 } drsuapi_SecBufferDesc; 1287 1288 /* 1289 * Ref: DRS_MSG_ADDENTRYREQ_V3, [MS-DRSR]: 4.1.1.1.4 1290 */ 1291 typedef struct { 1292 drsuapi_DsReplicaObjectListItem first_object; 1293 drsuapi_SecBufferDesc *client_creds; 1294 } drsuapi_DsAddEntryRequest3; 1295 1296 typedef [switch_type(uint32)] union { 1252 1297 [case(2)] drsuapi_DsAddEntryRequest2 req2; 1298 [case(3)] drsuapi_DsAddEntryRequest3 req3; 1253 1299 } drsuapi_DsAddEntryRequest; 1254 1300 1255 typedef struct { 1256 uint32 unknown1; 1301 /* Generic extended error info 1302 * commonly used in most places 1303 * where rich error info is returned */ 1304 typedef struct { 1305 uint32 dsid; /* implementation-specific diagnostic code */ 1306 WERROR extended_err; /* 0, STATUS code, or Windows error code */ 1307 uint32 extended_data; /* implementation-specific diagnostic code */ 1308 uint16 problem; /* 0 or PROBLEM error code */ 1309 } drsuapi_DsAddEntryErrorInfoX; 1310 1311 /* Attribute errors 1312 * Ref: ATRERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.11 */ 1313 typedef struct { 1314 uint32 dsid; 1315 WERROR extended_err; 1316 uint32 extended_data; 1317 uint16 problem; 1318 drsuapi_DsAttributeId attid; 1319 boolean32 is_val_returned; 1320 drsuapi_DsAttributeValue attr_val; 1321 } drsuapi_DsAddEntry_AttrErr_V1; 1322 1323 typedef [noprint] struct { 1324 drsuapi_DsAddEntry_AttrErrListItem_V1 *next; 1325 drsuapi_DsAddEntry_AttrErr_V1 err_data; 1326 } drsuapi_DsAddEntry_AttrErrListItem_V1; 1327 1328 typedef struct { 1329 drsuapi_DsReplicaObjectIdentifier *id; 1330 uint32 count; 1331 drsuapi_DsAddEntry_AttrErrListItem_V1 first; 1332 } drsuapi_DsAddEntryErrorInfo_Attr_V1; 1333 1334 /* Name resolution error 1335 * Ref: NAMERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.14 */ 1336 typedef struct { 1337 uint32 dsid; 1338 WERROR extended_err; 1339 uint32 extended_data; 1340 uint16 problem; 1341 drsuapi_DsReplicaObjectIdentifier *id_matched; /* The best match for the supplied object identity */ 1342 } drsuapi_DsAddEntryErrorInfo_Name_V1; 1343 1344 /* Referral error 1345 * Ref: REFERR_DRS_WIRE_V1, [MS-DRSR]: 4.1.1.1.15 */ 1346 typedef struct { 1347 [value(83)] uint8 name_res; /* Must be 'S' */ 1348 [value(0)] uint8 unused_pad; 1349 [value(0)] uint16 next_rdn; 1350 } drsuapi_NameResOp_V1; 1351 1352 typedef [enum16bit] enum { 1353 DRSUAPI_CH_REFTYPE_SUPERIOR = 0x0000, /* referral to a superior DC */ 1354 DRSUAPI_CH_REFTYPE_SUBORDINATE = 0x0001, /* referral to a subordinate DC */ 1355 DRSUAPI_CH_REFTYPE_NSSR = 0x0002, /* Not used */ 1356 DRSUAPI_CH_REFTYPE_CROSS = 0x0003 /* A referral to an external crossRef object */ 1357 } drsuapi_DsAddEntry_RefType; 1358 1359 typedef [enum8bit] enum { 1360 DRSUAPI_SE_CHOICE_BASE_ONLY = 0x00, 1361 DRSUAPI_SE_CHOICE_IMMED_CHLDRN = 0x01, 1362 DRSUAPI_SE_CHOICE_WHOLE_SUBTREE = 0x02 1363 } drsuapi_DsAddEntry_ChoiceType; 1364 1365 /* list of network names of the DCs 1366 * to which the referral is directed */ 1367 typedef struct { 1368 drsuapi_DsaAddressListItem_V1 *next; 1369 lsa_String *address; 1370 } drsuapi_DsaAddressListItem_V1; 1371 1372 typedef struct { 1373 drsuapi_DsReplicaObjectIdentifier *id_target; /* object to which the referral is directed */ 1374 drsuapi_NameResOp_V1 op_state; 1375 [value(0)] uint16 rdn_alias; 1376 [value(0)] uint16 rdn_internal; 1377 drsuapi_DsAddEntry_RefType ref_type; 1378 uint16 addr_list_count; 1379 drsuapi_DsaAddressListItem_V1 *addr_list; 1380 drsuapi_DsAddEntry_RefErrListItem_V1 *next; 1381 boolean32 is_choice_set; 1382 drsuapi_DsAddEntry_ChoiceType choice; 1383 } drsuapi_DsAddEntry_RefErrListItem_V1; 1384 1385 typedef struct { 1386 uint32 dsid; 1387 WERROR extended_err; 1388 uint32 extended_data; 1389 drsuapi_DsAddEntry_RefErrListItem_V1 refer; 1390 } drsuapi_DsAddEntryErrorInfo_Referr_V1; 1391 1392 typedef [switch_type(uint32)] union { 1393 [case(1)] drsuapi_DsAddEntryErrorInfo_Attr_V1 attr_err; 1394 [case(2)] drsuapi_DsAddEntryErrorInfo_Name_V1 name_err; 1395 [case(3)] drsuapi_DsAddEntryErrorInfo_Referr_V1 referral_err; 1396 [case(4)] drsuapi_DsAddEntryErrorInfoX security_err; 1397 [case(5)] drsuapi_DsAddEntryErrorInfoX service_err; 1398 [case(6)] drsuapi_DsAddEntryErrorInfoX update_err; 1399 [case(7)] drsuapi_DsAddEntryErrorInfoX system_err; 1400 } drsuapi_DsAddEntryErrorInfo; 1401 1402 typedef struct { 1257 1403 WERROR status; 1258 uint32 unknown2; 1259 uint16 unknown3; 1260 } drsuapi_DsAddEntryErrorInfoX; 1261 1262 typedef struct { 1263 [range(0,10485760)] uint32 size; 1264 [size_is(size)] uint8 *data; 1265 } drsuapi_DsAddEntryExtraErrorBuffer; 1266 1267 typedef struct { 1268 drsuapi_DsAddEntryErrorInfoX error; 1269 drsuapi_DsAttributeId attid; 1270 uint32 unknown2; 1271 drsuapi_DsAddEntryExtraErrorBuffer buffer; 1272 } drsuapi_DsAddEntryExtraError1; 1273 1274 typedef /*[noprint]*/ struct { 1275 drsuapi_DsAddEntryErrorListItem1 *next; 1276 drsuapi_DsAddEntryExtraError1 error; 1277 } drsuapi_DsAddEntryErrorListItem1; 1278 1279 typedef struct { 1280 drsuapi_DsReplicaObjectIdentifier *id; 1281 WERROR status; 1282 drsuapi_DsAddEntryErrorListItem1 first; 1283 } drsuapi_DsAddEntryErrorInfo1; 1284 1285 typedef [switch_type(uint32)] union { 1286 [case(1)] drsuapi_DsAddEntryErrorInfo1 error1; 1287 /* [case(2)] drsuapi_DsAddEntryErrorInfo2 error2; 1288 [case(3)] drsuapi_DsAddEntryErrorInfo3 error3; 1289 */ [case(4)] drsuapi_DsAddEntryErrorInfoX errorX; 1290 [case(5)] drsuapi_DsAddEntryErrorInfoX errorX; 1291 [case(6)] drsuapi_DsAddEntryErrorInfoX errorX; 1292 [case(7)] drsuapi_DsAddEntryErrorInfoX errorX; 1293 } drsuapi_DsAddEntryErrorInfo; 1294 1295 typedef struct { 1296 WERROR status; 1297 uint32 level; 1298 [switch_is(level)] drsuapi_DsAddEntryErrorInfo *info; 1299 } drsuapi_DsAddEntryError1; 1300 1301 typedef [switch_type(uint32)] union { 1302 [case(1)] drsuapi_DsAddEntryError1 info1; 1303 } drsuapi_DsAddEntryError; 1404 drsuapi_DsAddEntry_DirErr dir_err; 1405 [switch_is(dir_err)] drsuapi_DsAddEntryErrorInfo *info; 1406 } drsuapi_DsAddEntry_ErrData_V1; 1407 1408 typedef [switch_type(uint32)] union { 1409 [case(1)] drsuapi_DsAddEntry_ErrData_V1 v1; 1410 } drsuapi_DsAddEntry_ErrData; 1304 1411 1305 1412 typedef struct { … … 1310 1417 typedef struct { 1311 1418 drsuapi_DsReplicaObjectIdentifier *id; 1312 uint32 unknown1; 1313 drsuapi_DsAddEntryErrorInfoX error; 1419 drsuapi_DsAddEntry_DirErr dir_err; 1420 uint32 dsid; /* implementation-specific diagnostic code */ 1421 WERROR extended_err; /* 0, STATUS code, or Windows error code */ 1422 uint32 extended_data; /* implementation-specific diagnostic code */ 1423 uint16 problem; /* 0 or PROBLEM error code */ 1314 1424 [range(0,10000)] uint32 count; 1315 1425 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects; … … 1318 1428 typedef struct { 1319 1429 drsuapi_DsReplicaObjectIdentifier *id; 1320 uint32 level;1321 [switch_is( level)] drsuapi_DsAddEntryError *error;1430 uint32 err_ver; /* Must be 1 */ 1431 [switch_is(err_ver)] drsuapi_DsAddEntry_ErrData *err_data; 1322 1432 [range(0,10000)] uint32 count; 1323 1433 [size_is(count)] drsuapi_DsReplicaObjectIdentifier2 *objects; 1324 1434 } drsuapi_DsAddEntryCtr3; 1325 1435 1326 typedef [switch_type( int32)] union {1436 typedef [switch_type(uint32)] union { 1327 1437 [case(2)] drsuapi_DsAddEntryCtr2 ctr2; 1328 1438 [case(3)] drsuapi_DsAddEntryCtr3 ctr3; … … 1331 1441 [public] WERROR drsuapi_DsAddEntry( 1332 1442 [in] policy_handle *bind_handle, 1333 [in] int32 level,1443 [in] uint32 level, 1334 1444 [in,ref,switch_is(level)] drsuapi_DsAddEntryRequest *req, 1335 [out,ref] int32 *level_out,1445 [out,ref] uint32 *level_out, 1336 1446 [out,ref,switch_is(*level_out)] drsuapi_DsAddEntryCtr *ctr 1337 1447 ); … … 1378 1488 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2 = 9, 1379 1489 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2 = 10, 1380 DRSUAPI_DS_REPLICA_INFO_ NEIGHBORS02= -2,1381 DRSUAPI_DS_REPLICA_INFO_C ONNECTIONS04= -4,1382 DRSUAPI_DS_REPLICA_INFO_ CURSORS05= -5,1383 DRSUAPI_DS_REPLICA_INFO_ 06= -61490 DRSUAPI_DS_REPLICA_INFO_REPSTO = -2, 1491 DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS = -4, 1492 DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1 = -5, 1493 DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS = -6 1384 1494 } drsuapi_DsReplicaInfoType; 1385 1495 … … 1387 1497 drsuapi_DsReplicaInfoType info_type; 1388 1498 [charset(UTF16),string] uint16 *object_dn; 1389 GUID guid1;1499 GUID source_dsa_guid; 1390 1500 } drsuapi_DsReplicaGetInfoRequest1; 1391 1501 … … 1393 1503 drsuapi_DsReplicaInfoType info_type; 1394 1504 [charset(UTF16),string] uint16 *object_dn; 1395 GUID guid1;1396 uint32 unknown1;1397 [charset(UTF16),string] uint16 * string1;1398 [charset(UTF16),string] uint16 * string2;1399 uint32 unknown2;1505 GUID source_dsa_guid; 1506 uint32 flags; 1507 [charset(UTF16),string] uint16 *attribute_name; 1508 [charset(UTF16),string] uint16 *value_dn_str; 1509 uint32 enumeration_context; 1400 1510 } drsuapi_DsReplicaGetInfoRequest2; 1401 1511 … … 1410 1520 [charset(UTF16),string] uint16 *source_dsa_address; 1411 1521 [charset(UTF16),string] uint16 *transport_obj_dn; 1412 drsuapi_D sReplicaNeighbourFlags replica_flags;1522 drsuapi_DrsOptions replica_flags; 1413 1523 uint32 reserved; 1414 1524 GUID naming_context_obj_guid; … … 1473 1583 } drsuapi_DsReplicaOpType; 1474 1584 1475 typedef [switch_type(drsuapi_DsReplicaOpType)] union {1476 [case(DRSUAPI_DS_REPLICA_OP_TYPE_SYNC)] drsuapi_DsReplicaSyncOptions sync;1477 [case(DRSUAPI_DS_REPLICA_OP_TYPE_ADD)] drsuapi_DsReplicaAddOptions add;1478 [case(DRSUAPI_DS_REPLICA_OP_TYPE_DELETE)] drsuapi_DsReplicaDeleteOptions op_delete;1479 [case(DRSUAPI_DS_REPLICA_OP_TYPE_MODIFY)] drsuapi_DsReplicaModifyOptions modify;1480 [case(DRSUAPI_DS_REPLICA_OP_TYPE_UPDATE_REFS)] drsuapi_DsReplicaUpdateRefsOptions update_refs;1481 [default] uint32 unknown;1482 } drsuapi_DsRplicaOpOptions;1483 1484 1585 typedef struct { 1485 1586 NTTIME operation_start; … … 1487 1588 uint32 priority; 1488 1589 drsuapi_DsReplicaOpType operation_type; 1489 [switch_is(operation_type)] drsuapi_DsRplicaOpOptions options;1590 drsuapi_DrsOptions options; 1490 1591 [charset(UTF16),string] uint16 *nc_dn; 1491 1592 [charset(UTF16),string] uint16 *remote_dsa_obj_dn; … … 1517 1618 typedef struct { 1518 1619 uint32 count; 1519 int32 enumeration_context;1620 uint32 enumeration_context; 1520 1621 [size_is(count)] drsuapi_DsReplicaAttrValMetaData array[]; 1521 1622 } drsuapi_DsReplicaAttrValMetaDataCtr; … … 1523 1624 typedef struct { 1524 1625 uint32 count; 1525 int32 enumeration_context;1626 uint32 enumeration_context; 1526 1627 [size_is(count)] drsuapi_DsReplicaCursor2 array[]; 1527 1628 } drsuapi_DsReplicaCursor2Ctr; … … 1536 1637 typedef struct { 1537 1638 uint32 count; 1538 int32 enumeration_context;1639 uint32 enumeration_context; 1539 1640 [size_is(count)] drsuapi_DsReplicaCursor3 array[]; 1540 1641 } drsuapi_DsReplicaCursor3Ctr; … … 1552 1653 typedef struct { 1553 1654 uint32 count; 1554 int32 enumeration_context;1655 uint32 enumeration_context; 1555 1656 [size_is(count)] drsuapi_DsReplicaObjMetaData2 array[]; 1556 1657 } drsuapi_DsReplicaObjMetaData2Ctr; … … 1573 1674 typedef struct { 1574 1675 uint32 count; 1575 int32 enumeration_context;1676 uint32 enumeration_context; 1576 1677 [size_is(count)] drsuapi_DsReplicaAttrValMetaData2 array[]; 1577 1678 } drsuapi_DsReplicaAttrValMetaData2Ctr; … … 1622 1723 [case(DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2)] drsuapi_DsReplicaObjMetaData2Ctr *objmetadata2; 1623 1724 [case(DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2)] drsuapi_DsReplicaAttrValMetaData2Ctr *attrvalmetadata2; 1624 [case(DRSUAPI_DS_REPLICA_INFO_ NEIGHBORS02)] drsuapi_DsReplicaNeighbourCtr *neighbours02;1625 [case(DRSUAPI_DS_REPLICA_INFO_C ONNECTIONS04)] drsuapi_DsReplicaConnection04Ctr *connections04;1626 [case(DRSUAPI_DS_REPLICA_INFO_ CURSORS05)] drsuapi_DsReplicaCursorCtrEx *cursors05;1627 [case(DRSUAPI_DS_REPLICA_INFO_ 06)] drsuapi_DsReplica06Ctr *i06;1725 [case(DRSUAPI_DS_REPLICA_INFO_REPSTO)] drsuapi_DsReplicaNeighbourCtr *repsto; 1726 [case(DRSUAPI_DS_REPLICA_INFO_CLIENT_CONTEXTS)] drsuapi_DsReplicaConnection04Ctr *clientctx; 1727 [case(DRSUAPI_DS_REPLICA_INFO_UPTODATE_VECTOR_V1)] drsuapi_DsReplicaCursorCtrEx *udv1; 1728 [case(DRSUAPI_DS_REPLICA_INFO_SERVER_OUTGOING_CALLS)] drsuapi_DsReplica06Ctr *srvoutgoingcalls; 1628 1729 } drsuapi_DsReplicaInfo; 1629 1730 … … 1648 1749 } drsuapi_DsGetMemberships2Ctr1; 1649 1750 1650 typedef [switch_type( int32)] union {1751 typedef [switch_type(uint32)] union { 1651 1752 [case(1)] drsuapi_DsGetMembershipsCtr1 ctr1; 1652 1753 } drsuapi_DsGetMemberships2Ctr; … … 1657 1758 } drsuapi_DsGetMemberships2Request1; 1658 1759 1659 typedef [switch_type( int32)] union {1760 typedef [switch_type(uint32)] union { 1660 1761 [case(1)] drsuapi_DsGetMemberships2Request1 req1; 1661 1762 } drsuapi_DsGetMemberships2Request; … … 1663 1764 WERROR drsuapi_DsGetMemberships2( 1664 1765 [in] policy_handle *bind_handle, 1665 [in] int32 level,1766 [in] uint32 level, 1666 1767 [in,ref] [switch_is(level)] drsuapi_DsGetMemberships2Request *req, 1667 [out,ref] int32 *level_out,1768 [out,ref] uint32 *level_out, 1668 1769 [out,ref] [switch_is(*level_out)] drsuapi_DsGetMemberships2Ctr *ctr 1669 1770 ); … … 1687 1788 [range(0,10000)] uint32 num_info; 1688 1789 [size_is(num_info)] drsuapi_DsSiteCostInfo *info; 1689 uint32 unknown;1790 [value(0)] uint32 flags_reserved; 1690 1791 } drsuapi_QuerySitesByCostCtr1; 1691 1792 1692 typedef [switch_type( int32)] union {1793 typedef [switch_type(uint32)] union { 1693 1794 [case(1)] drsuapi_QuerySitesByCostCtr1 ctr1; 1694 1795 } drsuapi_QuerySitesByCostCtr; … … 1701 1802 } drsuapi_QuerySitesByCostRequest1; 1702 1803 1703 typedef [switch_type( int32)] union {1804 typedef [switch_type(uint32)] union { 1704 1805 [case(1)] drsuapi_QuerySitesByCostRequest1 req1; 1705 1806 } drsuapi_QuerySitesByCostRequest; … … 1707 1808 WERROR drsuapi_QuerySitesByCost( 1708 1809 [in] policy_handle *bind_handle, 1709 [in] int32 level,1810 [in] uint32 level, 1710 1811 [in,ref] [switch_is(level)] drsuapi_QuerySitesByCostRequest *req, 1711 [out,ref] int32 *level_out,1812 [out,ref] uint32 *level_out, 1712 1813 [out,ref] [switch_is(*level_out)] drsuapi_QuerySitesByCostCtr *ctr 1713 1814 ); -
trunk/server/librpc/idl/epmapper.idl
r414 r745 31 31 */ 32 32 33 const int EPMAPPER_STATUS_CANT_PERFORM_OP = 0x6d8; 33 34 const int EPMAPPER_STATUS_NO_MORE_ENTRIES = 0x16c9a0d6; 34 35 const int EPMAPPER_STATUS_NO_MEMORY = 0x16C9A012; 35 36 const int EPMAPPER_STATUS_OK = 0; 36 37 38 37 39 38 typedef [enum8bit] enum { … … 217 216 218 217 typedef struct { 219 [value(ndr_size_epm_tower(&tower, ndr-> iconv_convenience, ndr->flags))] uint32 tower_length;218 [value(ndr_size_epm_tower(&tower, ndr->flags))] uint32 tower_length; 220 219 [subcontext(4)] epm_tower tower; 221 220 } epm_twr_t; … … 256 255 [in, size_is(num_ents)] epm_entry_t entries[] 257 256 ); 258 257 258 typedef [v1_enum] enum { 259 RPC_C_EP_ALL_ELTS = 0x00000000, 260 RPC_C_EP_MATCH_BY_IF = 0x00000001, 261 RPC_C_EP_MATCH_BY_OBJ = 0x00000002, 262 RPC_C_EP_MATCH_BY_BOTH = 0x00000003 263 } epm_InquiryType; 264 265 typedef [v1_enum] enum { 266 RPC_C_VERS_ALL = 0x00000000, 267 RPC_C_VERS_COMPATIBLE = 0x00000001, 268 RPC_C_VERS_EXACT = 0x00000002, 269 RPC_C_VERS_MAJOR_ONLY = 0x00000003, 270 RPC_C_VERS_UPTO = 0x00000004 271 } epm_VersionOption; 272 259 273 /**********************/ 260 274 /* Function 0x02 */ 261 275 error_status_t epm_Lookup( 262 [in] uint32inquiry_type,263 [in,ptr] GUID*object,264 [in,ptr] rpc_if_id_t*interface_id,265 [in] uint32vers_option,266 [in,out] policy_handle *entry_handle,267 [in] uint32 max_ents,268 [out] uint32 *num_ents,276 [in] epm_InquiryType inquiry_type, 277 [in,ptr] GUID *object, 278 [in,ptr] rpc_if_id_t *interface_id, 279 [in] epm_VersionOption vers_option, 280 [in,out] policy_handle *entry_handle, 281 [in] uint32 max_ents, 282 [out] uint32 *num_ents, 269 283 [out, length_is(*num_ents), size_is(max_ents)] epm_entry_t entries[] 270 284 ); -
trunk/server/librpc/idl/frsrpc.idl
r414 r745 339 339 [value(pkt_len+12)] uint32 memory_len; 340 340 [value(ndr_size_frsrpc_CommPktChunkCtr(r->ctr, 341 ndr-> iconv_convenience, ndr->flags))]341 ndr->flags))] 342 342 [range(0, 262144)] 343 343 uint32 pkt_len; -
trunk/server/librpc/idl/frstrans.idl
r414 r745 278 278 /*****************/ 279 279 /* Function 0x0f */ 280 [todo] void FRSTRANS_RAW_GET_FILE_DATA_ASYNC(); 280 typedef pipe uint8 frstrans_BytePipe; 281 282 WERROR frstrans_RawGetFileDataAsync( 283 [in,ref] policy_handle *server_context, 284 [out,ref] frstrans_BytePipe *byte_pipe 285 ); 281 286 282 287 /*****************/ 283 288 /* Function 0x10 */ 284 [todo] void FRSTRANS_RDC_GET_FILE_DATA_ASYNC(); 289 WERROR frstrans_RdcGetFileDataAsync( 290 [in,ref] policy_handle *server_context, 291 [out,ref] frstrans_BytePipe *byte_pipe 292 ); 285 293 } -
trunk/server/librpc/idl/idl_types.h
r596 r745 14 14 */ 15 15 #define nstring [flag(STR_NULLTERM|NDR_ALIGN2)] string 16 17 /*18 an ascii string prefixed with [offset] [length], both 32 bits19 null terminated20 */21 #define ascstr2 [flag(STR_ASCII|STR_LEN4)] string22 23 /*24 an ascii string prefixed with [size], 32 bits25 */26 #define asclstr [flag(STR_ASCII|STR_SIZE4)] string27 28 /*29 an ascii string prefixed with [size], 16 bits30 null terminated31 */32 #define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string33 34 /*35 an ascii string prefixed with [size] [offset] [length], all 32 bits36 not null terminated37 */38 #define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string39 16 40 17 /* -
trunk/server/librpc/idl/krb5pac.idl
r414 r745 123 123 ); 124 124 125 void decode_login_info_ctr( 126 [in] PAC_LOGON_INFO_CTR logon_info_ctr 127 ); 128 125 129 void decode_pac_validate( 126 130 [in] PAC_Validate pac_validate -
trunk/server/librpc/idl/lsa.idl
r414 r745 114 114 /* Function: 0x06 */ 115 115 typedef struct { 116 uint32 len; /* ignored */116 uint3264 len; /* ignored */ 117 117 uint16 impersonation_level; 118 118 uint8 context_mode; … … 121 121 122 122 typedef struct { 123 uint32 len; /* ignored */123 uint3264 len; /* ignored */ 124 124 uint8 *root_dir; 125 125 [string,charset(UTF16)] uint16 *object_name; … … 520 520 521 521 const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32; 522 typedef struct {522 typedef [public] struct { 523 523 [range(0,1000)] uint32 count; 524 524 [size_is(count)] lsa_DomainInfo *domains; … … 534 534 */ 535 535 536 typedef enum {536 typedef [public] enum { 537 537 LSA_LOOKUP_NAMES_ALL = 1, 538 538 LSA_LOOKUP_NAMES_DOMAINS_ONLY = 2, … … 564 564 } lsa_TranslatedName; 565 565 566 typedef struct {566 typedef [public] struct { 567 567 [range(0,20480)] uint32 count; 568 568 [size_is(count)] lsa_TranslatedName *names; … … 640 640 [todo] NTSTATUS lsa_SetQuotasForAccount(); 641 641 642 typedef [bitmap32bit] bitmap {643 LSA_POLICY_MODE_INTERACTIVE = 0x00000001,644 LSA_POLICY_MODE_NETWORK = 0x00000002,645 LSA_POLICY_MODE_BATCH = 0x00000004,646 LSA_POLICY_MODE_SERVICE = 0x00000010,647 LSA_POLICY_MODE_PROXY = 0x00000020,648 LSA_POLICY_MODE_DENY_INTERACTIVE = 0x00000040,649 LSA_POLICY_MODE_DENY_NETWORK = 0x00000080,650 LSA_POLICY_MODE_DENY_BATCH = 0x00000100,651 LSA_POLICY_MODE_DENY_SERVICE = 0x00000200,652 LSA_POLICY_MODE_REMOTE_INTERACTIVE = 0x00000400,653 LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE = 0x00000800,654 LSA_POLICY_MODE_ALL = 0x00000FF7,655 LSA_POLICY_MODE_ALL_NT4 = 0x00000037656 } lsa_SystemAccessModeFlags;657 658 642 /* Function: 0x17 */ 659 643 NTSTATUS lsa_GetSystemAccessAccount( … … 677 661 678 662 typedef [flag(NDR_PAHEX)] struct { 679 uint32 length;680 uint32 size;663 uint3264 length; 664 uint3264 size; 681 665 [size_is(size),length_is(length)] uint8 *data; 682 666 } lsa_DATA_BUF; … … 771 755 } lsa_TrustDomainInfoBuffer; 772 756 773 typedef struct {757 typedef [public] struct { 774 758 uint32 incoming_count; 775 759 lsa_TrustDomainInfoBuffer *incoming_current_auth_info; … … 1041 1025 /**********************/ 1042 1026 /* Function 0x31 */ 1043 NTSTATUS lsa_SetTrustedDomainInfoByName(1027 [public] NTSTATUS lsa_SetTrustedDomainInfoByName( 1044 1028 [in] policy_handle *handle, 1045 [in ] lsa_Stringtrusted_domain,1029 [in,ref] lsa_String *trusted_domain, 1046 1030 [in] lsa_TrustDomInfoEnum level, 1047 [in, unique,switch_is(level)] lsa_TrustedDomainInfo *info1031 [in,ref,switch_is(level)] lsa_TrustedDomainInfo *info 1048 1032 ); 1049 1033 … … 1070 1054 [in] lsa_TrustDomainInfoInfoEx *info, 1071 1055 [in] lsa_TrustDomainInfoAuthInfoInternal *auth_info, 1072 [in] uint32access_mask,1056 [in] lsa_TrustedAccessMask access_mask, 1073 1057 [out] policy_handle *trustdom_handle 1074 1058 ); … … 1081 1065 1082 1066 /* Function 0x35 */ 1067 typedef [bitmap32bit] bitmap { 1068 LSA_POLICY_KERBEROS_VALIDATE_CLIENT = 0x00000080 1069 } lsa_krbAuthenticationOptions; 1083 1070 1084 1071 /* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000 1085 for unknown6- gd */1086 typedef struct { 1087 uint32 enforce_restrictions;1072 for reserved - gd */ 1073 typedef struct { 1074 lsa_krbAuthenticationOptions authentication_options; 1088 1075 hyper service_tkt_lifetime; 1089 1076 hyper user_tkt_lifetime; 1090 1077 hyper user_tkt_renewaltime; 1091 1078 hyper clock_skew; 1092 hyper unknown6;1079 hyper reserved; 1093 1080 } lsa_DomainInfoKerberos; 1094 1081 … … 1126 1113 [in] policy_handle *handle, 1127 1114 [in] lsa_String name, 1128 [in] uint32access_mask,1115 [in] lsa_TrustedAccessMask access_mask, 1129 1116 [out] policy_handle *trustdom_handle 1130 1117 ); … … 1201 1188 [in] lsa_TrustDomainInfoInfoEx *info, 1202 1189 [in] lsa_TrustDomainInfoAuthInfoInternal *auth_info, 1203 [in] uint32access_mask,1190 [in] lsa_TrustedAccessMask access_mask, 1204 1191 [out] policy_handle *trustdom_handle 1205 1192 ); … … 1269 1256 /* Function 0x49 */ 1270 1257 typedef struct { 1271 [range(0,131072)] uint32 length;1258 [range(0,131072)] uint3264 length; 1272 1259 [size_is(length)] uint8 *data; 1273 1260 } lsa_ForestTrustBinaryData; … … 1280 1267 1281 1268 typedef [switch_type(uint32)] union { 1282 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_String top_level_name;1269 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_StringLarge top_level_name; 1283 1270 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] lsa_StringLarge top_level_name_ex; 1284 1271 [case(LSA_FOREST_TRUST_DOMAIN_INFO)] lsa_ForestTrustDomainInfo domain_info; … … 1295 1282 typedef struct { 1296 1283 uint32 flags; 1297 lsa_ForestTrustRecordType level;1298 hyper unknown;1299 [switch_is( level)] lsa_ForestTrustData forest_trust_data;1284 lsa_ForestTrustRecordType type; 1285 hyper time; 1286 [switch_is(type)] lsa_ForestTrustData forest_trust_data; 1300 1287 } lsa_ForestTrustRecord; 1301 1288 … … 1312 1299 ); 1313 1300 1314 /* Function 0x4a */ 1315 [todo] NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION(); 1301 /***************** 1302 * Function 0x4a */ 1303 1304 typedef [v1_enum] enum { 1305 LSA_FOREST_TRUST_COLLISION_TDO = 0, 1306 LSA_FOREST_TRUST_COLLISION_XREF = 1, 1307 LSA_FOREST_TRUST_COLLISION_OTHER = 2 1308 } lsa_ForestTrustCollisionRecordType; 1309 1310 /* if type is CollisionTdo, flags can be */ 1311 typedef [bitmap32bit] bitmap { 1312 LSA_TLN_DISABLED_NEW = 0x00000001, 1313 LSA_TLN_DISABLED_ADMIN = 0x00000002, 1314 LSA_TLN_DISABLED_CONFLICT = 0x00000004 1315 } lsa_ForestTrustCollisionTDOFlags; 1316 1317 /* if type is CollisionXref, flags can be */ 1318 typedef [bitmap32bit] bitmap { 1319 LSA_SID_DISABLED_ADMIN = 0x00000001, 1320 LSA_SID_DISABLED_CONFLICT = 0x00000002, 1321 LSA_NB_DISABLED_ADMIN = 0x00000004, 1322 LSA_NB_DISABLED_CONFLICT = 0x00000008 1323 } lsa_ForestTrustCollisionXrefFlags; 1324 1325 typedef [nodiscriminant] union { 1326 [case(LSA_FOREST_TRUST_COLLISION_TDO)] lsa_ForestTrustCollisionTDOFlags flags; 1327 [case(LSA_FOREST_TRUST_COLLISION_XREF)] lsa_ForestTrustCollisionXrefFlags flags; 1328 [default] uint32 flags; 1329 } lsa_ForestTrustCollisionFlags; 1330 1331 typedef struct { 1332 uint32 index; 1333 lsa_ForestTrustCollisionRecordType type; 1334 [switch_is(type)] lsa_ForestTrustCollisionFlags flags; 1335 lsa_String name; 1336 } lsa_ForestTrustCollisionRecord; 1337 1338 typedef struct { 1339 uint32 count; 1340 [size_is(count)] lsa_ForestTrustCollisionRecord **entries; 1341 } lsa_ForestTrustCollisionInfo; 1342 1343 [public] NTSTATUS lsa_lsaRSetForestTrustInformation( 1344 [in] policy_handle *handle, 1345 [in,ref] lsa_StringLarge *trusted_domain_name, 1346 [in] uint16 highest_record_type, 1347 [in,ref] lsa_ForestTrustInformation *forest_trust_info, 1348 [in] uint8 check_only, 1349 [out,ref] lsa_ForestTrustCollisionInfo **collision_info 1350 ); 1316 1351 1317 1352 /* Function 0x4b */ -
trunk/server/librpc/idl/mgmt.idl
r414 r745 71 71 [in] uint32 authn_proto, 72 72 [in] uint32 princ_name_size, 73 [out] [string, charset(DOS)] uint8 princ_name[]73 [out] [string,size_is(princ_name_size),charset(DOS)] uint8 princ_name[] 74 74 ); 75 75 } -
trunk/server/librpc/idl/misc.idl
r414 r745 22 22 typedef [public] struct { 23 23 GUID uuid; 24 /* The major version is encoded in the 16 least significant bits, 25 the minor in the 16 most significant bits. 26 http://www.opengroup.org/onlinepubs/9629399/chap12.htm */ 24 27 uint32 if_version; 25 28 } ndr_syntax_id; … … 35 38 typedef [public] enum { 36 39 SEC_CHAN_NULL = 0, 40 SEC_CHAN_LOCAL = 1, 37 41 SEC_CHAN_WKSTA = 2, 38 42 SEC_CHAN_DNS_DOMAIN = 3, 39 43 SEC_CHAN_DOMAIN = 4, 40 SEC_CHAN_BDC = 6 44 SEC_CHAN_LANMAN = 5, 45 SEC_CHAN_BDC = 6, 46 SEC_CHAN_RODC = 7 41 47 } netr_SchannelType; 42 48 -
trunk/server/librpc/idl/named_pipe_auth.idl
r414 r745 4 4 */ 5 5 6 import "netlogon.idl" ;6 import "netlogon.idl", "security.idl", "auth.idl"; 7 7 8 8 [ … … 20 20 [charset(DOS),string] uint8 *server_addr; 21 21 uint16 server_port; 22 netr_SamInfo3 *sam_info3; 23 uint32 session_key_length; 24 [size_is(session_key_length)] uint8 *session_key; 25 } named_pipe_auth_req_info2; 26 27 typedef struct { 28 [charset(UTF8),string] uint8 *client_name; 29 [charset(DOS),string] uint8 *client_addr; 30 uint16 client_port; 31 [charset(UTF8),string] uint8 *server_name; 32 [charset(DOS),string] uint8 *server_addr; 33 uint16 server_port; 34 netr_SamInfo3 *sam_info3; 35 uint32 session_key_length; 36 [size_is(session_key_length)] uint8 *session_key; 37 uint32 gssapi_delegated_creds_length; 38 [size_is(gssapi_delegated_creds_length)] 39 uint8 *gssapi_delegated_creds; 40 } named_pipe_auth_req_info3; 22 auth_session_info_transport *session_info; 23 } named_pipe_auth_req_info4; 41 24 42 25 typedef [switch_type(uint32)] union { 43 [case(0)] ;/* anonymous */ 44 [case(1)] netr_SamInfo3 info1; 45 [case(2)] named_pipe_auth_req_info2 info2; 46 [case(3)] named_pipe_auth_req_info3 info3; 26 [case(4)] named_pipe_auth_req_info4 info4; 47 27 } named_pipe_auth_req_info; 48 28 49 29 typedef [public,gensize] struct { 50 30 [flag(NDR_BIG_ENDIAN), 51 value(ndr_size_named_pipe_auth_req(r,ndr-> iconv_convenience,ndr->flags)-4)]31 value(ndr_size_named_pipe_auth_req(r,ndr->flags)-4)] 52 32 uint32 length; 53 33 [charset(DOS),value(NAMED_PIPE_AUTH_MAGIC)] uint8 magic[4]; … … 60 40 uint16 device_state; 61 41 hyper allocation_size; 62 } named_pipe_auth_rep_info2; 63 64 typedef struct { 65 uint16 file_type; 66 uint16 device_state; 67 hyper allocation_size; 68 } named_pipe_auth_rep_info3; 42 } named_pipe_auth_rep_info4; 69 43 70 44 typedef [switch_type(uint32)] union { 71 [case(0)] ; 72 [case(1)] ; 73 [case(2)] named_pipe_auth_rep_info2 info2; 74 [case(3)] named_pipe_auth_rep_info3 info3; 45 [case(4)] named_pipe_auth_rep_info4 info4; 75 46 } named_pipe_auth_rep_info; 76 47 77 48 typedef [public,gensize] struct { 78 49 [flag(NDR_BIG_ENDIAN), 79 value(ndr_size_named_pipe_auth_rep(r,ndr-> iconv_convenience,ndr->flags)-4)]50 value(ndr_size_named_pipe_auth_rep(r,ndr->flags)-4)] 80 51 uint32 length; 81 52 [charset(DOS),value(NAMED_PIPE_AUTH_MAGIC)] uint8 magic[4]; -
trunk/server/librpc/idl/nbt.idl
r414 r745 11 11 import "misc.idl", "security.idl", "svcctl.idl", "samr.idl"; 12 12 [ 13 helper("../libcli/netlogon.h", "../libcli/nbt/libnbt.h") 13 helper("../libcli/netlogon/netlogon.h", "../libcli/nbt/libnbt.h"), 14 helpstring("NBT messages"), 15 uuid("6def41b6-86e4-4c32-997c-ed33af7bcd8e") 14 16 ] 15 17 interface nbt … … 24 26 NBT_FLAG_RECURSION_DESIRED = 0x0100, 25 27 NBT_FLAG_TRUNCATION = 0x0200, 26 NBT_FLAG_AUTHORIT IVE= 0x0400,28 NBT_FLAG_AUTHORITATIVE = 0x0400, 27 29 NBT_OPCODE = 0x7800, 28 30 NBT_FLAG_REPLY = 0x8000 … … 358 360 NBT_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800, 359 361 NBT_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000, 360 NBT_SERVER_DNS_FOREST = 0x01000000 362 NBT_SERVER_ADS_WEB_SERVICE = 0x00002000, 363 NBT_SERVER_HAS_DNS_NAME = 0x20000000, 364 NBT_SERVER_IS_DEFAULT_NC = 0x40000000, 365 NBT_SERVER_FOREST_ROOT = 0x80000000 361 366 } nbt_server_type; 362 367 … … 367 372 NETLOGON_NT_VERSION_5EX_WITH_IP = 0x00000008, 368 373 NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = 0x00000010, 369 NETLOGON_NT_VERSION_AV IOD_NT4EMUL = 0x01000000,374 NETLOGON_NT_VERSION_AVOID_NT4EMUL = 0x01000000, 370 375 NETLOGON_NT_VERSION_PDC = 0x10000000, 371 376 NETLOGON_NT_VERSION_IP = 0x20000000, … … 375 380 376 381 typedef [enum16bit,public] enum { 382 LOGON_REQUEST = 0, 383 LOGON_RESPONSE2 = 6, 377 384 LOGON_PRIMARY_QUERY = 7, /* Was also NETLOGON_QUERY_FOR_PDC */ 378 385 NETLOGON_ANNOUNCE_UAS = 10, … … 411 418 } NETLOGON_SAM_LOGON_REQUEST; 412 419 420 typedef struct { 421 astring computer_name; 422 astring user_name; 423 astring mailslot_name; 424 uint8 request_count; 425 uint16 lmnt_token; 426 uint16 lm20_token; 427 } NETLOGON_LOGON_REQUEST; 428 413 429 typedef [flag(NDR_NOALIGN),public] struct { 414 430 netlogon_command command; 415 nstring server;431 nstring pdc_name; 416 432 nstring user_name; 417 nstring domain ;433 nstring domain_name; 418 434 netlogon_nt_version_flags nt_version; 419 435 uint16 lmnt_token; … … 449 465 nbt_string dns_domain; 450 466 nbt_string pdc_dns_name; 451 nbt_string domain ;467 nbt_string domain_name; 452 468 nbt_string pdc_name; 453 469 nbt_string user_name; … … 456 472 457 473 /* Optional on NETLOGON_NT_VERSION_5EX_WITH_IP */ 458 [value(ndr_size_nbt_sockaddr(&sockaddr, ndr-> iconv_convenience, ndr->flags))] uint8 sockaddr_size;474 [value(ndr_size_nbt_sockaddr(&sockaddr, ndr->flags))] uint8 sockaddr_size; 459 475 [subcontext(0),subcontext_size(sockaddr_size)] nbt_sockaddr sockaddr; 460 476 … … 479 495 480 496 /* response from pdc */ 481 typedef [ flag(NDR_NOALIGN),public] struct {497 typedef [public] struct { 482 498 netlogon_command command; 483 499 astring pdc_name; … … 489 505 uint16 lm20_token; 490 506 } nbt_netlogon_response_from_pdc; 507 508 typedef [flag(NDR_NOALIGN),public] struct { 509 netlogon_command command; 510 astring pdc_name; 511 uint16 lm20_token; 512 } nbt_netlogon_response2; 491 513 492 514 typedef enum netr_SamDatabaseID netr_SamDatabaseID; … … 518 540 519 541 typedef [nodiscriminant] union { 542 [case(LOGON_REQUEST)] NETLOGON_LOGON_REQUEST logon0; 520 543 [case(LOGON_SAM_LOGON_REQUEST)] NETLOGON_SAM_LOGON_REQUEST logon; 521 544 [case(LOGON_PRIMARY_QUERY)] nbt_netlogon_query_for_pdc pdc; … … 539 562 [switch_is(command)] nbt_netlogon_request req; 540 563 } nbt_netlogon_packet; 564 565 void decode_nbt_netlogon_packet( 566 [in] nbt_netlogon_packet packet 567 ); 541 568 542 569 /********************************************************/ -
trunk/server/librpc/idl/netlogon.idl
r414 r745 5 5 */ 6 6 7 import "misc.idl", "lsa.idl", "samr.idl", "security.idl" , "nbt.idl";7 import "misc.idl", "lsa.idl", "samr.idl", "security.idl"; 8 8 9 9 #include "idl_types.h" … … 17 17 endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"), 18 18 helper("../librpc/ndr/ndr_netlogon.h"), 19 ms_union, 19 20 pointer_default(unique) 20 21 ] … … 180 181 [case(NetlogonNetworkTransitiveInformation)] netr_NetworkInfo *network; 181 182 [case(NetlogonServiceTransitiveInformation)] netr_PasswordInfo *password; 183 [default]; 182 184 } netr_LogonLevel; 183 185 … … 252 254 uint32 sidcount; 253 255 [size_is(sidcount)] netr_SidAttr *sids; 254 lsa_String forest;256 lsa_String dns_domainname; 255 257 lsa_String principle; 256 258 uint32 unknown4[20]; … … 292 294 [case(NetlogonValidationGenericInfo2)] netr_GenericInfo2 *generic; 293 295 [case(NetlogonValidationSamInfo4)] netr_SamInfo6 *sam6; 296 [default]; 294 297 } netr_Validation; 295 298 … … 303 306 } netr_Authenticator; 304 307 305 NTSTATUS netr_LogonSamLogon(308 [public] NTSTATUS netr_LogonSamLogon( 306 309 [in,unique] [string,charset(UTF16)] uint16 *server_name, 307 310 [in,unique] [string,charset(UTF16)] uint16 *computer_name, … … 603 606 604 607 typedef struct { 605 uint16 unknown;606 } netr_DELTA_DELETE_TRUST;607 608 typedef struct {609 608 uint32 privilege_entries; 610 609 uint32 privilege_control; … … 624 623 uint32 unknown8; 625 624 } netr_DELTA_ACCOUNT; 626 627 typedef struct {628 uint16 unknown;629 } netr_DELTA_DELETE_ACCOUNT;630 631 typedef struct {632 uint16 unknown;633 } netr_DELTA_DELETE_SECRET;634 625 635 626 typedef struct { … … 695 686 [case(NETR_DELTA_ALIAS_MEMBER)] netr_DELTA_ALIAS_MEMBER *alias_member; 696 687 [case(NETR_DELTA_POLICY)] netr_DELTA_POLICY *policy; 697 [case(NETR_DELTA_TRUSTED_DOMAIN)] netr_DELTA_TRUSTED_DOMAIN 698 [case(NETR_DELTA_DELETE_TRUST)] netr_DELTA_DELETE_TRUST delete_trust;688 [case(NETR_DELTA_TRUSTED_DOMAIN)] netr_DELTA_TRUSTED_DOMAIN *trusted_domain; 689 [case(NETR_DELTA_DELETE_TRUST)] ; /* sid only */ 699 690 [case(NETR_DELTA_ACCOUNT)] netr_DELTA_ACCOUNT *account; 700 [case(NETR_DELTA_DELETE_ACCOUNT)] netr_DELTA_DELETE_ACCOUNT delete_account;691 [case(NETR_DELTA_DELETE_ACCOUNT)] ; /* sid only */ 701 692 [case(NETR_DELTA_SECRET)] netr_DELTA_SECRET *secret; 702 [case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret;693 [case(NETR_DELTA_DELETE_SECRET)] ; /* name only */ 703 694 [case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group; 704 695 [case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user; 705 696 [case(NETR_DELTA_MODIFY_COUNT)] udlong *modified_count; 697 [default]; 706 698 } netr_DELTA_UNION; 707 699 … … 729 721 [case(NETR_DELTA_DELETE_USER2)] uint32 rid; 730 722 [case(NETR_DELTA_MODIFY_COUNT)] ; 723 [default]; 731 724 } netr_DELTA_ID_UNION; 732 725 … … 1050 1043 [in] netr_Authenticator *credential, 1051 1044 [in,out,ref] netr_Authenticator *return_authenticator, 1052 [in] [subcontext(4),subcontext_size(change_log_entry_size)] netr_ChangeLogEntry change_log_entry, 1053 [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry, ndr->iconv_convenience, ndr->flags))] uint32 change_log_entry_size, 1045 /* 1046 * we cannot use subcontext_size() here, as 1047 * change_log_entry_size is encoded after the subcontext 1048 */ 1049 [in] [subcontext(4)/*,subcontext_size(change_log_entry_size)*/] 1050 netr_ChangeLogEntry change_log_entry, 1051 [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry, 1052 ndr->flags))] 1053 uint32 change_log_entry_size, 1054 1054 [out,ref] netr_DELTA_ENUM_ARRAY **delta_enum_array 1055 1055 ); … … 1074 1074 } netr_Blob; 1075 1075 1076 WERRORnetr_NetrEnumerateTrustedDomains(1076 NTSTATUS netr_NetrEnumerateTrustedDomains( 1077 1077 [in,unique] [string,charset(UTF16)] uint16 *server_name, 1078 1078 [out,ref] netr_Blob *trusted_domains_blob … … 1099 1099 DS_IS_FLAT_NAME | 1100 1100 DS_IS_DNS_NAME | 1101 DS_TRY_NEXTCLOSEST_SITE | 1102 DS_DIRECTORY_SERVICE_6_REQUIRED | 1103 DS_WEB_SERVICE_REQUIRED | 1101 1104 DS_RETURN_FLAT_NAME | 1102 1105 DS_RETURN_DNS_NAME); … … 1131 1134 1132 1135 typedef [bitmap32bit] bitmap { 1133 DS_SERVER_PDC = NBT_SERVER_PDC,1134 DS_SERVER_GC = NBT_SERVER_GC,1135 DS_SERVER_LDAP = NBT_SERVER_LDAP,1136 DS_SERVER_DS = NBT_SERVER_DS,1137 DS_SERVER_KDC = NBT_SERVER_KDC,1138 DS_SERVER_TIMESERV = NBT_SERVER_TIMESERV,1139 DS_SERVER_CLOSEST = NBT_SERVER_CLOSEST,1140 DS_SERVER_WRITABLE = NBT_SERVER_WRITABLE,1141 DS_SERVER_GOOD_TIMESERV = NBT_SERVER_GOOD_TIMESERV,1142 DS_SERVER_NDNC = NBT_SERVER_NDNC,1143 DS_SERVER_SELECT_SECRET_DOMAIN_6 = NBT_SERVER_SELECT_SECRET_DOMAIN_6,1144 DS_SERVER_FULL_SECRET_DOMAIN_6 = NBT_SERVER_FULL_SECRET_DOMAIN_6,1136 DS_SERVER_PDC = 0x00000001, 1137 DS_SERVER_GC = 0x00000004, 1138 DS_SERVER_LDAP = 0x00000008, 1139 DS_SERVER_DS = 0x00000010, 1140 DS_SERVER_KDC = 0x00000020, 1141 DS_SERVER_TIMESERV = 0x00000040, 1142 DS_SERVER_CLOSEST = 0x00000080, 1143 DS_SERVER_WRITABLE = 0x00000100, 1144 DS_SERVER_GOOD_TIMESERV = 0x00000200, 1145 DS_SERVER_NDNC = 0x00000400, 1146 DS_SERVER_SELECT_SECRET_DOMAIN_6 = 0x00000800, 1147 DS_SERVER_FULL_SECRET_DOMAIN_6 = 0x00001000, 1145 1148 DS_DNS_CONTROLLER = 0x20000000, 1146 1149 DS_DNS_DOMAIN = 0x40000000, 1147 DS_DNS_FOREST 1150 DS_DNS_FOREST_ROOT = 0x80000000 1148 1151 } netr_DsR_DcFlags; 1149 1152 … … 1621 1624 /****************/ 1622 1625 /* Function 0x2c */ 1623 WERRORnetr_GetForestTrustInformation(1624 [in,unique] [string,charset(UTF16)] uint16 *server_name, 1625 [in,ref] [string,charset(UTF16)] uint16 * trusted_domain_name,1626 NTSTATUS netr_GetForestTrustInformation( 1627 [in,unique] [string,charset(UTF16)] uint16 *server_name, 1628 [in,ref] [string,charset(UTF16)] uint16 *computer_name, 1626 1629 [in,ref] netr_Authenticator *credential, 1627 1630 [out,ref] netr_Authenticator *return_authenticator, … … 1668 1671 [out,ref] netr_TrustInfo **trust_info 1669 1672 ); 1673 1674 /****************/ 1675 /* Function 0x2f */ 1676 1677 NTSTATUS netr_Unused47(void); 1678 1679 1680 /****************/ 1681 /* Function 0x30 */ 1682 1683 typedef enum { 1684 NlDnsLdapAtSite = 22, 1685 NlDnsGcAtSite = 25, 1686 NlDnsDsaCname = 28, 1687 NlDnsKdcAtSite = 30, 1688 NlDnsDcAtSite = 32, 1689 NlDnsRfc1510KdcAtSite = 34, 1690 NlDnsGenericGcAtSite = 36 1691 } netr_DnsType; 1692 1693 typedef enum { 1694 NlDnsInfoTypeNone = 0, 1695 NlDnsDomainName = 1, 1696 NlDnsDomainNameAlias = 2, 1697 NlDnsForestName = 3, 1698 NlDnsForestNameAlias = 4, 1699 NlDnsNdncDomainName = 5, 1700 NlDnsRecordName = 6 1701 } netr_DnsDomainInfoType; 1702 1703 typedef struct { 1704 netr_DnsType type; 1705 [string,charset(UTF16)] uint16 *dns_domain_info; 1706 netr_DnsDomainInfoType dns_domain_info_type; 1707 uint32 priority; 1708 uint32 weight; 1709 uint32 port; 1710 boolean32 dns_register; 1711 uint32 status; 1712 } NL_DNS_NAME_INFO; 1713 1714 typedef [public] struct { 1715 uint32 count; 1716 [size_is(count)] NL_DNS_NAME_INFO *names; 1717 } NL_DNS_NAME_INFO_ARRAY; 1718 1719 NTSTATUS netr_DsrUpdateReadOnlyServerDnsRecords( 1720 [in,unique] [string,charset(UTF16)] uint16 *server_name, 1721 [in,ref] [string,charset(UTF16)] uint16 *computer_name, 1722 [in, ref] netr_Authenticator *credential, 1723 [out,ref] netr_Authenticator *return_authenticator, 1724 [in,unique] [string,charset(UTF16)] uint16 *site_name, 1725 [in] uint32 dns_ttl, 1726 [in,out,ref] NL_DNS_NAME_INFO_ARRAY *dns_names 1727 ); 1670 1728 } -
trunk/server/librpc/idl/ntlmssp.idl
r414 r745 87 87 /* [MS-NLMP] 2.2.2.10 VERSION */ 88 88 89 typedef struct {89 typedef [public] struct { 90 90 ntlmssp_WindowsMajorVersion ProductMajorVersion; 91 91 ntlmssp_WindowsMinorVersion ProductMinorVersion; … … 93 93 uint8 Reserved[3]; 94 94 ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent; 95 } VERSION;95 } ntlmssp_VERSION; 96 96 97 97 typedef [noprint,nodiscriminant] union { 98 [case(NTLMSSP_NEGOTIATE_VERSION)] VERSION version;98 [case(NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_VERSION version; 99 99 [default]; 100 100 } ntlmssp_Version; … … 106 106 [value(NtLmNegotiate)] ntlmssp_MessageType MessageType; 107 107 NEGOTIATE NegotiateFlags; 108 [value( strlen(DomainName))] uint16 DomainNameLen;108 [value(DomainName ? strlen(DomainName) : 0)] uint16 DomainNameLen; 109 109 [value(DomainNameLen)] uint16 DomainNameMaxLen; 110 110 [relative] [subcontext(0),subcontext_size(DomainNameLen)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] string *DomainName; 111 [value( strlen(Workstation))] uint16 WorkstationLen;111 [value(Workstation ? strlen(Workstation) : 0)] uint16 WorkstationLen; 112 112 [value(WorkstationLen)] uint16 WorkstationMaxLen; 113 113 [relative] [subcontext(0),subcontext_size(WorkstationLen)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] string *Workstation; … … 163 163 typedef [public,flag(NDR_NOALIGN)] struct { 164 164 ntlmssp_AvId AvId; 165 [value(ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, ndr->iconv_convenience,0))] uint16 AvLen;165 [value(ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0))] uint16 AvLen; 166 166 [subcontext(0),subcontext_size(AvLen),switch_is(AvId)] ntlmssp_AvValue Value; 167 167 } AV_PAIR; … … 183 183 uint8 ServerChallenge[8]; 184 184 uint8 Reserved[8]; 185 [value(ndr_size_AV_PAIR_LIST(TargetInfo, ndr-> iconv_convenience, ndr->flags))] uint16 TargetInfoLen;185 [value(ndr_size_AV_PAIR_LIST(TargetInfo, ndr->flags))] uint16 TargetInfoLen; 186 186 [value(TargetInfoLen)] uint16 TargetNameInfoMaxLen; 187 187 [relative] [subcontext(0),subcontext_size(TargetInfoLen)] AV_PAIR_LIST *TargetInfo; … … 314 314 ); 315 315 316 void decode_NTLMv2_RESPONSE( 317 [in] NTLMv2_RESPONSE response 318 ); 319 316 320 } -
trunk/server/librpc/idl/samr.idl
r414 r745 24 24 SAM_DATABASE_PRIVS = 2 /* Privileges */ 25 25 } netr_SamDatabaseID; 26 27 typedef [public,v1_enum] enum {28 SAMR_REJECT_OTHER = 0,29 SAMR_REJECT_TOO_SHORT = 1,30 SAMR_REJECT_IN_HISTORY = 2,31 SAMR_REJECT_COMPLEXITY = 532 } samr_RejectReason;33 34 35 26 36 27 /* account control (acct_flags) bits */ … … 54 45 ACB_DONT_REQUIRE_PREAUTH = 0x00010000, /* 1 = Preauth not required */ 55 46 ACB_PW_EXPIRED = 0x00020000, /* 1 = Password Expired */ 56 ACB_NO_AUTH_DATA_REQD = 0x00080000 /* 1 = No authorization data required */ 47 ACB_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 0x00040000, 48 ACB_NO_AUTH_DATA_REQD = 0x00080000, /* 1 = No authorization data required */ 49 ACB_PARTIAL_SECRETS_ACCOUNT = 0x00100000, 50 ACB_USE_AES_KEYS = 0x00200000 57 51 } samr_AcctFlags; 58 52 … … 665 659 uint32 count; 666 660 [size_is(count)] uint32 *rids; 667 [size_is(count)] uint32 *types;668 } samr_Rid TypeArray;661 [size_is(count)] samr_GroupAttrs *attributes; 662 } samr_RidAttrArray; 669 663 670 664 NTSTATUS samr_QueryGroupMember( 671 665 [in,ref] policy_handle *group_handle, 672 [out,ref] samr_Rid TypeArray **rids666 [out,ref] samr_RidAttrArray **rids 673 667 ); 674 668 … … 816 810 typedef struct { 817 811 lsa_String comment; 818 lsa_String unknown; /* settable, but doesn't stick. probably obsolete */812 lsa_String reserved; /* settable, but doesn't stick. probably obsolete */ 819 813 uint16 country_code; 820 814 uint16 code_page; … … 992 986 lsa_BinaryString lm_owf_password; 993 987 lsa_BinaryString nt_owf_password; 994 lsa_String unknown3;988 lsa_String private_data; 995 989 uint32 buf_count; 996 990 [size_is(buf_count)] uint8 *buffer; … … 1007 1001 uint8 nt_password_set; 1008 1002 uint8 password_expired; 1009 uint8 unknown4;1003 uint8 private_data_sensitive; 1010 1004 } samr_UserInfo21; 1011 1005 … … 1448 1442 /* Function 0x3f */ 1449 1443 1450 typedef enum samr_RejectReason samr_RejectReason; 1451 1452 typedef struct { 1453 samr_RejectReason reason; 1454 uint32 unknown1; 1455 uint32 unknown2; 1456 } samr_ChangeReject; 1457 1458 NTSTATUS samr_ChangePasswordUser3( 1444 typedef [public,v1_enum] enum { 1445 SAM_PWD_CHANGE_NO_ERROR = 0, 1446 SAM_PWD_CHANGE_PASSWORD_TOO_SHORT = 1, 1447 SAM_PWD_CHANGE_PWD_IN_HISTORY = 2, 1448 SAM_PWD_CHANGE_USERNAME_IN_PASSWORD = 3, 1449 SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD = 4, 1450 SAM_PWD_CHANGE_NOT_COMPLEX = 5, 1451 SAM_PWD_CHANGE_MACHINE_NOT_DEFAULT = 6, 1452 SAM_PWD_CHANGE_FAILED_BY_FILTER = 7, 1453 SAM_PWD_CHANGE_PASSWORD_TOO_LONG = 8 1454 } samPwdChangeReason; 1455 1456 typedef struct { 1457 samPwdChangeReason extendedFailureReason; 1458 [string,charset(UTF16)] uint16 *filterModuleName; 1459 } userPwdChangeFailureInformation; 1460 1461 [public] NTSTATUS samr_ChangePasswordUser3( 1459 1462 [in,unique] lsa_String *server, 1460 1463 [in,ref] lsa_String *account, … … 1466 1469 [in,unique] samr_CryptPassword *password3, 1467 1470 [out,ref] samr_DomInfo1 **dominfo, 1468 [out,ref] samr_ChangeReject**reject1471 [out,ref] userPwdChangeFailureInformation **reject 1469 1472 ); 1470 1473 -
trunk/server/librpc/idl/schannel.idl
r414 r745 91 91 } NL_AUTH_SIGNATURE; 92 92 93 const int NL_AUTH_SIGNATURE_SIZE = 0x20; 94 93 95 /* MS-NRPC 2.2.1.3.3 NL_AUTH_SHA2_SIGNATURE */ 94 96 -
trunk/server/librpc/idl/security.idl
r414 r745 32 32 interface security 33 33 { 34 35 typedef bitmap lsa_SystemAccessModeFlags lsa_SystemAccessModeFlags; 34 36 35 37 typedef [public,gensize,noprint,nosize,nopull,nopush] struct { … … 263 265 const string SID_BUILTIN_REMOTE_DESKTOP_USERS = "S-1-5-32-555"; 264 266 const string SID_BUILTIN_NETWORK_CONF_OPERATORS = "S-1-5-32-556"; 267 const string SID_BUILTIN_INCOMING_FOREST_TRUST = "S-1-5-32-557"; 268 const string SID_BUILTIN_PERFMON_USERS = "S-1-5-32-558"; 269 const string SID_BUILTIN_PERFLOG_USERS = "S-1-5-32-559"; 270 const string SID_BUILTIN_AUTH_ACCESS = "S-1-5-32-560"; 271 const string SID_BUILTIN_TS_LICENSE_SERVERS = "S-1-5-32-561"; 272 273 /* SECURITY_NT_SERVICE */ 274 const string NAME_NT_SERVICE = "NT SERVICE"; 275 276 const string SID_NT_NT_SERVICE = "S-1-5-80"; 277 const string SID_NT_TRUSTED_INSTALLER = 278 "S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464"; 265 279 266 280 /* well-known domain RIDs */ 267 const int DOMAIN_RID_LOGON = 9; 268 const int DOMAIN_RID_ADMINISTRATOR = 500; 269 const int DOMAIN_RID_GUEST = 501; 270 const int DOMAIN_RID_KRBTGT = 502; 271 const int DOMAIN_RID_ADMINS = 512; 272 const int DOMAIN_RID_USERS = 513; 273 const int DOMAIN_RID_GUESTS = 514; 274 const int DOMAIN_RID_DOMAIN_MEMBERS = 515; 275 const int DOMAIN_RID_DCS = 516; 276 const int DOMAIN_RID_CERT_ADMINS = 517; 277 const int DOMAIN_RID_SCHEMA_ADMINS = 518; 278 const int DOMAIN_RID_ENTERPRISE_ADMINS = 519; 279 const int DOMAIN_RID_POLICY_ADMINS = 520; 280 281 282 /* 283 privilege IDs. Please keep the IDs below 64. If we get more 284 than 64 then we need to change security_token 285 */ 281 const int DOMAIN_RID_LOGON = 9; 282 const int DOMAIN_RID_ENTERPRISE_READONLY_DCS = 498; 283 const int DOMAIN_RID_ADMINISTRATOR = 500; 284 const int DOMAIN_RID_GUEST = 501; 285 const int DOMAIN_RID_KRBTGT = 502; 286 const int DOMAIN_RID_ADMINS = 512; 287 const int DOMAIN_RID_USERS = 513; 288 const int DOMAIN_RID_GUESTS = 514; 289 const int DOMAIN_RID_DOMAIN_MEMBERS = 515; 290 const int DOMAIN_RID_DCS = 516; 291 const int DOMAIN_RID_CERT_ADMINS = 517; 292 const int DOMAIN_RID_SCHEMA_ADMINS = 518; 293 const int DOMAIN_RID_ENTERPRISE_ADMINS = 519; 294 const int DOMAIN_RID_POLICY_ADMINS = 520; 295 const int DOMAIN_RID_READONLY_DCS = 521; 296 const int DOMAIN_RID_RAS_SERVERS = 553; 297 const int DOMAIN_RID_RODC_ALLOW = 571; 298 const int DOMAIN_RID_RODC_DENY = 572; 299 300 /* well-known builtin RIDs */ 301 const int BUILTIN_RID_ADMINISTRATORS = 544; 302 const int BUILTIN_RID_USERS = 545; 303 const int BUILTIN_RID_GUESTS = 546; 304 const int BUILTIN_RID_POWER_USERS = 547; 305 const int BUILTIN_RID_ACCOUNT_OPERATORS = 548; 306 const int BUILTIN_RID_SERVER_OPERATORS = 549; 307 const int BUILTIN_RID_PRINT_OPERATORS = 550; 308 const int BUILTIN_RID_BACKUP_OPERATORS = 551; 309 const int BUILTIN_RID_REPLICATOR = 552; 310 const int BUILTIN_RID_RAS_SERVERS = 553; 311 const int BUILTIN_RID_PRE_2K_ACCESS = 554; 312 const int BUILTIN_RID_REMOTE_DESKTOP_USERS = 555; 313 const int BUILTIN_RID_NETWORK_CONF_OPERATORS = 556; 314 const int BUILTIN_RID_INCOMING_FOREST_TRUST = 557; 315 const int BUILTIN_RID_PERFMON_USERS = 558; 316 const int BUILTIN_RID_PERFLOG_USERS = 559; 317 const int BUILTIN_RID_AUTH_ACCESS = 560; 318 const int BUILTIN_RID_TS_LICENSE_SERVERS = 561; 319 320 /******************************************************************** 321 This is a list of privileges reported by a WIndows 2008 R2 DC 322 just for reference purposes (and I know the LUID is not guaranteed 323 across reboots): 324 325 0x00000002 SeCreateTokenPrivilege "Create a token object" 326 0x00000003 SeAssignPrimaryTokenPrivilege "Replace a process level token" 327 0x00000004 SeLockMemoryPrivilege "Lock pages in memory" 328 0x00000005 SeIncreaseQuotaPrivilege "Adjust memory quotas for a process" 329 0x00000006 SeMachineAccountPrivilege "Add workstations to domain" 330 0x00000007 SeTcbPrivilege "Act as part of the operating system" 331 0x00000008 SeSecurityPrivilege "Manage auditing and security log" 332 0x00000009 SeTakeOwnershipPrivilege "Take ownership of files or other objects" 333 0x0000000a SeLoadDriverPrivilege "Load and unload device drivers" 334 0x0000000b SeSystemProfilePrivilege "Profile system performance" 335 0x0000000c SeSystemtimePrivilege "Change the system time" 336 0x0000000d SeProfileSingleProcessPrivilege "Profile single process" 337 0x0000000e SeIncreaseBasePriorityPrivilege "Increase scheduling priority" 338 0x0000000f SeCreatePagefilePrivilege "Create a pagefile" 339 0x00000010 SeCreatePermanentPrivilege "Create permanent shared objects" 340 0x00000011 SeBackupPrivilege "Back up files and directories" 341 0x00000012 SeRestorePrivilege "Restore files and directories" 342 0x00000013 SeShutdownPrivilege "Shut down the system" 343 0x00000014 SeDebugPrivilege "Debug programs" 344 0x00000015 SeAuditPrivilege "Generate security audits" 345 0x00000016 SeSystemEnvironmentPrivilege "Modify firmware environment values" 346 0x00000017 SeChangeNotifyPrivilege "Bypass traverse checking" 347 0x00000018 SeRemoteShutdownPrivilege "Force shutdown from a remote system" 348 0x00000019 SeUndockPrivilege "Remove computer from docking station" 349 0x0000001a SeSyncAgentPrivilege "Synchronize directory service data" 350 0x0000001b SeEnableDelegationPrivilege "Enable computer and user accounts to be trusted for delegation" 351 0x0000001c SeManageVolumePrivilege "Perform volume maintenance tasks" 352 0x0000001d SeImpersonatePrivilege "Impersonate a client after authentication" 353 0x0000001e SeCreateGlobalPrivilege "Create global objects" 354 0x0000001f SeTrustedCredManAccessPrivilege "Access Credential Manager as a trusted caller" 355 0x00000020 SeRelabelPrivilege "Modify an object label" 356 0x00000021 SeIncreaseWorkingSetPrivilege "Increase a process working set" 357 0x00000022 SeTimeZonePrivilege "Change the time zone" 358 0x00000023 SeCreateSymbolicLinkPrivilege "Create symbolic links" 359 360 ********************************************************************/ 361 362 /* LUID values for privileges known about by Samba (bottom 32 bits of enum, top bits are 0) */ 363 364 /* we have to define the LUID here due to a horrible check by printmig.exe 365 that requires the SeBackupPrivilege match what is in Windows. So match 366 those that we implement and start Samba privileges at 0x1001 */ 367 286 368 typedef enum { 287 SEC_PRIV_SECURITY = 1, 288 SEC_PRIV_BACKUP = 2, 289 SEC_PRIV_RESTORE = 3, 290 SEC_PRIV_SYSTEMTIME = 4, 291 SEC_PRIV_SHUTDOWN = 5, 292 SEC_PRIV_REMOTE_SHUTDOWN = 6, 293 SEC_PRIV_TAKE_OWNERSHIP = 7, 294 SEC_PRIV_DEBUG = 8, 295 SEC_PRIV_SYSTEM_ENVIRONMENT = 9, 296 SEC_PRIV_SYSTEM_PROFILE = 10, 297 SEC_PRIV_PROFILE_SINGLE_PROCESS = 11, 298 SEC_PRIV_INCREASE_BASE_PRIORITY = 12, 299 SEC_PRIV_LOAD_DRIVER = 13, 300 SEC_PRIV_CREATE_PAGEFILE = 14, 301 SEC_PRIV_INCREASE_QUOTA = 15, 302 SEC_PRIV_CHANGE_NOTIFY = 16, 303 SEC_PRIV_UNDOCK = 17, 304 SEC_PRIV_MANAGE_VOLUME = 18, 305 SEC_PRIV_IMPERSONATE = 19, 306 SEC_PRIV_CREATE_GLOBAL = 20, 307 SEC_PRIV_ENABLE_DELEGATION = 21, 308 SEC_PRIV_INTERACTIVE_LOGON = 22, 309 SEC_PRIV_NETWORK_LOGON = 23, 310 SEC_PRIV_REMOTE_INTERACTIVE_LOGON = 24, 311 SEC_PRIV_MACHINE_ACCOUNT = 25 369 SEC_PRIV_INVALID = 0x0, 370 SEC_PRIV_INCREASE_QUOTA = 0x5, 371 SEC_PRIV_MACHINE_ACCOUNT = 0x6, 372 SEC_PRIV_SECURITY = 0x8, 373 SEC_PRIV_TAKE_OWNERSHIP = 0x09, 374 SEC_PRIV_LOAD_DRIVER = 0x0a, 375 SEC_PRIV_SYSTEM_PROFILE = 0x0b, 376 SEC_PRIV_SYSTEMTIME = 0x0c, 377 SEC_PRIV_PROFILE_SINGLE_PROCESS = 0x0d, 378 SEC_PRIV_INCREASE_BASE_PRIORITY = 0x0e, 379 SEC_PRIV_CREATE_PAGEFILE = 0x0f, 380 SEC_PRIV_BACKUP = 0x11, 381 SEC_PRIV_RESTORE = 0x12, 382 SEC_PRIV_SHUTDOWN = 0x13, 383 SEC_PRIV_DEBUG = 0x14, 384 SEC_PRIV_SYSTEM_ENVIRONMENT = 0x16, 385 SEC_PRIV_CHANGE_NOTIFY = 0x17, 386 SEC_PRIV_REMOTE_SHUTDOWN = 0x18, 387 SEC_PRIV_UNDOCK = 0x19, 388 SEC_PRIV_ENABLE_DELEGATION = 0x1b, 389 SEC_PRIV_MANAGE_VOLUME = 0x1c, 390 SEC_PRIV_IMPERSONATE = 0x1d, 391 SEC_PRIV_CREATE_GLOBAL = 0x1e, 392 /* Samba-specific privs */ 393 SEC_PRIV_PRINT_OPERATOR = 0x1001, 394 SEC_PRIV_ADD_USERS = 0x1002, 395 SEC_PRIV_DISK_OPERATOR = 0x1003 312 396 } sec_privilege; 313 397 398 399 /* Bitmap of privilege values for internal use only. We need 400 * our own bitmap here as privilages.tdb records these values 401 * as a bitmap (privilages.ldb uses the string forms). 402 */ 403 typedef [bitmap64bit] bitmap { 404 SEC_PRIV_MACHINE_ACCOUNT_BIT = 0x00000010, 405 406 /* Samba-specific privs */ 407 SEC_PRIV_PRINT_OPERATOR_BIT = 0x00000020, 408 SEC_PRIV_ADD_USERS_BIT = 0x00000040, 409 SEC_PRIV_DISK_OPERATOR_BIT = 0x00000080, 410 411 SEC_PRIV_REMOTE_SHUTDOWN_BIT = 0x00000100, 412 SEC_PRIV_BACKUP_BIT = 0x00000200, 413 SEC_PRIV_RESTORE_BIT = 0x00000400, 414 SEC_PRIV_TAKE_OWNERSHIP_BIT = 0x00000800, 415 /* End of privilages implemented before merge to common code */ 416 417 SEC_PRIV_INCREASE_QUOTA_BIT = 0x00001000, 418 SEC_PRIV_SECURITY_BIT = 0x00002000, 419 SEC_PRIV_LOAD_DRIVER_BIT = 0x00004000, 420 SEC_PRIV_SYSTEM_PROFILE_BIT = 0x00008000, 421 SEC_PRIV_SYSTEMTIME_BIT = 0x00010000, 422 SEC_PRIV_PROFILE_SINGLE_PROCESS_BIT = 0x00020000, 423 SEC_PRIV_INCREASE_BASE_PRIORITY_BIT = 0x00040000, 424 SEC_PRIV_CREATE_PAGEFILE_BIT = 0x00080000, 425 SEC_PRIV_SHUTDOWN_BIT = 0x00100000, 426 SEC_PRIV_DEBUG_BIT = 0x00200000, 427 SEC_PRIV_SYSTEM_ENVIRONMENT_BIT = 0x00400000, 428 SEC_PRIV_CHANGE_NOTIFY_BIT = 0x00800000, 429 SEC_PRIV_UNDOCK_BIT = 0x01000000, 430 SEC_PRIV_ENABLE_DELEGATION_BIT = 0x02000000, 431 SEC_PRIV_MANAGE_VOLUME_BIT = 0x04000000, 432 SEC_PRIV_IMPERSONATE_BIT = 0x08000000, 433 SEC_PRIV_CREATE_GLOBAL_BIT = 0x10000000 434 } se_privilege; 435 436 typedef [bitmap32bit] bitmap { 437 LSA_POLICY_MODE_INTERACTIVE = 0x00000001, 438 LSA_POLICY_MODE_NETWORK = 0x00000002, 439 LSA_POLICY_MODE_BATCH = 0x00000004, 440 LSA_POLICY_MODE_SERVICE = 0x00000010, 441 LSA_POLICY_MODE_PROXY = 0x00000020, 442 LSA_POLICY_MODE_DENY_INTERACTIVE = 0x00000040, 443 LSA_POLICY_MODE_DENY_NETWORK = 0x00000080, 444 LSA_POLICY_MODE_DENY_BATCH = 0x00000100, 445 LSA_POLICY_MODE_DENY_SERVICE = 0x00000200, 446 LSA_POLICY_MODE_REMOTE_INTERACTIVE = 0x00000400, 447 LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE = 0x00000800, 448 LSA_POLICY_MODE_ALL = 0x00000FF7, 449 LSA_POLICY_MODE_ALL_NT4 = 0x00000037 450 } lsa_SystemAccessModeFlags; 314 451 315 452 typedef [public,bitmap8bit] bitmap { … … 372 509 security_ace_type type; /* SEC_ACE_TYPE_* */ 373 510 security_ace_flags flags; /* SEC_ACE_FLAG_* */ 374 [value(ndr_size_security_ace(r,ndr-> iconv_convenience,ndr->flags))] uint16 size;511 [value(ndr_size_security_ace(r,ndr->flags))] uint16 size; 375 512 uint32 access_mask; 376 513 [switch_is(type)] security_ace_object_ctr object; … … 387 524 typedef [public,gensize,nosize] struct { 388 525 security_acl_revision revision; 389 [value(ndr_size_security_acl(r,ndr-> iconv_convenience,ndr->flags))] uint16 size;526 [value(ndr_size_security_acl(r,ndr->flags))] uint16 size; 390 527 [range(0,1000)] uint32 num_aces; 391 528 security_ace aces[num_aces]; … … 429 566 430 567 typedef [public] struct { 431 [range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr-> iconv_convenience,ndr->flags))] uint32 sd_size;568 [range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->flags))] uint32 sd_size; 432 569 [subcontext(4)] security_descriptor *sd; 433 570 } sec_desc_buf; 434 571 572 /* This is not yet sent over the network, but is simply defined in IDL */ 435 573 typedef [public] struct { 436 dom_sid *user_sid;437 dom_sid *group_sid;438 574 uint32 num_sids; 439 [size_is(num_sids)] dom_sid *sids[*];440 udlongprivilege_mask;441 security_acl *default_dacl;575 [size_is(num_sids)] dom_sid sids[*]; 576 se_privilege privilege_mask; 577 lsa_SystemAccessModeFlags rights_mask; 442 578 } security_token; 579 580 /* This is not yet sent over the network, but is simply defined in IDL */ 581 typedef [public] struct { 582 uid_t uid; 583 uid_t gid; 584 uint32 ngroups; 585 [size_is(ngroups)] gid_t groups[*]; 586 } security_unix_token; 443 587 444 588 /* bits that determine which parts of a security descriptor … … 470 614 SEC_GROUP_FROM_PARENT = 0x00000010 471 615 } security_autoinherit; 616 617 /***************************************************************/ 618 /* Extended right guids */ 619 620 const string GUID_DRS_ALLOCATE_RIDS = "1abd7cf8-0a99-11d1-adbb-00c04fd8d5cd"; 621 const string GUID_DRS_CHANGE_DOMAIN_MASTER = "014bf69c-7b3b-11d1-85f6-08002be74fab"; 622 const string GUID_DRS_CHANGE_INFR_MASTER = "cc17b1fb-33d9-11d2-97d4-00c04fd8d5cd"; 623 const string GUID_DRS_CHANGE_PDC = "bae50096-4752-11d1-9052-00c04fc2d4cf"; 624 const string GUID_DRS_CHANGE_RID_MASTER = "d58d5f36-0a98-11d1-adbb-00c04fd8d5cd"; 625 const string GUID_DRS_CHANGE_SCHEMA_MASTER = "e12b56b6-0a95-11d1-adbb-00c04fd8d5cd"; 626 const string GUID_DRS_GET_CHANGES = "1131f6aa-9c07-11d1-f79f-00c04fc2dcd2"; 627 const string GUID_DRS_GET_ALL_CHANGES = "1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"; 628 const string GUID_DRS_GET_FILTERED_ATTRIBUTES = "89e95b76-444d-4c62-991a-0facbeda640c"; 629 const string GUID_DRS_MANAGE_TOPOLOGY = "1131f6ac-9c07-11d1-f79f-00c04fc2dcd2"; 630 const string GUID_DRS_MONITOR_TOPOLOGY = "f98340fb-7c5b-4cdb-a00b-2ebdfa115a96"; 631 const string GUID_DRS_REPL_SYNCRONIZE = "1131f6ab-9c07-11d1-f79f-00c04fc2dcd2"; 632 const string GUID_DRS_RO_REPL_SECRET_SYNC = "1131f6ae-9c07-11d1-f79f-00c04fc2dcd2"; 633 const string GUID_DRS_USER_CHANGE_PASSWORD = "ab721a53-1e2f-11d0-9819-00aa0040529b"; 634 const string GUID_DRS_FORCE_CHANGE_PASSWORD = "00299570-246d-11d0-a768-00aa006e0529"; 635 636 /***************************************************************/ 637 /* validated writes guids */ 638 const string GUID_DRS_VALIDATE_SPN = "f3a64788-5306-11d1-a9c5-0000f80367c1"; 639 const string GUID_DRS_SELF_MEMBERSHIP = "bf9679c0-0de6-11d0-a285-00aa003049e2"; 640 const string GUID_DRS_DNS_HOST_NAME = "72e39547-7b18-11d1-adef-00c04fd8d5cd"; 641 const string GUID_DRS_ADD_DNS_HOST_NAME = "80863791-dbe9-4eb8-837e-7f0ab55d9ac7"; 642 const string GUID_DRS_BEHAVIOR_VERSION = "d31a8757-2447-4545-8081-3bb610cacbf2"; 643 644 /* A type to describe the mapping of generic access rights to object 645 specific access rights. */ 646 647 typedef struct { 648 uint32 generic_read; 649 uint32 generic_write; 650 uint32 generic_execute; 651 uint32 generic_all; 652 } generic_mapping; 653 654 typedef struct { 655 uint32 std_read; 656 uint32 std_write; 657 uint32 std_execute; 658 uint32 std_all; 659 } standard_mapping; 472 660 } -
trunk/server/librpc/idl/spoolss.idl
r596 r745 30 30 31 31 typedef struct { 32 [value(ndr_size_spoolss_Time(time, ndr-> iconv_convenience, ndr->flags))] uint32 size;32 [value(ndr_size_spoolss_Time(time, ndr->flags))] uint32 size; 33 33 [unique] spoolss_Time *time; 34 34 } spoolss_TimeCtr; … … 120 120 } spoolss_JobStatus; 121 121 122 typedef [v1_enum] enum { 123 SPOOLSS_DEBUGGING_BUILD = 0x00000000, 124 SPOOLSS_RELEASE_BUILD = 0x00000001 125 } spoolss_Build; 126 122 127 typedef [public,gensize] struct { 123 128 [relative] nstring *printername; … … 130 135 uint32 total_pages; 131 136 uint32 version; 132 uint32free_build;137 spoolss_Build free_build; 133 138 uint32 spooling; 134 139 uint32 max_spooling; … … 151 156 uint32 reserved3; 152 157 } spoolss_PrinterInfo0; 158 159 /* Device Mode Extra Data */ 160 161 typedef [v1_enum] enum { 162 SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA = 0x554e4944, /* 0x44494e55 */ 163 SPOOLSS_DM_SIGNATURE_JTEXP = 0x4a544d53, /* 0x534d544a */ 164 SPOOLSS_DM_SIGNATURE_PSEXTRA = 0x50524956 /* 0x56495250 */ 165 } spoolss_DM_Signature; 166 167 typedef [v1_enum] enum { 168 SPOOLSS_DM_LAYOUT_NUP_DISABLED = 0x00000000, 169 SPOOLSS_DM_LAYOUT_NUP_2 = 0x00000001, 170 SPOOLSS_DM_LAYOUT_NUP_4 = 0x00000002, 171 SPOOLSS_DM_LAYOUT_NUP_6 = 0x00000003, 172 SPOOLSS_DM_LAYOUT_NUP_9 = 0x00000004, 173 SPOOLSS_DM_LAYOUT_NUP_16 = 0x00000005, 174 SPOOLSS_DM_LAYOUT_BOOKLET = 0x00000006 175 } spoolss_DM_Layout; 176 177 typedef [v1_enum] enum { 178 SPOOLSS_DM_NUP_DIRECTION_L2R_T2B = 0x00000001, 179 SPOOLSS_DM_NUP_DIRECTION_T2B_L2R = 0x00000002, 180 SPOOLSS_DM_NUP_DIRECTION_R2L_T2B = 0x00000004, 181 SPOOLSS_DM_NUP_DIRECTION_T2B_R2L = 0x00000008 182 } spoolss_DM_NupDirection; 183 184 typedef [v1_enum] enum { 185 SPOOLSS_DM_NUP_BORDER_PRINT = 0x00000000, 186 SPOOLSS_DM_NUP_BORDER_NONE = 0x00000001 187 } spoolss_DM_NupBorderFlags; 188 189 typedef [v1_enum] enum { 190 SPOOLSS_DM_BOOKLET_LEFT_FLIP = 0x00000000, 191 SPOOLSS_DM_BOOKLET_RIGHT_FLIP = 0x00000001 192 } spoolss_DM_BookletFlags; 193 194 /* Device Mode Extra Data: PostScript */ 195 196 /* NT 3.51 */ 197 198 typedef [bitmap32bit] bitmap { 199 SPOOLSS_DM_PS_FLAGS_DRV_ERROR_HANDLER = 0x00000002, 200 SPOOLSS_DM_PS_FLAGS_PRINT_MIRROR = 0x00000004, 201 SPOOLSS_DM_PS_FLAGS_PRINT_NEGATIVE = 0x00000010, 202 SPOOLSS_DM_PS_FLAGS_COMPRESS_BITMAP = 0x00000040, 203 SPOOLSS_DM_PS_FLAGS_ROTATE_180 = 0x00000200, 204 SPOOLSS_DM_PS_FLAGS_GDI_METAFILE_SPOOL = 0x00002000 205 } spoolss_DMPS_Flags; 206 207 typedef struct { 208 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature; 209 spoolss_DMPS_Flags dwFlags; 210 uint32 wchEPSFile[12]; 211 [value(24)] uint16 caSize; 212 uint16 caFlags; 213 uint16 caIlluminantIndex; 214 uint16 caRedGamma; 215 uint16 caGreenGamma; 216 uint16 caBlueGamma; 217 uint16 caReferenceBlack; 218 uint16 caReferenceWhite; 219 uint16 caContrast; 220 uint16 caBrightness; 221 uint16 caColorfulness; 222 uint16 caRedGreenTint; 223 } spoolss_PSDRVEXTRA351; 224 225 /* NT 4.0 */ 226 227 typedef struct { 228 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature; 229 spoolss_DMPS_Flags dwFlags; 230 uint32 wchEPSFile[12]; 231 [value(24)] uint16 caSize; 232 uint16 caFlags; 233 uint16 caIlluminantIndex; 234 uint16 caRedGamma; 235 uint16 caGreenGamma; 236 uint16 caBlueGamma; 237 uint16 caReferenceBlack; 238 uint16 caReferenceWhite; 239 uint16 caContrast; 240 uint16 caBrightness; 241 uint16 caColorfulness; 242 uint16 caRedGreenTint; 243 uint16 wChecksum; 244 uint16 wOptions; 245 uint32 aubOptions[8]; 246 } spoolss_PSDRVEXTRA400; 247 248 /* 2000 & XP */ 249 250 typedef [v1_enum] enum { 251 SPOOLSS_DM_PS_OPTIMIZE_SPEED = 0x00000000, 252 SPOOLSS_DM_PS_OPTIMIZE_PORTABILITY = 0x00000001, 253 SPOOLSS_DM_PS_OPTIMIZE_EPS = 0x00000002, 254 SPOOLSS_DM_PS_OPTIMIZE_ARCHIVAL = 0x00000003 255 } spoolss_DMPS_Dialect; 256 257 typedef [v1_enum] enum { 258 SPOOLSS_DM_PS_TTDLFMT_DEFAULT = 0x00000000, 259 SPOOLSS_DM_PS_TTDLFMT_TYPE_1 = 0x00000001, 260 SPOOLSS_DM_PS_TTDLFMT_TYPE_3 = 0x00000002, 261 SPOOLSS_DM_PS_TTDLFMT_TYPE_42 = 0x00000003 262 } spoolss_DMPS_TTDLFmt; 263 264 typedef [v1_enum] enum { 265 SPOOLSS_DM_PS_PSLEVEL_1 = 0x00000001, 266 SPOOLSS_DM_PS_PSLEVEL_2 = 0x00000002, 267 SPOOLSS_DM_PS_PSLEVEL_3 = 0x00000003 268 } spoolss_DMPS_PSLevel; 269 270 typedef enum { 271 SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST = 0x0000, 272 SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST = 0x0001, 273 SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST_UPSIDEDOWN = 0x0002, 274 SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST_UPSIDEDOWN= 0x0003 275 } spoolss_DMPS_FeedDirection; 276 277 typedef struct { 278 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature; 279 spoolss_DMPS_Flags dwFlags; 280 uint32 wchEPSFile[12]; 281 [value(24)] uint16 caSize; 282 uint16 caFlags; 283 uint16 caIlluminantIndex; 284 uint16 caRedGamma; 285 uint16 caGreenGamma; 286 uint16 caBlueGamma; 287 uint16 caReferenceBlack; 288 uint16 caReferenceWhite; 289 uint16 caContrast; 290 uint16 caBrightness; 291 uint16 caColorfulness; 292 uint16 caRedGreenTint; 293 uint16 wReserved1; 294 uint16 wSize; 295 uint32 fxScrFreq; 296 uint32 fxScrAngle; 297 spoolss_DMPS_Dialect iDialect; 298 spoolss_DMPS_TTDLFmt iTTDLFmt; 299 boolean32 bReversePrint; 300 spoolss_DM_Layout iLayout; 301 spoolss_DMPS_PSLevel iPSLevel; 302 uint32 dwReserved2; 303 uint16 wOEMExtra; 304 [value(0x0010)] uint16 wVer; 305 uint32 dwX; 306 uint32 dwY; 307 uint32 dwWidthOffset; 308 uint32 dwHeightOffset; 309 spoolss_DMPS_FeedDirection wFeedDirection; 310 uint16 wCutSheet; 311 uint32 dwReserved3[4]; 312 uint32 dwChecksum32; 313 uint32 dwOptions; 314 uint32 aOptions[128]; 315 } spoolss_PSDRVEXTRA500; 316 317 /* Vista, 2008, 7 */ 318 319 typedef struct { 320 [value(SPOOLSS_DM_SIGNATURE_PSEXTRA)] spoolss_DM_Signature dwSignature; 321 spoolss_DMPS_Flags dwFlags; 322 uint32 wchEPSFile[12]; 323 [value(24)] uint16 caSize; 324 uint16 caFlags; 325 uint16 caIlluminantIndex; 326 uint16 caRedGamma; 327 uint16 caGreenGamma; 328 uint16 caBlueGamma; 329 uint16 caReferenceBlack; 330 uint16 caReferenceWhite; 331 uint16 caContrast; 332 uint16 caBrightness; 333 uint16 caColorfulness; 334 uint16 caRedGreenTint; 335 uint16 wCoreJTExpSize; 336 [value(ndr_size_spoolss_PSDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize; 337 uint32 fxScrFreq; 338 uint32 fxScrAngle; 339 spoolss_DMPS_Dialect iDialect; 340 spoolss_DMPS_TTDLFmt iTTDLFmt; 341 boolean32 bReversePrint; 342 spoolss_DM_Layout iLayout; 343 spoolss_DMPS_PSLevel iPSLevel; 344 uint32 dwReserved2; 345 uint16 wOEMExtra; 346 [value(0x0010)] uint16 wVer; 347 uint32 dwX; 348 uint32 dwY; 349 uint32 dwWidthOffset; 350 uint32 dwHeightOffset; 351 spoolss_DMPS_FeedDirection wFeedDirection; 352 uint16 wCutSheet; 353 uint32 dwReserved3[4]; 354 uint32 dwChecksum32; 355 uint32 dwOptions; 356 uint32 aOptions[128]; 357 spoolss_DM_NupDirection dwNupDirection; 358 spoolss_DM_NupBorderFlags dwNupBorderFlags; 359 spoolss_DM_BookletFlags dwBookletFlags; 360 uint32 dwPadding; 361 } spoolss_PSDRVEXTRA; 362 363 /* Device Mode Extra Data: UniDriver */ 364 365 /* NT 3.5, NT 4.0 */ 366 367 typedef struct { 368 uint16 wReserved[56]; 369 } spoolss_UNIDRVEXTRA3_4; 370 371 /* 2000, XP */ 372 373 typedef [v1_enum] enum { 374 SPOOLSS_DM_UNI_QUALITY_BEST = 0x00000000, 375 SPOOLSS_DM_UNI_QUALITY_MEDIUM = 0x00000001, 376 SPOOLSS_DM_UNI_QUALITY_DRAFT = 0x00000002 377 } spoolss_DMUNI_Quality; 378 379 typedef [bitmap32bit] bitmap { 380 SPOOLSS_DM_UNI_FLAGS_PRINT_TEXT_AS_GRAPHICS = 0x00000002, 381 SPOOLSS_DM_UNI_FLAGS_AVOID_EMFSPOOL = 0x00000010, 382 SPOOLSS_DM_UNI_FLAGS_CUSTOM_HALFTONING = 0x00000080 383 } spoolss_DMUNI_Flags; 384 385 typedef struct { 386 [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature; 387 [value(0x0022)] uint16 wVer; 388 uint16 sPadding; 389 uint16 wSize; 390 uint16 wOEMExtra; 391 uint32 dwChecksum32; 392 spoolss_DMUNI_Flags dwFlags; 393 boolean32 bReversePrint; 394 spoolss_DM_Layout iLayout; 395 spoolss_DMUNI_Quality iQuality; 396 uint16 wReserved[6]; 397 uint32 dwOptions; 398 uint32 aOptions[128]; 399 } spoolss_UNIDRVEXTRA500; 400 401 /* Vista, 2008, 7 */ 402 403 typedef [public,gensize] struct { 404 [value(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)] spoolss_DM_Signature dwSignature; 405 [value(0x0022)] uint16 wVer; 406 uint16 wCoreJTExpSize; 407 [value(ndr_size_spoolss_UNIDRVEXTRA(r, ndr->flags) + wCoreJTExpSize)] uint16 wCoreFullSize; 408 uint16 wOEMExtra; 409 uint32 dwChecksum32; 410 spoolss_DMUNI_Flags dwFlags; 411 boolean32 bReversePrint; 412 spoolss_DM_Layout iLayout; 413 spoolss_DMUNI_Quality iQuality; 414 uint16 wReserved[6]; 415 uint32 dwOptions; 416 uint32 aOptions[128]; 417 spoolss_DM_NupDirection dwNupDirection; 418 spoolss_DM_NupBorderFlags dwNupBorderFlags; 419 spoolss_DM_BookletFlags dwBookletFlags; 420 } spoolss_UNIDRVEXTRA; 421 422 /* Device Mode Extra Data: JTEXP */ 423 424 typedef struct { 425 uint32 dwSize; 426 [value(SPOOLSS_DM_SIGNATURE_JTEXP)] spoolss_DM_Signature dwSignature; 427 [value(0)] uint32 dwVersion; 428 [value(16)] uint32 wJTHdrSize; 429 uint32 wCoreMFOSize; 430 [string,charset(UTF16)] uint16 *ModelName; 431 nstring_array FeatureOptionPairs; 432 } spoolss_JTEXP; 433 434 /* Device Mode Extra Data: OEM_DMEXTRA */ 435 436 typedef struct { 437 uint32 dwSize; 438 spoolss_DM_Signature dwSignature; 439 uint32 dwVersion; 440 [flag(NDR_REMAINING)] DATA_BLOB Data; 441 } spoolss_OEM_DMEXTRA; 442 443 typedef [nodiscriminant] union { 444 [case(0x0350)] spoolss_PSDRVEXTRA351 psdrvextra351; 445 [case(0x0400)] spoolss_PSDRVEXTRA400 psdrvextra400; 446 [case(0x0501)] spoolss_PSDRVEXTRA500 psdrvextra500; 447 [case(0x0600)] spoolss_PSDRVEXTRA psdrvextra; 448 [default] [flag(NDR_REMAINING)] DATA_BLOB psblob; 449 } spoolss_DeviceModeExtraDataPostScript; 450 451 typedef [nodiscriminant] union { 452 [case(0x0301)] spoolss_UNIDRVEXTRA3_4 unidrvextra3_4; 453 [case(0x0500)] spoolss_UNIDRVEXTRA500 unidrvextra500; 454 [case(0x0600)] spoolss_UNIDRVEXTRA unidrvextra; 455 [default] [flag(NDR_REMAINING)] DATA_BLOB uniblob; 456 } spoolss_DeviceModeExtraDataUniDriver; 153 457 154 458 typedef [bitmap32bit] bitmap { … … 463 767 464 768 typedef [public,gensize] struct { 465 spoolss_ PrinterAttributes flags;769 spoolss_EnumPrinterFlags flags; 466 770 [relative] nstring *description; 467 771 [relative] nstring *name; … … 581 885 /* Function: 0x01 */ 582 886 typedef struct { 583 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr-> iconv_convenience, ndr->flags))] uint32 _ndr_size;887 [value(_ndr_size_spoolss_DeviceMode(devmode, ndr->flags))] uint32 _ndr_size; 584 888 [subcontext(4),subcontext_size(_ndr_size)] spoolss_DeviceMode *devmode; 585 889 } spoolss_DevmodeContainer; … … 858 1162 uint32 total_pages; 859 1163 uint32 version; 860 uint32free_build;1164 spoolss_Build free_build; 861 1165 uint32 spooling; 862 1166 uint32 max_spooling; … … 864 1168 uint32 num_error_out_of_paper; 865 1169 uint32 num_error_not_ready; 866 uint32job_error;1170 spoolss_JobStatus job_error; 867 1171 uint32 number_of_processors; 868 1172 spoolss_ProcessorType processor_type; … … 870 1174 uint32 change_id; 871 1175 WERROR last_error; 872 uint32status;1176 spoolss_PrinterStatus status; 873 1177 uint32 enumerate_network_printers; 874 1178 uint32 c_setprinter; … … 988 1292 989 1293 typedef [public] struct { 990 [value((ndr_size_spoolss_StringArray(r, ndr-> iconv_convenience, ndr->flags)-4)/2)] uint32 _ndr_size;1294 [value((ndr_size_spoolss_StringArray(r, ndr->flags)-4)/2)] uint32 _ndr_size; 991 1295 /*[subcontext(0),subcontext_size(_ndr_size*2)]*/ nstring_array string; 992 1296 } spoolss_StringArray; … … 1022 1326 [string,charset(UTF16)] uint16 *monitor_name; 1023 1327 [string,charset(UTF16)] uint16 *default_datatype; 1024 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;1328 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files; 1025 1329 spoolss_StringArray *dependent_files; 1026 1330 } spoolss_AddDriverInfo3; … … 1036 1340 [string,charset(UTF16)] uint16 *monitor_name; 1037 1341 [string,charset(UTF16)] uint16 *default_datatype; 1038 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;1342 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files; 1039 1343 spoolss_StringArray *dependent_files; 1040 [value(((ndr_size_spoolss_StringArray(previous_names, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;1344 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names; 1041 1345 spoolss_StringArray *previous_names; 1042 1346 } spoolss_AddDriverInfo4; … … 1068 1372 [string,charset(UTF16)] uint16 *monitor_name; 1069 1373 [string,charset(UTF16)] uint16 *default_datatype; 1070 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;1374 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files; 1071 1375 spoolss_StringArray *dependent_files; 1072 [value(((ndr_size_spoolss_StringArray(previous_names, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;1376 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names; 1073 1377 spoolss_StringArray *previous_names; 1074 1378 NTTIME driver_date; … … 1090 1394 [string,charset(UTF16)] uint16 *monitor_name; 1091 1395 [string,charset(UTF16)] uint16 *default_datatype; 1092 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files;1396 [value(((ndr_size_spoolss_StringArray(dependent_files, ndr->flags)-4)/2))] uint32 _ndr_size_dependent_files; 1093 1397 spoolss_StringArray *dependent_files; 1094 [value(((ndr_size_spoolss_StringArray(previous_names, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names;1398 [value(((ndr_size_spoolss_StringArray(previous_names, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names; 1095 1399 spoolss_StringArray *previous_names; 1096 1400 NTTIME driver_date; … … 1102 1406 [string,charset(UTF16)] uint16 *print_processor; 1103 1407 [string,charset(UTF16)] uint16 *vendor_setup; 1104 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles;1408 [value(((ndr_size_spoolss_StringArray(color_profiles, ndr->flags)-4)/2))] uint32 _ndr_size_color_profiles; 1105 1409 spoolss_StringArray *color_profiles; 1106 1410 [string,charset(UTF16)] uint16 *inf_path; 1107 1411 uint32 printer_driver_attributes; 1108 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr-> iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies;1412 [value(((ndr_size_spoolss_StringArray(core_driver_dependencies, ndr->flags)-4)/2))] uint32 _ndr_size_core_driver_dependencies; 1109 1413 spoolss_StringArray *core_driver_dependencies; 1110 1414 NTTIME min_inbox_driver_ver_date; … … 1523 1827 1524 1828 typedef [public,gensize] struct { 1525 [value(ndr_size_spoolss_OSVersion(r,ndr-> iconv_convenience,ndr->flags))] uint32 _ndr_size;1829 [value(ndr_size_spoolss_OSVersion(r,ndr->flags))] uint32 _ndr_size; 1526 1830 uint32 major; 1527 1831 uint32 minor; … … 1532 1836 1533 1837 typedef [public,gensize] struct { 1534 [value(ndr_size_spoolss_OSVersionEx(r,ndr-> iconv_convenience,ndr->flags))] uint32 _ndr_size;1838 [value(ndr_size_spoolss_OSVersionEx(r,ndr->flags))] uint32 _ndr_size; 1535 1839 uint32 major; 1536 1840 uint32 minor; … … 1622 1926 const string SPOOL_REG_VERSIONNUMBER = "versionNumber"; 1623 1927 1624 WERROR spoolss_GetPrinterData(1928 [public] WERROR spoolss_GetPrinterData( 1625 1929 [in,ref] policy_handle *handle, 1626 1930 [in] [string,charset(UTF16)] uint16 value_name[], … … 1930 2234 /******************/ 1931 2235 /* Function: 0x25 */ 2236 2237 typedef [public,gensize] struct { 2238 [string,charset(UTF16)] uint16 *port_name; 2239 } spoolss_SetPortInfo1; 2240 2241 typedef [public,gensize] struct { 2242 [string,charset(UTF16)] uint16 *port_name; 2243 [string,charset(UTF16)] uint16 *monitor_name; 2244 [string,charset(UTF16)] uint16 *description; 2245 spoolss_PortType port_type; 2246 uint32 reserved; 2247 } spoolss_SetPortInfo2; 2248 2249 typedef [public,gensize] struct { 2250 spoolss_PortStatus status; 2251 [string,charset(UTF16)] uint16 *status_string; 2252 spoolss_PortSeverity severity; 2253 } spoolss_SetPortInfo3; 2254 2255 typedef [public,gensize] struct { 2256 [string,charset(UTF16)] uint16 *port_name; 2257 DATA_BLOB monitor_data; /* relative ?? */ 2258 } spoolss_SetPortInfoFF; 2259 2260 typedef [switch_type(uint32)] union { 2261 [case(1)] spoolss_SetPortInfo1 *info1; 2262 [case(2)] spoolss_SetPortInfo2 *info2; 2263 [case(3)] spoolss_SetPortInfo3 *info3; 2264 [case(0xff)] spoolss_SetPortInfoFF *infoFF; 2265 } spoolss_SetPortInfo; 2266 2267 typedef struct { 2268 uint32 level; 2269 [switch_is(level)] spoolss_SetPrinterInfo info; 2270 } spoolss_SetPortInfoContainer; 2271 1932 2272 WERROR spoolss_AddPort( 1933 2273 [in,unique] [string,charset(UTF16)] uint16 *server_name, … … 1943 2283 /******************/ 1944 2284 /* Function: 0x27 */ 1945 [todo] WERROR spoolss_DeletePort( 2285 WERROR spoolss_DeletePort( 2286 [in,unique] [string,charset(UTF16)] uint16 *server_name, 2287 [in] uint32 ptr, 2288 [in,ref] [string,charset(UTF16)] uint16 *port_name 1946 2289 ); 1947 2290 … … 2055 2398 /******************/ 2056 2399 /* Function: 0x35 */ 2057 WERROR spoolss_GetPrinterDriver2(2400 [public] WERROR spoolss_GetPrinterDriver2( 2058 2401 [in,ref] policy_handle *handle, 2059 2402 [in,unique] [string,charset(UTF16)] uint16 *architecture, … … 2167 2510 /******************/ 2168 2511 /* Function: 0x3d */ 2169 [todo] WERROR spoolss_AddPortEx( 2512 2513 typedef struct { 2514 uint32 monitor_data_size; 2515 [size_is(monitor_data_size),unique] uint8 *monitor_data; 2516 } spoolss_PortVarContainer; 2517 2518 WERROR spoolss_AddPortEx( 2519 [in,unique] [string,charset(UTF16)] uint16 *servername, 2520 [in,ref] spoolss_SetPortInfoContainer *port_ctr, 2521 [in,ref] spoolss_PortVarContainer *port_var_ctr, 2522 [in,unique] [string,charset(UTF16)] uint16 *monitor_name 2170 2523 ); 2171 2524 … … 2482 2835 /******************/ 2483 2836 /* Function: 0x47 */ 2484 [todo] WERROR spoolss_47( 2837 WERROR spoolss_SetPort( 2838 [in,unique] [string,charset(UTF16)] uint16 *servername, 2839 [in,unique] [string,charset(UTF16)] uint16 *port_name, 2840 [in,ref] spoolss_SetPortInfoContainer *port_ctr 2485 2841 ); 2486 2842 … … 2631 2987 /******************/ 2632 2988 /* Function: 0x55 */ 2633 [todo] WERROR spoolss_55( 2989 WERROR spoolss_AddPerMachineConnection( 2990 [in,unique] [string,charset(UTF16)] uint16 *server, 2991 [in,ref] [string,charset(UTF16)] uint16 *printername, 2992 [in,ref] [string,charset(UTF16)] uint16 *printserver, 2993 [in,ref] [string,charset(UTF16)] uint16 *provider 2634 2994 ); 2635 2995 2636 2996 /******************/ 2637 2997 /* Function: 0x56 */ 2638 [todo] WERROR spoolss_56( 2998 WERROR spoolss_DeletePerMachineConnection( 2999 [in,unique] [string,charset(UTF16)] uint16 *server, 3000 [in,ref] [string,charset(UTF16)] uint16 *printername 2639 3001 ); 2640 3002 2641 3003 /******************/ 2642 3004 /* Function: 0x57 */ 2643 [todo] WERROR spoolss_ 57(3005 [todo] WERROR spoolss_EnumPerMachineConnections( 2644 3006 ); 2645 3007 -
trunk/server/librpc/idl/srvsvc.idl
r414 r745 4 4 srvsvc interface definitions 5 5 */ 6 import " security.idl", "svcctl.idl";6 import "misc.idl", "security.idl", "svcctl.idl"; 7 7 8 8 [ uuid("4b324fc8-1670-01d3-1278-5a47bf6ee188"), -
trunk/server/librpc/idl/winreg.idl
r429 r745 113 113 } winreg_SecBuf; 114 114 115 const int REG_OPTION_NON_VOLATILE = 0x00000000; 116 117 typedef [bitmap32bit] bitmap { 118 REG_OPTION_VOLATILE = 0x00000001, 119 REG_OPTION_CREATE_LINK = 0x00000002, 120 REG_OPTION_BACKUP_RESTORE = 0x00000004, 121 REG_OPTION_OPEN_LINK = 0x00000008 122 } winreg_KeyOptions; 123 115 124 typedef [v1_enum] enum { 116 125 REG_ACTION_NONE = 0, /* used by caller */ … … 123 132 [in] winreg_String name, 124 133 [in] winreg_String keyclass, 125 [in] uint32options,134 [in] winreg_KeyOptions options, 126 135 [in] winreg_AccessMask access_mask, 127 136 [in,unique] winreg_SecBuf *secdesc, … … 180 189 [in,out,ref] winreg_ValNameBuf *name, 181 190 [in,out,unique] winreg_Type *type, 182 [in,out,unique,size_is( *size),length_is(*length)] uint8 *value,191 [in,out,unique,size_is(size ? *size : 0),length_is(length ? *length : 0),range(0,0x4000000)] uint8 *value, 183 192 [in,out,unique] uint32 *size, 184 193 [in,out,unique] uint32 *length … … 231 240 [in,ref] policy_handle *parent_handle, 232 241 [in] winreg_String keyname, 233 [in] uint32 unknown,242 [in] winreg_KeyOptions options, 234 243 [in] winreg_AccessMask access_mask, 235 244 [out,ref] policy_handle *handle … … 264 273 /******************/ 265 274 /* Function: 0x12 */ 266 [todo] WERROR winreg_ReplaceKey( 275 WERROR winreg_ReplaceKey( 276 [in,ref] policy_handle *handle, 277 [in,ref] winreg_String *subkey, 278 [in,ref] winreg_String *new_file, 279 [in,ref] winreg_String *old_file 267 280 ); 268 281 269 282 /******************/ 270 283 /* Function: 0x13 */ 284 285 typedef [public,bitmap32bit] bitmap { 286 REG_WHOLE_HIVE_VOLATILE = 0x00000001, 287 REG_REFRESH_HIVE = 0x00000002, 288 REG_NO_LAZY_FLUSH = 0x00000004, 289 REG_FORCE_RESTORE = 0x00000008 290 } winreg_RestoreKeyFlags; 291 271 292 WERROR winreg_RestoreKey( 272 293 [in,ref] policy_handle *handle, 273 294 [in,ref] winreg_String *filename, 274 [in] uint32 flags295 [in] winreg_RestoreKeyFlags flags 275 296 ); 276 297 … … 310 331 /******************/ 311 332 /* Function: 0x17 */ 312 [todo] WERROR winreg_UnLoadKey( 333 WERROR winreg_UnLoadKey( 334 [in,ref] policy_handle *handle, 335 [in,ref] winreg_String *subkey 313 336 ); 314 337 … … 357 380 358 381 typedef struct { 359 winreg_ String *name;360 winreg_Type type;361 uint32 offset;362 uint32 length;382 winreg_ValNameBuf *ve_valuename; 383 uint32 ve_valuelen; 384 uint32 ve_valueptr; 385 winreg_Type ve_type; 363 386 } QueryMultipleValue; 364 387 365 388 /******************/ 366 389 /* Function: 0x1d */ 367 390 [public] WERROR winreg_QueryMultipleValues( 368 391 [in,ref] policy_handle *key_handle, 369 [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values, 392 [in,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values_in, 393 [out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values_out, 370 394 [in] uint32 num_values, 371 395 [in,out,unique,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer, … … 390 414 /******************/ 391 415 /* Function: 0x1f */ 392 [todo] WERROR winreg_SaveKeyEx( 416 WERROR winreg_SaveKeyEx( 417 [in,ref] policy_handle *handle, 418 [in,ref] winreg_String *filename, 419 [in,unique] KeySecurityAttribute *sec_attrib, 420 [in] uint32 flags 393 421 ); 394 422 … … 411 439 /******************/ 412 440 /* Function: 0x22 */ 413 [todo] WERROR winreg_QueryMultipleValues2( 441 [public] WERROR winreg_QueryMultipleValues2( 442 [in,ref] policy_handle *key_handle, 443 [in,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values_in, 444 [out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values_out, 445 [in] uint32 num_values, 446 [in,out,unique,size_is(*offered),length_is(*offered)] uint8 *buffer, 447 [in,ref] uint32 *offered, 448 [out,ref] uint32 *needed 449 ); 450 451 /******************/ 452 /* Function: 0x23 */ 453 WERROR winreg_DeleteKeyEx( 454 [in,ref] policy_handle *handle, 455 [in,ref] winreg_String *key, 456 [in] winreg_AccessMask access_mask, 457 [in] uint32 reserved 414 458 ); 415 459 } -
trunk/server/librpc/idl/wmi.idl
r414 r745 9 9 10 10 [ 11 helper("librpc/ndr/ndr_wmi.h"),12 11 uuid("8BC3F05E-D86B-11d0-A075-00C04FB68820") 13 12 ] coclass WbemLevel1Login … … 18 17 19 18 [ 20 local, 21 object, 19 local, 20 object, 22 21 uuid("dc12a681-737f-11cf-884d-00aa004b2e24") 23 22 ] … … 204 203 } WBEMSTATUS; 205 204 206 typedef [public ,noprint] enum205 typedef [public] bitmap 207 206 { 208 207 WBEM_FLAG_RETURN_WBEM_COMPLETE = 0, … … 226 225 } WBEM_GENERIC_FLAG_TYPE; 227 226 228 typedef [public, noprint,v1_enum] enum tag_WBEM_TIMEOUT_TYPE227 typedef [public,v1_enum] enum tag_WBEM_TIMEOUT_TYPE 229 228 { 230 229 WBEM_NO_WAIT = 0, … … 280 279 WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE = 0x1, 281 280 WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS = 0x2, 282 / / WBEM_FLAVOR_MASK_PROPAGATION = 0x0F,281 /* WBEM_FLAVOR_MASK_PROPAGATION = 0x0F, */ 283 282 284 283 WBEM_FLAVOR_NOT_OVERRIDABLE = 0x10, 285 / / WBEM_FLAVOR_MASK_PERMISSIONS = 0x10,284 /* WBEM_FLAVOR_MASK_PERMISSIONS = 0x10, */ 286 285 287 286 WBEM_FLAVOR_ORIGIN_PROPAGATED = 0x20, 288 287 WBEM_FLAVOR_ORIGIN_SYSTEM = 0x40, 289 / / WBEM_FLAVOR_MASK_ORIGIN = 0x60,288 /* WBEM_FLAVOR_MASK_ORIGIN = 0x60, */ 290 289 291 290 WBEM_FLAVOR_AMENDED = 0x80 292 / / WBEM_FLAVOR_MASK_AMENDED = 0x80291 /* WBEM_FLAVOR_MASK_AMENDED = 0x80 */ 293 292 294 293 } WBEM_FLAVOR_TYPE; … … 300 299 WCF_CLASS = 4, 301 300 WCF_CLASS_PART_INTERNAL = 8 302 / / WCF_CLASS_PART_SHARED = 0x104303 304 305 typedef [public,nopull,nopush]struct306 301 /* WCF_CLASS_PART_SHARED = 0x104 */ 302 } WCO_FLAGS; 303 304 typedef struct 305 { 307 306 uint32 count; 308 307 [ref,charset(UTF16)] uint16 *item[count]; 309 310 311 312 313 314 308 } CIMSTRINGS; 309 310 typedef [public,bitmap8bit] bitmap { 311 DEFAULT_FLAG_EMPTY = 1, 312 DEFAULT_FLAG_INHERITED = 2 313 } DEFAULT_FLAGS; 315 314 316 315 WERROR OpenNamespace( … … 421 420 422 421 WERROR CreateInstanceEnum( 423 [in] BSTR strFilter, / / allow more things than a class name422 [in] BSTR strFilter, /* allow more things than a class name */ 424 423 [in] long lFlags, 425 424 [in,unique] IWbemContext* pCtx, … … 526 525 527 526 WERROR GetNames( 528 / / [in] long lFlags,529 / / [out] SAFEARRAY (BSTR)* pNames527 /* [in] long lFlags, */ 528 /* [out] SAFEARRAY (BSTR)* pNames */ 530 529 ); 531 530 … … 533 532 534 533 WERROR Next( 535 / / [in] long lFlags,536 / / [out] BSTR* pstrName,537 / / [out] VARIANT* pValue534 /* [in] long lFlags, */ 535 /* [out] BSTR* pstrName, */ 536 /* [out] VARIANT* pValue */ 538 537 ); 539 538 … … 542 541 543 542 WERROR SetValue( 544 / / [in, string] LPCWSTR wszName,545 / / [in] long lFlags546 / / [in] VARIANT* pValue543 /* [in, string] LPCWSTR wszName, */ 544 /* [in] long lFlags */ 545 /* [in] VARIANT* pValue */ 547 546 ); 548 547 549 548 WERROR GetValue( 550 / / [in, string] LPCWSTR wszName,551 / / [in] long lFlags,552 / / [out] VARIANT* pValue549 /* [in, string] LPCWSTR wszName, */ 550 /* [in] long lFlags, */ 551 /* [out] VARIANT* pValue */ 553 552 ); 554 553 555 554 WERROR DeleteValue( 556 / / [in, string] LPCWSTR wszName,557 / / [in] long lFlags555 /* [in, string] LPCWSTR wszName, */ 556 /* [in] long lFlags */ 558 557 ); 559 558 … … 614 613 615 614 typedef [relative_base] struct { 616 / / [relative] WBEMDATA4 *data;/* 0x9 */615 /* [relative] WBEMDATA4 *data; */ /* 0x9 */ 617 616 uint32 data_size; 618 617 uint8 wtype; … … 654 653 [out,ref] uint32 *puReturned, 655 654 [out,ref] uint32 *pSize, 656 [out,ref, noprint,size_is(,*pSize)] uint8 **pData655 [out,ref,size_is(,*pSize)] uint8 **pData 657 656 ); 658 657 } … … 670 669 [ 671 670 object, 672 / / restricted,671 /* restricted, */ 673 672 uuid(44aca675-e8fc-11d0-a07c-00c04fb68820) 674 673 ] interface IWbemCallResult : IUnknown -
trunk/server/librpc/idl/xattr.idl
r414 r745 15 15 version(0.0), 16 16 helper("../librpc/ndr/ndr_xattr.h"), 17 pyhelper("librpc/ndr/py_xattr.c"), 17 18 pointer_default(unique) 18 19 ] -
trunk/server/librpc/ndr.pc.in
r414 r745 8 8 Requires: samba-hostconfig talloc 9 9 Version: 0.0.1 10 Libs: -L${libdir} -lndr10 Libs: @LIB_RPATH@ -L${libdir} -lndr 11 11 Cflags: -I${includedir} -DHAVE_IMMEDIATE_STRUCTURES=1 -D_GNU_SOURCE=1 -
trunk/server/librpc/ndr/libndr.h
r590 r745 61 61 uint32_t offset; 62 62 63 struct smb_iconv_convenience *iconv_convenience; 64 63 uint32_t relative_highest_offset; 65 64 uint32_t relative_base_offset; 65 uint32_t relative_rap_convert; 66 66 struct ndr_token_list *relative_base_list; 67 67 … … 93 93 struct ndr_token_list *relative_begin_list; 94 94 struct ndr_token_list *nbt_string_list; 95 struct ndr_token_list *dns_string_list; 95 96 struct ndr_token_list *full_ptr_list; 96 97 97 98 /* this is used to ensure we generate unique reference IDs */ 98 99 uint32_t ptr_count; 99 100 struct smb_iconv_convenience *iconv_convenience;101 100 }; 102 101 … … 106 105 uint32_t depth; 107 106 struct ndr_token_list *switch_list; 108 struct smb_iconv_convenience *iconv_convenience;109 107 void (*print)(struct ndr_print *, const char *, ...) PRINTF_ATTRIBUTE(2,3); 110 108 void *private_data; 109 bool no_newline; 111 110 }; 112 111 … … 192 191 NDR_ERR_TOKEN, 193 192 NDR_ERR_IPV4ADDRESS, 193 NDR_ERR_IPV6ADDRESS, 194 194 NDR_ERR_INVALID_POINTER, 195 195 NDR_ERR_UNREAD_BYTES, … … 329 329 extern const struct ndr_syntax_id ndr_transfer_syntax; 330 330 extern const struct ndr_syntax_id ndr64_transfer_syntax; 331 extern const struct ndr_syntax_id null_ndr_syntax_id; 332 333 struct ndr_interface_call_pipe { 334 const char *name; 335 const char *chunk_struct_name; 336 size_t chunk_struct_size; 337 ndr_push_flags_fn_t ndr_push; 338 ndr_pull_flags_fn_t ndr_pull; 339 ndr_print_fn_t ndr_print; 340 }; 341 342 struct ndr_interface_call_pipes { 343 uint32_t num_pipes; 344 const struct ndr_interface_call_pipe *pipes; 345 }; 331 346 332 347 struct ndr_interface_call { … … 336 351 ndr_pull_flags_fn_t ndr_pull; 337 352 ndr_print_function_t ndr_print; 338 bool async; 353 struct ndr_interface_call_pipes in_pipes; 354 struct ndr_interface_call_pipes out_pipes; 339 355 }; 340 356 … … 364 380 NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err); 365 381 const char *ndr_map_error2string(enum ndr_err_code ndr_err); 382 #define ndr_errstr ndr_map_error2string 366 383 367 384 /* FIXME: Use represent_as instead */ … … 378 395 void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); 379 396 size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); 380 void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip);381 397 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); 382 398 bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2); 383 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,const void *p, ndr_push_flags_fn_t fn);384 enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p, uint32_t level, ndr_push_flags_fn_t fn);385 size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push , struct smb_iconv_convenience *);386 size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push , struct smb_iconv_convenience *);399 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn); 400 enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_push_flags_fn_t fn); 401 size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push); 402 size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push); 387 403 uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr); 388 404 void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset); … … 390 406 enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p); 391 407 enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p); 408 enum ndr_err_code ndr_push_short_relative_ptr1(struct ndr_push *ndr, const void *p); 392 409 enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, const void *p); 393 410 enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, const void *p); 411 enum ndr_err_code ndr_push_short_relative_ptr2(struct ndr_push *ndr, const void *p); 394 412 uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr); 395 413 void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset); … … 398 416 enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset); 399 417 enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p); 418 enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v); 400 419 size_t ndr_align_size(uint32_t offset, size_t n); 401 struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx , struct smb_iconv_convenience *iconv_convenience);420 struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx); 402 421 enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size); 403 struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx , struct smb_iconv_convenience *iconv_convenience);422 struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx); 404 423 DATA_BLOB ndr_push_blob(struct ndr_push *ndr); 405 424 enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size); 406 425 void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 426 void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 407 427 void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3); 408 428 void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr); … … 441 461 const void *key, 442 462 uint32_t value); 443 enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v, comparison_fn_t _cmp_fn, bool _remove_tok);463 enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v, int(*_cmp_fn)(const void*,const void*), bool _remove_tok); 444 464 enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v); 445 465 uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key); … … 450 470 uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p); 451 471 enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length); 472 enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count); 473 enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count); 452 474 enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val); 453 475 enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val); … … 456 478 uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p); 457 479 uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p); 458 enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p, ndr_pull_flags_fn_t fn);459 enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p, ndr_pull_flags_fn_t fn);460 enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p, uint32_t level, ndr_pull_flags_fn_t fn);461 enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p, uint32_t level, ndr_pull_flags_fn_t fn);480 enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn); 481 enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, ndr_pull_flags_fn_t fn); 482 enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn); 483 enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn); 462 484 463 485 /* from libndr_basic.h */ … … 487 509 NDR_SCALAR_PROTO(pointer, void *) 488 510 NDR_SCALAR_PROTO(time_t, time_t) 511 NDR_SCALAR_PROTO(uid_t, uid_t) 512 NDR_SCALAR_PROTO(gid_t, gid_t) 489 513 NDR_SCALAR_PROTO(NTSTATUS, NTSTATUS) 490 514 NDR_SCALAR_PROTO(WERROR, WERROR) … … 494 518 NDR_SCALAR_PROTO(DATA_BLOB, DATA_BLOB) 495 519 NDR_SCALAR_PROTO(ipv4address, const char *) 520 NDR_SCALAR_PROTO(ipv6address, const char *) 496 521 NDR_SCALAR_PROTO(string, const char *) 497 522 NDR_SCALAR_PROTO(double, double) … … 500 525 enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r); 501 526 void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r); 502 bool policy_handle_empty(struct policy_handle *h); 527 bool policy_handle_empty(const struct policy_handle *h); 528 bool is_valid_policy_hnd(const struct policy_handle *hnd); 529 bool policy_handle_equal(const struct policy_handle *hnd1, 530 const struct policy_handle *hnd2); 503 531 504 532 void ndr_check_padding(struct ndr_pull *ndr, size_t n); … … 520 548 enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr); 521 549 void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type); 550 void ndr_print_null(struct ndr_print *ndr); 522 551 void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, const char *val, uint32_t value); 523 552 void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value); … … 544 573 /* GUIDs */ 545 574 bool GUID_equal(const struct GUID *u1, const struct GUID *u2); 575 NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b); 546 576 NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid); 547 577 NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid); … … 566 596 _PUBLIC_ enum ndr_err_code ndr_push_enum_uint1632(struct ndr_push *ndr, int ndr_flags, uint16_t v); 567 597 598 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b); 599 568 600 #endif /* __LIBNDR_H__ */ -
trunk/server/librpc/ndr/ndr.c
r596 r745 47 47 }; 48 48 49 const struct ndr_syntax_id null_ndr_syntax_id = { 50 { 0, 0, 0, { 0, 0 }, { 0, 0, 0, 0, 0, 0 } }, 51 0 52 }; 53 49 54 /* 50 55 work out the number of bytes needed to align on a n byte boundary … … 59 64 initialise a ndr parse structure from a data blob 60 65 */ 61 _PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx , struct smb_iconv_convenience *iconv_convenience)66 _PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx) 62 67 { 63 68 struct ndr_pull *ndr; … … 69 74 ndr->data = blob->data; 70 75 ndr->data_size = blob->length; 71 ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience);72 76 73 77 return ndr; … … 103 107 104 108 /* create a ndr_push structure, ready for some marshalling */ 105 _PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx , struct smb_iconv_convenience *iconv_convenience)109 _PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx) 106 110 { 107 111 struct ndr_push *ndr; … … 118 122 return NULL; 119 123 } 120 ndr->iconv_convenience = talloc_reference(ndr, iconv_convenience);121 124 122 125 return ndr; … … 169 172 va_list ap; 170 173 char *s = NULL; 171 int i, ret; 174 uint32_t i; 175 int ret; 172 176 173 177 va_start(ap, format); … … 179 183 } 180 184 185 if (ndr->no_newline) { 186 DEBUGADD(1,("%s", s)); 187 free(s); 188 return; 189 } 190 181 191 for (i=0;i<ndr->depth;i++) { 182 192 DEBUGADD(1,(" ")); … … 187 197 } 188 198 199 _PUBLIC_ void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) 200 { 201 va_list ap; 202 uint32_t i; 203 204 if (!ndr->no_newline) { 205 for (i=0;i<ndr->depth;i++) { 206 printf(" "); 207 } 208 } 209 210 va_start(ap, format); 211 vprintf(format, ap); 212 va_end(ap); 213 if (!ndr->no_newline) { 214 printf("\n"); 215 } 216 } 217 189 218 _PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) 190 219 { 191 220 va_list ap; 192 int i; 193 194 for (i=0;i<ndr->depth;i++) { 195 ndr->private_data = talloc_asprintf_append_buffer( 196 (char *)ndr->private_data, " "); 221 uint32_t i; 222 223 if (!ndr->no_newline) { 224 for (i=0;i<ndr->depth;i++) { 225 ndr->private_data = talloc_asprintf_append_buffer( 226 (char *)ndr->private_data, " "); 227 } 197 228 } 198 229 … … 201 232 format, ap); 202 233 va_end(ap); 203 ndr->private_data = talloc_asprintf_append_buffer((char *)ndr->private_data, 204 "\n"); 234 if (!ndr->no_newline) { 235 ndr->private_data = talloc_asprintf_append_buffer((char *)ndr->private_data, 236 "\n"); 237 } 205 238 } 206 239 … … 257 290 ndr->flags = 0; 258 291 259 /* this is a s4 hack until we build up the courage to pass260 * this all the way down261 */262 #if _SAMBA_BUILD_ == 4263 ndr->iconv_convenience = smb_iconv_convenience_init(talloc_autofree_context(), "ASCII", "UTF-8", true);264 #endif265 266 292 fn(ndr, name, flags, ptr); 267 293 talloc_free(ndr); … … 285 311 ndr->depth = 1; 286 312 ndr->flags = 0; 287 288 /* this is a s4 hack until we build up the courage to pass289 * this all the way down290 */291 #if _SAMBA_BUILD_ == 4292 ndr->iconv_convenience = smb_iconv_convenience_init(talloc_autofree_context(), "ASCII", "UTF-8", true);293 #endif294 313 295 314 fn(ndr, name, ptr); … … 554 573 subndr->offset = 0; 555 574 subndr->data_size = r_content_size; 556 subndr->iconv_convenience = talloc_reference(subndr, ndr->iconv_convenience);557 575 558 576 if (force_le) { … … 590 608 struct ndr_push *subndr; 591 609 592 subndr = ndr_push_init_ctx(ndr , ndr->iconv_convenience);610 subndr = ndr_push_init_ctx(ndr); 593 611 NDR_ERR_HAVE_NO_MEMORY(subndr); 594 612 subndr->flags = ndr->flags & ~LIBNDR_FLAG_NDR64; … … 812 830 } 813 831 832 _PUBLIC_ enum ndr_err_code ndr_push_pipe_chunk_trailer(struct ndr_push *ndr, int ndr_flags, uint32_t count) 833 { 834 if (ndr->flags & LIBNDR_FLAG_NDR64) { 835 int64_t tmp = 0 - (int64_t)count; 836 uint64_t ncount = tmp; 837 838 NDR_CHECK(ndr_push_hyper(ndr, ndr_flags, ncount)); 839 } 840 841 return NDR_ERR_SUCCESS; 842 } 843 844 _PUBLIC_ enum ndr_err_code ndr_check_pipe_chunk_trailer(struct ndr_pull *ndr, int ndr_flags, uint32_t count) 845 { 846 if (ndr->flags & LIBNDR_FLAG_NDR64) { 847 int64_t tmp = 0 - (int64_t)count; 848 uint64_t ncount1 = tmp; 849 uint64_t ncount2; 850 851 NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &ncount2)); 852 if (ncount1 == ncount2) { 853 return NDR_ERR_SUCCESS; 854 } 855 856 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, 857 "Bad pipe trailer[%lld should be %lld] size was %lu\"", 858 (unsigned long long)ncount2, 859 (unsigned long long)ncount1, 860 (unsigned long)count); 861 } 862 863 return NDR_ERR_SUCCESS; 864 } 865 814 866 /* 815 867 store a switch value … … 851 903 pull a struct from a blob using NDR 852 904 */ 853 _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p,905 _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, 854 906 ndr_pull_flags_fn_t fn) 855 907 { 856 908 struct ndr_pull *ndr; 857 ndr = ndr_pull_init_blob(blob, mem_ctx , iconv_convenience);909 ndr = ndr_pull_init_blob(blob, mem_ctx); 858 910 NDR_ERR_HAVE_NO_MEMORY(ndr); 859 911 NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); … … 866 918 */ 867 919 _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, 868 struct smb_iconv_convenience *iconv_convenience,869 920 void *p, ndr_pull_flags_fn_t fn) 870 921 { 871 922 struct ndr_pull *ndr; 872 ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience); 923 uint32_t highest_ofs; 924 ndr = ndr_pull_init_blob(blob, mem_ctx); 873 925 NDR_ERR_HAVE_NO_MEMORY(ndr); 874 926 NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); 875 if (ndr->offset < ndr->data_size) { 876 return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, 877 "not all bytes consumed ofs[%u] size[%u]", 878 ndr->offset, ndr->data_size); 927 if (ndr->offset > ndr->relative_highest_offset) { 928 highest_ofs = ndr->offset; 929 } else { 930 highest_ofs = ndr->relative_highest_offset; 931 } 932 if (highest_ofs < ndr->data_size) { 933 enum ndr_err_code ret; 934 ret = ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, 935 "not all bytes consumed ofs[%u] size[%u]", 936 highest_ofs, ndr->data_size); 937 talloc_free(ndr); 938 return ret; 879 939 } 880 940 talloc_free(ndr); … … 886 946 */ 887 947 _PUBLIC_ enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, 888 struct smb_iconv_convenience *iconv_convenience,void *p,948 void *p, 889 949 uint32_t level, ndr_pull_flags_fn_t fn) 890 950 { 891 951 struct ndr_pull *ndr; 892 ndr = ndr_pull_init_blob(blob, mem_ctx , iconv_convenience);952 ndr = ndr_pull_init_blob(blob, mem_ctx); 893 953 NDR_ERR_HAVE_NO_MEMORY(ndr); 894 954 NDR_CHECK_FREE(ndr_pull_set_switch_value(ndr, p, level)); … … 903 963 */ 904 964 _PUBLIC_ enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, 905 struct smb_iconv_convenience *iconv_convenience,void *p,965 void *p, 906 966 uint32_t level, ndr_pull_flags_fn_t fn) 907 967 { 908 968 struct ndr_pull *ndr; 909 ndr = ndr_pull_init_blob(blob, mem_ctx, iconv_convenience); 969 uint32_t highest_ofs; 970 ndr = ndr_pull_init_blob(blob, mem_ctx); 910 971 NDR_ERR_HAVE_NO_MEMORY(ndr); 911 972 NDR_CHECK_FREE(ndr_pull_set_switch_value(ndr, p, level)); 912 973 NDR_CHECK_FREE(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); 913 if (ndr->offset < ndr->data_size) { 974 if (ndr->offset > ndr->relative_highest_offset) { 975 highest_ofs = ndr->offset; 976 } else { 977 highest_ofs = ndr->relative_highest_offset; 978 } 979 if (highest_ofs < ndr->data_size) { 914 980 enum ndr_err_code ret; 915 981 ret = ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, 916 982 "not all bytes consumed ofs[%u] size[%u]", 917 ndr->offset, ndr->data_size);983 highest_ofs, ndr->data_size); 918 984 talloc_free(ndr); 919 985 return ret; … … 926 992 push a struct to a blob using NDR 927 993 */ 928 _PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,const void *p, ndr_push_flags_fn_t fn)994 _PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn) 929 995 { 930 996 struct ndr_push *ndr; 931 ndr = ndr_push_init_ctx(mem_ctx , iconv_convenience);997 ndr = ndr_push_init_ctx(mem_ctx); 932 998 NDR_ERR_HAVE_NO_MEMORY(ndr); 933 999 … … 944 1010 push a union to a blob using NDR 945 1011 */ 946 _PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,void *p,1012 _PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, 947 1013 uint32_t level, ndr_push_flags_fn_t fn) 948 1014 { 949 1015 struct ndr_push *ndr; 950 ndr = ndr_push_init_ctx(mem_ctx , iconv_convenience);1016 ndr = ndr_push_init_ctx(mem_ctx); 951 1017 NDR_ERR_HAVE_NO_MEMORY(ndr); 952 1018 … … 964 1030 generic ndr_size_*() handler for structures 965 1031 */ 966 _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push , struct smb_iconv_convenience *iconv_convenience)1032 _PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push) 967 1033 { 968 1034 struct ndr_push *ndr; … … 973 1039 if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0; 974 1040 975 ndr = ndr_push_init_ctx(NULL , iconv_convenience);1041 ndr = ndr_push_init_ctx(NULL); 976 1042 if (!ndr) return 0; 977 1043 ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE; … … 989 1055 generic ndr_size_*() handler for unions 990 1056 */ 991 _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push , struct smb_iconv_convenience *iconv_convenience)1057 _PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push) 992 1058 { 993 1059 struct ndr_push *ndr; … … 998 1064 if (flags & LIBNDR_FLAG_NO_NDR_SIZE) return 0; 999 1065 1000 ndr = ndr_push_init_ctx(NULL , iconv_convenience);1066 ndr = ndr_push_init_ctx(NULL); 1001 1067 if (!ndr) return 0; 1002 1068 ndr->flags |= flags | LIBNDR_FLAG_NO_NDR_SIZE; … … 1067 1133 } 1068 1134 1135 /* 1136 push a short relative object - stage1 1137 this is called during SCALARS processing 1138 */ 1139 _PUBLIC_ enum ndr_err_code ndr_push_short_relative_ptr1(struct ndr_push *ndr, const void *p) 1140 { 1141 if (p == NULL) { 1142 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); 1143 return NDR_ERR_SUCCESS; 1144 } 1145 NDR_CHECK(ndr_push_align(ndr, 2)); 1146 NDR_CHECK(ndr_token_store(ndr, &ndr->relative_list, p, ndr->offset)); 1147 return ndr_push_uint16(ndr, NDR_SCALARS, 0xFFFF); 1148 } 1069 1149 /* 1070 1150 push a relative object - stage2 … … 1092 1172 } 1093 1173 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, save_offset - ndr->relative_base_offset)); 1174 ndr->offset = save_offset; 1175 return NDR_ERR_SUCCESS; 1176 } 1177 /* 1178 push a short relative object - stage2 1179 this is called during buffers processing 1180 */ 1181 _PUBLIC_ enum ndr_err_code ndr_push_short_relative_ptr2(struct ndr_push *ndr, const void *p) 1182 { 1183 uint32_t save_offset; 1184 uint32_t ptr_offset = 0xFFFF; 1185 if (p == NULL) { 1186 return NDR_ERR_SUCCESS; 1187 } 1188 save_offset = ndr->offset; 1189 NDR_CHECK(ndr_token_retrieve(&ndr->relative_list, p, &ptr_offset)); 1190 if (ptr_offset > ndr->offset) { 1191 return ndr_push_error(ndr, NDR_ERR_BUFSIZE, 1192 "ndr_push_short_relative_ptr2 ptr_offset(%u) > ndr->offset(%u)", 1193 ptr_offset, ndr->offset); 1194 } 1195 ndr->offset = ptr_offset; 1196 if (save_offset < ndr->relative_base_offset) { 1197 return ndr_push_error(ndr, NDR_ERR_BUFSIZE, 1198 "ndr_push_relative_ptr2 save_offset(%u) < ndr->relative_base_offset(%u)", 1199 save_offset, ndr->relative_base_offset); 1200 } 1201 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, save_offset - ndr->relative_base_offset)); 1094 1202 ndr->offset = save_offset; 1095 1203 return NDR_ERR_SUCCESS; -
trunk/server/librpc/ndr/ndr_basic.c
r596 r745 23 23 #include "system/network.h" 24 24 #include "librpc/ndr/libndr.h" 25 #include "lib/util/util_net.h" 25 26 26 27 #define NDR_SVAL(ndr, ofs) (NDR_BE(ndr)?RSVAL(ndr->data,ofs):SVAL(ndr->data,ofs)) … … 177 178 178 179 /* 180 parse a pointer referent identifier stored in 2 bytes 181 */ 182 _PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uint16_t *v) 183 { 184 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, v)); 185 if (*v != 0) { 186 ndr->ptr_count++; 187 } 188 *(v) -= ndr->relative_rap_convert; 189 return NDR_ERR_SUCCESS; 190 } 191 192 /* 179 193 parse a pointer referent identifier 180 194 */ … … 239 253 { 240 254 NDR_PULL_ALIGN(ndr, 8); 255 if (NDR_BE(ndr)) { 256 return ndr_pull_udlongr(ndr, ndr_flags, v); 257 } 241 258 return ndr_pull_udlong(ndr, ndr_flags, v); 242 259 } … … 536 553 { 537 554 NDR_PUSH_ALIGN(ndr, 8); 555 if (NDR_BE(ndr)) { 556 return ndr_push_udlongr(ndr, NDR_SCALARS, v); 557 } 538 558 return ndr_push_udlong(ndr, NDR_SCALARS, v); 539 559 } … … 791 811 792 812 /* 813 push a uid_t 814 */ 815 _PUBLIC_ enum ndr_err_code ndr_push_uid_t(struct ndr_push *ndr, int ndr_flags, uid_t u) 816 { 817 return ndr_push_hyper(ndr, NDR_SCALARS, (uint64_t)u); 818 } 819 820 /* 821 pull a uid_t 822 */ 823 _PUBLIC_ enum ndr_err_code ndr_pull_uid_t(struct ndr_pull *ndr, int ndr_flags, uid_t *u) 824 { 825 uint64_t uu; 826 NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &uu)); 827 *u = (uid_t)uu; 828 if (unlikely(uu != *u)) { 829 DEBUG(0,(__location__ ": uid_t pull doesn't fit 0x%016llx\n", 830 (unsigned long long)uu)); 831 return NDR_ERR_NDR64; 832 } 833 return NDR_ERR_SUCCESS; 834 } 835 836 837 /* 838 push a gid_t 839 */ 840 _PUBLIC_ enum ndr_err_code ndr_push_gid_t(struct ndr_push *ndr, int ndr_flags, gid_t g) 841 { 842 return ndr_push_hyper(ndr, NDR_SCALARS, (uint64_t)g); 843 } 844 845 /* 846 pull a gid_t 847 */ 848 _PUBLIC_ enum ndr_err_code ndr_pull_gid_t(struct ndr_pull *ndr, int ndr_flags, gid_t *g) 849 { 850 uint64_t gg; 851 NDR_CHECK(ndr_pull_hyper(ndr, ndr_flags, &gg)); 852 *g = (gid_t)gg; 853 if (unlikely(gg != *g)) { 854 DEBUG(0,(__location__ ": gid_t pull doesn't fit 0x%016llx\n", 855 (unsigned long long)gg)); 856 return NDR_ERR_NDR64; 857 } 858 return NDR_ERR_SUCCESS; 859 } 860 861 862 /* 793 863 pull a ipv4address 794 864 */ … … 812 882 if (!is_ipaddress(address)) { 813 883 return ndr_push_error(ndr, NDR_ERR_IPV4ADDRESS, 814 "Invalid IPv4 address: '%s'", 884 "Invalid IPv4 address: '%s'", 815 885 address); 816 886 } … … 823 893 print a ipv4address 824 894 */ 825 _PUBLIC_ void ndr_print_ipv4address(struct ndr_print *ndr, const char *name, 895 _PUBLIC_ void ndr_print_ipv4address(struct ndr_print *ndr, const char *name, 826 896 const char *address) 827 897 { … … 829 899 } 830 900 901 /* 902 pull a ipv6address 903 */ 904 #define IPV6_BYTES 16 905 #define IPV6_ADDR_STR_LEN 39 906 _PUBLIC_ enum ndr_err_code ndr_pull_ipv6address(struct ndr_pull *ndr, int ndr_flags, const char **address) 907 { 908 uint8_t addr[IPV6_BYTES]; 909 char *addr_str = talloc_strdup(ndr->current_mem_ctx, ""); 910 int i; 911 NDR_CHECK(ndr_pull_array_uint8(ndr, ndr_flags, addr, IPV6_BYTES)); 912 for (i = 0; i < IPV6_BYTES; ++i) { 913 addr_str = talloc_asprintf_append(addr_str, "%02x", addr[i]); 914 /* We need a ':' every second byte but the last one */ 915 if (i%2 == 1 && i != (IPV6_BYTES - 1)) { 916 addr_str = talloc_strdup_append(addr_str, ":"); 917 } 918 } 919 *address = addr_str; 920 NDR_ERR_HAVE_NO_MEMORY(*address); 921 return NDR_ERR_SUCCESS; 922 } 923 924 /* 925 push a ipv6address 926 */ 927 _PUBLIC_ enum ndr_err_code ndr_push_ipv6address(struct ndr_push *ndr, int ndr_flags, const char *address) 928 { 929 #ifdef AF_INET6 930 uint8_t addr[IPV6_BYTES]; 931 int ret; 932 933 if (!is_ipaddress(address)) { 934 return ndr_push_error(ndr, NDR_ERR_IPV6ADDRESS, 935 "Invalid IPv6 address: '%s'", 936 address); 937 } 938 ret = inet_pton(AF_INET6, address, addr); 939 if (ret <= 0) { 940 return NDR_ERR_IPV6ADDRESS; 941 } 942 943 NDR_CHECK(ndr_push_array_uint8(ndr, ndr_flags, addr, IPV6_BYTES)); 944 945 return NDR_ERR_SUCCESS; 946 #else 947 return NDR_ERR_IPV6ADDRESS; 948 #endif 949 } 950 951 /* 952 print a ipv6address 953 */ 954 _PUBLIC_ void ndr_print_ipv6address(struct ndr_print *ndr, const char *name, 955 const char *address) 956 { 957 ndr->print(ndr, "%-25s: %s", name, address); 958 } 959 #undef IPV6_BYTES 831 960 832 961 _PUBLIC_ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type) 833 962 { 834 963 ndr->print(ndr, "%s: struct %s", name, type); 964 } 965 966 _PUBLIC_ void ndr_print_null(struct ndr_print *ndr) 967 { 968 ndr->print(ndr, "UNEXPECTED NULL POINTER"); 835 969 } 836 970 … … 891 1025 } 892 1026 1027 _PUBLIC_ void ndr_print_int3264(struct ndr_print *ndr, const char *name, int32_t v) 1028 { 1029 ndr->print(ndr, "%-25s: %d", name, v); 1030 } 1031 1032 _PUBLIC_ void ndr_print_uint3264(struct ndr_print *ndr, const char *name, uint32_t v) 1033 { 1034 ndr->print(ndr, "%-25s: 0x%08x (%u)", name, v, v); 1035 } 1036 893 1037 _PUBLIC_ void ndr_print_udlong(struct ndr_print *ndr, const char *name, uint64_t v) 894 1038 { … … 957 1101 } 958 1102 1103 _PUBLIC_ void ndr_print_uid_t(struct ndr_print *ndr, const char *name, uid_t u) 1104 { 1105 ndr_print_dlong(ndr, name, u); 1106 } 1107 1108 _PUBLIC_ void ndr_print_gid_t(struct ndr_print *ndr, const char *name, gid_t g) 1109 { 1110 ndr_print_dlong(ndr, name, g); 1111 } 1112 959 1113 _PUBLIC_ void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type) 960 1114 { … … 975 1129 { 976 1130 int i; 1131 1132 if (data == NULL) { 1133 ndr->print(ndr, "%s: ARRAY(%d) : NULL", name, count); 1134 return; 1135 } 977 1136 978 1137 if (count <= 600 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) { … … 998 1157 } 999 1158 1159 static void ndr_print_asc(struct ndr_print *ndr, const uint8_t *buf, int len) 1160 { 1161 int i; 1162 for (i=0;i<len;i++) 1163 ndr->print(ndr, "%c", isprint(buf[i])?buf[i]:'.'); 1164 } 1165 1166 /* 1167 ndr_print version of dump_data() 1168 */ 1169 static void ndr_dump_data(struct ndr_print *ndr, const uint8_t *buf, int len) 1170 { 1171 int i=0; 1172 1173 ndr->no_newline = true; 1174 1175 for (i=0;i<len;) { 1176 if (i%16 == 0 && i<len) { 1177 ndr->print(ndr, "[%04X] ",i); 1178 } 1179 1180 ndr->print(ndr, "%02X ",(int)buf[i]); 1181 i++; 1182 if (i%8 == 0) ndr->print(ndr," "); 1183 if (i%16 == 0) { 1184 ndr_print_asc(ndr,&buf[i-16],8); ndr->print(ndr," "); 1185 ndr_print_asc(ndr,&buf[i-8],8); ndr->print(ndr, "\n"); 1186 } 1187 } 1188 1189 if (i%16) { 1190 int n; 1191 n = 16 - (i%16); 1192 ndr->print(ndr, " "); 1193 if (n>8) ndr->print(ndr," "); 1194 while (n--) ndr->print(ndr," "); 1195 n = MIN(8,i%16); 1196 ndr_print_asc(ndr,&buf[i-(i%16)],n); ndr->print(ndr, " "); 1197 n = (i%16) - n; 1198 if (n>0) ndr_print_asc(ndr,&buf[i-n],n); 1199 ndr->print(ndr,"\n"); 1200 } 1201 1202 ndr->no_newline = false; 1203 } 1204 1205 1000 1206 _PUBLIC_ void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_BLOB r) 1001 1207 { 1002 1208 ndr->print(ndr, "%-25s: DATA_BLOB length=%u", name, (unsigned)r.length); 1003 1209 if (r.length) { 1004 dump_data(10, r.data, r.length);1210 ndr_dump_data(ndr, r.data, r.length); 1005 1211 } 1006 1212 } … … 1069 1275 return ret + data->length; 1070 1276 } 1277 1278 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b) 1279 { 1280 ndr->print(ndr, "%-25s: %s", name, b?"true":"false"); 1281 } 1282 1283 _PUBLIC_ NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err) 1284 { 1285 switch (ndr_err) { 1286 case NDR_ERR_SUCCESS: 1287 return NT_STATUS_OK; 1288 case NDR_ERR_BUFSIZE: 1289 return NT_STATUS_BUFFER_TOO_SMALL; 1290 case NDR_ERR_TOKEN: 1291 return NT_STATUS_INTERNAL_ERROR; 1292 case NDR_ERR_ALLOC: 1293 return NT_STATUS_NO_MEMORY; 1294 case NDR_ERR_ARRAY_SIZE: 1295 return NT_STATUS_ARRAY_BOUNDS_EXCEEDED; 1296 case NDR_ERR_INVALID_POINTER: 1297 return NT_STATUS_INVALID_PARAMETER_MIX; 1298 case NDR_ERR_UNREAD_BYTES: 1299 return NT_STATUS_PORT_MESSAGE_TOO_LONG; 1300 default: 1301 break; 1302 } 1303 1304 /* we should map all error codes to different status codes */ 1305 return NT_STATUS_INVALID_PARAMETER; 1306 } -
trunk/server/librpc/ndr/ndr_compression.c
r414 r745 392 392 z_stream z; 393 393 394 ndrpush = ndr_push_init_ctx(subndr , subndr->iconv_convenience);394 ndrpush = ndr_push_init_ctx(subndr); 395 395 NDR_ERR_HAVE_NO_MEMORY(ndrpush); 396 396 … … 431 431 comndr->data_size = uncompressed.length; 432 432 comndr->offset = 0; 433 434 comndr->iconv_convenience = talloc_reference(comndr, subndr->iconv_convenience);435 433 436 434 *_comndr = comndr; … … 466 464 } 467 465 468 uncomndr = ndr_push_init_ctx(subndr , subndr->iconv_convenience);466 uncomndr = ndr_push_init_ctx(subndr); 469 467 NDR_ERR_HAVE_NO_MEMORY(uncomndr); 470 468 uncomndr->flags = subndr->flags; … … 493 491 ndrpull->offset = 0; 494 492 495 ndrpull->iconv_convenience = talloc_reference(ndrpull, subndr->iconv_convenience);496 497 493 switch (compression_alg) { 498 494 case NDR_COMPRESSION_MSZIP: -
trunk/server/librpc/ndr/ndr_compression.h
r414 r745 1 /* 2 Unix SMB/CIFS implementation. 3 4 libndr compression support 5 6 Copyright (C) Stefan Metzmacher 2005 7 Copyright (C) Matthieu Suiche 2008 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 3 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 1 23 #ifndef __LIBRPC_NDR_NDR_COMPRESSION_H__ 2 24 #define __LIBRPC_NDR_NDR_COMPRESSION_H__ -
trunk/server/librpc/ndr/ndr_drsblobs.c
r414 r745 5 5 6 6 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008 7 Copyright (C) Guenther Deschner <gd@samba.org> 2010 7 8 8 9 This program is free software; you can redistribute it and/or modify … … 22 23 #include "includes.h" 23 24 #include "librpc/gen_ndr/ndr_drsblobs.h" 25 #include "../lib/util/asn1.h" 24 26 25 /* parser auto-generated by pidl, then hand-modified by abartlet */ 26 27 /* Modified to have 'count' specified */ 28 static enum ndr_err_code ndr_push_AuthenticationInformationArray_with_count(struct ndr_push *ndr, int ndr_flags, int count, 29 const struct AuthenticationInformationArray *r) 27 _PUBLIC_ enum ndr_err_code ndr_push_AuthenticationInformationArray(struct ndr_push *ndr, int ndr_flags, const struct AuthenticationInformationArray *r) 30 28 { 31 29 uint32_t cntr_array_0; 32 30 if (ndr_flags & NDR_SCALARS) { 33 31 NDR_CHECK(ndr_push_align(ndr, 4)); 34 for (cntr_array_0 = 0; cntr_array_0 < count; cntr_array_0++) {32 for (cntr_array_0 = 0; cntr_array_0 < r->count; cntr_array_0++) { 35 33 NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_SCALARS, &r->array[cntr_array_0])); 36 34 } 35 NDR_CHECK(ndr_push_trailer_align(ndr, 4)); 37 36 } 38 37 if (ndr_flags & NDR_BUFFERS) { 39 for (cntr_array_0 = 0; cntr_array_0 < count; cntr_array_0++) {40 NDR_CHECK(ndr_push_AuthenticationInformation(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));41 }42 38 } 43 39 return NDR_ERR_SUCCESS; 44 40 } 45 41 46 /* Modified to have 'count' specified, and to allocate the array */ 47 static enum ndr_err_code ndr_pull_AuthenticationInformationArray_with_count(struct ndr_pull *ndr, int ndr_flags, int count, struct AuthenticationInformationArray *r) 42 _PUBLIC_ enum ndr_err_code ndr_pull_AuthenticationInformationArray(struct ndr_pull *ndr, int ndr_flags, struct AuthenticationInformationArray *r) 48 43 { 49 uint32_t cntr_array_0;50 TALLOC_CTX *_mem_save_array_0;51 44 if (ndr_flags & NDR_SCALARS) { 52 NDR_CHECK(ndr_pull_align(ndr, 4)); 53 NDR_PULL_ALLOC_N(ndr, r->array, count); 54 _mem_save_array_0 = NDR_PULL_GET_MEM_CTX(ndr); 55 NDR_PULL_SET_MEM_CTX(ndr, r->array, 0); 56 for (cntr_array_0 = 0; cntr_array_0 < count; cntr_array_0++) { 57 NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS, &r->array[cntr_array_0])); 45 r->count = 0; 46 NDR_PULL_ALLOC_N(ndr, r->array, r->count); 47 /* entry is at least 16 bytes large */ 48 while (ndr->offset + 16 <= ndr->data_size) { 49 r->array = talloc_realloc(ndr, r->array, struct AuthenticationInformation, r->count + 1); 50 NDR_ERR_HAVE_NO_MEMORY(r->array); 51 NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_SCALARS, &r->array[r->count])); 52 r->count++; 58 53 } 59 NDR_ PULL_SET_MEM_CTX(ndr, _mem_save_array_0, 0);54 NDR_CHECK(ndr_pull_trailer_align(ndr, 4)); 60 55 } 61 56 if (ndr_flags & NDR_BUFFERS) { 62 for (cntr_array_0 = 0; cntr_array_0 < count; cntr_array_0++) {63 NDR_CHECK(ndr_pull_AuthenticationInformation(ndr, NDR_BUFFERS, &r->array[cntr_array_0]));64 }65 57 } 66 58 return NDR_ERR_SUCCESS; 67 59 } 68 60 69 /* Modified to have 'count' specified */70 _PUBLIC_ void ndr_print_AuthenticationInformationArray_with_count(struct ndr_print *ndr, const char *name, int count, const struct AuthenticationInformationArray *r)71 {72 uint32_t cntr_array_0;73 ndr_print_struct(ndr, name, "AuthenticationInformationArray");74 ndr->depth++;75 ndr->print(ndr, "%s: ARRAY(%d)", "array", (int)1);76 ndr->depth++;77 for (cntr_array_0=0;cntr_array_0<count;cntr_array_0++) {78 char *idx_0=NULL;79 if (asprintf(&idx_0, "[%d]", cntr_array_0) != -1) {80 ndr_print_AuthenticationInformation(ndr, "array", &r->array[cntr_array_0]);81 free(idx_0);82 }83 }84 ndr->depth--;85 ndr->depth--;86 }87 88 /* Modified to call AuthenticationInformationArray with 'count' specified */89 61 _PUBLIC_ enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r) 90 62 { … … 92 64 NDR_CHECK(ndr_push_align(ndr, 4)); 93 65 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); 94 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->current)); 95 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous)); 66 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->count > 0)?12:0)); 67 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->count > 0)?12 + ndr_size_AuthenticationInformationArray(&r->current, ndr_flags):0)); 68 { 69 struct ndr_push *_ndr_current; 70 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_current, 0, ((r->count > 0)?12 + ndr_size_AuthenticationInformationArray(&r->current, ndr_flags):0) - ((r->count > 0)?12:0))); 71 NDR_CHECK(ndr_push_AuthenticationInformationArray(_ndr_current, NDR_SCALARS, &r->current)); 72 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_current, 0, ((r->count > 0)?12 + ndr_size_AuthenticationInformationArray(&r->current, ndr_flags):0) - ((r->count > 0)?12:0))); 73 } 74 { 75 uint32_t _flags_save_AuthenticationInformationArray = ndr->flags; 76 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); 77 { 78 struct ndr_push *_ndr_previous; 79 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_previous, 0, -1)); 80 NDR_CHECK(ndr_push_AuthenticationInformationArray(_ndr_previous, NDR_SCALARS, &r->previous)); 81 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_previous, 0, -1)); 82 } 83 ndr->flags = _flags_save_AuthenticationInformationArray; 84 } 85 NDR_CHECK(ndr_push_trailer_align(ndr, 4)); 96 86 } 97 87 if (ndr_flags & NDR_BUFFERS) { 98 if (r->current) {99 NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->current));100 NDR_CHECK(ndr_push_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->current));101 NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->current));102 }103 if (r->previous) {104 NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous));105 NDR_CHECK(ndr_push_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->previous));106 NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous));107 }108 88 } 109 89 return NDR_ERR_SUCCESS; 110 90 } 111 91 112 _PUBLIC_ enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r)113 {114 uint32_t _ptr_current;115 TALLOC_CTX *_mem_save_current_0;116 uint32_t _ptr_previous;117 TALLOC_CTX *_mem_save_previous_0;118 if (ndr_flags & NDR_SCALARS) {119 NDR_CHECK(ndr_pull_align(ndr, 4));120 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));121 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_current));122 if (_ptr_current) {123 NDR_PULL_ALLOC(ndr, r->current);124 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->current, _ptr_current));125 } else {126 r->current = NULL;127 }128 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous));129 if (_ptr_previous) {130 NDR_PULL_ALLOC(ndr, r->previous);131 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous, _ptr_previous));132 } else {133 r->previous = NULL;134 }135 }136 if (ndr_flags & NDR_BUFFERS) {137 if (r->current) {138 uint32_t _relative_save_offset;139 _relative_save_offset = ndr->offset;140 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->current));141 _mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr);142 NDR_PULL_SET_MEM_CTX(ndr, r->current, 0);143 NDR_CHECK(ndr_pull_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->current));144 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0);145 ndr->offset = _relative_save_offset;146 }147 if (r->previous) {148 uint32_t _relative_save_offset;149 _relative_save_offset = ndr->offset;150 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous));151 _mem_save_previous_0 = NDR_PULL_GET_MEM_CTX(ndr);152 NDR_PULL_SET_MEM_CTX(ndr, r->previous, 0);153 NDR_CHECK(ndr_pull_AuthenticationInformationArray_with_count(ndr, NDR_SCALARS|NDR_BUFFERS, r->count, r->previous));154 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_0, 0);155 ndr->offset = _relative_save_offset;156 }157 }158 return NDR_ERR_SUCCESS;159 }160 161 _PUBLIC_ void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r)162 {163 ndr_print_struct(ndr, name, "trustAuthInOutBlob");164 ndr->depth++;165 ndr_print_uint32(ndr, "count", r->count);166 ndr_print_ptr(ndr, "current", r->current);167 ndr->depth++;168 if (r->current) {169 ndr_print_AuthenticationInformationArray_with_count(ndr, "current", r->count, r->current);170 }171 ndr->depth--;172 ndr_print_ptr(ndr, "previous", r->previous);173 ndr->depth++;174 if (r->previous) {175 ndr_print_AuthenticationInformationArray_with_count(ndr, "previous", r->count, r->previous);176 }177 ndr->depth--;178 ndr->depth--;179 }180 92 181 93 _PUBLIC_ enum ndr_err_code ndr_pull_trustDomainPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustDomainPasswords *r) … … 197 109 struct ndr_pull *_ndr_outgoing; 198 110 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_outgoing, 0, r->outgoing_size)); 199 NDR_CHECK(ndr_pull_trust CurrentPasswords(_ndr_outgoing, NDR_SCALARS|NDR_BUFFERS, &r->outgoing));111 NDR_CHECK(ndr_pull_trustAuthInOutBlob(_ndr_outgoing, NDR_SCALARS|NDR_BUFFERS, &r->outgoing)); 200 112 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_outgoing, 0, r->outgoing_size)); 201 113 } … … 203 115 struct ndr_pull *_ndr_incoming; 204 116 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_incoming, 0, r->incoming_size)); 205 NDR_CHECK(ndr_pull_trust CurrentPasswords(_ndr_incoming, NDR_SCALARS|NDR_BUFFERS, &r->incoming));117 NDR_CHECK(ndr_pull_trustAuthInOutBlob(_ndr_incoming, NDR_SCALARS|NDR_BUFFERS, &r->incoming)); 206 118 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_incoming, 0, r->incoming_size)); 207 119 } … … 214 126 } 215 127 128 _PUBLIC_ void ndr_print_drsuapi_MSPrefixMap_Entry(struct ndr_print *ndr, const char *name, const struct drsuapi_MSPrefixMap_Entry *r) 129 { 130 ndr_print_struct(ndr, name, "drsuapi_MSPrefixMap_Entry"); 131 { 132 uint32_t _flags_save_STRUCT = ndr->flags; 133 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); 134 ndr->depth++; 135 ndr_print_uint16(ndr, "entryID", r->entryID); 136 ndr->print(ndr, "%-25s: length=%u", "oid", r->length); 137 if (r->binary_oid) { 138 char *partial_oid = NULL; 139 DATA_BLOB oid_blob = data_blob_const(r->binary_oid, r->length); 140 char *hex_str = data_blob_hex_string_upper(ndr, &oid_blob); 141 ber_read_partial_OID_String(ndr, oid_blob, &partial_oid); 142 ndr->depth++; 143 ndr->print(ndr, "%-25s: 0x%s (%s)", "binary_oid", hex_str, partial_oid); 144 ndr->depth--; 145 talloc_free(hex_str); 146 talloc_free(partial_oid); 147 } 148 ndr->depth--; 149 ndr->flags = _flags_save_STRUCT; 150 } 151 } -
trunk/server/librpc/ndr/ndr_drsblobs.h
r414 r745 20 20 */ 21 21 22 _PUBLIC_ void ndr_print_AuthenticationInformationArray_with_count(struct ndr_print *ndr, const char *name, int count, const struct AuthenticationInformationArray *r);23 _PUBLIC_ enum ndr_err_code ndr_push_trustAuthInOutBlob(struct ndr_push *ndr, int ndr_flags, const struct trustAuthInOutBlob *r);24 _PUBLIC_ enum ndr_err_code ndr_pull_trustAuthInOutBlob(struct ndr_pull *ndr, int ndr_flags, struct trustAuthInOutBlob *r);25 _PUBLIC_ void ndr_print_trustAuthInOutBlob(struct ndr_print *ndr, const char *name, const struct trustAuthInOutBlob *r);26 22 _PUBLIC_ enum ndr_err_code ndr_pull_trustDomainPasswords(struct ndr_pull *ndr, int ndr_flags, struct trustDomainPasswords *r); 27 23 _PUBLIC_ void ndr_print_drsuapi_MSPrefixMap_Entry(struct ndr_print *ndr, const char *name, const struct drsuapi_MSPrefixMap_Entry *r); -
trunk/server/librpc/ndr/ndr_drsuapi.c
r414 r745 67 67 } 68 68 69 #define _OID_PUSH_CHECK(call) do { \ 70 bool _status; \ 71 _status = call; \ 72 if (_status != true) { \ 73 return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, "OID Conversion Error: %s\n", __location__); \ 74 } \ 75 } while (0) 76 77 #define _OID_PULL_CHECK(call) do { \ 78 bool _status; \ 79 _status = call; \ 80 if (_status != true) { \ 81 return ndr_pull_error(ndr, NDR_ERR_SUBCONTEXT, "OID Conversion Error: %s\n", __location__); \ 82 } \ 83 } while (0) 84 85 enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r) 86 { 87 if (ndr_flags & NDR_SCALARS) { 88 NDR_CHECK(ndr_push_align(ndr, 4)); 89 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_drsuapi_DsReplicaOID_oid(r->oid, 0))); 90 NDR_CHECK(ndr_push_unique_ptr(ndr, r->oid)); 91 } 92 if (ndr_flags & NDR_BUFFERS) { 93 if (r->oid) { 94 DATA_BLOB blob; 95 96 if (strncasecmp("ff", r->oid, 2) == 0) { 97 blob = strhex_to_data_blob(ndr, r->oid); 98 if (!blob.data) { 99 return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, 100 "HEX String Conversion Error: %s\n", 101 __location__); 102 } 103 } else { 104 _OID_PUSH_CHECK(ber_write_OID_String(&blob, r->oid)); 105 talloc_steal(ndr, blob.data); 106 } 107 108 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length)); 109 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, blob.data, blob.length)); 110 } 111 } 112 return NDR_ERR_SUCCESS; 113 } 114 115 enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r) 116 { 117 uint32_t _ptr_oid; 118 TALLOC_CTX *_mem_save_oid_0; 119 if (ndr_flags & NDR_SCALARS) { 120 NDR_CHECK(ndr_pull_align(ndr, 4)); 121 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->__ndr_size)); 122 if (r->__ndr_size < 0 || r->__ndr_size > 10000) { 123 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); 124 } 125 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_oid)); 126 if (_ptr_oid) { 127 NDR_PULL_ALLOC(ndr, r->oid); 128 } else { 129 r->oid = NULL; 130 } 131 } 132 if (ndr_flags & NDR_BUFFERS) { 133 if (r->oid) { 134 DATA_BLOB _oid_array; 135 const char *_oid; 136 137 _mem_save_oid_0 = NDR_PULL_GET_MEM_CTX(ndr); 138 NDR_PULL_SET_MEM_CTX(ndr, ndr, 0); 139 NDR_CHECK(ndr_pull_array_size(ndr, &r->oid)); 140 _oid_array.length = ndr_get_array_size(ndr, &r->oid); 141 NDR_PULL_ALLOC_N(ndr, _oid_array.data, _oid_array.length); 142 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, _oid_array.data, _oid_array.length)); 143 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oid_0, 0); 144 145 if (_oid_array.length && _oid_array.data[0] == 0xFF) { 146 _oid = data_blob_hex_string(ndr, &_oid_array); 147 NDR_ERR_HAVE_NO_MEMORY(_oid); 148 } else { 149 _OID_PULL_CHECK(ber_read_OID_String(ndr, _oid_array, &_oid)); 150 } 151 data_blob_free(&_oid_array); 152 talloc_steal(r->oid, _oid); 153 r->oid = _oid; 154 } 155 if (r->oid) { 156 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->oid, r->__ndr_size)); 157 } 158 } 159 return NDR_ERR_SUCCESS; 160 } 161 162 size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags) 163 { 164 DATA_BLOB _blob; 165 size_t ret = 0; 166 167 if (!oid) return 0; 168 169 if (strncasecmp("ff", oid, 2) == 0) { 170 _blob = strhex_to_data_blob(NULL, oid); 171 if (_blob.data) { 172 ret = _blob.length; 173 } 69 _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r) 70 { 71 ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID"); 72 ndr->depth++; 73 ndr_print_uint32(ndr, "length", r->length); 74 ndr->print(ndr, "%-25s: length=%u", "oid", r->length); 75 if (r->binary_oid) { 76 char *partial_oid = NULL; 77 DATA_BLOB oid_blob = data_blob_const(r->binary_oid, r->length); 78 char *hex_str = data_blob_hex_string_upper(ndr, &oid_blob); 79 ber_read_partial_OID_String(ndr, oid_blob, &partial_oid); 80 ndr->depth++; 81 ndr->print(ndr, "%-25s: 0x%s (%s)", "binary_oid", hex_str, partial_oid); 82 ndr->depth--; 83 talloc_free(hex_str); 84 talloc_free(partial_oid); 85 } 86 ndr->depth--; 87 } 88 89 static void _print_drsuapi_DsAttributeValue_attid(struct ndr_print *ndr, const char *name, 90 const struct drsuapi_DsAttributeValue *r) 91 { 92 uint32_t v; 93 94 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue"); 95 ndr->depth++; 96 v = IVAL(r->blob->data, 0); 97 ndr_print_uint32(ndr, "attid", v); 98 ndr->depth--; 99 } 100 101 static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const char *name, 102 const struct drsuapi_DsAttributeValue *r) 103 { 104 char *str; 105 106 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValue"); 107 ndr->depth++; 108 if (!convert_string_talloc(ndr, 109 CH_UTF16, CH_UNIX, 110 r->blob->data, 111 r->blob->length, 112 (void **)&str, NULL, false)) { 113 ndr_print_string(ndr, "string", "INVALID CONVERSION"); 174 114 } else { 175 if (ber_write_OID_String(&_blob, oid)) { 176 ret = _blob.length; 177 } 178 } 179 data_blob_free(&_blob); 180 return ret; 115 ndr_print_string(ndr, "string", str); 116 talloc_free(str); 117 } 118 ndr->depth--; 119 } 120 121 static void _print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr, 122 const char *name, 123 const struct drsuapi_DsAttributeValueCtr *r, 124 void (*print_val_fn)(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r)) 125 { 126 uint32_t cntr_values_1; 127 ndr_print_struct(ndr, name, "drsuapi_DsAttributeValueCtr"); 128 ndr->depth++; 129 ndr_print_uint32(ndr, "num_values", r->num_values); 130 ndr_print_ptr(ndr, "values", r->values); 131 ndr->depth++; 132 if (r->values) { 133 ndr->print(ndr, "%s: ARRAY(%d)", "values", (int)r->num_values); 134 ndr->depth++; 135 for (cntr_values_1=0;cntr_values_1<r->num_values;cntr_values_1++) { 136 char *idx_1=NULL; 137 if (asprintf(&idx_1, "[%d]", cntr_values_1) != -1) { 138 //ndr_print_drsuapi_DsAttributeValue(ndr, "values", &r->values[cntr_values_1]); 139 print_val_fn(ndr, "values", &r->values[cntr_values_1]); 140 free(idx_1); 141 } 142 } 143 ndr->depth--; 144 } 145 ndr->depth--; 146 ndr->depth--; 147 } 148 149 _PUBLIC_ void ndr_print_drsuapi_DsReplicaAttribute(struct ndr_print *ndr, 150 const char *name, 151 const struct drsuapi_DsReplicaAttribute *r) 152 { 153 ndr_print_struct(ndr, name, "drsuapi_DsReplicaAttribute"); 154 ndr->depth++; 155 ndr_print_drsuapi_DsAttributeId(ndr, "attid", r->attid); 156 switch (r->attid) { 157 case DRSUAPI_ATTID_objectClass: 158 case DRSUAPI_ATTID_possSuperiors: 159 case DRSUAPI_ATTID_subClassOf: 160 case DRSUAPI_ATTID_governsID: 161 case DRSUAPI_ATTID_mustContain: 162 case DRSUAPI_ATTID_mayContain: 163 case DRSUAPI_ATTID_rDNAttId: 164 case DRSUAPI_ATTID_attributeID: 165 case DRSUAPI_ATTID_attributeSyntax: 166 case DRSUAPI_ATTID_auxiliaryClass: 167 case DRSUAPI_ATTID_systemPossSuperiors: 168 case DRSUAPI_ATTID_systemMayContain: 169 case DRSUAPI_ATTID_systemMustContain: 170 case DRSUAPI_ATTID_systemAuxiliaryClass: 171 case DRSUAPI_ATTID_transportAddressAttribute: 172 /* ATTIDs for classSchema and attributeSchema */ 173 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr, 174 _print_drsuapi_DsAttributeValue_attid); 175 break; 176 case DRSUAPI_ATTID_cn: 177 case DRSUAPI_ATTID_ou: 178 case DRSUAPI_ATTID_description: 179 case DRSUAPI_ATTID_displayName: 180 case DRSUAPI_ATTID_dMDLocation: 181 case DRSUAPI_ATTID_adminDisplayName: 182 case DRSUAPI_ATTID_adminDescription: 183 case DRSUAPI_ATTID_lDAPDisplayName: 184 case DRSUAPI_ATTID_name: 185 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr, 186 _print_drsuapi_DsAttributeValue_str); 187 break; 188 default: 189 _print_drsuapi_DsAttributeValueCtr(ndr, "value_ctr", &r->value_ctr, 190 ndr_print_drsuapi_DsAttributeValue); 191 break; 192 } 193 ndr->depth--; 181 194 } 182 195 … … 353 366 } 354 367 355 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags) 356 { 357 return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3, ic); 358 } 359 368 _PUBLIC_ size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags) 369 { 370 return ndr_size_struct((const struct drsuapi_DsReplicaObjectIdentifier3 *)r, flags, (ndr_push_flags_fn_t)ndr_push_drsuapi_DsReplicaObjectIdentifier3); 371 } 372 373 _PUBLIC_ void ndr_print_drsuapi_SecBufferType(struct ndr_print *ndr, const char *name, enum drsuapi_SecBufferType r) 374 { 375 const char *val = NULL; 376 377 switch (r & 0x00000007) { 378 case DRSUAPI_SECBUFFER_EMPTY: val = "DRSUAPI_SECBUFFER_EMPTY"; break; 379 case DRSUAPI_SECBUFFER_DATA: val = "DRSUAPI_SECBUFFER_DATA"; break; 380 case DRSUAPI_SECBUFFER_TOKEN: val = "DRSUAPI_SECBUFFER_TOKEN"; break; 381 case DRSUAPI_SECBUFFER_PKG_PARAMS: val = "DRSUAPI_SECBUFFER_PKG_PARAMS"; break; 382 case DRSUAPI_SECBUFFER_MISSING: val = "DRSUAPI_SECBUFFER_MISSING"; break; 383 case DRSUAPI_SECBUFFER_EXTRA: val = "DRSUAPI_SECBUFFER_EXTRA"; break; 384 case DRSUAPI_SECBUFFER_STREAM_TRAILER: val = "DRSUAPI_SECBUFFER_STREAM_TRAILER"; break; 385 case DRSUAPI_SECBUFFER_STREAM_HEADER: val = "DRSUAPI_SECBUFFER_STREAM_HEADER"; break; 386 } 387 388 if (r & DRSUAPI_SECBUFFER_READONLY) { 389 char *v = talloc_asprintf(ndr, "DRSUAPI_SECBUFFER_READONLY | %s", val); 390 ndr_print_enum(ndr, name, "ENUM", v, r); 391 } else { 392 ndr_print_enum(ndr, name, "ENUM", val, r); 393 } 394 } 395 396 _PUBLIC_ void ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntry_AttrErrListItem_V1 *r) 397 { 398 ndr_print_struct(ndr, name, "drsuapi_DsAddEntry_AttrErrListItem_V1"); 399 ndr->depth++; 400 ndr_print_ptr(ndr, "next", r->next); 401 ndr_print_drsuapi_DsAddEntry_AttrErr_V1(ndr, "err_data", &r->err_data); 402 ndr->depth--; 403 if (r->next) { 404 ndr_print_drsuapi_DsAddEntry_AttrErrListItem_V1(ndr, "next", r->next); 405 } 406 } -
trunk/server/librpc/ndr/ndr_drsuapi.h
r414 r745 29 29 const struct drsuapi_DsReplicaObjectListItemEx *r); 30 30 31 enum ndr_err_code ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsReplicaOID *r); 32 enum ndr_err_code ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, struct drsuapi_DsReplicaOID *r); 33 size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags); 31 size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, int flags); 34 32 35 size_t ndr_size_drsuapi_DsReplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, struct smb_iconv_convenience *ic, int flags);36 33 37 34 #endif /* _LIBRPC_NDR_NDR_DRSUAPI_H */ -
trunk/server/librpc/ndr/ndr_frsrpc.c
r414 r745 85 85 86 86 size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r, 87 struct smb_iconv_convenience *ic,88 87 int flags) 89 88 { 90 89 flags |= LIBNDR_FLAG_NOALIGN; 91 90 return ndr_size_struct(r, flags, 92 (ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr, 93 ic); 91 (ndr_push_flags_fn_t)ndr_push_frsrpc_CommPktChunkCtr); 94 92 } -
trunk/server/librpc/ndr/ndr_frsrpc.h
r414 r745 30 30 struct frsrpc_CommPktChunkCtr *r); 31 31 size_t ndr_size_frsrpc_CommPktChunkCtr(const struct frsrpc_CommPktChunkCtr *r, 32 struct smb_iconv_convenience *ic,33 32 int flags); 34 33 -
trunk/server/librpc/ndr/ndr_krb5pac.c
r414 r745 24 24 #include "librpc/gen_ndr/ndr_krb5pac.h" 25 25 26 static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct smb_iconv_convenience *ic,int flags)26 static size_t _ndr_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) 27 27 { 28 size_t s = ndr_size_PAC_INFO(r, level, ic,flags);28 size_t s = ndr_size_PAC_INFO(r, level, flags); 29 29 switch (level) { 30 30 case PAC_TYPE_LOGON_INFO: … … 35 35 } 36 36 37 static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, struct smb_iconv_convenience *ic,int flags)37 static size_t _subcontext_size_PAC_INFO(const union PAC_INFO *r, uint32_t level, int flags) 38 38 { 39 size_t s = ndr_size_PAC_INFO(r, level, ic,flags);39 size_t s = ndr_size_PAC_INFO(r, level, flags); 40 40 return NDR_ROUND(s,8); 41 41 } … … 46 46 NDR_CHECK(ndr_push_align(ndr, 4)); 47 47 NDR_CHECK(ndr_push_PAC_TYPE(ndr, NDR_SCALARS, r->type)); 48 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type, ndr->iconv_convenience,0)));48 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_PAC_INFO(r->info,r->type,0))); 49 49 { 50 50 uint32_t _flags_save_PAC_INFO = ndr->flags; … … 63 63 { 64 64 struct ndr_push *_ndr_info; 65 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type, ndr->iconv_convenience,0)));65 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0))); 66 66 NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->info, r->type)); 67 67 NDR_CHECK(ndr_push_PAC_INFO(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->info)); 68 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type, ndr->iconv_convenience,0)));68 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 0, _subcontext_size_PAC_INFO(r->info,r->type,0))); 69 69 } 70 70 NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->info)); … … 129 129 ndr->depth++; 130 130 ndr_print_PAC_TYPE(ndr, "type", r->type); 131 ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type, ndr->iconv_convenience,0):r->_ndr_size);131 ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size); 132 132 ndr_print_ptr(ndr, "info", r->info); 133 133 ndr->depth++; -
trunk/server/librpc/ndr/ndr_ntlmssp.c
r414 r745 109 109 110 110 _PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx, 111 struct smb_iconv_convenience *ic,112 111 const DATA_BLOB *nt_response, 113 112 bool ntlmv2) … … 118 117 struct NTLMv2_RESPONSE nt; 119 118 if (nt_response->length > 24) { 120 ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, ic,&nt,119 ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, &nt, 121 120 (ndr_pull_flags_fn_t)ndr_pull_NTLMv2_RESPONSE); 122 121 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 127 126 struct NTLM_RESPONSE nt; 128 127 if (nt_response->length == 24) { 129 ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, ic,&nt,128 ndr_err = ndr_pull_struct_blob(nt_response, mem_ctx, &nt, 130 129 (ndr_pull_flags_fn_t)ndr_pull_NTLM_RESPONSE); 131 130 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 137 136 138 137 _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx, 139 struct smb_iconv_convenience *ic,140 138 const DATA_BLOB *lm_response, 141 139 bool ntlmv2) … … 146 144 struct LMv2_RESPONSE lm; 147 145 if (lm_response->length == 24) { 148 ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, ic,&lm,146 ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, &lm, 149 147 (ndr_pull_flags_fn_t)ndr_pull_LMv2_RESPONSE); 150 148 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 155 153 struct LM_RESPONSE lm; 156 154 if (lm_response->length == 24) { 157 ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, ic,&lm,155 ndr_err = ndr_pull_struct_blob(lm_response, mem_ctx, &lm, 158 156 (ndr_pull_flags_fn_t)ndr_pull_LM_RESPONSE); 159 157 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 170 168 switch (level) { 171 169 case NTLMSSP_NEGOTIATE_VERSION: 172 ndr_print_ VERSION(ndr, name, &r->version);170 ndr_print_ntlmssp_VERSION(ndr, name, &r->version); 173 171 break; 174 172 -
trunk/server/librpc/ndr/ndr_ntlmssp.h
r414 r745 25 25 _PUBLIC_ enum ndr_err_code ndr_pull_AV_PAIR_LIST(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR_LIST *r); 26 26 _PUBLIC_ void ndr_print_ntlmssp_nt_response(TALLOC_CTX *mem_ctx, 27 struct smb_iconv_convenience *ic,28 27 const DATA_BLOB *nt_response, 29 28 bool ntlmv2); 30 29 _PUBLIC_ void ndr_print_ntlmssp_lm_response(TALLOC_CTX *mem_ctx, 31 struct smb_iconv_convenience *ic,32 30 const DATA_BLOB *lm_response, 33 31 bool ntlmv2); -
trunk/server/librpc/ndr/ndr_schannel.c
r414 r745 86 86 case NL_SIGN_HMAC_MD5: { 87 87 struct NL_AUTH_SIGNATURE r; 88 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL,&r,88 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &r, 89 89 (ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SIGNATURE); 90 90 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 95 95 case NL_SIGN_HMAC_SHA256: { 96 96 struct NL_AUTH_SHA2_SIGNATURE r; 97 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL,&r,97 ndr_err = ndr_pull_struct_blob(blob, mem_ctx, &r, 98 98 (ndr_pull_flags_fn_t)ndr_pull_NL_AUTH_SHA2_SIGNATURE); 99 99 if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { -
trunk/server/librpc/ndr/ndr_sec_helper.c
r414 r745 24 24 #include "includes.h" 25 25 #include "librpc/gen_ndr/ndr_security.h" 26 #if _SAMBA_BUILD_ == 4 27 #include "libcli/security/security.h" 28 #endif 26 #include "../libcli/security/security.h" 29 27 30 28 /* 31 29 return the wire size of a security_ace 32 30 */ 33 size_t ndr_size_security_ace(const struct security_ace *ace, struct smb_iconv_convenience *ic,int flags)31 size_t ndr_size_security_ace(const struct security_ace *ace, int flags) 34 32 { 35 33 size_t ret; … … 37 35 if (!ace) return 0; 38 36 39 ret = 8 + ndr_size_dom_sid(&ace->trustee, ic,flags);37 ret = 8 + ndr_size_dom_sid(&ace->trustee, flags); 40 38 41 39 switch (ace->type) { … … 92 90 return the wire size of a security_acl 93 91 */ 94 size_t ndr_size_security_acl(const struct security_acl *theacl, struct smb_iconv_convenience *ic,int flags)92 size_t ndr_size_security_acl(const struct security_acl *theacl, int flags) 95 93 { 96 94 size_t ret; … … 99 97 ret = 8; 100 98 for (i=0;i<theacl->num_aces;i++) { 101 ret += ndr_size_security_ace(&theacl->aces[i], ic,flags);99 ret += ndr_size_security_ace(&theacl->aces[i], flags); 102 100 } 103 101 return ret; … … 107 105 return the wire size of a security descriptor 108 106 */ 109 size_t ndr_size_security_descriptor(const struct security_descriptor *sd, struct smb_iconv_convenience *ic,int flags)107 size_t ndr_size_security_descriptor(const struct security_descriptor *sd, int flags) 110 108 { 111 109 size_t ret; … … 113 111 114 112 ret = 20; 115 ret += ndr_size_dom_sid(sd->owner_sid, ic,flags);116 ret += ndr_size_dom_sid(sd->group_sid, ic,flags);117 ret += ndr_size_security_acl(sd->dacl, ic,flags);118 ret += ndr_size_security_acl(sd->sacl, ic,flags);113 ret += ndr_size_dom_sid(sd->owner_sid, flags); 114 ret += ndr_size_dom_sid(sd->group_sid, flags); 115 ret += ndr_size_security_acl(sd->dacl, flags); 116 ret += ndr_size_security_acl(sd->sacl, flags); 119 117 return ret; 120 118 } … … 123 121 return the wire size of a dom_sid 124 122 */ 125 size_t ndr_size_dom_sid(const struct dom_sid *sid, struct smb_iconv_convenience *ic,int flags)123 size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags) 126 124 { 127 125 if (!sid) return 0; -
trunk/server/librpc/ndr/ndr_spoolss_buf.c
r596 r745 61 61 if (r->in.buffer) {\ 62 62 DATA_BLOB _data_blob_info;\ 63 _ndr_info = ndr_push_init_ctx(ndr , ndr->iconv_convenience);\63 _ndr_info = ndr_push_init_ctx(ndr);\ 64 64 NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\ 65 65 _ndr_info->flags= ndr->flags;\ … … 138 138 struct ndr_pull *_ndr_info;\ 139 139 NDR_PULL_ALLOC(ndr, *r->out.info);\ 140 _ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info , ndr->iconv_convenience);\140 _ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info);\ 141 141 NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\ 142 142 _ndr_info->flags= ndr->flags;\ … … 182 182 struct __##fn __r;\ 183 183 DATA_BLOB _data_blob_info;\ 184 struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx , iconv_convenience);\184 struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\ 185 185 if (!_ndr_info) return 0;\ 186 186 _ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\ … … 197 197 struct __##fn __r;\ 198 198 DATA_BLOB _data_blob_info;\ 199 struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx , iconv_convenience);\199 struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx);\ 200 200 if (!_ndr_info) return 0;\ 201 201 _ndr_info->flags|=LIBNDR_FLAG_NO_NDR_SIZE;\ … … 235 235 } 236 236 237 uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_PrinterInfo *info)237 uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info) 238 238 { 239 239 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinters); … … 271 271 } 272 272 273 uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_JobInfo *info)273 uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_JobInfo *info) 274 274 { 275 275 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumJobs); … … 303 303 } 304 304 305 uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_DriverInfo *info)305 uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_DriverInfo *info) 306 306 { 307 307 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers); … … 331 331 } 332 332 333 uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_FormInfo *info)333 uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_FormInfo *info) 334 334 { 335 335 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumForms); … … 359 359 } 360 360 361 uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_PortInfo *info)361 uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PortInfo *info) 362 362 { 363 363 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPorts); … … 387 387 } 388 388 389 uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_MonitorInfo *info)389 uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info) 390 390 { 391 391 NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumMonitors); … … 419 419 } 420 420 421 uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,421 uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, 422 422 uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info) 423 423 { … … 452 452 } 453 453 454 uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,454 uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, 455 455 uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info) 456 456 { … … 481 481 _r.out.info = data_blob(NULL, 0); 482 482 if (r->in.offered >= *r->out.needed) { 483 struct ndr_push *_subndr_info; 483 484 struct __spoolss_EnumPrinterDataEx __r; 484 _ndr_info = ndr_push_init_ctx(ndr , ndr->iconv_convenience);485 _ndr_info = ndr_push_init_ctx(ndr); 485 486 NDR_ERR_HAVE_NO_MEMORY(_ndr_info); 486 487 _ndr_info->flags= ndr->flags; 487 488 __r.in.count = *r->out.count; 488 489 __r.out.info = *r->out.info; 489 NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r)); 490 NDR_CHECK(ndr_push_subcontext_start(_ndr_info, &_subndr_info, 0, r->in.offered)); 491 NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_subndr_info, flags, &__r)); 492 NDR_CHECK(ndr_push_subcontext_end(_ndr_info, _subndr_info, 0, r->in.offered)); 490 493 if (r->in.offered > _ndr_info->offset) { 491 494 uint32_t _padding_len = r->in.offered - _ndr_info->offset; … … 532 535 struct ndr_pull *_ndr_info; 533 536 NDR_PULL_ALLOC(ndr, *r->out.info); 534 _ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info , ndr->iconv_convenience);537 _ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info); 535 538 NDR_ERR_HAVE_NO_MEMORY(_ndr_info); 536 539 _ndr_info->flags= ndr->flags; … … 552 555 } 553 556 554 uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,557 uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, 555 558 uint32_t count, struct spoolss_PrinterEnumValues *info) 556 559 { … … 558 561 } 559 562 560 uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic,uint32_t flags)563 uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, uint32_t flags) 561 564 { 562 565 if (!devmode) return 0; 563 return ndr_size_spoolss_DeviceMode(devmode, ic,flags);564 } 565 566 _PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic,int flags)566 return ndr_size_spoolss_DeviceMode(devmode, flags); 567 } 568 569 _PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, int flags) 567 570 { 568 571 if (!r) { … … 570 573 } 571 574 572 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray , ic);575 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray); 573 576 } 574 577 … … 640 643 ndr->flags = _flags_save_string; 641 644 } 645 NDR_CHECK(ndr_push_trailer_align(ndr, 8)); 642 646 } 643 647 if (ndr_flags & NDR_BUFFERS) { … … 665 669 NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->file_info)); 666 670 #if 0 667 NDR_CHECK(ndr_push_uint32 (ndr, NDR_SCALARS, r->file_count));671 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->file_count)); 668 672 #endif 669 673 for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) { … … 894 898 ndr->flags = _flags_save_string; 895 899 } 900 NDR_CHECK(ndr_pull_trailer_align(ndr, 8)); 896 901 } 897 902 if (ndr_flags & NDR_BUFFERS) { … … 907 912 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name)); 908 913 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); 914 if (ndr->offset > ndr->relative_highest_offset) { 915 ndr->relative_highest_offset = ndr->offset; 916 } 909 917 ndr->offset = _relative_save_offset; 910 918 } … … 922 930 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture)); 923 931 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0); 932 if (ndr->offset > ndr->relative_highest_offset) { 933 ndr->relative_highest_offset = ndr->offset; 934 } 924 935 ndr->offset = _relative_save_offset; 925 936 } … … 948 959 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_1, 0); 949 960 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_0, 0); 961 if (ndr->offset > ndr->relative_highest_offset) { 962 ndr->relative_highest_offset = ndr->offset; 963 } 950 964 ndr->offset = _relative_save_offset; 951 965 } … … 961 975 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name)); 962 976 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0); 977 if (ndr->offset > ndr->relative_highest_offset) { 978 ndr->relative_highest_offset = ndr->offset; 979 } 963 980 ndr->offset = _relative_save_offset; 964 981 } … … 976 993 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype)); 977 994 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0); 995 if (ndr->offset > ndr->relative_highest_offset) { 996 ndr->relative_highest_offset = ndr->offset; 997 } 978 998 ndr->offset = _relative_save_offset; 979 999 } … … 991 1011 NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names)); 992 1012 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0); 1013 if (ndr->offset > ndr->relative_highest_offset) { 1014 ndr->relative_highest_offset = ndr->offset; 1015 } 993 1016 ndr->offset = _relative_save_offset; 994 1017 } … … 1006 1029 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_name)); 1007 1030 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0); 1031 if (ndr->offset > ndr->relative_highest_offset) { 1032 ndr->relative_highest_offset = ndr->offset; 1033 } 1008 1034 ndr->offset = _relative_save_offset; 1009 1035 } … … 1021 1047 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_url)); 1022 1048 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0); 1049 if (ndr->offset > ndr->relative_highest_offset) { 1050 ndr->relative_highest_offset = ndr->offset; 1051 } 1023 1052 ndr->offset = _relative_save_offset; 1024 1053 } … … 1036 1065 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->hardware_id)); 1037 1066 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0); 1067 if (ndr->offset > ndr->relative_highest_offset) { 1068 ndr->relative_highest_offset = ndr->offset; 1069 } 1038 1070 ndr->offset = _relative_save_offset; 1039 1071 } … … 1051 1083 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->provider)); 1052 1084 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0); 1085 if (ndr->offset > ndr->relative_highest_offset) { 1086 ndr->relative_highest_offset = ndr->offset; 1087 } 1053 1088 ndr->offset = _relative_save_offset; 1054 1089 } … … 1083 1118 } 1084 1119 1085 _PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic,int flags)1120 _PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, int flags) 1086 1121 { 1087 1122 if (!r) { 1088 1123 return 0; 1089 1124 } 1090 return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData , ic);1125 return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData); 1091 1126 } 1092 1127 -
trunk/server/librpc/ndr/ndr_spoolss_buf.h
r596 r745 1 /* 2 Unix SMB/CIFS implementation. 3 4 routines for marshalling/unmarshalling spoolss subcontext buffer structures 5 6 Copyright (C) Andrew Tridgell 2003 7 Copyright (C) Tim Potter 2003 8 Copyright (C) Guenther Deschner 2009 9 10 This program is free software; you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 3 of the License, or 13 (at your option) any later version. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 1 24 #ifndef ___SPACE_SRC_SAMBA_SOURCES_SAMBA_GIT_SOURCE3____SOURCE4_LIBRPC_NDR_NDR_SPOOLSS_BUF_H__ 2 25 #define ___SPACE_SRC_SAMBA_SOURCES_SAMBA_GIT_SOURCE3____SOURCE4_LIBRPC_NDR_NDR_SPOOLSS_BUF_H__ … … 15 38 enum ndr_err_code ndr_push_spoolss_EnumPrinters(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinters *r); 16 39 enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinters *r); 17 uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_PrinterInfo *info);40 uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info); 18 41 enum ndr_err_code ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, const struct spoolss_EnumJobs *r); 19 42 enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, struct spoolss_EnumJobs *r); 20 uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_JobInfo *info);43 uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_JobInfo *info); 21 44 enum ndr_err_code ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDrivers *r); 22 45 enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDrivers *r); 23 uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_DriverInfo *info);46 uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_DriverInfo *info); 24 47 enum ndr_err_code ndr_push_spoolss_EnumForms(struct ndr_push *ndr, int flags, const struct spoolss_EnumForms *r); 25 48 enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, int flags, struct spoolss_EnumForms *r); 26 uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_FormInfo *info);49 uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_FormInfo *info); 27 50 enum ndr_err_code ndr_push_spoolss_EnumPorts(struct ndr_push *ndr, int flags, const struct spoolss_EnumPorts *r); 28 51 enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, int flags, struct spoolss_EnumPorts *r); 29 uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_PortInfo *info);52 uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_PortInfo *info); 30 53 enum ndr_err_code ndr_push_spoolss_EnumMonitors(struct ndr_push *ndr, int flags, const struct spoolss_EnumMonitors *r); 31 54 enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags, struct spoolss_EnumMonitors *r); 32 uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,uint32_t level, uint32_t count, union spoolss_MonitorInfo *info);55 uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info); 33 56 enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r); 34 57 enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessors *r); 35 uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,58 uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, 36 59 uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info); 37 60 enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r); 38 61 enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r); 39 uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,62 uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, 40 63 uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info); 41 64 enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r); 42 65 enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r); 43 uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience,66 uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, 44 67 uint32_t count, struct spoolss_PrinterEnumValues *info); 45 uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic,uint32_t flags);46 size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic,int flags);68 uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, uint32_t flags); 69 size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, int flags); 47 70 _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); 48 71 _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); 49 72 void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r); 50 size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic,int flags);73 size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, int flags); 51 74 void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); 52 75 enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); -
trunk/server/librpc/ndr/ndr_table.h
r414 r745 1 /* 2 Unix SMB/CIFS implementation. 3 4 dcerpc utility functions 5 6 Copyright (C) Andrew Tridgell 2003 7 Copyright (C) Jelmer Vernooij 2004 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 3 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 1 23 #ifndef _NDR_TABLE_PROTO_H_ 2 24 #define _NDR_TABLE_PROTO_H_ -
trunk/server/librpc/ndr/ndr_wmi.c
r414 r745 24 24 #include "librpc/gen_ndr/ndr_dcom.h" 25 25 #include "librpc/gen_ndr/ndr_wmi.h" 26 #include "librpc/ndr/ndr_wmi.h"27 26 28 27 // Just for debugging … … 36 35 enum ndr_err_code status; 37 36 len = strlen(r->data); 38 39 40 41 42 37 if (ndr_flags & NDR_SCALARS) { 38 NDR_CHECK(ndr_push_align(ndr, 4)); 39 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355)); 40 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len)); 41 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len)); 43 42 flags = ndr->flags; 44 43 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4); … … 46 45 ndr->flags = flags; 47 46 return status; 48 49 47 } 48 return NDR_ERR_SUCCESS; 50 49 } 51 50 -
trunk/server/librpc/ndr/uuid.c
r590 r745 26 26 #include "librpc/gen_ndr/ndr_misc.h" 27 27 28 /** 29 build a NDR blob from a GUID 30 */ 31 _PUBLIC_ NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b) 32 { 33 enum ndr_err_code ndr_err; 34 ndr_err = ndr_push_struct_blob(b, mem_ctx, guid, 35 (ndr_push_flags_fn_t)ndr_push_GUID); 36 return ndr_map_error2ntstatus(ndr_err); 37 } 38 28 39 29 40 /** … … 38 49 NT_STATUS_HAVE_NO_MEMORY(mem_ctx); 39 50 40 ndr_err = ndr_pull_struct_blob_all(b, mem_ctx, NULL,guid,51 ndr_err = ndr_pull_struct_blob_all(b, mem_ctx, guid, 41 52 (ndr_pull_flags_fn_t)ndr_pull_GUID); 42 53 talloc_free(mem_ctx); … … 64 75 } 65 76 66 if (s->length == 36) { 77 switch(s->length) { 78 case 36: 79 { 67 80 TALLOC_CTX *mem_ctx; 68 81 const char *string; … … 80 93 } 81 94 talloc_free(mem_ctx); 82 83 } else if (s->length == 38) { 95 break; 96 } 97 case 38: 98 { 84 99 TALLOC_CTX *mem_ctx; 85 100 const char *string; … … 97 112 } 98 113 talloc_free(mem_ctx); 99 100 } else if (s->length == 32) { 114 break; 115 } 116 case 32: 117 { 101 118 size_t rlen = strhex_to_str((char *)blob16.data, blob16.length, 102 119 (const char *)s->data, s->length); … … 108 125 return GUID_from_ndr_blob(s, guid); 109 126 } 110 111 if (s->length == 16) { 127 case 16: 112 128 return GUID_from_ndr_blob(s, guid); 129 default: 130 status = NT_STATUS_INVALID_PARAMETER; 131 break; 113 132 } 114 133 … … 136 155 DATA_BLOB blob = data_blob_string_const(s); 137 156 return GUID_from_data_blob(&blob, guid); 138 return NT_STATUS_OK;139 157 } 140 158 … … 233 251 { 234 252 if (u1->time_low != u2->time_low) { 235 return u1->time_low - u2->time_low;253 return u1->time_low > u2->time_low ? 1 : -1; 236 254 } 237 255 238 256 if (u1->time_mid != u2->time_mid) { 239 return u1->time_mid - u2->time_mid;257 return u1->time_mid > u2->time_mid ? 1 : -1; 240 258 } 241 259 242 260 if (u1->time_hi_and_version != u2->time_hi_and_version) { 243 return u1->time_hi_and_version - u2->time_hi_and_version;261 return u1->time_hi_and_version > u2->time_hi_and_version ? 1 : -1; 244 262 } 245 263 246 264 if (u1->clock_seq[0] != u2->clock_seq[0]) { 247 return u1->clock_seq[0] - u2->clock_seq[0];265 return u1->clock_seq[0] > u2->clock_seq[0] ? 1 : -1; 248 266 } 249 267 250 268 if (u1->clock_seq[1] != u2->clock_seq[1]) { 251 return u1->clock_seq[1] - u2->clock_seq[1];269 return u1->clock_seq[1] > u2->clock_seq[1] ? 1 : -1; 252 270 } 253 271 … … 283 301 char *ret; 284 302 DATA_BLOB guid_blob; 285 enum ndr_err_code ndr_err;286 303 TALLOC_CTX *tmp_mem; 304 NTSTATUS status; 287 305 288 306 tmp_mem = talloc_new(mem_ctx); … … 290 308 return NULL; 291 309 } 292 ndr_err = ndr_push_struct_blob(&guid_blob, tmp_mem, 293 NULL, 294 guid, 295 (ndr_push_flags_fn_t)ndr_push_GUID); 296 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 310 status = GUID_to_ndr_blob(guid, tmp_mem, &guid_blob); 311 if (!NT_STATUS_IS_OK(status)) { 297 312 talloc_free(tmp_mem); 298 313 return NULL; 299 314 } 300 315 301 ret = data_blob_hex_string (mem_ctx, &guid_blob);316 ret = data_blob_hex_string_upper(mem_ctx, &guid_blob); 302 317 talloc_free(tmp_mem); 303 318 return ret; … … 317 332 } 318 333 319 _PUBLIC_ bool policy_handle_empty( struct policy_handle *h)334 _PUBLIC_ bool policy_handle_empty(const struct policy_handle *h) 320 335 { 321 336 return (h->handle_type == 0 && GUID_all_zero(&h->uuid)); 322 337 } 338 339 _PUBLIC_ bool is_valid_policy_hnd(const struct policy_handle *hnd) 340 { 341 return !policy_handle_empty(hnd); 342 } 343 344 _PUBLIC_ bool policy_handle_equal(const struct policy_handle *hnd1, 345 const struct policy_handle *hnd2) 346 { 347 if (!hnd1 || !hnd2) { 348 return false; 349 } 350 351 return (memcmp(hnd1, hnd2, sizeof(*hnd1)) == 0); 352 } -
trunk/server/librpc/ndr_standard.pc.in
r414 r745 8 8 Requires: ndr 9 9 Version: 0.0.1 10 Libs: -L${libdir} -lndr-standard10 Libs: @LIB_RPATH@ -L${libdir} -lndr-standard 11 11 Cflags: -I${includedir} -DHAVE_IMMEDIATE_STRUCTURES=1 -D_GNU_SOURCE=1 -
trunk/server/librpc/rpc/binding.c
r414 r745 24 24 25 25 #include "includes.h" 26 #include "../../lib/util/util_net.h" 26 27 #include "librpc/gen_ndr/ndr_epmapper.h" 27 28 #include "librpc/gen_ndr/ndr_misc.h" 28 29 #include "librpc/rpc/dcerpc.h" 30 #include "rpc_common.h" 31 29 32 #undef strcasecmp 33 #undef strncasecmp 30 34 31 35 #define MAX_PROTSEQ 10 … … 86 90 {"smb2", DCERPC_SMB2}, 87 91 {"hdrsign", DCERPC_HEADER_SIGNING}, 88 {"ndr64", DCERPC_NDR64} 92 {"ndr64", DCERPC_NDR64}, 93 {"localaddress", DCERPC_LOCALADDRESS} 89 94 }; 90 95 … … 114 119 } else { /* IPX */ 115 120 return talloc_asprintf(mem_ctx, "IPX:%s", 116 data_blob_hex_string (mem_ctx, &epm_floor->rhs.uuid.unknown));121 data_blob_hex_string_upper(mem_ctx, &epm_floor->rhs.uuid.unknown)); 117 122 } 118 123 … … 220 225 for (i=0;i<ARRAY_SIZE(ncacn_options);i++) { 221 226 if (b->flags & ncacn_options[i].flag) { 222 s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name); 227 if (ncacn_options[i].flag == DCERPC_LOCALADDRESS && b->localaddress) { 228 s = talloc_asprintf_append_buffer(s, ",%s=%s", ncacn_options[i].name, 229 b->localaddress); 230 } else { 231 s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name); 232 } 223 233 if (!s) return NULL; 224 234 } … … 240 250 int i, j, comma_count; 241 251 242 b = talloc (mem_ctx, struct dcerpc_binding);252 b = talloc_zero(mem_ctx, struct dcerpc_binding); 243 253 if (!b) { 244 254 return NT_STATUS_NO_MEMORY; … … 313 323 b->assoc_group_id = 0; 314 324 b->endpoint = NULL; 325 b->localaddress = NULL; 315 326 316 327 if (!options) { … … 339 350 for (i=0;b->options[i];i++) { 340 351 for (j=0;j<ARRAY_SIZE(ncacn_options);j++) { 341 if (strcasecmp(ncacn_options[j].name, b->options[i]) == 0) { 352 size_t opt_len = strlen(ncacn_options[j].name); 353 if (strncasecmp(ncacn_options[j].name, b->options[i], opt_len) == 0) { 342 354 int k; 355 char c = b->options[i][opt_len]; 356 357 if (ncacn_options[j].flag == DCERPC_LOCALADDRESS && c == '=') { 358 b->localaddress = talloc_strdup(b, &b->options[i][opt_len+1]); 359 } else if (c != 0) { 360 continue; 361 } 362 343 363 b->flags |= ncacn_options[j].flag; 344 364 for (k=i;b->options[k];k++) { … … 376 396 uint16_t if_version=0; 377 397 378 ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx , NULL);398 ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx); 379 399 if (ndr == NULL) { 380 400 talloc_free(mem_ctx); … … 404 424 static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax) 405 425 { 406 struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL); 426 DATA_BLOB blob; 427 struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx); 407 428 408 429 ndr->flags |= LIBNDR_FLAG_NOALIGN; … … 411 432 ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version); 412 433 413 return ndr_push_blob(ndr); 434 blob = ndr_push_blob(ndr); 435 talloc_steal(mem_ctx, blob.data); 436 talloc_free(ndr); 437 return blob; 438 } 439 440 static bool dcerpc_floor_pack_rhs_if_version_data( 441 TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, 442 DATA_BLOB *pblob) 443 { 444 DATA_BLOB blob; 445 struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx); 446 enum ndr_err_code ndr_err; 447 448 if (ndr == NULL) { 449 return false; 450 } 451 452 ndr->flags |= LIBNDR_FLAG_NOALIGN; 453 454 ndr_err = ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version >> 16); 455 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 456 return false; 457 } 458 459 blob = ndr_push_blob(ndr); 460 talloc_steal(mem_ctx, blob.data); 461 talloc_free(ndr); 462 *pblob = blob; 463 return true; 414 464 } 415 465 … … 608 658 } 609 659 610 _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 611 struct epm_tower *tower,612 struct dcerpc_binding **b_out)660 _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 661 struct epm_tower *tower, 662 struct dcerpc_binding **b_out) 613 663 { 614 664 NTSTATUS status; 615 665 struct dcerpc_binding *binding; 616 666 617 binding = talloc(mem_ctx, struct dcerpc_binding); 667 /* 668 * A tower needs to have at least 4 floors to carry useful 669 * information. Floor 3 is the transport identifier which defines 670 * how many floors are required at least. 671 */ 672 if (tower->num_floors < 4) { 673 return NT_STATUS_INVALID_PARAMETER; 674 } 675 676 binding = talloc_zero(mem_ctx, struct dcerpc_binding); 618 677 NT_STATUS_HAVE_NO_MEMORY(binding); 619 678 … … 631 690 } 632 691 633 if (tower->num_floors < 1) {634 return NT_STATUS_OK;635 }636 637 692 /* Set object uuid */ 638 693 status = dcerpc_floor_get_lhs_data(&tower->floors[0], &binding->object); 639 694 640 695 if (!NT_STATUS_IS_OK(status)) { 641 DEBUG(1, ("Error pulling object uuid and version: %s", nt_errstr(status))); 696 DEBUG(1, ("Error pulling object uuid and version: %s", nt_errstr(status))); 642 697 return status; 643 698 } … … 649 704 /* Set endpoint */ 650 705 if (tower->num_floors >= 4) { 651 binding->endpoint = dcerpc_floor_get_rhs_data( mem_ctx, &tower->floors[3]);706 binding->endpoint = dcerpc_floor_get_rhs_data(binding, &tower->floors[3]); 652 707 } else { 653 708 binding->endpoint = NULL; … … 656 711 /* Set network address */ 657 712 if (tower->num_floors >= 5) { 658 binding->host = dcerpc_floor_get_rhs_data( mem_ctx, &tower->floors[4]);713 binding->host = dcerpc_floor_get_rhs_data(binding, &tower->floors[4]); 659 714 NT_STATUS_HAVE_NO_MEMORY(binding->host); 660 715 binding->target_hostname = binding->host; … … 662 717 *b_out = binding; 663 718 return NT_STATUS_OK; 719 } 720 721 _PUBLIC_ struct dcerpc_binding *dcerpc_binding_dup(TALLOC_CTX *mem_ctx, 722 const struct dcerpc_binding *b) 723 { 724 struct dcerpc_binding *n; 725 uint32_t count; 726 727 n = talloc_zero(mem_ctx, struct dcerpc_binding); 728 if (n == NULL) { 729 return NULL; 730 } 731 732 n->transport = b->transport; 733 n->object = b->object; 734 n->flags = b->flags; 735 n->assoc_group_id = b->assoc_group_id; 736 737 if (b->host != NULL) { 738 n->host = talloc_strdup(n, b->host); 739 if (n->host == NULL) { 740 talloc_free(n); 741 return NULL; 742 } 743 } 744 745 if (b->target_hostname != NULL) { 746 n->target_hostname = talloc_strdup(n, b->target_hostname); 747 if (n->target_hostname == NULL) { 748 talloc_free(n); 749 return NULL; 750 } 751 } 752 753 if (b->target_principal != NULL) { 754 n->target_principal = talloc_strdup(n, b->target_principal); 755 if (n->target_principal == NULL) { 756 talloc_free(n); 757 return NULL; 758 } 759 } 760 761 if (b->localaddress != NULL) { 762 n->localaddress = talloc_strdup(n, b->localaddress); 763 if (n->localaddress == NULL) { 764 talloc_free(n); 765 return NULL; 766 } 767 } 768 769 if (b->endpoint != NULL) { 770 n->endpoint = talloc_strdup(n, b->endpoint); 771 if (n->endpoint == NULL) { 772 talloc_free(n); 773 return NULL; 774 } 775 } 776 777 for (count = 0; b->options && b->options[count]; count++); 778 779 if (count > 0) { 780 uint32_t i; 781 782 n->options = talloc_array(n, const char *, count + 1); 783 if (n->options == NULL) { 784 talloc_free(n); 785 return NULL; 786 } 787 788 for (i = 0; i < count; i++) { 789 n->options[i] = talloc_strdup(n->options, b->options[i]); 790 if (n->options[i] == NULL) { 791 talloc_free(n); 792 return NULL; 793 } 794 } 795 n->options[count] = NULL; 796 } 797 798 return n; 664 799 } 665 800 … … 692 827 tower->floors[0].lhs.protocol = EPM_PROTOCOL_UUID; 693 828 694 tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(mem_ctx, &binding->object); 695 696 tower->floors[0].rhs.uuid.unknown = data_blob_talloc_zero(mem_ctx, 2); 829 tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(tower->floors, &binding->object); 830 831 if (!dcerpc_floor_pack_rhs_if_version_data( 832 tower->floors, &binding->object, 833 &tower->floors[0].rhs.uuid.unknown)) { 834 return NT_STATUS_NO_MEMORY; 835 } 697 836 698 837 /* Floor 1 */ 699 838 tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID; 700 839 701 tower->floors[1].lhs.lhs_data = dcerpc_floor_pack_lhs_data( mem_ctx,840 tower->floors[1].lhs.lhs_data = dcerpc_floor_pack_lhs_data(tower->floors, 702 841 &ndr_transfer_syntax); 703 842 704 tower->floors[1].rhs.uuid.unknown = data_blob_talloc_zero( mem_ctx, 2);843 tower->floors[1].rhs.uuid.unknown = data_blob_talloc_zero(tower->floors, 2); 705 844 706 845 /* Floor 2 to num_protocols */ 707 846 for (i = 0; i < num_protocols; i++) { 708 847 tower->floors[2 + i].lhs.protocol = protseq[i]; 709 tower->floors[2 + i].lhs.lhs_data = data_blob_talloc( mem_ctx, NULL, 0);848 tower->floors[2 + i].lhs.lhs_data = data_blob_talloc(tower->floors, NULL, 0); 710 849 ZERO_STRUCT(tower->floors[2 + i].rhs); 711 dcerpc_floor_set_rhs_data( mem_ctx, &tower->floors[2 + i], "");850 dcerpc_floor_set_rhs_data(tower->floors, &tower->floors[2 + i], ""); 712 851 } 713 852 714 853 /* The 4th floor contains the endpoint */ 715 854 if (num_protocols >= 2 && binding->endpoint) { 716 status = dcerpc_floor_set_rhs_data( mem_ctx, &tower->floors[3], binding->endpoint);855 status = dcerpc_floor_set_rhs_data(tower->floors, &tower->floors[3], binding->endpoint); 717 856 if (NT_STATUS_IS_ERR(status)) { 718 857 return status; … … 722 861 /* The 5th contains the network address */ 723 862 if (num_protocols >= 3 && binding->host) { 724 if (is_ipaddress(binding->host)) { 725 status = dcerpc_floor_set_rhs_data(mem_ctx, &tower->floors[4], 863 if (is_ipaddress(binding->host) || 864 (binding->host[0] == '\\' && binding->host[1] == '\\')) { 865 status = dcerpc_floor_set_rhs_data(tower->floors, &tower->floors[4], 726 866 binding->host); 727 867 } else { … … 731 871 a wildcard all-zeros IP for the server to 732 872 fill in */ 733 status = dcerpc_floor_set_rhs_data( mem_ctx, &tower->floors[4],873 status = dcerpc_floor_set_rhs_data(tower->floors, &tower->floors[4], 734 874 "0.0.0.0"); 735 875 } -
trunk/server/librpc/rpc/dcerpc_error.c
r596 r745 22 22 #include "includes.h" 23 23 #include "librpc/rpc/dcerpc.h" 24 #include "rpc_common.h" 24 25 25 26 struct dcerpc_fault_table { … … 30 31 static const struct dcerpc_fault_table dcerpc_faults[] = 31 32 { 32 { "DCERPC_FAULT_OP_RNG_ERROR", DCERPC_FAULT_OP_RNG_ERROR }, 33 { "DCERPC_FAULT_UNK_IF", DCERPC_FAULT_UNK_IF }, 34 { "DCERPC_FAULT_NDR", DCERPC_FAULT_NDR }, 35 { "DCERPC_FAULT_INVALID_TAG", DCERPC_FAULT_INVALID_TAG }, 36 { "DCERPC_FAULT_CONTEXT_MISMATCH", DCERPC_FAULT_CONTEXT_MISMATCH }, 37 { "DCERPC_FAULT_OTHER", DCERPC_FAULT_OTHER }, 38 { "DCERPC_FAULT_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED }, 39 { "DCERPC_FAULT_SEC_PKG_ERROR", DCERPC_FAULT_SEC_PKG_ERROR }, 40 41 { NULL, 0} 33 #define _FAULT_STR(x) { #x , x } 34 _FAULT_STR(DCERPC_NCA_S_COMM_FAILURE), 35 _FAULT_STR(DCERPC_NCA_S_OP_RNG_ERROR), 36 _FAULT_STR(DCERPC_NCA_S_UNKNOWN_IF), 37 _FAULT_STR(DCERPC_NCA_S_WRONG_BOOT_TIME), 38 _FAULT_STR(DCERPC_NCA_S_YOU_CRASHED), 39 _FAULT_STR(DCERPC_NCA_S_PROTO_ERROR), 40 _FAULT_STR(DCERPC_NCA_S_OUT_ARGS_TOO_BIG), 41 _FAULT_STR(DCERPC_NCA_S_SERVER_TOO_BUSY), 42 _FAULT_STR(DCERPC_NCA_S_FAULT_STRING_TOO_LARGE), 43 _FAULT_STR(DCERPC_NCA_S_UNSUPPORTED_TYPE), 44 _FAULT_STR(DCERPC_NCA_S_FAULT_INT_DIV_BY_ZERO), 45 _FAULT_STR(DCERPC_NCA_S_FAULT_ADDR_ERROR), 46 _FAULT_STR(DCERPC_NCA_S_FAULT_FP_DIV_BY_ZERO), 47 _FAULT_STR(DCERPC_NCA_S_FAULT_FP_UNDERFLOW), 48 _FAULT_STR(DCERPC_NCA_S_FAULT_FP_OVERRFLOW), 49 _FAULT_STR(DCERPC_NCA_S_FAULT_INVALID_TAG), 50 _FAULT_STR(DCERPC_NCA_S_FAULT_INVALID_BOUND), 51 _FAULT_STR(DCERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH), 52 _FAULT_STR(DCERPC_NCA_S_FAULT_UNSPEC_REJECT), 53 _FAULT_STR(DCERPC_NCA_S_FAULT_BAD_ACTID), 54 _FAULT_STR(DCERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED), 55 _FAULT_STR(DCERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED), 56 _FAULT_STR(DCERPC_NCA_S_FAULT_CANCEL), 57 _FAULT_STR(DCERPC_NCA_S_FAULT_ILL_INST), 58 _FAULT_STR(DCERPC_NCA_S_FAULT_FP_ERROR), 59 _FAULT_STR(DCERPC_NCA_S_FAULT_INT_OVERFLOW), 60 _FAULT_STR(DCERPC_NCA_S_UNUSED_1C000011), 61 _FAULT_STR(DCERPC_NCA_S_FAULT_UNSPEC), 62 _FAULT_STR(DCERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE), 63 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_EMPTY), 64 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_CLOSED), 65 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_ORDER), 66 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_DISCIPLINE), 67 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_COMM_ERROR), 68 _FAULT_STR(DCERPC_NCA_S_FAULT_PIPE_MEMORY), 69 _FAULT_STR(DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH), 70 _FAULT_STR(DCERPC_NCA_S_FAULT_REMOTE_NO_MEMORY), 71 _FAULT_STR(DCERPC_NCA_S_INVALID_PRES_CONTEXT_ID), 72 _FAULT_STR(DCERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL), 73 _FAULT_STR(DCERPC_NCA_S_UNUSED_1C00001E), 74 _FAULT_STR(DCERPC_NCA_S_INVALID_CHECKSUM), 75 _FAULT_STR(DCERPC_NCA_S_INVALID_CRC), 76 _FAULT_STR(DCERPC_NCA_S_FAULT_USER_DEFINED), 77 _FAULT_STR(DCERPC_NCA_S_FAULT_TX_OPEN_FAILED), 78 _FAULT_STR(DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR), 79 _FAULT_STR(DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND), 80 _FAULT_STR(DCERPC_NCA_S_FAULT_NO_CLIENT_STUB), 81 { NULL, 0 } 82 #undef _FAULT_STR 42 83 }; 43 84 … … 45 86 { 46 87 int idx = 0; 88 WERROR werr = W_ERROR(fault_code); 47 89 48 90 while (dcerpc_faults[idx].errstr != NULL) { … … 53 95 } 54 96 55 return talloc_asprintf(mem_ctx, "DCERPC fault 0x%08x", fault_code);97 return win_errstr(werr); 56 98 } 99 100 _PUBLIC_ NTSTATUS dcerpc_fault_to_nt_status(uint32_t fault_code) 101 { 102 /* TODO: add more mappings */ 103 switch (fault_code) { 104 case DCERPC_FAULT_OP_RNG_ERROR: 105 return NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE; 106 case DCERPC_FAULT_UNK_IF: 107 return NT_STATUS_RPC_UNKNOWN_IF; 108 case DCERPC_FAULT_NDR: 109 return NT_STATUS_RPC_BAD_STUB_DATA; 110 case DCERPC_FAULT_INVALID_TAG: 111 return NT_STATUS_RPC_ENUM_VALUE_OUT_OF_RANGE; 112 case DCERPC_FAULT_CONTEXT_MISMATCH: 113 return NT_STATUS_RPC_SS_CONTEXT_MISMATCH; 114 case DCERPC_FAULT_OTHER: 115 return NT_STATUS_RPC_CALL_FAILED; 116 case DCERPC_FAULT_ACCESS_DENIED: 117 return NT_STATUS_ACCESS_DENIED; 118 case DCERPC_FAULT_SEC_PKG_ERROR: 119 return NT_STATUS_RPC_SEC_PKG_ERROR; 120 } 121 122 return NT_STATUS_RPC_PROTOCOL_ERROR; 123 } 124 -
trunk/server/librpc/tools/ndrdump.1.xml
r414 r745 1 1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE refentry PUBLIC "-// Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> 3 3 <refentry id="ndrdump.1"> 4 4 -
trunk/server/librpc/tools/ndrdump.c
r414 r745 128 128 } 129 129 130 static void printf_cb(const char *buf, void *private_data) 131 { 132 printf("%s", buf); 133 } 134 130 135 static void ndrdump_data(uint8_t *d, uint32_t l, bool force) 131 136 { 132 if (force) { 133 dump_data(0, d, l); 134 } else { 135 dump_data_skip_zeros(0, d, l); 136 } 137 dump_data_cb(d, l, !force, printf_cb, NULL); 138 } 139 140 static NTSTATUS ndrdump_pull_and_print_pipes(const char *function, 141 struct ndr_pull *ndr_pull, 142 struct ndr_print *ndr_print, 143 const struct ndr_interface_call_pipes *pipes) 144 { 145 NTSTATUS status; 146 enum ndr_err_code ndr_err; 147 uint32_t i; 148 149 for (i=0; i < pipes->num_pipes; i++) { 150 uint64_t idx = 0; 151 while (true) { 152 uint32_t *count; 153 void *c; 154 char *n; 155 156 c = talloc_zero_size(ndr_pull, pipes->pipes[i].chunk_struct_size); 157 talloc_set_name(c, "struct %s", pipes->pipes[i].name); 158 /* 159 * Note: the first struct member is always 160 * 'uint32_t count;' 161 */ 162 count = (uint32_t *)c; 163 164 n = talloc_asprintf(c, "%s: %s[%llu]", 165 function, pipes->pipes[i].name, 166 (unsigned long long)idx); 167 168 ndr_err = pipes->pipes[i].ndr_pull(ndr_pull, NDR_SCALARS, c); 169 status = ndr_map_error2ntstatus(ndr_err); 170 171 printf("pull returned %s\n", nt_errstr(status)); 172 if (!NT_STATUS_IS_OK(status)) { 173 return status; 174 } 175 pipes->pipes[i].ndr_print(ndr_print, n, c); 176 177 if (*count == 0) { 178 break; 179 } 180 idx++; 181 } 182 } 183 184 return NT_STATUS_OK; 137 185 } 138 186 … … 172 220 { NULL } 173 221 }; 174 175 if (DEBUGLEVEL < 1) { 176 DEBUGLEVEL = 1; 177 } 222 struct ndr_interface_call_pipes *in_pipes = NULL; 223 struct ndr_interface_call_pipes *out_pipes = NULL; 178 224 179 225 ndr_table_init(); … … 184 230 setlinebuf(stdout); 185 231 186 dbf = x_stderr; 187 188 setup_logging_stdout(); 232 setup_logging("ndrdump", DEBUG_STDOUT); 189 233 190 234 pc = poptGetContext("ndrdump", argc, argv, long_options, 0); … … 253 297 } 254 298 299 f = find_function(p, function); 300 255 301 if (strcmp(inout, "in") == 0 || 256 302 strcmp(inout, "request") == 0) { 257 303 flags = NDR_IN; 304 in_pipes = &f->in_pipes; 258 305 } else if (strcmp(inout, "out") == 0 || 259 306 strcmp(inout, "response") == 0) { 260 307 flags = NDR_OUT; 308 out_pipes = &f->out_pipes; 261 309 } else { 262 310 printf("Bad inout value '%s'\n", inout); 263 311 exit(1); 264 312 } 265 266 f = find_function(p, function);267 313 268 314 mem_ctx = talloc_init("ndrdump"); … … 295 341 blob.length = size; 296 342 297 ndr_pull = ndr_pull_init_blob(&blob, mem_ctx , lp_iconv_convenience(cmdline_lp_ctx));343 ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); 298 344 ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; 299 345 if (assume_ndr64) { … … 331 377 blob.length = size; 332 378 333 ndr_pull = ndr_pull_init_blob(&blob, mem_ctx , lp_iconv_convenience(cmdline_lp_ctx));379 ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); 334 380 ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; 335 381 if (assume_ndr64) { 336 382 ndr_pull->flags |= LIBNDR_FLAG_NDR64; 383 } 384 385 ndr_print = talloc_zero(mem_ctx, struct ndr_print); 386 ndr_print->print = ndr_print_printf_helper; 387 ndr_print->depth = 1; 388 389 if (out_pipes) { 390 status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, out_pipes); 391 if (!NT_STATUS_IS_OK(status)) { 392 printf("dump FAILED\n"); 393 exit(1); 394 } 337 395 } 338 396 … … 354 412 } 355 413 356 ndr_print = talloc_zero(mem_ctx, struct ndr_print);357 ndr_print->print = ndr_print_debug_helper;358 ndr_print->depth = 1;359 414 f->ndr_print(ndr_print, function, flags, st); 360 415 … … 362 417 printf("dump FAILED\n"); 363 418 exit(1); 419 } 420 421 if (in_pipes) { 422 status = ndrdump_pull_and_print_pipes(function, ndr_pull, ndr_print, in_pipes); 423 if (!NT_STATUS_IS_OK(status)) { 424 printf("dump FAILED\n"); 425 exit(1); 426 } 364 427 } 365 428 … … 373 436 bool differ; 374 437 375 ndr_v_push = ndr_push_init_ctx(mem_ctx , lp_iconv_convenience(cmdline_lp_ctx));438 ndr_v_push = ndr_push_init_ctx(mem_ctx); 376 439 377 440 ndr_err = f->ndr_push(ndr_v_push, flags, st); … … 390 453 } 391 454 392 ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx , lp_iconv_convenience(cmdline_lp_ctx));455 ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx); 393 456 ndr_v_pull->flags |= LIBNDR_FLAG_REF_ALLOC; 394 457
Note:
See TracChangeset
for help on using the changeset viewer.