Category : C Source Code
Archive   : C-FDC.ZIP
Filename : SRDPB.C

 
Output of file : SRDPB.C contained in archive : C-FDC.ZIP
/* get & restore disk parameter blocks
*
*/

#include
#include "fdc.h"

struct dpb dsk_p_blk[MAXDRIVES]; /* disk parameter block for a: & b */

static int org_dpb_offset, org_dpb_segment;

int setdbp() /* sets DISK_POINTER to our dpbs */
{ /* return # of drives with dpbs (1 or 2) */

int i;
char *p;

org_dpb_offset = peek(DSK_PTR_SEG, DSK_PTR_OFF); /* get dpb offset */
org_dpb_segment = peek(DSK_PTR_SEG, DSK_PTR_OFF + 2); /* get dpb segment */

p = dsk_p_blk;
for(i = 0; i < (sizeof(struct dpb) * MAXDRIVES); ++org_dpb_offset)
*p++ = peek(org_dpb_segment, org_dpb_offset);
poke(DSK_PTR_SEG, DSK_PTR_OFF, getds());
poke(DSK_PTR_SEG, DSK_PTR_OFF + 2, dsk_p_blk);
return(dsk_p_blk[0].first);

}

int restoredpb() /* restores DISK_POINTER to original dbps */
{
poke(DSK_PTR_SEG, DSK_PTR_OFF, org_dpb_offset);
poke(DSK_PTR_SEG, DSK_PTR_OFF + 2, org_dpb_segment);
}







  3 Responses to “Category : C Source Code
Archive   : C-FDC.ZIP
Filename : SRDPB.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/