Skip to content
Snippets Groups Projects
Commit 70211388 authored by rswindell's avatar rswindell
Browse files

Created smb_incmsg(), opposite function of smb_freemsg().

parent c2d40022
No related branches found
No related tags found
No related merge requests found
......@@ -1497,6 +1497,28 @@ int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers)
return(0);
}
/****************************************************************************/
/* Increments data allocation records (message references) by number of */
/* headers specified (usually 1) */
/* The opposite function of smb_freemsg() */
/****************************************************************************/
int SMBCALL smb_incmsg(smb_t* smb, smbmsg_t* msg)
{
int i;
ushort x;
if(smb->status.attr&SMB_HYPERALLOC) /* Nothing to do */
return(0);
for(x=0;x<msg->hdr.total_dfields;x++) {
if((i=smb_incdat(smb,msg->hdr.offset+msg->dfield[x].offset
,msg->dfield[x].length,1))!=0)
return(i);
}
return(0);
}
/****************************************************************************/
/* De-allocates blocks for header record */
/* Returns non-zero on error */
......
......@@ -127,6 +127,7 @@ SMBEXPORT long SMBCALL smb_hallochdr(smb_t* smb);
SMBEXPORT long SMBCALL smb_allocdat(smb_t* smb, ulong length, ushort headers);
SMBEXPORT long SMBCALL smb_fallocdat(smb_t* smb, ulong length, ushort headers);
SMBEXPORT long SMBCALL smb_hallocdat(smb_t* smb);
SMBEXPORT int SMBCALL smb_incmsg(smb_t* smb, smbmsg_t* msg);
SMBEXPORT int SMBCALL smb_incdat(smb_t* smb, ulong offset, ulong length, ushort headers);
SMBEXPORT int SMBCALL smb_freemsg(smb_t* smb, smbmsg_t* msg);
SMBEXPORT int SMBCALL smb_freemsgdat(smb_t* smb, ulong offset, ulong length, ushort headers);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment