2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* Netbios function for DJGPP: calls interrupt 5Ch for Netbios function.
11 NCB and buffer space must be in DOS memory (below 1MB). */
17 #include "dosdefs95.h"
18 #include "netbios95.h"
20 extern int handler_seg, handler_off;
22 int Netbios(NCB *Ncb, dos_ptr dos_ncb)
26 dos_ptr oldncb_buffer;
29 if (Ncb->ncb_command == NCBRESET ||
30 Ncb->ncb_command == NCBCANCEL ||
31 Ncb->ncb_command == NCBUNLINK ||
32 Ncb->ncb_command == NCBADDNAME ||
33 Ncb->ncb_command == NCBENUM ||
34 Ncb->ncb_command == NCBDELNAME) /* temp */
41 /* set to asynchronous */
42 Ncb->ncb_command |= ASYNCH;
44 /* adjust ncb_buffer pointer to be a segment:zero-offset pointer
46 oldncb_buffer = Ncb->ncb_buffer;
47 Ncb->ncb_buffer = Ncb->ncb_buffer << 12;
50 Ncb->ncb_post = (handler_seg << 16) | handler_off;*/
52 /* copy to DOS space */
53 dosmemput(Ncb, sizeof(NCB), dos_ncb);
55 /* set address of NCB in registers */
56 memset(®s, 0, sizeof(regs));
58 regs.x.ds = regs.x.es = dos_ncb/16;
60 __dpmi_int(0x5c,®s);
61 /*dosmemget(__tb, sizeof(NCB), Ncb);*/
64 IOMGR_NCBSelect(Ncb, dos_ncb, NULL);
66 /* undo the change to ncb_buffer */
67 Ncb->ncb_buffer = oldncb_buffer;