Commit graph

77 commits

Author SHA1 Message Date
Tim Potter
1c898c8a11 Fixed memory leak in dissect_unistr2().
Fixed double free bug in GetPrinterData occuring when applying a filter.

Cleaned up same bit of code in OpenPrinterEx.

svn path=/trunk/; revision=7051
2003-01-30 23:41:28 +00:00
Guy Harris
5dc66497b7 Generalize "cb_str_postprocess()" to allow the string to be appended to
items N levels up from the item being processed, and use that to
decorate the tree as it was decorated before.

svn path=/trunk/; revision=7043
2003-01-30 08:19:39 +00:00
Tim Potter
448023934d Clean up the handling of null buffers in getprinter, getform,
getjob and getprinterdriver2.

svn path=/trunk/; revision=7037
2003-01-30 05:11:33 +00:00
Tim Potter
b846a41c05 Cleanup of filterable fields for printer data and devicemodes.
Added a stack of value_strings for devicemode fields that didn't
have them already.

svn path=/trunk/; revision=7027
2003-01-28 22:51:54 +00:00
Tim Potter
8af5b67b4e Convert dissector to callback based version of dissect_ndr_pointer().
This fixes a bunch of neat stuff that was broken after the conversion
to the dissect_ndr_* functions like printer handle tracking by name
and many COL_INFO things.

svn path=/trunk/; revision=7018
2003-01-28 06:42:20 +00:00
Tim Potter
23a6b3819c Change name of proto item for UINT16UNI.
Use dissect_ndr_uint32 instead of dissect_doserror() to peek at the
RPC error in SpoolssOpenPrinterEx_r.

svn path=/trunk/; revision=6935
2003-01-16 22:44:05 +00:00
Tim Potter
5039537845 Finish converting remaining RPCs to ndr routines.
Deleted all the old crufy ndr pointer dissection. Hooray!

Next on the hit list is some refactoring of the ndr string
routines...

svn path=/trunk/; revision=6899
2003-01-11 04:40:21 +00:00
Tim Potter
855f004140 Converted some more RPCs to ndr routines.
svn path=/trunk/; revision=6897
2003-01-11 00:42:12 +00:00
Tim Potter
08d2e5e8b7 Converted enumprinters and enumprinterkey rpc to ndr routines.
svn path=/trunk/; revision=6892
2003-01-10 05:41:29 +00:00
Tim Potter
6abd907e29 Convert enumprinterdataex rpc to ndr format calls.
svn path=/trunk/; revision=6891
2003-01-10 05:01:48 +00:00
Tim Potter
2e5169d5aa More conversions to NDR routines. This commit does most of the printerdata
routines except for the enumprinterdata values.  Note the display of
strings inside the protocol tree is broken due to lack of a unicode
string frametype.

svn path=/trunk/; revision=6784
2002-12-13 06:07:04 +00:00
Tim Potter
e7eeefc8ff Guy has pointed out that this dissection looks wrong. In the ethereal
output for a USER_LEVEL_1 it looks like the info level and container
pointer are transposed.  I'm not even sure this structure is a
container

svn path=/trunk/; revision=6783
2002-12-13 04:58:56 +00:00
Guy Harris
cf54ab47b7 When dissecting a buffer, use the tvbuff for the buffer, as the offset
we're using is relative to the beginning of that tvbuff, not relative to
the beginning of the containing tvbuff; that also lets us use -1 when in
"proto_tree_add_text()" calls when we mean "to the end of the buffer.

Fix the comment for one field.

svn path=/trunk/; revision=6781
2002-12-12 08:05:31 +00:00
Tim Potter
31754bcb7c Decode getprinter level 7.
svn path=/trunk/; revision=6742
2002-12-04 05:41:47 +00:00
Guy Harris
0e050b1107 Get rid of the "pdata" argument to "dissect_dcerpc_uint16s()" and
"dissect_ndr_uint16s()"; "dissect_ndr_uint16s()" is always passed a null
pointer, "dissect_dcerpc_uint16s()" is only called by
"dissect_ndr_uint16s()", and the pointer returned through "pdata" is
*NOT* guaranteed to be aligned on a 16-bit boundary so we don't want to
tempt people to blithely dereference that pointer.

svn path=/trunk/; revision=6699
2002-11-28 21:03:36 +00:00
Guy Harris
f1d905c917 Make the pointer passed by reference as the last argument of
"dissect_ndr_uint8s()" a const pointer, as that's what
"dissect_ndr_uint8s()" expects.

svn path=/trunk/; revision=6690
2002-11-28 04:56:43 +00:00
Guy Harris
94b5a36fe1 Make "dissect_spoolss_uint16uni()" take an extra argument giving the
name of the field being dissected, and, if it's not null, use it instead
of "UINT16UNI".  Pass the appropriate argument in some calls.

In "SpoolssOpenPrinterEx_q()", put in some #if 0'ed out code to note
what should be done with the printer name when we can get it.

svn path=/trunk/; revision=6670
2002-11-23 08:57:15 +00:00
Tim Potter
2ca021395a Some more spoolss ndr conversions. OpenPrinterEx now decodes it's
arguments correctly.  There's a string datatype, a devicemode
container with a possibly null devicemode, and a "user level"
structure, whatever that is.

svn path=/trunk/; revision=6659
2002-11-19 05:25:04 +00:00
Tim Potter
bf87f85692 Fix dissection of printer info levels 0-3 which has been broken for a
while.  Also convert to dissect_ndr_* functions instead of old-style
prs_* functions.

Converted devicemode dissection to ndr functions as well.  There are
still a bunch of value_strings that can be written to decode some of
the constants here.

svn path=/trunk/; revision=6658
2002-11-19 03:01:18 +00:00
Tim Potter
4518450b28 Convert getprinter info 0, 1, 2, 3 to dissect_ndr routines. Hooray!
The old prs_DEVMODE function is still used by something else for the
moment.

svn path=/trunk/; revision=6607
2002-11-11 05:39:51 +00:00
Guy Harris
acf6949830 Eliminate a compiler warning, and handle overflows.
svn path=/trunk/; revision=6589
2002-11-08 19:58:09 +00:00
Richard Sharpe
aac18f73d4 More patches from Jim McDonough
svn path=/trunk/; revision=6587
2002-11-08 19:29:39 +00:00
Richard Sharpe
d15a388ded Another patch from Jim McDonough.
svn path=/trunk/; revision=6586
2002-11-08 19:25:42 +00:00
Richard Sharpe
65c1756287 Some more SPOOLSS stuff from Jim McDonough.
svn path=/trunk/; revision=6578
2002-11-07 17:45:30 +00:00
Guy Harris
3f4397bbb0 From Ulf Lamping: change some #define names to avoid name collisions on
Windows that cause compiler warnings.

svn path=/trunk/; revision=6129
2002-08-29 19:05:41 +00:00
Jörg Mayer
7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Tim Potter
532f7b3d1e Dissect flags field for enumprinters rpc.
The string in this rpc is not a devmode, but rather an object name.

svn path=/trunk/; revision=6092
2002-08-27 07:38:36 +00:00
Guy Harris
99e286d8a3 Fix the type of "spoolss_specific_rights()" to match the curent
definition of "nt_access_mask_fn_t".

svn path=/trunk/; revision=6059
2002-08-22 07:05:31 +00:00
Tim Potter
50b37822a0 Some cleanups and fixes from Guy:
- combine proto_tree_add_text() and proto_tree_append_text() calls in the
   access mask dissector

 - make the specific access bits dissector functions return void instead of
   an offset

I think Samba has the create user reply wrong.  There is perhaps a uint32
marked as unknown that shouldn't be there.  Removing this parses all the
captures I have.

svn path=/trunk/; revision=6057
2002-08-22 01:13:13 +00:00
Tim Potter
bc792aa9a4 Call dissect_nt_access_mask() instead of dissect_ndr_uint32()
svn path=/trunk/; revision=6054
2002-08-21 21:31:15 +00:00
Tim Potter
7ad8ddcc46 Reordered some boolean fields to be consistent with the rest of ethereal.
svn path=/trunk/; revision=5850
2002-07-10 02:59:38 +00:00
Tim Potter
98933ccb32 Converted form related dissectors from prs_* routines to dissect_ndr_*
routines.

svn path=/trunk/; revision=5846
2002-07-09 14:24:39 +00:00
Tim Potter
d24a5fd6c9 Cleaned up NT policy handle hashing a bit. Split the store function
into two - one that stores request/reply frame numbers and another
that associates a text name with a policy handle.

Removed all calls to prs_policy_hnd() and converted to calls to
dissect_nt_policy_hnd().

svn path=/trunk/; revision=5772
2002-06-28 01:23:26 +00:00
Tim Potter
3ba95d7b16 Added some more dissection of rffpcnex flags.
svn path=/trunk/; revision=5768
2002-06-27 03:02:50 +00:00
Tim Potter
5b56b34783 Fixed typo in text name and added dissector for RouterReplyPrinter rpc.
Fixed incorrect format strings in numerous calls to val_to_str() as you can't use %s

Added %d format to end of numerous calls to val_to_str()

svn path=/trunk/; revision=5763
2002-06-25 03:01:05 +00:00
Tim Potter
71bfd45e2d Added value_string array for setprinter level 0 command.
svn path=/trunk/; revision=5754
2002-06-24 04:36:56 +00:00
Tim Potter
6d6dce305d Change each DCERPC dissector to pass in a hf value on initialisation
for a value_string that corresponds to that dissectors opnums.  Pass
in -1 if no such table is available.

svn path=/trunk/; revision=5749
2002-06-24 00:03:18 +00:00
Tim Potter
51fb1868ca Warning cleanup.
svn path=/trunk/; revision=5721
2002-06-21 05:13:15 +00:00
Tim Potter
32674167bc Added true_false_string for job status codes.
Fixed bug in printer notify subtree item display.

The flags field in rfnpcnex is a change id not a flags value.

svn path=/trunk/; revision=5691
2002-06-17 06:45:42 +00:00
Tim Potter
4c9a866c6d Added value_string for printer status values.
Added true_false_string for printer attributes.

Display notify type and notify field name in subtree item when
dissecting notify options or notify data.

svn path=/trunk/; revision=5690
2002-06-17 03:21:15 +00:00
Tim Potter
c15486768a Fixed another bug in RRPCN.
Some more updates for printer notification data types as I figure out
how it all hangs together.

svn path=/trunk/; revision=5641
2002-06-07 06:10:53 +00:00
Tim Potter
7c8ae51531 A printer port name is a notification string, not a two word value.
A RFNPCNEX request contains a NOTIFY_OPTIONS_ARRAY_CTR instead of a
NOTIFY_OPTIONS_ARRAY.

svn path=/trunk/; revision=5639
2002-06-07 03:42:02 +00:00
Tim Potter
7db4c88dcd Dissect spoolss FCPN. Not sure what it stands for.
svn path=/trunk/; revision=5632
2002-06-06 05:46:55 +00:00
Tim Potter
fb78dde09e Implemented ReplyClosePrinter().
Fixed calls to dissect_nt_policy_hnd() as ReplyOpenPrinter() opens a
handle and ReplyClosePrinter() closes one.

svn path=/trunk/; revision=5631
2002-06-06 03:18:14 +00:00
Tim Potter
230ac0da7a Implemented RRPCN (RemotePrinterChangeNotification).
Use the di->levels field to pass info to notify options rather than
mucking about with the private_data fields which mysteriously doesn't
work.

Fixed some display bugs in notify data.

svn path=/trunk/; revision=5625
2002-06-05 07:15:47 +00:00
Tim Potter
4616797423 Converted all reply functions to use dissect_doserror() instead of
prs_werror().

Converted RFFPCNEX (FindFirstPrintChangeNotification) to Ronnie's NDR
routines.

Implemented RFNPCNEX (FindNextPrintChangeNotification).  Print
notification data is dissected in a length/buffer format instead of
dissecting as the underlying type (string secdesc, devmode etc).

svn path=/trunk/; revision=5623
2002-06-05 04:15:30 +00:00
Tim Potter
8b8f0130a3 Implemented getprinterdriver2, levels 1 and 3.
svn path=/trunk/; revision=5513
2002-05-20 06:53:31 +00:00
Tim Potter
6519b11bcb Some miscellaneous updates:
- implemented WritePrinter, DeletePrinterData

 - fixed dissection of various printerdata routines to use a more
   consistent field naming scheme and convert to ndr functions

svn path=/trunk/; revision=5509
2002-05-20 00:36:04 +00:00
Tim Potter
70a045e948 Added subdissectors for StartDocPrinter and EndDocPrinter RPCs.
svn path=/trunk/; revision=5454
2002-05-13 01:27:07 +00:00
Guy Harris
6a79ad7e91 In "dissect_nt_policy_hnd()":
add arguments to specify whether the policy handle is being
	opened or closed, and don't set the "open frame" for the handle
	unless it's being opened and don't set the "close frame" for the
	handle unless it's being closed;

	store the policy handle before fetching it, so that an open or
	close is marked appropriately in the protocol tree on the first
	pass;

	if the policy handle has a name associated with it, put that
	name into the top-level item for the policy handle.

In "packet-dcerpc-spoolss.c":

	get rid of aun unused variable;

	make "setjob_commands[]" static, as it's not used outside
	"packet-dcerpc-spoolss.c";

	put a "VALS()" call around the reference to "setjob_commands",
	to squelch compiler warnings;

	give the SPOOLSS return code field the appropriate
	"value_string" array.

svn path=/trunk/; revision=5448
2002-05-11 22:29:43 +00:00