- /* Update the current block */
- CurrentMcb->BlockType = 'M';
- CurrentMcb->Size = Size;
+ /* Update the current block */
+ CurrentMcb->BlockType = 'M';
+ CurrentMcb->Size = Size;
+ }
+ else
+ {
+ /* Save the location of the current MCB */
+ PDOS_MCB PreviousMcb = CurrentMcb;
+
+ /* Move the current MCB higher */
+ Result += CurrentMcb->Size - Size;
+ CurrentMcb = SEGMENT_TO_MCB(Result);
+
+ /* Initialize the new MCB structure */
+ CurrentMcb->BlockType = PreviousMcb->BlockType;
+ CurrentMcb->Size = Size;
+ CurrentMcb->OwnerPsp = 0;
+
+ /* Update the previous block */
+ PreviousMcb->BlockType = 'M';
+ PreviousMcb->Size -= Size + 1;
+ }