home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 8 / 08.iso / d / d026 / 25.ddi / NET / LIBINIT.AS_ / LIBINIT.AS
Encoding:
Text File  |  1991-04-19  |  2.8 KB  |  116 lines

  1. page        60, 132
  2. title        Library Initialisation
  3. ;===============================================================================
  4. ;        Filename    LOADLIB.ASM
  5. ;        Copyright    (C) 1989 by Research Machines
  6. ;        Copyright    (C) 1989, 1990 Microsoft Corp.
  7. ;
  8. ;===============================================================================
  9. ; REVISIONS:    24/02/1989    Initial version
  10. ;===============================================================================
  11.  
  12.         memM    equ    1            ; Middle memory model
  13.         ?WIN    =    1            ; Windows prolog/epilog
  14.         ?PLM    =    1            ; Pascal calling convention
  15.  
  16.  
  17.         .xlist
  18. include     cmacros.inc
  19. include     windows.inc
  20. include     wnet.inc
  21. include     wnetcaps.inc
  22.         .list
  23.  
  24. externFP    PostWarning
  25. externFP    GetProfileInt
  26.  
  27. ;===============================================================================
  28. ; ============= DATA SEGMENT ===================================================
  29. ;===============================================================================
  30.  
  31. sBegin        DATA
  32.  
  33. externW     CapsTable
  34.  
  35. globalW     hLibraryModule, 0, 1
  36.  
  37. szNetwork    db 'Network',0
  38. szNoQuery    db 'NoQueryPrinter',0
  39.  
  40. sEnd        DATA
  41.  
  42. ;===============================================================================
  43. ; ============= CODE SEGMENT ===================================================
  44. ;===============================================================================
  45.  
  46. sBegin        CODE
  47.         assumes CS, CODE
  48.         assumes DS, DATA
  49.  
  50. ;===============================================================================
  51. subttl        LibraryInitialisation
  52. page
  53. ;===============================================================================
  54.  
  55. cProc        LibraryInit, <FAR, PUBLIC, NODATA>
  56.  
  57. cBegin
  58.         mov    hLibraryModule, di
  59.  
  60.         mov    ax,00FFh      ; check if network installed
  61.         int    2Ah
  62.         mov    al,ah          ; 0 in AH iff net not installed
  63.         cmp    ax,0
  64.         jnz    @F
  65.  
  66.         cCall    PostWarning
  67.  
  68.         sub    ax,ax        ; return FALSE to unload
  69.         jmp    li_exit
  70.  
  71.     ;   If the user sets [Network]NoQueryPrinter=1
  72.     ;   in WIN.INI, disable the spooler print queue functions.
  73.     ;   This is for INT 21h compatible networks that do not
  74.     ;   support either NetBIOS or the SMB protocol.
  75.     ;
  76.  
  77. @@:        push    ds
  78.         lea    ax, szNetwork
  79.         push    ax
  80.         push    ds
  81.         lea    ax, szNoQuery
  82.         push    ax
  83.         sub    ax, ax
  84.         push    ax
  85.         call    GetProfileInt
  86.         or    ax, ax
  87.         jz    @F
  88.  
  89.         prtcaps =            WNNC_PRT_OpenJob
  90.         prtcaps = prtcaps or WNNC_PRT_CloseJob
  91.  
  92.         mov    CapsTable[ 12 ], prtcaps
  93. @@:
  94.         mov    ax, 1
  95. li_exit:
  96. cEnd
  97.  
  98. cProc        WEP, <FAR, PUBLIC, NODATA>
  99.  
  100. ;   parmW    fLeaving
  101.  
  102. cBegin    <nogen>
  103.  
  104.     xor     ax, ax
  105.     retf    2
  106.  
  107. cEnd    <nogen>
  108.  
  109. ;===============================================================================
  110. ; ============= END OF LOADLIB =================================================
  111. ;===============================================================================
  112.  
  113. sEnd        CODE
  114.  
  115.         end    LibraryInit
  116.