pickling / unpickling self-relative (was: Re: Quick question on IDL)
Luke Kenneth Casson Leighton
lkcl at samba-tng.org
Tue Oct 16 06:03:20 GMT 2001
> See the chapter 7 of OSF RFC 2.1.
> http://www.opengroup.org/tech/rfc/mirror-rfc/rfc2.1.txt
seiichi, and anyone else that gets this stuff:
just took a look at it, compiled up the encoding example,
i notice that it sends the idl UUID at the beginning,
plus the idl version number etc.
here is an example that i wish to encode / decode.
note that it doesn't have an idl UUID at the front:
i can live with that, by faking up the UUID at the
front of the buffer, and doing anything else necessary.
the nasty bit about this example is the pointers.
note at offsets 0014 and 001c indicating self-relative
offsets to 0x20 and 0x29.
it looks like what microsoft has done is to change the
meaning of the pointer token field when pickling is used.
they have changed it to mean "relative to the start of
this buffer, the pointed-to-data can be found at the
offset specified by the pointer-token".
this is of course a complete pain, however is very
useful. the number of structures which require
this "self-relative" pickling is quite large. they are:
- NTLMSSP auth structures:
- client negotiation
- server challenge
- client challenge-response
- Security Descriptors ...
- contain ACLs ...
- which contain ACEs
- Spoolss API contains (info_level, void*, size_t) tuples
these are used to pickle / unpickle info level structures
for the ENTIRE set of data structures in Spoolss, of
which there are approximately 30 to 40.
e.g. SPOOLSS_PRINTER_INFO_0, 1, 2 etc.
- svcctl (service control manager) API.
in the same way, contains (info_level, void*, size_t)
tuples for the same reasons.
anybody, help! i know there's 50,000 lines of code to
look through, here, to find the right place to change
the usage of the pointers in the marshalling / unmarshalling
code.
heeeeeeeelp!
luke :)
000000 smb_io_rpc_auth_verifier auth_verifier
0000 signature: NTLMSSP
0008 msg_type : 00000001
00000c smb_io_rpc_auth_ntlmssp_neg ntlmssp_neg
000c neg_flgs : 0000b2b3
000010 smb_io_strhdr hdr_domain
0010 str_str_len: 0009
0012 str_max_len: 0009
0014 buffer : 00000029
000018 smb_io_strhdr hdr_myname
0018 str_str_len: 0009
001a str_max_len: 0009
001c buffer : 00000020
0020 myname: HIGHFIELD
0029 domain: WORKGROUP
[000] 4E 54 4C 4D 53 53 50 00 01 00 00 00 B3 B2 00 00 NTLMSSP ........
[010] 09 00 09 00 29 00 00 00 09 00 09 00 20 00 00 00 .....).. .... ...
[020] 48 49 47 48 46 49 45 4C 44 57 4F 52 4B 47 52 4F HIGHFIEL DWORKGRO
[030] 55 50 UP
More information about the samba-technical
mailing list