home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / GETMANAM.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  1.6 KB  |  78 lines

  1. ;/*
  2. ;** getmanam.asm
  3. ;** contains:    getmanam()
  4. ;*/
  5.  
  6. GETMACHINENAME        equ    05e00h        ;Get Machine Name function number
  7. DOSCALL         equ    021h        ;DOS Software Interrupt
  8.  
  9.         include model.h
  10.         include prologue.h
  11.  
  12.         pseg    cgetmanam
  13.  
  14.  
  15. ;/*
  16. ;**  int
  17. ;** getmanam(char *name,int *namenumind, int *namenumber)
  18. ;**
  19. ;** ARGUMENT(s)
  20. ;**    name    -    pointer to a buffer of at least 16 bytes in length to
  21. ;**            receive the name (terminated with 0)
  22. ;**    namenumind  -    pointer to a Name/number indicator flag.  After
  23. ;**            calling GetComputerName() if namenumind == 0
  24. ;**            the name is not defined.  If namenumind != 0
  25. ;**            the name and number are valid.
  26. ;**    namenumber  -    NETBIOS name number for the name.
  27. ;**
  28. ;** DESCRIPTION
  29. ;**  Returns the character identifier of the local computer.  The IBM PC
  30. ;**  Network Program must be loaded for the function call to execute
  31. ;**  properly.
  32. ;**
  33. ;**
  34. ;** RETURNS
  35. ;**  0 if successful, else a DOS error code.
  36. ;**
  37. ;** AUTHOR
  38. ;**  ""   Fri 11-Nov-1988    16:01:57
  39. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  40. ;**
  41. ;** MODIFICATIONS
  42. ;**
  43. ;*/
  44.         cproc    getmanam
  45.         if    _LDATA
  46.          push    ds
  47.          lds    dx,parm1_
  48.         else
  49.          mov    dx,parm1_
  50.         endif
  51.         mov    ax,GETMACHINENAME
  52.         int    DOSCALL
  53.         jc    getcompexit
  54.         if    _LDATA
  55.          lds    bx,parm3_
  56.         else
  57.          mov    bx,parm2_
  58.         endif
  59.         xor    ah,ah
  60.         mov    al,ch
  61.         mov    [bx],ax         ;save indicator
  62.         if    _LDATA
  63.          lds    bx,parm5_
  64.         else
  65.          mov    bx,parm3_
  66.         endif
  67.         mov    al,cl
  68.         mov    [bx],al         ;save namenumber
  69.         xor    ax,ax            ;indicate success
  70. getcompexit:
  71.         if    _LDATA
  72.          pop    ds
  73.         endif
  74.         cproce
  75.  
  76.         endps
  77.         end
  78.