/* Header field declarations */
static gint hf_iremotewinspool_hresult = -1;
static gint hf_iremotewinspool_opnum = -1;
+static gint hf_iremotewinspool_sec_desc_buf_len = -1;
static gint hf_iremotewinspool_werror = -1;
static gint hf_iremotewinspool_winspool_AsyncAbortPrinter_hPrinter = -1;
static gint hf_iremotewinspool_winspool_AsyncAddForm_hPrinter = -1;
static int iremotewinspool_dissect_element_winspool_AsyncLogJobInfoForBranchOffice_hPrinter(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int iremotewinspool_dissect_element_winspool_AsyncLogJobInfoForBranchOffice_pBranchOfficeJobDataContainer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
static int iremotewinspool_dissect_element_winspool_AsyncLogJobInfoForBranchOffice_pBranchOfficeJobDataContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_);
+ #include "packet-smb.h"
+ #include "packet-smb-browse.h"
+extern struct access_mask_info spoolss_printer_access_mask_info;
+static int
+iremotewinspool_dissect_sec_desc_buf(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info* di, guint8 *drep)
+{
+ guint32 len;
+ if(di->conformant_run){
+ /*just a run to handle conformant arrays, nothing to dissect */
+ return offset;
+ }
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
+ hf_iremotewinspool_sec_desc_buf_len, &len);
+ dissect_nt_sec_desc(
+ tvb, offset, pinfo, tree, drep, TRUE, len,
+ &spoolss_printer_access_mask_info);
+ offset += len;
+ return offset;
+}
/* IDL: struct { */
static int
iremotewinspool_dissect_element_winspool_NOTIFY_REPLY_CONTAINER_pInfo_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_NOTIFY_INFO(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_NOTIFY_OPTIONS_CONTAINER_pOptions_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_NOTIFY_OPTIONS_ARRAY_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_PrintPropertyValueUnion_propertyDevModeContainer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_PrintPropertyValueUnion_propertySDContainer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = iremotewinspool_dissect_sec_desc_buf(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncOpenPrinter_pDevModeContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncOpenPrinter_pClientInfo_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncAddPrinter_pPrinterContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_SPOOL_PRINTER_INFO(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncAddPrinter_pDevModeContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncAddPrinter_pSecurityContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = iremotewinspool_dissect_sec_desc_buf(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncAddPrinter_pClientInfo_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncSetPrinter_pPrinterContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_SPOOL_PRINTER_INFO(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncSetPrinter_pDevModeContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncSetPrinter_pSecurityContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = iremotewinspool_dissect_sec_desc_buf(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncStartDocPrinter_pDocInfoContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_spoolss_doc_info_ctr(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncAddForm_pFormInfoContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncSetForm_pFormInfoContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncCreatePrinterIC_pDevModeContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
static int
iremotewinspool_dissect_element_winspool_AsyncResetPrinter_pDevModeContainer_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, dcerpc_info* di _U_, guint8 *drep _U_)
{
- offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);
+ offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);
return offset;
}
{ "HRES Windows Error", "iremotewinspool.hresult", FT_UINT32, BASE_HEX, VALS(HRES_errors), 0, NULL, HFILL }},
{ &hf_iremotewinspool_opnum,
{ "Operation", "iremotewinspool.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+ { &hf_iremotewinspool_sec_desc_buf_len,
+ { "Sec Desc Buf Len", "iremotewinspool.sec_desc_buf_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
{ &hf_iremotewinspool_werror,
{ "Windows Error", "iremotewinspool.werror", FT_UINT32, BASE_HEX, VALS(WERR_errors), 0, NULL, HFILL }},
{ &hf_iremotewinspool_winspool_AsyncAbortPrinter_hPrinter,
# Conformance file for winspool
-# these are all TODO!
+#iremotewinspool_dissect_struct_sec_desc_buf
+HF_FIELD hf_iremotewinspool_sec_desc_buf_len "Sec Desc Buf Len" "iremotewinspool.sec_desc_buf_len" FT_UINT32 BASE_DEC NULL 0 "" "" ""
#TYPE winreg_AccessMask "offset = winreg_dissect_bitmap_AccessMask(tvb, offset, pinfo, tree, di, drep, @HF@, @PARAM@);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE sec_desc_buf "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_UserLevelCtr "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_NotifyInfo "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_NotifyOption "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_DevmodeContainer "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_SetPrinterInfoCtr "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_DocumentInfoCtr "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
-TYPE spoolss_AddFormInfoCtr "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE sec_desc_buf "offset = iremotewinspool_dissect_sec_desc_buf(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_UserLevelCtr "offset = dissect_USER_LEVEL_CTR(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_NotifyInfo "offset = dissect_NOTIFY_INFO(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_NotifyOption "offset = dissect_NOTIFY_OPTIONS_ARRAY_CTR(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_DevmodeContainer "offset = dissect_DEVMODE_CTR(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_SetPrinterInfoCtr "offset = dissect_SPOOL_PRINTER_INFO(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_DocumentInfoCtr "offset = dissect_spoolss_doc_info_ctr(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+TYPE spoolss_AddFormInfoCtr "offset = dissect_FORM_CTR(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+
+# these are all TODO!
TYPE spoolss_TimeCtr "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
TYPE spoolss_JobInfoContainer "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
TYPE RPC_BIDI_REQUEST_CONTAINER "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
TYPE spoolss_PrintPropertyValue "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
TYPE spoolss_PrintNamedProperty "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
TYPE spoolss_BranchOfficeJobDataContainer "offset = dissect_ndr_byte_array(tvb, offset, pinfo, tree, di, drep);" FT_NONE BASE_NONE 0 NULL NULL
+
+CODE START
+ #include "packet-smb.h"
+ #include "packet-smb-browse.h"
+
+extern struct access_mask_info spoolss_printer_access_mask_info;
+
+static int
+iremotewinspool_dissect_sec_desc_buf(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info* di, guint8 *drep)
+{
+ guint32 len;
+
+ if(di->conformant_run){
+ /*just a run to handle conformant arrays, nothing to dissect */
+ return offset;
+ }
+
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
+ hf_iremotewinspool_sec_desc_buf_len, &len);
+
+ dissect_nt_sec_desc(
+ tvb, offset, pinfo, tree, drep, TRUE, len,
+ &spoolss_printer_access_mask_info);
+
+ offset += len;
+
+ return offset;
+}
+
+CODE END