Beispiel #1
0
/******************************************************************
 do IO on a byte array
 ********************************************************************/
BOOL io_uint8s(char *name, io_struct *ps, int depth, uint8 **data8s, int len, unsigned flags)
{
	char *q;
	size_t num_bytes = len * sizeof(uint8);

	if (MARSHALLING(ps) && num_bytes == 0)
	{
		*data8s = NULL;
		return True;
	}

	if (!(flags & PARSE_SCALARS)) return True;

	q = io_mem_get(ps, num_bytes);
	if (q == NULL) return False;

	if (MARSHALLING(ps))
	{
		if (*data8s != NULL)
			DBG_RW_PCVAL(True, name, depth, ps->data_offset, ps->io, q, *data8s, len)
		else
			memset(q, 0, num_bytes);
	}
	else
	{
/*******************************************************************
reads or writes a structure.
********************************************************************/
char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth)
{
	if (r_u == NULL) return NULL;

	DEBUG(5,("%s%04x samr_io_r_unknown_24\n", tab_depth(depth), PTR_DIFF(q, base)));
	depth++;

	q = align_offset(q, base, align);

	DBG_RW_IVAL("ptr         ", depth, base, io, q, r_u->ptr         ); q += 4;
	DBG_RW_SVAL("unknown_0   ", depth, base, io, q, r_u->unknown_0   ); q += 2;
	DBG_RW_SVAL("unknown_1   ", depth, base, io, q, r_u->unknown_1   ); q += 2;
	DBG_RW_PCVAL(False, "padding_0   ", depth, base, io, q, r_u->padding_0   , sizeof(r_u->padding_0)); q += sizeof(r_u->padding_0);

	q = smb_io_time(io, &(r_u->expiry), q, base, align, depth); 
	DBG_RW_PCVAL(False, "padding_1   ", depth, base, io, q, r_u->padding_1   , sizeof(r_u->padding_1)); q += sizeof(r_u->padding_1);

	q = smb_io_unihdr (io, &(r_u->hdr_mach_acct), q, base, align, depth); 
	DBG_RW_IVAL("padding_2   ", depth, base, io, q, r_u->padding_2   ); q += 4;

	DBG_RW_IVAL("ptr_1       ", depth, base, io, q, r_u->ptr_1       ); q += 4;
	DBG_RW_PCVAL(False, "padding_3   ", depth, base, io, q, r_u->padding_3   , sizeof(r_u->padding_3)); q += sizeof(r_u->padding_3);
	DBG_RW_IVAL("padding_4   ", depth, base, io, q, r_u->padding_4   ); q += 4;

	DBG_RW_IVAL("ptr_2       ", depth, base, io, q, r_u->ptr_2       ); q += 4;
	DBG_RW_IVAL("padding_5   ", depth, base, io, q, r_u->padding_5   ); q += 4;

	DBG_RW_IVAL("ptr_3       ", depth, base, io, q, r_u->ptr_3       ); q += 4;
	DBG_RW_PCVAL(False, "padding_6   ", depth, base, io, q, r_u->padding_6   , sizeof(r_u->padding_6)); q += sizeof(r_u->padding_6);

	DBG_RW_IVAL("unknown_id_0", depth, base, io, q, r_u->unknown_id_0); q += 4;
	DBG_RW_SVAL("unknown_2   ", depth, base, io, q, r_u->unknown_2   ); q += 2;
	DBG_RW_IVAL("unknown_3   ", depth, base, io, q, r_u->unknown_3   ); q += 4;
	DBG_RW_SVAL("unknown_4   ", depth, base, io, q, r_u->unknown_4   ); q += 2;
	DBG_RW_SVAL("unknown_5   ", depth, base, io, q, r_u->unknown_5   ); q += 2;

	DBG_RW_PCVAL(False, "padding_7   ", depth, base, io, q, r_u->padding_7   , sizeof(r_u->padding_7)); q += sizeof(r_u->padding_7);
	DBG_RW_IVAL("padding_8   ", depth, base, io, q, r_u->padding_8   ); q += 4;
	
	q = smb_io_unistr2(io, &(r_u->uni_mach_acct), q, base, align, depth); 
	q = align_offset(q, base, align);

	DBG_RW_PCVAL(False, "padding_9   ", depth, base, io, q, r_u->padding_9   , sizeof(r_u->padding_9)); q += sizeof(r_u->padding_9);

	DBG_RW_IVAL("status", depth, base, io, q, r_u->status); q += 4;

	return q;
}