[cifs-protocol] [REG: 110021555999716 ]Spoolss questions

Obaid Farooqi obaidf at microsoft.com
Tue Mar 2 16:30:03 MST 2010


Hi Matthieu:
We have finished our investigation on your question 2 and 3. The research on your question about GetPrinterDriver is still in progress and I'll update you as soon as I have an answer. Please find below the answers to question 2 & 3. I have arranged them in Question/Answer format for clarity.

Question 2:
2) I have the impression that the definition of the JTEXP structure defined page 372 is not complete.
Because here is a dump of the whole extra data field:
00000000  44 49 4e 55 22 00 b0 00  ec 02 00 00 ba 91 73 ca  |DINU".........s.|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 05 00 00 00  |................|
00000030  02 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000230  01 00 00 00 00 00 00 00  00 00 00 00 b0 00 00 00  |................|
00000240  53 4d 54 4a 00 00 00 00  10 00 a0 00 47 00 65 00  |SMTJ........G.e.|
00000250  6e 00 65 00 72 00 69 00  63 00 20 00 2f 00 20 00  |n.e.r.i.c. ./. .|
00000260  54 00 65 00 78 00 74 00  20 00 4f 00 6e 00 6c 00  |T.e.x.t. .O.n.l.|
00000270  79 00 00 00 49 6e 70 75  74 42 69 6e 00 4f 70 74  |y...InputBin.Opt|
00000280  69 6f 6e 31 00 52 45 53  44 4c 4c 00 55 6e 69 72  |ion1.RESDLL.Unir|
00000290  65 73 44 4c 4c 00 52 65  73 6f 6c 75 74 69 6f 6e  |esDLL.Resolution|
000002a0  00 4f 70 74 69 6f 6e 31  00 50 61 70 65 72 53 69  |.Option1.PaperSi|
000002b0  7a 65 00 4c 45 54 54 45  52 00 4f 72 69 65 6e 74  |ze.LETTER.Orient|
000002c0  61 74 69 6f 6e 00 50 4f  52 54 52 41 49 54 00 00  |ation.PORTRAIT..|
000002d0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002e0 00 00 00 00 00 00 00 00  00 00 00 00              |............|
000002ec

As the feature options pair is a null terminated array of null terminated string it seems to me that the end of the array is at 2cF and it leaves 28 bytes not used.
Am I wrong ?

Answer:
In a future release of MS-RPRN, section "<88> Section 2.2.2.1.4" will include modifications to the definitions of dwSize and wCoreMFOSize as follows:

Current Verbiage
---------------------
dwSize: Must be the total size of Extra Data.

wCoreMFOSize: Must be the combined size of ModelName and FeatureOptionPairs.

Future Verbiage
--------------------
dwSize: Must be the total size of the JTEXP structure. This size must be large enough to accommodate any possible combination of options for the vendor-specified features stored in FeatureOptionPairs.

wCoreMFOSize: Must be the combined size of ModelName and FeatureOptionPairs. This must be exactly 16 bytes less than dwSize.

Question 3:
3) Page 372 it is stated that:
"dwOptions: The value of this field must be the number of entries in the aOptions array that are initialized.
aOptions: This field is an array that is 512 bytes in length and contains user interface selections.
Unused fields should be initialized to zero. The meaning of the entries differs for each supported printer model. Upon receipt, the checksum of this array is computed and compared to dwChecksum32. The array is used only if the checksums match.
"

A ndrdump of this part gives:
                     usedoptions              : 0x00000005 (5)
                     options: ARRAY(128)
                         options                  : 0x00000002 (2)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)

where usedoptions is dwOptions and options is aOptions.

The questions are: what is the meaning of an initialized entry in the aOptions array, because according to the dump we should have 5 initialized entries and we have only 1 with a non null value, and what is the signification of the value of the entry, is there a special meaning for each entry (ie. entry #1 is for the paper size, entry #2 is for the duplex capability) Also which checksum function is used how to compute it ? on which data ?

Answer:
In a future release of MS-RPRN, section "<86> Section 2.2.2.1.1" and section " <87> Section 2.2.2.1.2 " will include modifications to the definitions of dwChecksum32, dwOptions and aOptions as follows:

Current verbiage
---------------------
dwChecksum32: The value of this field must be the checksum of the aOptions array.

dwOptions: The value of this field must be the number of entries in the aOptions array that are initialized.

aOptions: This field is an array that is 512 bytes in length and contains user interface selections. Unused fields should be initialized to zero. The meaning of the entries differs for each supported printer model. Upon receipt, the checksum of this array is computed and compared to dwChecksum32. The array is used only if the checksums match.


Future verbiage
----------------------
dwChecksum32: The value of this field is the checksum of the names of the vendor-defined features and feature options that are supported by the printer model, as provided by the printer driver. The checksum is calculated using the 32-bit cyclic redundancy check (CRC) function defined in section 3.2.9 of [IEEE802-3]. For each feature, the checksum is calculated on the null-terminated ASCII string representations of the feature name and each of the feature options in order. The checksum is accumulated in this manner over all of the features supported by the printer model.

dwOptions: The value of this field is the number of entries in the aOptions array.

aOptions: This field is an array that is 512 bytes in length and contains the options selected by the user for each vendor-defined feature. Unused fields should be initialized to zero. The meaning of the entries differs for each supported printer model.

Please let me know if it answers your questions. If yes, I'll consider this issue resolved.

Regards,
Obaid Farooqi
Sr. Support Escalation Engineer | Microsoft




-----Original Message-----
From: Matthieu Patou [mailto:mat+Informatique.Samba at matws.net] 
Sent: Sunday, February 14, 2010 3:26 PM
To: Interoperability Documentation Help; pfif at tridgell.net; cifs-protocol at samba.org
Subject: Spoolss questions

Hello Dochelp Team,

I've got a few questions regarding the MS-RPRN documentation, here they are:

1) Page 372 it is stated that :
"FeatureOptionPairs (variable): Must be a concatenation of an even number of zero-terminated ASCII strings, terminated by an additional zero character. Each pair of two consecutive strings specifies a print schema feature and the currently selected option."

Which options should be included in this field ?
What is the signification of the options, for instance the dump of the Generic / Text only driver give the following array:
                             options: ARRAY(10)
                                 [0]                      : 'InputBin'
                                 [1]                      : 'Option1'
                                 [2]                      : 'RESDLL'
                                 [3]                      : 'UniresDLL'
                                 [4]                      : 'Resolution'
                                 [5]                      : 'Option1'
                                 [6]                      : 'PaperSize'
                                 [7]                      : 'LETTER'
                                 [8]                      : 'Orientation'
                                 [9]                      : 'PORTRAIT'

For PaperSize and Orientation it's quite obvious but for InputBin RESDLL or Resolution it's already not

2) I have the impression that the definition of the JTEXP structure defined page 372 is not complete.
Because here is a dump of the whole extra data field:
00000000  44 49 4e 55 22 00 b0 00  ec 02 00 00 ba 91 73 ca  
|DINU".........s.|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
|................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 05 00 00 00  
|................|
00000030  02 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
|................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
|................|
*
00000230  01 00 00 00 00 00 00 00  00 00 00 00 b0 00 00 00  
|................|
00000240  53 4d 54 4a 00 00 00 00  10 00 a0 00 47 00 65 00  
|SMTJ........G.e.|
00000250  6e 00 65 00 72 00 69 00  63 00 20 00 2f 00 20 00  |n.e.r.i.c. 
./. .|
00000260  54 00 65 00 78 00 74 00  20 00 4f 00 6e 00 6c 00  |T.e.x.t. 
.O.n.l.|
00000270  79 00 00 00 49 6e 70 75  74 42 69 6e 00 4f 70 74  
|y...InputBin.Opt|
00000280  69 6f 6e 31 00 52 45 53  44 4c 4c 00 55 6e 69 72  
|ion1.RESDLL.Unir|
00000290  65 73 44 4c 4c 00 52 65  73 6f 6c 75 74 69 6f 6e  
|esDLL.Resolution|
000002a0  00 4f 70 74 69 6f 6e 31  00 50 61 70 65 72 53 69  
|.Option1.PaperSi|
000002b0  7a 65 00 4c 45 54 54 45  52 00 4f 72 69 65 6e 74  
|ze.LETTER.Orient|
000002c0  61 74 69 6f 6e 00 50 4f  52 54 52 41 49 54 00 00  
|ation.PORTRAIT..|
000002d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
|................|
000002e0  00 00 00 00 00 00 00 00  00 00 00 00              |............|
000002ec

As the feature options pair is a null terminated array of null terminated string it seems to me that the end of the array is at 2cF and it leaves 28 bytes not used.
Am I wrong ?

3) Page 372 it is stated that:
"dwOptions: The value of this field must be the number of entries in the aOptions array that are initialized.
aOptions: This field is an array that is 512 bytes in length and contains user interface selections.
Unused fields should be initialized to zero. The meaning of the entries differs for each supported printer model. Upon receipt, the checksum of this array is computed and compared to dwChecksum32. The array is used only if the checksums match.
"

A ndrdump of this part gives:
                     usedoptions              : 0x00000005 (5)
                     options: ARRAY(128)
                         options                  : 0x00000002 (2)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)
                         options                  : 0x00000000 (0)

where usedoptions is dwOptions and options is aOptions.

The questions are: what is the meaning of an initialized entry in the aOptions array, because according to the dump we should have 5 initialized entries and we have only 1 with a non null value, and what is the signification of the value of the entry, is there a special meaning for each entry (ie. entry #1 is for the paper size, entry #2 is for the duplex capability) Also which checksum function is used how to compute it ? on which data ?

4) About level 101 of getprinterdriver
We have currently a problem when replying correctly to level 101 request in getprinterdriver as the client is not downloading the drivers from the server, I made a test with a windows XP acting as a print server and in this case the client (also XP) is downloading the driver (see capture
http://www.matws.net/mat/misc/xpserver_genericprinter) after the getprinterdriver response.
In capture http://www.matws.net/mat/misc/s3server_genericprinter we can see that around packet 619, instead of requesting the drivers from the server (as it was the case for xp) the client is requesting forms.
Do you have an explanation for this ? what is needed as an answer from the server to trigger the driver download ?


Regards.
Matthieu.




More information about the cifs-protocol mailing list