home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c004 / 3.ddi / NOVELL / CTVAPFC.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-04-18  |  6.8 KB  |  380 lines

  1. ;*****************************************************************************
  2. ;*
  3. ;*    System Dependent Server Message Handler
  4. ;*    Novell Advanced NetWare 2.1
  5. ;*
  6. ;*    This program is the CONFIDENTIAL and PROPRIETARY property 
  7. ;*    of FairCom(R) Corporation. Any unauthorized use, reproduction or
  8. ;*    transfer of this program is strictly prohibited.
  9. ;*
  10. ;*      Copyright (c) 1987, 1988, 1989 FairCom Corporation
  11. ;*    (Subject to limited distribution and
  12. ;*     restricted disclosure only.)
  13. ;*    *** ALL RIGHTS RESERVED ***
  14. ;*
  15. ;*    4006 West Broadway
  16. ;*    Columbia, MO 65203
  17. ;*
  18. ;*    ALL RIGHTS RESERVED.
  19. ;*
  20. ;*    c-tree(R)    Version 4.3
  21. ;*            Release C
  22. ;*            February 7, 1989 17:30
  23. ;*
  24. ;*
  25. ;*****************************************************************************
  26.  
  27.     name    VAPPreludeModule
  28.  
  29. SLEEP    EQU    1    ; # of ticks to sleep during idle time
  30. DGROUP    GROUP    _DATA
  31. PGROUP    GROUP    _TEXT
  32.  
  33.     extrn    _srvprm:far
  34.  
  35.     assume cs:PGROUP
  36.  
  37. _TEXT    segment public 'CODE'
  38.  
  39.     public    NetWareShellServices
  40.     public    ProcessControlServices
  41.     public     ConsoleControlServices
  42.     public    IPXSPXServices
  43.     public    _SndESR
  44.     public    _RcvESR
  45.     public    _killvap
  46.     public    _initcomp
  47.     public    _display
  48.     public    _novshlx
  49. ;    public    _spxshl
  50.     public    _login
  51.     public    _dlayvap
  52.     public  _valloc
  53.  
  54.     Signature            db    'NWProc'
  55.     NetWareShellServices        dd    ?
  56.     ProcessControlServices        dd    ?
  57.     ConsoleControlServices        dd    ?
  58.     IPXSPXServices            dd    ?
  59.     VAPConsoleHandler        dd    ConsoleHandlerCALL
  60.     VAPDownHandler            dd    DownHandlerCALL
  61.     VAPConsoleOrDownDataSegment    dw    DGroup
  62.     VAPConnectionRequestFlag    dw    0        ;connection
  63.     VAPNameString            db    'c-tree Server VAP', 64-($-VAPNameString) dup(0)
  64.     VAPConsoleKeyWordCount        dw    2
  65.     VAPKeyword1            db    'REVERSE', 16-($-VAPKeyword1) dup(0)
  66.     VAPKeyword2            db    'STATS', 16-($-VAPKeyword2) dup(0)
  67.     VAPSignOnMessage        db    0ah,0dh,0ah
  68.                     db    '               '
  69.                     db    'c-tree(R) Server V4.3 Release C'
  70.                     db    0ah,0dh,0
  71.                     db    500-($-VAPSignOnMessage) dup(0)
  72.  
  73.     extrn    _main: near
  74. ;    extrn    _ConsoleHandler: near
  75.     extrn    _stopsrvr: near
  76. ;    extrn    _ReceiveESR: near
  77. ;    extrn    _SendESR: near
  78.  
  79. VAPStart    proc    near
  80.     cli
  81. ;    int    3            ;for PFIX debugging purposes
  82.     mov    ax, DGroup
  83.     mov    di, 1            ;change segment to data (read/write)
  84.     call     dword ptr cs:ProcessControlServices
  85.     mov    ax, DGroup
  86.     mov    ds, ax
  87.     mov    es, ax
  88.     mov    ss, ax
  89.     mov    ax, OFFSET DGROUP:StackEnd
  90.     mov    sp, ax
  91.  
  92.     mov    ax, SEG _srvprm
  93.     mov    di, 1
  94.     call     dword ptr cs:ProcessControlServices
  95.  
  96.     sti
  97.  
  98.     xor    ax,ax
  99.     push    ax
  100.     push    ax
  101.     push    ax
  102.     call    _main
  103.     add    sp,6
  104.  
  105.     call    _killvap
  106.  
  107. VAPStart    endp
  108.  
  109. ;    Assumes        DS point to DGroup
  110. ;            AL number of keyword type to enter the VAP
  111.  
  112.     assume    ds: DGroup
  113.  
  114. _login    proc    near
  115.     push    bp
  116.     mov    bp,sp
  117.     push    si
  118.     push    di
  119.     push    es
  120.     push    ds
  121.     pop    es
  122.     mov    si,OFFSET DGROUP:logpak
  123.     mov    di,OFFSET DGROUP:logret
  124.     mov    ah,0e3h
  125.     call    dword ptr cs:NetWareShellServices
  126.     xor    ah,ah
  127.     pop    es
  128.     pop    di
  129.     pop    si
  130.     mov    sp,bp
  131.     pop    bp
  132.     ret
  133. _login    endp
  134.  
  135. _novshlx    proc    near
  136.     push    bp
  137.     mov    bp,sp
  138.     push    si
  139.     push    di
  140.     push    es
  141.     push    ds
  142. ; get input registers
  143.     mov    di,word ptr [bp + 4]
  144.     mov    es,word ptr [bp + 6]
  145.     mov    ax,word ptr es:[di]
  146.     mov    bx,word ptr es:[di + 2]
  147.     mov    cx,word ptr es:[di + 4]
  148.     mov    dx,word ptr es:[di + 6]
  149.     mov    si,word ptr es:[di + 8]
  150.     mov    di,word ptr es:[di + 0ah]
  151.     push    di
  152.     push    ax
  153. ; get ds register
  154.     mov    di,word ptr [bp + 12]
  155.     mov    es,word ptr [bp + 14]
  156.     mov    ax,word ptr es:[di + 6]        ; ds register value
  157.     push    ax
  158.     pop    ds
  159.     pop    ax
  160.     pop    di
  161. ; call netware
  162.     call    dword ptr cs:NetWareShellServices
  163.     pop    ds                ; restore ds
  164. ; get output registers
  165.     push    di
  166.     mov    di,word ptr [bp + 8]
  167.     mov    es,word ptr [bp + 10]
  168.     mov    word ptr es:[di],ax
  169.     mov    _noverr,ax
  170.     mov    word ptr es:[di + 2],bx
  171.     mov    word ptr es:[di + 4],cx
  172.     mov    word ptr es:[di + 6],dx
  173.     mov    word ptr es:[di + 8],si
  174.     pop    word ptr es:[di + 0ah]
  175.     jnc    novret
  176.     mov    ax,1
  177.     jmp    novert
  178. novret:
  179.     xor    ax,ax
  180.     mov    _noverr,ax
  181. novert:
  182.     pop    es
  183.     pop    di
  184.     pop    si
  185.     mov    sp,bp
  186.     pop    bp
  187.     ret
  188. _novshlx    endp
  189.  
  190. _spxshl    proc    near
  191.     push    bp
  192.     mov    bp,sp
  193.     push    si
  194.     push    di
  195.     push    es
  196.     mov    di,word ptr [bp+4]
  197.     mov    ax,word ptr [di]
  198.     mov    bx,word ptr [di + 2]
  199.     mov    cx,word ptr [di + 4]
  200.     mov    dx,word ptr [di + 6]
  201.     mov    si,word ptr [di + 8]
  202.     mov    di,word ptr [di + 0ah]
  203.     push    ds
  204.     pop    es
  205.     call    dword ptr cs:IPXSPXServices
  206. ;    int    7ah
  207.     push    di
  208.     mov    di,word ptr [bp+6]
  209.     mov    word ptr [di],ax
  210.     mov    _noverr,ax
  211.     mov    word ptr [di + 2],bx
  212.     mov    word ptr [di + 4],cx
  213.     mov    word ptr [di + 6],dx
  214.     mov    word ptr [di + 8],si
  215.     pop    word ptr [di + 0ah]
  216.  
  217.     pop    es
  218.     pop    di
  219.     pop    si
  220.     mov    sp,bp
  221.     pop    bp
  222.     ret
  223. _spxshl    endp
  224.  
  225. _killvap    proc    near
  226.     mov    di,8
  227.     call    dword ptr cs:ProcessControlServices
  228. _killvap    endp
  229.  
  230. _dlayvap    proc    near
  231.     push    bp
  232.     push    si
  233.     push    di
  234.     mov    di,0ah
  235.     mov    dx,SLEEP
  236.     call    dword ptr cs:ProcessControlServices
  237.     pop    di
  238.     pop    si
  239.     pop    bp
  240.     ret
  241. _dlayvap    endp
  242.  
  243. _initcomp    proc    near
  244.     push    bp
  245.     push    si
  246.     push    di
  247.     mov    di,7
  248.     call    dword ptr cs:ProcessControlServices
  249.     pop    di
  250.     pop    si
  251.     pop    bp
  252.     ret
  253. _initcomp    endp
  254.  
  255. _display    proc    near
  256.     push    bp
  257.     mov    bp,sp
  258.     push    si
  259.     push    di
  260.     
  261.     mov    ax,0ffffH
  262.     push    ax
  263.     mov    di,word ptr [bp+6]    ;text segment
  264.     push    di
  265.     mov    di,word ptr [bp+4]    ;text ptr into di
  266.     push    di
  267.     push    ax
  268.     push    ax
  269.     mov    di,1
  270.     call    dword ptr cs:ConsoleControlServices
  271.     add    sp,10            ; ???? is this necessary ????
  272.  
  273.     pop    di
  274.     pop    si
  275.     mov    sp,bp
  276.     pop    bp
  277.     xor    ax,ax            ;zero return value
  278.     ret
  279. _display    endp
  280.  
  281. _valloc    proc    near
  282.     push    bp
  283.     mov    bp,sp
  284.     push    si
  285.     push    di
  286.     
  287.     mov    ax,word ptr [bp+4]    ;paragraph size
  288.     mov    di,0h            ;allocate segment
  289.     call    dword ptr cs:ProcessControlServices
  290. ; ax contains segment value
  291.     push    ax            ;save segment
  292.     pop    dx            ;segment value in dx
  293.     xor    ax,ax            ;set offset to zero
  294.  
  295.     pop    di
  296.     pop    si
  297.     mov    sp,bp
  298.     pop    bp
  299.     ret
  300. _valloc    endp
  301.  
  302. _RcvESR    proc    far
  303. ;    push    ds
  304. ;    mov    ax, DGroup
  305. ;    mov    ds, ax
  306. ;    push    es
  307. ;    push    si
  308. ;    mov    ax, OFFSET DGROUP:bmsg
  309. ;    push    ax
  310. ;    call    _display
  311. ;    add    sp,2
  312. ;    call    _ReceiveESR
  313. ;    add    sp, 4
  314. ;    mov    ax, OFFSET DGROUP:amsg
  315. ;    push    ax
  316. ;    call    _display
  317. ;    add    sp,2
  318. ;    pop    ds
  319.     ret
  320. _RcvESR    endp
  321. ;
  322. _SndESR    proc    far
  323. ;    push    ds
  324. ;    mov    ax, DGroup
  325. ;    mov    ds, ax
  326. ;    push    es
  327. ;    push    si
  328. ;    call    _SendESR
  329. ;    add    sp, 4
  330. ;    pop    ds
  331.     ret
  332. _SndESR    endp
  333.  
  334. ConsoleHandlerCALL    proc    far
  335. ;    cbw
  336. ;    mov    _Keyword, ax
  337. ;    call    _ConsoleHandler
  338.     ret
  339. ConsoleHandlerCALL    endp
  340.  
  341. DownHandlerCALL            proc    far
  342. ;    call    _stopsrvr
  343.     ret
  344. DownHandlerCALL        endp
  345.  
  346. _TEXT    ends
  347.  
  348.  
  349. ;    This is the declaration for the data segment
  350.  
  351. _DATA    SEGMENT word public 'DATA'
  352.     assume ds:DGROUP
  353.     public    _vapdat
  354.     public    _noverr
  355.  
  356. _vapdat    dd    0
  357. _noverr    dw    0
  358.  
  359. logpak    dw    paslen + 1 - funnum    ; packet length
  360. funnum    db    20            ; function
  361.     db    00            ; object type
  362.     db    01
  363.     db    paslen - objnam        ; object name length
  364. objnam    db    "CTREEV4-3"        ; object name
  365. paslen    db    0            ; password length
  366.  
  367. logret    dw    0
  368. inbuf    db    80 dup (0)
  369.     dw    2000 dup (0)
  370.  
  371.     StackEnd    label     word
  372.  
  373.     public    _Keyword
  374.  
  375.     _Keyword    dw     0
  376.  
  377. _DATA    ENDS
  378.  
  379.     end    VAPStart
  380.