home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / ntws1.exe / NTCLI / NTCLNT_1.350 / NWSUBS.IN_ / NWSUBS.IN
Text File  |  1995-05-16  |  87KB  |  2,631 lines

  1. ;
  2. ; Novell NetWare for Windows NT Setup Common Shell Sections.
  3. ;
  4. ;
  5. ; ===================================================================================
  6. ;
  7. [NwBaseVars]
  8.     MAXIMUM_ALLOWED     = 33554432
  9.     KeyNull                = ""
  10.     RegistryErrorIndex = NO_ERROR
  11.     NoTitle                = 0
  12.     !RegLastError        = NO_ERROR
  13.     UtilityInf            = "UTILITY.INF"
  14.     IDH_NETWAREWRKSTATIONPARMS =    901
  15.     IDH_NETWAREIPXBIND            =    902
  16.     IDH_IPXSPXPARMS                =    903
  17.     IDH_NETWORKPROTOCOL            =    904
  18.     IDH_NETWAREODISETTINGS        =    905
  19.     IDH_NETWARECLIENTINSTALL    =    906
  20.     IDH_NETWARENDISODI            =    907
  21.     IDH_NODEADDRESSOVERIDE        =    908
  22.     IDH_RESMGRCONFIG            =    951
  23.     Help        = "&Help"
  24.     OK            = "&OK"
  25.     Continue    = "Con&tinue"
  26.     Cancel        = "&Cancel"
  27.     Advanced = "&Advanced"
  28. ;
  29. ; ===================================================================================
  30. ;
  31. ;
  32. [IpxVars]
  33.      IpxServiceName    = "IpxSpx"
  34.      IpxParameters    = $(!NTN_ServiceBase)"\"$(IpxServiceName)"\Parameters"
  35.      IpxCardName        = "Card Name"
  36.      IpxCardInstance = "Card Instance"
  37.      IpxNtCardInstance = "Nt Card Instance"
  38. ;
  39. ; ===================================================================================
  40. ;
  41. ;
  42. [OdiNSupVars]
  43.      OdiNSupServiceName    = "ODINSUP"
  44.      OdiNSupParameters    = $(!NTN_ServiceBase)"\"$(OdiNSupServiceName)"\Parameters"
  45.      OdiNSupLinkage        = $(!NTN_ServiceBase)"\"$(OdiNSupServiceName)"\Linkage"
  46.      OdiNSupCardName        = "Bind"
  47.      OdiNSupCardInstance = "BoardInstance"
  48.  
  49. ;
  50. ; ===================================================================================
  51. ;
  52. ;
  53. [OdiVars]
  54.      DriverName     = "OdiLoad"
  55.      OdiModules     = "ODI_Modules"
  56.      OdiLinkName    = "OdiLoadName"
  57.      OdiModuleName = $(!NTN_ServiceBase)"\"$(DriverName)"\"$(OdiModules)
  58.      NetworkCardsKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  59. ;
  60. ; ===================================================================================
  61. ;
  62. ;
  63. [OdinsupDlgENG]
  64.     DlgType = "RadioCombination"
  65.     DlgTemplate = "ONELIST"
  66.     Caption = "NetWare NDIS over ODI (ODINSUP) Setup"
  67.     Label1 = "Installed ODI Adapters"
  68.     EditTextIn = ""
  69.     EditTextLim = ""
  70.     CBOptionsGreyed = {}
  71.     HelpContext = $(IDH_NETWARENDISODI)
  72.     ComboListItemsIn = { OdiTitleList }
  73.     ComboListItemsOut = { DefaultOdiTitle }
  74.     NotifyFields = { "NO" }
  75. ;
  76. ; ===================================================================================
  77. ;
  78. ;
  79. [IPXBindDlgENG]
  80.     DlgType = "RadioCombination"
  81.     DlgTemplate = "ONELIST"
  82.     Caption = "NetWare IPX Bind"
  83.     Label1 = "ODI Adapter to bind IPX to"
  84.     EditTextIn = ""
  85.     EditTextLim = ""
  86.     CBOptionsGreyed = {}
  87.     HelpContext = $(IDH_NETWAREIPXBIND)
  88.     ComboListItemsIn = { OdiTitleList }
  89.     ComboListItemsOut = { DefaultOdiTitle }
  90.     NotifyFields = { "NO" }
  91. ;
  92. ; ===================================================================================
  93. ;
  94. ;
  95. [IPXDlgENG]
  96.     DlgType = "RadioCombination"
  97.     Label1 = "Enter the board and the default frame type to bind to IPX"
  98.     Label2 = "Board"
  99.     Label3 = "Frame"
  100.     DlgTemplate = "IPXFRAME"
  101.     Caption = "IPX Bind Parameters"
  102.     EditTextIn = ""
  103.     EditTextLim = ""
  104.     CBOptionsGreyed = {}
  105.     RadioOptionsGreyed = {}
  106.     HelpContext = $(IDH_NETWAREIPXBIND)
  107.     ComboOut = $(FrameListDefault)
  108.     ComboListItemsIn = { FrameList }
  109.     ComboListItemsOut = { ComboOut }
  110.     NotifyFields = { "NO" }
  111. ;
  112. ; ===================================================================================
  113. ;
  114. ;
  115. [NewFrameTypeDlgENG]
  116.     Label1 = "WARNING: Entering a non-standard frametype could prevent this workstation from communicating with the network."
  117.     Label2 = "Frame Type"
  118.     Label3 = "Protocol Identifier"
  119.     ICON = BANG
  120.     DlgType = "RadioCombination"
  121.     DlgTemplate = "DLG_NETWORKPROTOCOL"
  122.     Caption = "Network Protocol"
  123.     EditTextIn = { $(NewFrameTypeName), $(ProtocolID) }
  124.     EditTextLim = { "", 12 }
  125.     CBOptionsGreyed = {}
  126.     RadioOptionsGreyed = {}
  127.     HelpContext = $(IDH_NETWORKPROTOCOL)
  128.     ComboOut = {}
  129.     ComboListItemsIn = {}
  130.     ComboListItemsOut = {}
  131.     NotifyFields = {}
  132.  
  133. ;
  134. ; ===================================================================================
  135. ;
  136. ;
  137. [AdvancedIPXSPXDlgENG]
  138.     DlgType = "RadioCombination"
  139.     DlgTemplate = "DLG_IPXSPXPARAMETERS"
  140.     Caption = "IPX/SPX Parameters"
  141.     EditTextLim = { "5", "1", "2", "5", "10", "10", "10" }
  142.     CBOptionsGreyed = {}
  143.     HelpContext = $(IDH_IPXSPXPARMS)
  144.  
  145.  
  146. ;
  147. ;
  148. ; ===================================================================================
  149. ;
  150. ;
  151. ; ===================================================================================
  152. ;
  153. ; Section to create a list of all installed ODI adapters.    Used by IpxSpx configure.
  154. ; Could also be used by ODINSUP configure.
  155. ;
  156. ; INPUT:
  157. ;     NONE
  158. ;
  159. ; OUTPUT:
  160. ;     $($R0)    List of installed ODI adapter names.
  161. ;     $($R1)    List of installed ODI adapter titles.
  162. ;     $($R2)    List of installed ODI adapter card numbers.
  163. ;     $($R3)    Number of installed ODI adapters.
  164. ;
  165. ; ===================================================================================
  166.  
  167. [GetOdiAdapterList]
  168. ;
  169. ; In this section we will create a list of installed ODI adapters.
  170. ;
  171.     read-syms NwBaseVars
  172.     read-syms OdiVars
  173.  
  174.     Set OdiOnlyList = {}
  175.     Set OdiTitleList = {}
  176.     Set OdiCardList = {}
  177.  
  178.  
  179.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) $(MAXIMUM_ALLOWED) NetCardsKey
  180.  
  181.     Ifstr(i) $(NetCardsKey) == ""
  182.         Debug-Output "NWSUBS.INF: Can't Open Registry key "$(NetworkCardsKeyName)
  183.         set CommonStatus = STATUS_USERCANCEL
  184.     Else
  185. ;
  186. ;        Get a list of all installed network cards
  187. ;
  188.         EnumRegKey $(NetCardsKey) NetCardsList
  189.  
  190.         Set NumberOdiAdapters = 0
  191.  
  192.         ForListDo $(NetCardsList)
  193.             Set CardNumber = *($($), 1)
  194.  
  195.             OpenRegKey $(NetCardsKey) "" $(CardNumber) $(MAXIMUM_ALLOWED) CardKey
  196.             Ifstr(i) $(CardKey) == ""
  197.                 Debug-Output "NWSUBS.INF: Can't open adapter "$(Card)
  198.             Else
  199.                 GetRegValue $(CardKey) "OdiAdapter" OdiValueList
  200.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  201.                     set OdiAdapter = *($(OdiValueList), 4)
  202.  
  203.                     Ifstr(i) $(OdiAdapter) == "1"
  204. ;
  205. ;                        Must be an ODI Adapter so add it to our lists.
  206. ;
  207.                         set-add NumberOdiAdapters = $(NumberOdiAdapters), 1
  208.  
  209.                         GetRegValue $(CardKey) "Title" OdiTitleValues
  210.                         Set OdiTitle = *($(OdiTitleValues), 4)
  211.                         GetRegValue $(CardKey) "ProductName" OdiNameValues
  212.                         Set OdiName = *($(OdiNameValues), 4)
  213.  
  214.                         Set OdiOnlyList = >($(OdiOnlyList), $(CardNumber))
  215.                         Set OdiTitleList = >($(OdiTitleList), $(OdiTitle))
  216.                         Set OdiCardList = >($(OdiCardList), $(OdiName))
  217.                     Endif
  218.                 Endif
  219.  
  220.                 CloseRegKey $(CardKey)
  221.             Endif
  222.  
  223.         EndForListDo
  224.  
  225.         Debug-Output "NWSUBS.INF: OdiOnlyList         = "$(OdiOnlyList)
  226.         Debug-Output "NWSUBS.INF: OdiTitleList        = "$(OdiTitleList)
  227.         Debug-Output "NWSUBS.INF: OdiCardList         = "$(OdiCardList)
  228.         Debug-Output "NWSUBS.INF: NumberOdiAdapters = "$(NumberOdiAdapters)
  229.  
  230.         CloseRegKey $(NetCardsKey)
  231.  
  232.     Endif
  233.  
  234.     return $(OdiTitleList) $(OdiCardList) $(OdiOnlyList) $(NumberOdiAdapters)
  235.  
  236. ; ===================================================================================
  237. ;
  238. ; This section creates a list of the frame types loaded by OdiLoad.
  239. ;
  240. ; ===================================================================================
  241.  
  242. ;[GetOdiLoadFrameList]
  243. ;     read-syms InitBaseVars
  244. ;
  245. ;     return
  246.  
  247.  
  248. ; ===================================================================================
  249. ; NwSetCardInstance:
  250. ;
  251. ;     INPUT:
  252. ;         $($0) - Open Key to Services\OdiLoad or "" and I'll open it (*** NOT USED ***).
  253. ;         $($1) - Open key to Services\OdiLoad\Odi_Modules or "" and I'll open it.
  254. ;         $($2) - Open key to Services\OdiLoad\Odi_Modules\ne2000 #1 or "" and I'll try
  255. ;                        to open the key $($3) under Odi_Modules, that is if $($3) is not "".
  256. ;         $($3) - The card name (ne2000 #1, etc) or "".
  257. ;                        The 'ne2000 #1' will vary based on card name and instance.
  258. ;                        If something other than "" is passed then the Card Instance assigned
  259. ;            to this OdiLoad-able Module is returned as $($R1) otherwise
  260. ;                        $($R1) will equal 1.
  261. ;
  262. ;     OUTPUT:
  263. ;         $($R0) - Result NO_ERROR if successful, otherwise an error string.
  264. ;         $($R1) - New OdiLoad Board instance for the card currently being installed
  265. ;                     or 1 if the card name passed in $($3) is "".
  266. ;
  267. ;
  268. ;
  269. ; Sets the BoardInstance for ALL installed Odi Modules.
  270. ;
  271. ; ===================================================================================
  272.  
  273. [NwSetCardInstance]
  274.     Set KeyOdiLoad         =    $($0)
  275.     Set KeyOdiModules =    $($1)
  276.     Set KeyOdiCard         =    $($2)
  277.     Set OdiCardName    =    $($3)
  278.  
  279.     read-syms NwBaseVars
  280.     read-syms OdiVars
  281.  
  282.     Set CurInstance = 1
  283. ;
  284. ; Get a list of installed Odi Modules and create a list of the base card names.
  285. ;
  286.     Set CloseOdiModules = FALSE
  287.  
  288.     Ifstr(i) $(KeyOdiModules) == ""
  289.         OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName) $(MAXIMUM_ALLOWED) KeyOdiModules
  290.         Ifstr(i) $(KeyOdiModules) == ""
  291.             Set Result = "Can't open "$(OdiModuleName)
  292.             Debug-Output "NWSUBS.INF: SetCardInstance, "$(Result)
  293.             goto Exit_SetCardInstance
  294.         Endif
  295.         CloseOdiModules = TRUE
  296.     Endif
  297.  
  298.     EnumRegKey $(KeyOdiModules) OdiModulesList
  299.  
  300.     Set OdiList = {}
  301.     Set BaseNameList = {}
  302.  
  303.     ForListDo $(OdiModulesList)
  304.         Set CurList = $($)
  305.         Set CurModule = *($(CurList), 1)
  306.         Set OdiList = >($(OdiList), $(CurModule))
  307.         Set CloseCard = FALSE
  308.  
  309.         Split-String $(CurModule) " " NamePartList
  310.         Set NameBase = *($(NamePartList), 1)
  311.         Ifcontains(i) $(NameBase) in $(BaseNameList)
  312.             Debug-Output "NWSUBS.INF: "$(NameBase)" already in list"
  313.         Else
  314.             Set BaseNameList = >($(BaseNameList), $(NameBase))
  315.         Endif
  316.  
  317.         set-add Inst$(NameBase) = $(Inst$(NameBase)), 1
  318.  
  319.         Set KeyToCard = ""
  320.  
  321.         Ifstr(i) $(OdiCardName) != ""
  322.             Ifstr(i) $(OdiCardName) == $(CurModule)
  323.                 Set KeyToCard = $(KeyOdiCard)
  324.                  Set CurInstance = $(Inst$(NameBase))
  325.             Endif
  326.         Endif
  327.         Ifstr(i) $(KeyToCard) == ""
  328.             OpenRegKey $(KeyOdiModules) "" $(CurModule) $(MAXIMUM_ALLOWED) KeyToCard
  329.             Ifstr(i) $(KeyToCard) == ""
  330.                 Set Result = "Can't Open "$(CurModule)
  331.                 Debug-Output "NWSUBS.INF: SetCardInstance, "$(Result)
  332.                 goto Exit_SetCardInstance
  333.             Endif
  334.             Set CloseCard = TRUE
  335.         Endif
  336.  
  337.         SetRegValue $(KeyToCard) {BoardInstance,$(NoTitle),$(!REG_VT_DWORD),$(Inst$(NameBase))}
  338.  
  339.         Ifstr(i) $(CloseCard) == TRUE
  340.             CloseRegKey $(KeyToCard)
  341.         Endif
  342.  
  343.     EndForListDo
  344.  
  345.     Debug-Output "NWSUBS.INF: OdiList = "$(OdiList)
  346.     Debug-Output "NWSUBS.INF: BaseNameList = "$(BaseNameList)
  347.  
  348.     ForListDo $(BaseNameList)
  349.         set CardName = $($)
  350.         Debug-Output "NWSUBS.INF: "$(CardName)" cards found = "$(Inst$(CardName))
  351.     EndForListDo
  352.  
  353.     Set Result = NO_ERROR
  354.  
  355. Exit_SetCardInstance = +
  356.     Ifstr(i) $(CloseOdiModules) == TRUE
  357.         Debug-Output "NWSUBS.INF: Close Odi Modules"
  358.         CloseRegKey $(KeyOdiModules)
  359.     Endif
  360.  
  361.     return $(Result) $(CurInstance)
  362.  
  363.  
  364. ; ===================================================================================
  365. ; ===================================================================================
  366.  
  367. [NwSetIpxCard]
  368.     Set OdiCardName = $($0)
  369.     Set OdiCardInstance = $($1)
  370.  
  371.     Debug-Output "NwSetIpxCard: OdiCardName = "$(OdiCardName)
  372.     Debug-Output "NwSetIpxCard: OdiCardInstance = "$(OdiCardInstance)
  373.  
  374.     read-syms NwBaseVars
  375.     read-syms IpxVars
  376.     read-syms OdiVars
  377.     read-syms OdiNSupVars
  378.  
  379.     Set Result = NO_ERROR
  380.  
  381.     ; If more than one board ask the user which board to bind to.
  382.     ;
  383.     Shell $(NwSubsInf) GetOdiAdapterList
  384.  
  385.     Set OdiTitleList        = $($R0)
  386.     Set OdiCardList         = $($R1)
  387.     Set OdiNtNumberList    = $($R2)
  388.     Set NumberOdiAdapters = $($R3)
  389.  
  390.     LoadLibrary "NetWare for Windows NT" nwsetup.dll NwLibHandle
  391.     SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\english\nwnthelp.hlp" $(!MinimumID) $(!MaximumID)
  392.  
  393.     Ifint $(NumberOdiAdapters) > 1
  394.         ;
  395.         ; More than one ODI adapter is installed so allow
  396.         ; the user to select which one to bind to.
  397.         ;
  398.     
  399.     
  400.         Ifstr(i) $(OdiCurBindCardName) != ""
  401.              Debug-Output "NWSUBS.INF: OdiCurBindCardName = "$(OdiCurBindCardName)
  402.              Set DefaultOdiTitle = *($(OdiTitleList), ~($(OdiCardList), $(OdiCurBindCardName)))
  403.         Endif
  404.     
  405.         Ifstr(i) $(DefaultOdiTitle) == ""
  406.              Set DefaultOdiTitle = *($(OdiTitleList), 1)
  407.         Endif
  408.     
  409.         Debug-Output "NWSUBS.INF: DefaultOdiTitle = "$(DefaultOdiTitle)
  410.     
  411.         read-syms IPXBindDlg$(!STF_LANGUAGE)
  412.         ui start "IPXBIND" $(NwLibHandle)
  413.         ui pop 1
  414.  
  415.         ifstr(i) $(DLGEVENT) == "BACK"
  416.             set AdapterSelected = ""
  417.         else
  418.             Set AdapterSelected = *($(DefaultOdiTitle), 1)
  419.         endif
  420.     
  421.         Debug-Output "NWSUBS.INF: AdapterSelected = "$(AdapterSelected)
  422.         
  423.         Ifstr(i) $(AdapterSelected) == ""
  424.             Debug-Output "NWSUBS.INF: Cancel Selected"
  425.             Set CardToBindTo = *($(OdiCardList), 1)
  426.             Set CardInstance = 1
  427.             Set NtAdapterNumber = *($(OdiNtNumberList), 1)
  428.         Else
  429.             Set CardToBindTo = *($(OdiCardList), ~($(OdiTitleList), $(AdapterSelected)))
  430.             Debug-Output "CardToBindTo = "$(CardToBindTo)
  431.     
  432.             Set NtAdapterNumber = *($(OdiNtNumberList), ~($(OdiTitleList), $(AdapterSelected)))
  433.             Debug-Output "NtAdapterNumber = "$(NtAdapterNumber)
  434.     
  435.             Set NtAdapterKeyName = $(NetworkCardsKeyName)"\"$(NtAdapterNumber)
  436.             OpenRegKey $(!REG_H_LOCAL) "" $(NtAdapterKeyName) $(MAXIMUM_ALLOWED) KeyNtAdapter
  437.             Ifstr(i) $(KeyNtAdapter) != ""
  438.     
  439.                 GetRegValue $(KeyNtAdapter),"ServiceName", ServiceNameList
  440.                 Set ServiceName = *($(ServiceNameList), 4)
  441.                 CloseRegKey $(KeyNtAdapter)
  442.         
  443.         
  444.                 ; Open the lan man card's service\Parameters.
  445.                 ;
  446.                 OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  447.                 ifstr(i) $(KeyService) == ""
  448.         
  449.                      Debug-Output "NWSUBS.INF: NwSetIpxCard, Can't open "$(ServiceName)
  450.         
  451.                 Else
  452.                     ; Get the OdiLoad link.
  453.                     ;
  454.                     GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  455.                     Set CardInstanceName = *($(CardInstanceList), 4)
  456.                     CloseRegKey $(KeyService)
  457.             
  458.                     OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName)"\"$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  459.                     Ifstr(i) $(KeyOdiCard) != ""
  460.                         GetRegValue $(KeyOdiCard) "BoardInstance" BoardInstanceList
  461.                         Set CardInstance = *($(BoardInstanceList), 4)
  462.                         Debug-Output "1: Selected CardInstance = "$(CardInstance)
  463.                         CloseRegKey $(KeyOdiCard)
  464.                     Endif
  465.                 Endif
  466.             Else
  467.                 Debug-Output "Can't open "$(NtAdapterKeyName)
  468.             Endif
  469.         Endif
  470.     Else
  471.         Set CardToBindTo = *($(OdiCardList), 1)
  472.         Set CardInstance = 1
  473.         Set NtAdapterNumber = *($(OdiNtNumberList), 1)
  474.     Endif
  475.  
  476.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  477.     Ifstr(i) $(KeyIpxParameters) == ""
  478.           Set Result = "Can't open IpxSpx service."
  479.           Debug-Output "NWSUBS.INF: "$(Result)
  480.     Else
  481.         GetRegValue $(KeyIpxParameters) $(IpxCardName) CurrentCardNameList
  482.         Set CurrentCardName = *($(CurrentCardNameList), 4)
  483.         Debug-Output "CurrentCardName = "$(CurrentCardName)" CardToBindTo = "$(CardToBindTo)
  484.  
  485.         Set GUIResult = ""
  486.  
  487.         Ifstr(i) $(CurrentCardName) != $(CardToBindTo)
  488.             Shell "" NwSetFrameType $(CardToBindTo) $(NtAdapterNumber) $(NwLibHandle)
  489.  
  490.             Set GUIResult = $($R0)
  491.         Endif
  492.  
  493.           SetRegValue $(KeyIpxParameters) {$(IpxCardName),$(NoTitle),$(!REG_VT_SZ),$(CardToBindTo)}
  494.         Ifstr(i) $(OdiCardInstance) == ""
  495.             Debug-Output "NWSUBS.INF: NwSetIpxCard, OdiCardInstance set to default."
  496.             Set OdiCardInstance = "1"
  497.         Endif
  498.  
  499.         SetRegValue $(KeyIpxParameters) {$(IpxCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(OdiCardInstance)}
  500.         Debug-Output "2: NtAdapterNumber = "$(NtAdapterNumber)
  501.         SetRegValue $(KeyIpxParameters) {$(IpxNtCardInstance),$(NoTitle),$(!REG_VT_SZ),$(NtAdapterNumber)}
  502.         Ifstr(i) $(GUIResult) != ""
  503.             SetRegValue $(KeyIpxParameters) {"Frame Type",$(NoTitle),$(!REG_VT_SZ),$(GUIResult)}
  504.         Endif
  505.  
  506.         CloseRegKey $(KeyIpxParameters)
  507.     Endif
  508.  
  509.     ; Find the ODINSUPXX service name
  510.     ;
  511.  
  512.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) $(MAXIMUM_ALLOWED) NetCardsKey
  513.  
  514.     Ifstr(i) $(NetCardsKey) != ""
  515.         EnumRegKey $(NetCardsKey) NetCardsList
  516.         Debug-Output "NetCardsList = "$(NetCardsList)
  517.         ForListDo $(NetCardsList)
  518.             Set CardNumber = *($($), 1)
  519.             Debug-Output "CardNumber = "$(CardNumber)
  520.             OpenRegKey $(NetCardsKey) "" $(CardNumber) $(MAXIMUM_ALLOWED) KeyCardNumber
  521.             Ifstr(i) $(KeyCardNumber) != ""
  522.                 GetRegValue $(KeyCardNumber), "ProductName", ProductNameList
  523.                 Set ProductName = *($(ProductNameList), 4)
  524.                 Debug-Output "ProductName = "$(ProductName)
  525.                 Ifstr(i) $(ProductName) == "ODINSUP"
  526.                     GetRegValue $(KeyCardNumber), "ServiceName", ServiceNameList
  527.                     Set ServiceName = *($(ServiceNameList), 4)
  528.                     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyOdiNSupParameters
  529.                 Endif
  530.                 CloseRegKey $(KeyCardNumber)
  531.             Endif
  532.         EndForListDo
  533.         CloseRegKey $(NetCardsKey)
  534.     Endif
  535.  
  536.  
  537. ;    OpenRegKey $(!REG_H_LOCAL) "" $(OdiNSupParameters) $(MAXIMUM_ALLOWED) KeyOdiNSupParameters
  538.  
  539.     Ifstr(i) $(KeyOdiNSupParameters) != ""
  540.  
  541.         Ifint $(NumberOdiAdapters) > 1
  542.             ;
  543.             ; More than one ODI adapter is installed so allow
  544.             ; the user to select which one to bind to.
  545.             ;
  546.     
  547.     
  548.             Ifstr(i) $(OdiCurBindCardName) != ""
  549.                 Debug-Output "NWSUBS.INF: OdiCurBindCardName = "$(OdiCurBindCardName)
  550.                 Set DefaultOdiTitle = *($(OdiTitleList), ~($(OdiCardList), $(OdiCurBindCardName)))
  551.             Endif
  552.     
  553.             Ifstr(i) $(DefaultOdiTitle) == ""
  554.                 Set DefaultOdiTitle = *($(OdiTitleList), 1)
  555.             Endif
  556.     
  557.             Debug-Output "NWSUBS.INF: DefaultOdiTitle = "$(DefaultOdiTitle)
  558.  
  559.             read-syms OdinsupDlg$(!STF_LANGUAGE)
  560.             ui start "ODINSUP" $(NwLibHandle)
  561.             ui pop 1
  562.     
  563.             ifstr(i) $(DLGEVENT) == "BACK"
  564.                 set AdapterSelected = ""
  565.             else
  566.                 Set AdapterSelected = *($(DefaultOdiTitle), 1)
  567.             endif
  568.  
  569.             Debug-Output "NWSUBS.INF: ODINSUP AdapterSelected = "$(AdapterSelected)
  570.  
  571.             Ifstr(i) $(AdapterSelected) == ""
  572.                 Debug-Output "NWSUBS.INF: Cancel Selected"
  573.                 Set CardToBindTo = *($(OdiCardList), 1)
  574.                 Set CardInstance = 1
  575.             Else
  576.                 Set CardToBindTo = *($(OdiCardList), ~($(OdiTitleList), $(AdapterSelected)))
  577.                 Debug-Output "CardToBindTo = "$(CardToBindTo)
  578.     
  579.                 Set NtAdapterNumber = *($(OdiNtNumberList), ~($(OdiTitleList), $(AdapterSelected)))
  580.                 Debug-Output "NtAdapterNumber = "$(NtAdapterNumber)
  581.     
  582.                 Set NtAdapterKeyName = $(NetworkCardsKeyName)"\"$(NtAdapterNumber)
  583.                 OpenRegKey $(!REG_H_LOCAL) "" $(NtAdapterKeyName) $(MAXIMUM_ALLOWED) KeyNtAdapter
  584.                 Ifstr(i) $(KeyNtAdapter) != ""
  585.     
  586.                     GetRegValue $(KeyNtAdapter),"ServiceName", ServiceNameList
  587.                     Set ServiceName = *($(ServiceNameList), 4)
  588.                     CloseRegKey $(KeyNtAdapter)
  589.     
  590.     
  591.                     ; Open the lan man card's service\Parameters.
  592.                     ;
  593.                     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  594.                     ifstr(i) $(KeyService) == ""
  595.     
  596.                         Debug-Output "NWSUBS.INF: NwSetIpxCard, Can't open "$(ServiceName)
  597.     
  598.                     Else
  599.                         ; Get the OdiLoad link.
  600.                         ;
  601.                         GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  602.                         Set CardInstanceName = *($(CardInstanceList), 4)
  603.                         CloseRegKey $(KeyService)
  604.         
  605.                         OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName)"\"$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  606.                         Ifstr(i) $(KeyOdiCard) != ""
  607.                             GetRegValue $(KeyOdiCard) "BoardInstance" BoardInstanceList
  608.                             Set CardInstance = *($(BoardInstanceList), 4)
  609.                             Debug-Output "2: Selected CardInstance = "$(CardInstance)
  610.                             CloseRegKey $(KeyOdiCard)
  611.                         Endif
  612.                     Endif
  613.                 Else
  614.                     Debug-Output "Can't open "$(NtAdapterKeyName)
  615.                 Endif
  616.             Endif
  617.         Else
  618.             ;
  619.             ; only one ODI adapter so use same card name as ipx.
  620.             ;
  621.             Debug-Output "NWSUBS.INF: ODISUP bound to "$(CardToBindTo)
  622.         Endif
  623.  
  624.  
  625.         SetRegValue $(KeyOdiNSupParameters) {$(OdiNSupCardName),$(NoTitle),$(!REG_VT_SZ),$(CardToBindTo)}
  626.         Ifstr(i) $(OdiCardInstance) == ""
  627.             Debug-Output "NWSUBS.INF: NwSetIpxCard, OdiCardInstance set to default."
  628.             Set OdiCardInstance = "1"
  629.         Endif
  630.         SetRegValue $(KeyOdiNSupParameters) {$(OdiNSupCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(OdiCardInstance)}
  631.  
  632.         CloseRegKey $(KeyOdiNSupParameters)
  633.     Endif
  634.  
  635.     FreeLibrary $(NwLibHandle)
  636.  
  637.  
  638.     return $(Result)
  639.  
  640.  
  641. ; ===================================================================================
  642. ;
  643. ; Remove an installed NetWare ODI Adapter.
  644. ;
  645. ; We start with the SOFTWARE\Windows NT\NetworkCards\## key name.    Open this key and
  646. ; get the 'ServiceName' link value, use this string to open the service\Parameters key
  647. ; for this adapter.    Get the OdiLoadName link value from service\Parameters and open
  648. ; this key.
  649. ;
  650. ; ===================================================================================
  651.  
  652. [NwRemoveAdapter]
  653.      Set LanManCardInstance = $($0)
  654.  
  655.      read-syms NwBaseVars
  656.      read-syms IpxVars
  657.      read-syms OdiVars
  658.      read-syms OdiNSupVars
  659.  
  660.      Set Result = NO_ERROR
  661.  
  662.      Debug-Output "NWSUBS.INF: ------------------------------------------------------"
  663.      Debug-Output "NWSUBS.INF: NwRemoveAdapter called with "$(LanManCardInstance)
  664.  
  665. ;    Open the lan man card.
  666. ;
  667.      OpenRegKey $(!REG_H_LOCAL) "" $(LanManCardInstance) $(MAXIMUM_ALLOWED) KeyLanManCard
  668.      Ifstr(i) $(KeyLanManCard) == ""
  669.  
  670.             Debug-Output "NWSUBS.INF: RemoveAdapter, Can't open "$(LanManCardInstance)
  671.  
  672.      Else
  673.  
  674. ;    Clear the OdiAdapter Flag so that this adapter does not show up on the
  675. ;         list of Odi adapters for Ipx to bind too.
  676. ;
  677.     SetRegValue $(KeyLanManCard) {OdiAdapter,$(NoTitle),$(!REG_VT_DWORD),0}
  678.  
  679. ;         Get the lanman cards service name link.
  680. ;
  681.             GetRegValue $(KeyLanManCard),"ServiceName", ServiceNameList
  682.             Set ServiceName = *($(ServiceNameList), 4)
  683.             CloseRegKey $(KeyLanManCard)
  684.  
  685.  
  686. ;         Open the lan man card's service\Parameters.
  687. ;
  688.             OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  689.     ifstr(i) $(KeyService) == ""
  690.  
  691.          Debug-Output "NWSUBS.INF: RemoveAdapter, Can't open "$(ServiceName)
  692.  
  693.     Else
  694. ;                Get the OdiLoad link.
  695. ;
  696.          GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  697.          Set CardInstanceName = *($(CardInstanceList), 4)
  698.          CloseRegKey $(KeyService)
  699.     
  700.          OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName) $(MAXIMUM_ALLOWED) KeyOdiModules
  701.          Ifstr(i) $(KeyOdiModules) == ""
  702.     
  703.         Debug-Output "NWSUBS.INF: RemoveAdapter, Can't open "$(OdiModulesName)
  704.     
  705.          Else
  706. ;
  707. ;                    Get the Board instance for the card being deleted before we delete it.
  708. ;
  709.  
  710.         OpenRegKey $(KeyOdiModules) "" $(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  711.         Ifstr(i) $(KeyOdiCard) == ""
  712.              Set Result = "Can't open card "$(CardInstanceName)
  713.              Debug-Output "NWSUBS.INF: NwRemoveAdapter, "$(Result)
  714.         Else
  715.              GetRegValue $(KeyOdiCard) "BoardInstance" InstanceValues
  716.              Set DeletedCardInstance = *($(InstanceValues), 4)
  717.              Debug-Output "NWSUBS.INF: Board Instance of Card being Removed = "$(DeletedCardInstance)
  718.              CloseRegKey $(KeyOdiCard)
  719.         Endif
  720. ;
  721. ; Delete the card from ODI Modules.
  722. ;
  723.         Debug-Output "NWSUBS.INF: Deleting card "$(CardInstanceName)
  724.         Debug-Output "NWSUBS.INF: From Key "$(OdiModuleName)
  725.  
  726.         DeleteRegTree $(KeyOdiModules) $(CardInstanceName)
  727.     
  728.         FlushRegKey $(KeyOdiModules)
  729.  
  730.         Shell "" NwSetCardInstance "" $(KeyOdiModules) "" ""
  731.  
  732.  
  733. ;        Check IpxSpx parameters to see if IpxSpx is bound to the
  734. ;                    adapter just removed or to a greater instance of this model of adapter.
  735. ;
  736.         OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  737.         Ifstr(i) $(KeyIpxParameters) == ""
  738.              Debug-Output "NWSUBS.INF: NwRemoveAdapter, Can't open "$(IpxParameters)
  739.         Else
  740. ;                         Get Ipx CardName and CardInstance
  741. ;
  742.              GetRegValue $(KeyIpxParameters) $(IpxCardName) TmpCardList
  743.              Set CurIpxCardName = *($(TmpCardList), 4)
  744.  
  745.              GetRegValue $(KeyIpxParameters) $(IpxCardInstance) TmpInstanceList
  746.              Set CurIpxCardInstance = *($(TmpInstanceList), 4)
  747.  
  748.              GetRegValue $(KeyIpxParameters) $(IpxNtCardInstance) TmpNtInstanceList
  749.              Set NtAdapterNumber = *($(TmpNtInstanceList), 4)
  750.  
  751.              Debug-Output "NWSUBS.INF: CurIpxCardName        -- "$(CurIpxCardName)
  752.              Debug-Output "                CurIpxCardInstance -- "$(CurIpxCardInstance)
  753.              Debug-Output "                NtAdapterNumber     -- "$(NtAdapterNumber)
  754.  
  755. ;                         Get the base name of the ODI Module being removed.
  756. ;
  757.              Split-String $(CardInstanceName) " " CardInstanceValues
  758.              Set CardBaseName = *($(CardInstanceValues), 1)
  759.              Debug-Output "NWSUBS.INF: CardBaseName = "$(CardBaseName)
  760.  
  761.              Ifstr(i) $(CardBaseName) == $(CurIpxCardName)
  762.                     Debug-Output "NWSUBS.INF: Ipx bound to a card with the same name: "$(CardBaseName)
  763.  
  764.             Ifint $(DeletedCardInstance) < $(CurIpxCardInstance)
  765.                  Debug-Output "NWSUBS.INF: Existing Board Instance Okay"
  766.             Else-Ifint $(DeletedCardInstance) == $(CurIpxCardInstance)
  767.                  Debug-Output "NWSUBS.INF: The board Ipx was bound to has been removed."
  768.                                 Shell $(NwSubsInf) GetOdiAdapterList
  769.  
  770.                                      Set OdiTitleList        = $($R0)
  771.                                 Set OdiCardList         = $($R1)
  772.                  Set OdiNtNumberList    = $($R2)
  773.                  Set NumberOdiAdapters = $($R3)
  774.  
  775.                                 Debug-Output "NWSUBS.INF: OdiTitleList = "$(OdiTitleList)
  776.                                 Debug-Output "NWSUBS.INF: OdiCardList    = "$(OdiCardList)
  777.                                      Debug-Output "NWSUBS.INF: R2                = "$($R2)
  778.                                      Debug-Output "NWSUBS.INF: NumberOdiAdapters = "$(NumberOdiAdapters)
  779.  
  780.                  Set ReBind = FALSE
  781.  
  782.                         LoadLibrary "NetWare for Windows NT" nwsetup.dll NwLibHandle
  783.                         SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\english\nwnthelp.hlp" $(!MinimumID) $(!MaximumID)
  784.  
  785.                   Ifint $(NumberOdiAdapters) < 1
  786.                         Debug-Output "NWSUBS.INF: No ODI Adapters Installed."
  787.                  Else-Ifint $(NumberOdiAdapters) == 1
  788.                         Set CardToBindTo = *($(OdiCardList), 1)
  789.                         Set CardInstance = 1
  790.                                     Set NtAdapterNumber = *($(OdiNtNumberList), 1)
  791.                         Debug-Output "NWSUBS.INF: Only one ODI Adapter Installed "$(CardToBindTo)
  792.                 Set ReBind = TRUE;
  793.                 Else
  794.                         ;
  795.                         ; More than one ODI adapter is installed so allow
  796.                         ; the user to select which one to bind to.
  797.                         ;
  798.  
  799.  
  800.                         Ifstr(i) $(OdiCurBindCardName) != ""
  801.                             Debug-Output "NWSUBS.INF: OdiCurBindCardName = "$(OdiCurBindCardName)
  802.                             Set DefaultOdiTitle = *($(OdiTitleList), ~($(OdiCardList), $(OdiCurBindCardName)))
  803.                         Endif
  804.             
  805.                         Ifstr(i) $(DefaultOdiTitle) == ""
  806.                             Set DefaultOdiTitle = *($(OdiTitleList), 1)
  807.                         Endif
  808.             
  809.                         Debug-Output "NWSUBS.INF: DefaultOdiTitle = "$(DefaultOdiTitle)
  810.  
  811.                   read-syms IPXBindDlg$(!STF_LANGUAGE)
  812.                         ui start "IPXBIND" $(NwLibHandle)
  813.                         ui pop 1
  814.  
  815.                         ifstr(i) $(DLGEVENT) == "BACK"
  816.                             set AdapterSelected = ""
  817.                         else
  818.                             Set AdapterSelected = *($(DefaultOdiTitle), 1)
  819.                         endif
  820.  
  821.                         Debug-Output "NWSUBS.INF: AdapterSelected = "$(AdapterSelected)
  822.                         Ifstr(i) $(AdapterSelected) == ""
  823.                             Debug-Output "NWSUBS.INF: Cancel Selected"
  824.                             Set CardToBindTo = *($(OdiCardList), 1)
  825.                             Set CardInstance = 1
  826.                             Set NtAdapterNumber = *($(OdiNtNumberList), 1)
  827.                         Else
  828.                             Set CardToBindTo = *($(OdiCardList), ~($(OdiTitleList), $(AdapterSelected)))
  829.                             Debug-Output "CardToBindTo = "$(CardToBindTo)
  830.  
  831.                             Set NtAdapterNumber = *($(OdiNtNumberList), ~($(OdiTitleList), $(AdapterSelected)))
  832.                             Debug-Output "NtAdapterNumber = "$(NtAdapterNumber)
  833.  
  834.                             Set NtAdapterKeyName = $(NetworkCardsKeyName)"\"$(NtAdapterNumber)
  835.                             OpenRegKey $(!REG_H_LOCAL) "" $(NtAdapterKeyName) $(MAXIMUM_ALLOWED) KeyNtAdapter
  836.                             Ifstr(i) $(KeyNtAdapter) != ""
  837.  
  838.                                 GetRegValue $(KeyNtAdapter),"ServiceName", ServiceNameList
  839.                                 Set ServiceName = *($(ServiceNameList), 4)
  840.                                 CloseRegKey $(KeyNtAdapter)
  841.             
  842.                                  ; Open the lan man card's service\Parameters.
  843.                                  ;
  844.                                 OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  845.                                 ifstr(i) $(KeyService) == ""
  846.             
  847.                                     Debug-Output "NWSUBS.INF: RemoveAdapter, Can't open "$(ServiceName)
  848.                                 Else
  849.                                         ; Get the OdiLoad link.
  850.                                         ;
  851.                                     GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  852.                                     Set TmpCardInstanceName = *($(CardInstanceList), 4)
  853.                                     CloseRegKey $(KeyService)
  854.                 
  855.                                     OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName)"\"$(TmpCardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  856.                                     Ifstr(i) $(KeyOdiCard) != ""
  857.                                         GetRegValue $(KeyOdiCard) "BoardInstance" BoardInstanceList
  858.                                         Set CardInstance = *($(BoardInstanceList), 4)
  859.                                         Debug-Output "Selected CardInstance = "$(CardInstance)
  860.                                         CloseRegKey $(KeyOdiCard)
  861.                                     Endif
  862.                                 Endif
  863.                             Else
  864.                                 Debug-Output "Can't open "$(NtAdapterKeyName)
  865.                             Endif
  866.                         Endif
  867.             
  868.                 Set ReBind = TRUE
  869.                 Endif
  870.                  Ifstr(i) $(ReBind) == TRUE
  871.                         SetRegValue $(KeyIpxParameters) {$(IpxCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(CardInstance)}
  872.                                 SetRegValue $(KeyIpxParameters) {$(IpxCardName),$(NoTitle),$(!REG_VT_SZ),$(CardToBindTo)}
  873.                 SetRegValue $(KeyIpxParameters) {$(IpxNtCardInstance),$(NoTitle),$(!REG_VT_SZ),$(NtAdapterNumber)}
  874.                 Shell "" NwSetFrameType $(CardToBindTo) $(NtAdapterNumber) $(NwLibHandle)
  875.  
  876.                 Set GUIResult = $($R0)
  877.                 Ifstr(i) $(GUIResult) != ""
  878.                                          SetRegValue $(KeyIpxParameters) {"FrameType",$(NoTitle),$(!REG_VT_SZ),$(GUIResult)}
  879.                 Endif
  880.                  Endif
  881.  
  882.                         FreeLibrary $(NwLibHandle)
  883.  
  884.                     Else
  885.                         Set-sub CardInstance = $(DeletedCardInstance), 1
  886.                         Debug-Output "NWSUBS.INF: Need to change board instance "$(CardInstance)
  887.                         SetRegValue $(KeyIpxParameters) {$(IpxCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(CardInstance)}
  888.                 SetRegValue $(KeyIpxParameters) {$(IpxNtCardInstance),$(NoTitle),$(!REG_VT_SZ),$(NtAdapterNumber)}
  889.                     Endif
  890.  
  891.              Else
  892.                     Debug-Output "NWSUBS.INF: Ipx NOT bound to a card with this name : "$(CardBaseName)
  893.              Endif
  894.  
  895.  
  896.              CloseRegKey $(KeyIpxParameters)
  897.         Endif
  898.     
  899.                      ; Find the ODINSUPXX service name
  900.                      ;
  901.  
  902.                      OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) $(MAXIMUM_ALLOWED) NetCardsKey
  903.  
  904.                      Ifstr(i) $(NetCardsKey) != ""
  905.                          EnumRegKey $(NetCardsKey) NetCardsList
  906.                          Debug-Output "NetCardsList = "$(NetCardsList)
  907.                          ForListDo $(NetCardsList)
  908.                                 Set CardNumber = *($($), 1)
  909.                                 Debug-Output "CardNumber = "$(CardNumber)
  910.                                 OpenRegKey $(NetCardsKey) "" $(CardNumber) $(MAXIMUM_ALLOWED) KeyCardNumber
  911.                                 Ifstr(i) $(KeyCardNumber) != ""
  912.                              GetRegValue $(KeyCardNumber), "ProductName", ProductNameList
  913.                              Set ProductName = *($(ProductNameList), 4)
  914.                              Debug-Output "ProductName = "$(ProductName)
  915.                              Ifstr(i) $(ProductName) == "ODINSUP"
  916.                                     GetRegValue $(KeyCardNumber), "ServiceName", ServiceNameList
  917.                                     Set ServiceName = *($(ServiceNameList), 4)
  918.                                     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyOdiNSupParameters
  919.                              Endif
  920.                  CloseRegKey $(KeyCardNumber)
  921.                                 Endif
  922.                          EndForListDo
  923.              CloseRegKey $(NetCardsKey)
  924.                      Endif
  925.         ;
  926.         ; Check to see if ODINSUP was bound too this card.
  927.         ;
  928. ;                     OpenRegKey $(!REG_H_LOCAL) "" $(OdiNSupParameters) $(MAXIMUM_ALLOWED) KeyOdiNSupParameters
  929.  
  930.         Ifstr(i) $(KeyOdiNSupParameters) != ""
  931.              GetRegValue $(KeyOdiNSupParameters) $(OdiNSupCardName) TmpCardList
  932.              Set CurOdiNSupCardName = *($(TmpCardList), 4)
  933.              Debug-Output "NWSUBS.INF: CurOdiNSupCardName = "$(CurOdiNSupCardName)
  934.  
  935.              GetRegValue $(KeyOdiNSupParameters) $(OdiNSupCardInstance) TmpInstanceList
  936.              Set CurOdiNSupCardInstance = *($(TmpInstanceList), 4)
  937.              Debug-Output "NWSUBS.INF: CurOdiNSupCardInstance = "$(CurOdiNSupCardInstance)
  938.  
  939.  
  940. ;                         Get the base name of the ODI Module being removed.
  941. ;
  942.              Split-String $(CardInstanceName) " " CardInstanceValues
  943.              Set CardBaseName = *($(CardInstanceValues), 1)
  944.              Debug-Output "NWSUBS.INF: CardBaseName = "$(CardBaseName)
  945.  
  946.              Ifstr(i) $(CardBaseName) == $(CurOdiNSupCardName)
  947.                     Debug-Output "NWSUBS.INF: ODINSUP bound to a card with the same name: "$(CardBaseName)
  948.  
  949.             Ifint $(DeletedCardInstance) < $(CurOdiNSupCardInstance)
  950.                  Debug-Output "NWSUBS.INF: Existing Board Instance Okay"
  951.             Else-Ifint $(DeletedCardInstance) == $(CurOdiNSupCardInstance)
  952.                  Debug-Output "NWSUBS.INF: The board ODINSUP was bound to has been removed."
  953.                                 Shell $(NwSubsInf) GetOdiAdapterList
  954.  
  955.                                      Set OdiTitleList        = $($R0)
  956.                                 Set OdiCardList         = $($R1)
  957.                  Set OdiNtNumberList    = $($R2)
  958.                  Set NumberOdiAdapters = $($R3)
  959.  
  960.                                 Debug-Output "NWSUBS.INF: OdiTitleList = "$(OdiTitleList)
  961.                                 Debug-Output "NWSUBS.INF: OdiCardList    = "$(OdiCardList)
  962.                                      Debug-Output "NWSUBS.INF: R2                = "$($R2)
  963.                                      Debug-Output "NWSUBS.INF: NumberOdiAdapters = "$(NumberOdiAdapters)
  964.  
  965.                  Set CardInstance = $(DeletedCardInstance)
  966.  
  967.                  Set ReBind = FALSE
  968.  
  969.                   Ifint $(NumberOdiAdapters) < 1
  970.                         Debug-Output "NWSUBS.INF: No ODI Adapters Installed."
  971.                  Else-Ifint $(NumberOdiAdapters) == 1
  972.                         Set CardToBindTo = *($(OdiCardList), 1)
  973.                         Set CardInstance = 1
  974.                         Debug-Output "NWSUBS.INF: Only one ODI Adapter Installed "$(CardToBindTo)
  975.                 Set ReBind = TRUE;
  976.                  Else
  977.                         ;
  978.                         ; More than one ODI adapter is installed so allow
  979.                         ; the user to select which one to bind to.
  980.                         ;
  981.  
  982.  
  983.                         LoadLibrary "NetWare for Windows NT" nwsetup.dll NwLibHandle
  984.                         SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\english\nwnthelp.hlp" $(!MinimumID) $(!MaximumID)
  985.             
  986.                         Ifstr(i) $(OdiCurBindCardName) != ""
  987.                             Debug-Output "NWSUBS.INF: OdiCurBindCardName = "$(OdiCurBindCardName)
  988.                             Set DefaultOdiTitle = *($(OdiTitleList), ~($(OdiCardList), $(OdiCurBindCardName)))
  989.                         Endif
  990.             
  991.                         Ifstr(i) $(DefaultOdiTitle) == ""
  992.                             Set DefaultOdiTitle = *($(OdiTitleList), 1)
  993.                         Endif
  994.             
  995.                         Debug-Output "NWSUBS.INF: DefaultOdiTitle = "$(DefaultOdiTitle)
  996.             
  997.                         read-syms OdinsupDlg$(!STF_LANGUAGE)
  998.                         ui start "ODINSUP" $(NwLibHandle)
  999.                         ui pop 1
  1000.     
  1001.                         ifstr(i) $(DLGEVENT) == "BACK"
  1002.                             set AdapterSelected = ""
  1003.                         else
  1004.                             Set AdapterSelected = *($(DefaultOdiTitle), 1)
  1005.                         endif
  1006.  
  1007.                         Debug-Output "NWSUBS.INF: AdapterSelected = "$(AdapterSelected)
  1008.  
  1009.                         Ifstr(i) $(AdapterSelected) == ""
  1010.                             Debug-Output "NWSUBS.INF: Cancel Selected"
  1011.                             Set CardToBindTo = *($(OdiCardList), 1)
  1012.                             Set CardInstance = 1
  1013.                         Else
  1014.                             Set CardToBindTo = *($(OdiCardList), ~($(OdiTitleList), $(AdapterSelected)))
  1015.                             Debug-Output "CardToBindTo = "$(CardToBindTo)
  1016.  
  1017.                             Set NtAdapterNumber = *($(OdiNtNumberList), ~($(OdiTitleList), $(AdapterSelected)))
  1018.                             Debug-Output "NtAdapterNumber = "$(NtAdapterNumber)
  1019.  
  1020.                             Set NtAdapterKeyName = $(NetworkCardsKeyName)"\"$(NtAdapterNumber)
  1021.                             OpenRegKey $(!REG_H_LOCAL) "" $(NtAdapterKeyName) $(MAXIMUM_ALLOWED) KeyNtAdapter
  1022.                             Ifstr(i) $(KeyNtAdapter) != ""
  1023.  
  1024.                                 GetRegValue $(KeyNtAdapter),"ServiceName", ServiceNameList
  1025.                                 Set ServiceName = *($(ServiceNameList), 4)
  1026.                                 CloseRegKey $(KeyNtAdapter)
  1027.                                  ; Open the lan man card's service\Parameters.
  1028.                                  ;
  1029.                             OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  1030.                             ifstr(i) $(KeyService) == ""
  1031.             
  1032.                                 Debug-Output "NWSUBS.INF: RemoveAdapter, Can't open "$(ServiceName)
  1033.             
  1034.                             Else
  1035.                                         ; Get the OdiLoad link.
  1036.                                         ;
  1037.                                 GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  1038.                                 Set TmpCardInstanceName = *($(CardInstanceList), 4)
  1039.                                 CloseRegKey $(KeyService)
  1040.                 
  1041.                                 OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName)"\"$(TmpCardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  1042.                          Ifstr(i) $(KeyOdiCard) != ""
  1043.                                 GetRegValue $(KeyOdiCard) "BoardInstance" BoardInstanceList
  1044.                         Set CardInstance = *($(BoardInstanceList), 4)
  1045.                         Debug-Output "Selected CardInstance = "$(CardInstance)
  1046.                                 CloseRegKey $(KeyOdiCard)
  1047.                          Endif
  1048.  
  1049.  
  1050.                             Endif
  1051.                      Else
  1052.                             Debug-Output "Can't open "$(NtAdapterKeyName)
  1053.                      Endif
  1054.  
  1055.                 Endif
  1056.             
  1057.                         FreeLibrary $(NwLibHandle)
  1058.  
  1059.                 Set ReBind = TRUE
  1060.                  Endif
  1061.  
  1062.                  Ifstr(i) $(ReBind) == TRUE
  1063.                                     SetRegValue $(KeyOdiNSupParameters) {$(OdiNSupCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(CardInstance)}
  1064.                              SetRegValue $(KeyOdiNSupParameters) {$(OdiNSupCardName),$(NoTitle),$(!REG_VT_SZ),$(CardToBindTo)}
  1065.                  Endif
  1066.                     Else
  1067.                         Set-sub CardInstance = $(DeletedCardInstance), 1
  1068.                         Debug-Output "NWSUBS.INF: Need to change board instance "$(CardInstance)
  1069.                         SetRegValue $(KeyOdiNSupParameters) {$(OdiNSupCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(CardInstance)}
  1070.                     Endif
  1071.  
  1072.              Else
  1073.                     Debug-Output "NWSUBS.INF: Ipx NOT bound to a card with this name : "$(CardBaseName)
  1074.              Endif
  1075.  
  1076.  
  1077.              CloseRegKey $(KeyOdiNSupParameters)
  1078.  
  1079.                      Endif
  1080.  
  1081.         FlushRegKey $(KeyOdiModules)
  1082.         CloseRegKey $(KeyOdiModules)
  1083.     
  1084.          Endif
  1085.     Endif
  1086.  
  1087.      Endif
  1088.  
  1089.  
  1090. Exit_RemoveAdapter = +
  1091.      Debug-Output "NWSUBS.INF: ------------------------------------------------------"
  1092.  
  1093.      return $(Result)
  1094.  
  1095. ; ===================================================================================
  1096. ;
  1097. ; Add an Odi Load Module and set its Parameters.
  1098. ;
  1099. ; ===================================================================================
  1100.  
  1101. [NwAddOdiLoadModule]
  1102.      read-syms NwBaseVars
  1103.      read-syms IpxVars
  1104.      read-syms OdiVars
  1105.  
  1106.      Set CardInstanceName = $($0)
  1107.      Set AdapterNumber     = $($1)
  1108.      Set OdiParmList        = $($2)
  1109.  
  1110.      Set Result = "NO_ERROR"
  1111.  
  1112.      OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(DriverName) $(MAXIMUM_ALLOWED) KeyOdiLoad
  1113.      Ifstr $(KeyOdiLoad) == $(KeyNull)
  1114.             set Result = CANNOT_FIND_COMPONENT_SERVICE
  1115.             Debug-Output "NWSUBS.INF: Cannot open service "$(DriverName)
  1116.             goto Exit_AddOdiLoadModule
  1117.      Endif
  1118.  
  1119.      Set KeyOdiCard = $(KeyNull)
  1120.      Debug-Output "NWSUBS.INF: CardInstanceName = "$(CardInstanceName)
  1121.  
  1122. ;
  1123. ; Try to create Odi_Modules registry key.    If this fails try to open the key.
  1124. ; If this fails exit.
  1125. ;
  1126.      CreateRegKey $(KeyOdiLoad) {$(OdiModules),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiModules
  1127.      Ifstr(i) $(KeyOdiModules) == $(KeyNull)
  1128.             OpenRegKey $(KeyOdiLoad) "" $(OdiModules) $(MAXIMUM_ALLOWED) KeyOdiModules
  1129.             Ifstr(i) $(KeyOdiLoad) == $(KeyNull)
  1130.                 set Result = CANNOT_FIND_COMPONENT_SERVICE
  1131.                 Debug-Output "Cannot find "$(DriverName)"\"$(OdiModules)
  1132.                 CloseRegKey $(KeyOdiLoad)
  1133.                 goto Exit_AddOdiLoadModule
  1134.             Endif
  1135.      Endif
  1136.  
  1137.      Ifstr(i) $(AdapterNumber) != ""
  1138.             ;    This adapter was just installed; allow creation of the #nn key
  1139.             CreateRegKey $(KeyOdiModules) {$(CardInstanceName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiCard
  1140.      Endif
  1141.  
  1142.      Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  1143.             ;
  1144.             ;    This is either an old card, or a prior version of the key existed.
  1145.             ;
  1146.             OpenRegKey $(KeyOdiModules) "" $(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  1147.             Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  1148.                 Set Result = CANNOT_FIND_COMPONENT_SERVICE
  1149.                 Debug-Output "NWSUBS.INF: Can't Open "$(CardInstanceName)
  1150.                 CloseRegKey $(KeyOdiLoad)
  1151.                 CloseRegKey $(KeyOdiModules)
  1152.                 goto Exit_AddOdiLoadModule
  1153.             Endif
  1154.      Endif
  1155.  
  1156.      SetRegValue $(KeyOdiCard) {"Parameters",$(NoTitle),$(!REG_VT_MULTI_SZ),$(OdiParmList)}
  1157.  
  1158.      FlushRegKey $(KeyOdiCard)
  1159.  
  1160. ;
  1161. ; flush the Odi_Modules key so that the card we just added will show up in the enum
  1162. ;
  1163.  
  1164.      FlushRegKey $(KeyOdiModules)
  1165.  
  1166.      FlushRegKey $(KeyOdiLoad)
  1167.  
  1168.      Shell "" NwSetCardInstance $(KeyOdiLoad) $(KeyOdiModules) $(KeyOdiCard) $(CardInstanceName)
  1169.  
  1170.      Set Result = $($R0)
  1171.  
  1172.      CloseRegKey $(KeyOdiCard)
  1173.  
  1174.      CloseRegKey $(KeyOdiModules)
  1175.  
  1176.      FlushRegKey $(KeyOdiLoad)
  1177.      CloseRegKey $(KeyOdiLoad)
  1178.  
  1179.      Ifstr(i) $(Result) != NO_ERROR
  1180.             Debug-Output "NWSUBS.INF: SetCardInstance "$(Result)
  1181.             goto Exit_AddOdiLoadModule
  1182.      Endif
  1183.  
  1184.      Set OdiCardInstance = $($R1)
  1185.  
  1186.      Debug-Output "OdiCardInstance = "$(OdiCardInstance)
  1187.  
  1188. ;
  1189. ; Update the card name and card instance in IpxSpx to be the last card installed
  1190. ;
  1191. ;     Shell "" NwSetIpxCard $(CardInstanceName) $(OdiCardInstance)
  1192. ;
  1193. ;     Set Result = $($R0)
  1194. ;     Ifstr(i) $(Result) != NO_ERROR
  1195. ;            Debug-Output "NWSUBS.INF: NwSetIpxCard "$(Result)
  1196. ;            goto Exit_AddOdiLoadModule
  1197. ;     Endif
  1198.  
  1199. Exit_AddOdiLoadModule = +
  1200.  
  1201.      return $(Result)
  1202. ;
  1203. ; Remove the Nt Adapter Info.
  1204. ;
  1205. ;
  1206.  
  1207. [NwRemoveNtAdapter]
  1208.      read-syms NwBaseVars
  1209.      read-syms IpxVars
  1210.      read-syms OdiVars
  1211.  
  1212.      Set ProductKeyName = $($0)
  1213.      Set Manufacturer    = $($1)
  1214.      Set NetCardName     = $($2)
  1215.  
  1216.      Ifstr(i) $(NetCardName) == ""
  1217.             set NetCardName = $(!NTN_RegBase)
  1218.      Endif
  1219.  
  1220.      Debug-Output "NWSUBS.INF: NwRemoveNtAdapter, NTN_RegBase = "$(!NTN_RegBase)
  1221.      Debug-Output "NWSUBS.INF: ProductKeyName = "$(ProductKeyName)
  1222.      Debug-Output "NWSUBS.INF: Manufacturer = "$(Manufacturer)
  1223.      Debug-Output "NWSUBS.INF: NetCardName = "$(NetCardName)
  1224.  
  1225. ; ===================================================================================
  1226. ;
  1227. ; Increment the OdiLoad reference count so OdiLoad is not removed as a
  1228. ; service.
  1229. ;
  1230. ; ===================================================================================
  1231.  
  1232.      Shell $(UtilityInf), IncrementRefCount, $(ProductKeyName) $(Manufacturer)
  1233.      Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1234.             Debug-Output "NWSUBS.INF: IncrementRefCount ShellCode error "$($ShellCode)
  1235.             Set Result = "SHELL_CODE_ERROR"
  1236.             goto Exit_RemoveNtAdapter
  1237.      Endif
  1238.  
  1239.      set Result = $($R0)
  1240.  
  1241. ;     Ifstr(i) $(Result) != NO_ERROR
  1242. ;            Debug-Output "NWSUBS.INF: IncrementRefCount "$(ProductKeyName)": "$(Result)
  1243. ;            goto Exit_RemoveNtAdapter
  1244. ;     Endif
  1245.  
  1246.      Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1247.                 $(DriverName), $(NetCardName)
  1248.      ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1249.             Debug-Output "NWSUBS.INF: RemoveHardwareComponent ShellCode error "$($ShellCode)
  1250.             Set Result = "SHELL_CODE_ERROR"
  1251.             goto Exit_RemoveNtAdapter
  1252.      endif
  1253.  
  1254.      set Result = $($R0)
  1255.  
  1256.      Ifstr(i) $(Result) != NO_ERROR
  1257.             Debug-Output "NWSUBS.INF: RemoveHardwareComponent "$(Result)
  1258.     Shell "" ReallyRemoveHardwareComponent $(Manufacturer), +
  1259.              $(DriverName), $(!NTN_RegBase)
  1260.      endif
  1261.  
  1262. ; Decrement the reference count so OdiLoad can be removed when all the
  1263. ; ODI adapters have been removed.
  1264. ;
  1265.      Shell $(UtilityInf), DecrementRefCount, $(ProductKeyName)
  1266.      Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1267.             Debug-Output "NWSUBS.INF: DecrementRefCount ShellCode error "$($ShellCode)
  1268.             Set Result = "SHELL_CODE_ERROR"
  1269.             goto Exit_RemoveNtAdapter
  1270.      Endif
  1271.  
  1272.      set Result = $($R0)
  1273.  
  1274. ;     Ifstr(i) $(Result) != NO_ERROR
  1275. ;            Debug-Output "NWSUBS.INF: DecrementRefCount "$(Result)
  1276. ;            goto Exit_RemoveNtAdapter
  1277. ;     Endif
  1278.  
  1279. Exit_RemoveNtAdapter = +
  1280.  
  1281.      return $(Result)
  1282. ;
  1283. ; Select the card Ipx is bound to.
  1284. ;
  1285. ;
  1286.  
  1287. [NwSelectIpxCard]
  1288.     Set OdiCardName = $($0)
  1289.     Set OdiCardInstance = $($1)
  1290.     Set AlwaysPromptUser = $($2)
  1291.  
  1292.     Debug-Output "OdiCardName            "$(OdiCardName)
  1293.     Debug-Output "OdiCardInstance     "$(OdiCardInstance)
  1294.     Debug-Output "AlwaysPromptUser    "$(AlwaysPromptUser)
  1295.  
  1296.     read-syms NwBaseVars
  1297.     read-syms IpxVars
  1298.     read-syms OdiVars
  1299.     read-syms OdiNSupVars
  1300.  
  1301.     Set Result = NO_ERROR
  1302.  
  1303.     Shell $(NwSubsInf) GetOdiAdapterList
  1304.  
  1305.     Set OdiTitleList        = $($R0)
  1306.     Set OdiCardList         = $($R1)
  1307.     Set OdiNtNumberList    = $($R2)
  1308.     Set NumberOdiAdapters = $($R3)
  1309.  
  1310.     Set DoDialog = FALSE;
  1311.     Ifint $(NumberOdiAdapters) > 1
  1312.         Set DoDialog = TRUE
  1313.     Endif
  1314.     Ifstr(i) $(AlwaysPromptUser) == TRUE
  1315.         Set DoDialog = TRUE
  1316.     Endif
  1317.  
  1318.     Ifstr(i) $(DoDialog) == TRUE
  1319.         ;
  1320.         ; More than one ODI adapter is installed so allow
  1321.         ; the user to select which one to bind to.
  1322.         ;
  1323.  
  1324.         LoadLibrary "NetWare for Windows NT" nwsetup.dll NwLibHandle
  1325.         SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\english\nwnthelp.hlp" $(!MinimumID) $(!MaximumID)
  1326.  
  1327.         Ifstr(i) $(OdiCardName) == ""
  1328.             OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  1329.             Ifstr(i) $(KeyIpxParameters) != ""
  1330.                 GetRegValue $(KeyIpxParameters) $(IpxCardName) TmpCardList
  1331.                 Set OdiCardName = *($(TmpCardList), 4)
  1332.                 GetRegValue $(KeyIpxParameters) $(IpxCardInstance) TmpInstanceList
  1333.                 Set OdiCardInstance = *($(TmpInstanceList), 4)
  1334.                 GetRegValue $(KeyIpxParameters) $(IpxNtCardInstance) TmpNtInstanceList
  1335.                 Set NtAdapterNumber = *($(TmpNtInstanceList), 4)
  1336.                 Debug-Output "Ipx Currently bound too "$(OdiCardName)
  1337.                 Debug-Output "                                "$(OdiCardInstance)
  1338.                 Debug-Output "Nt Card Instance            "$(NtAdapterNumber)
  1339.                 Debug-Output $(OdiTitleList)
  1340.                 Debug-Output $(OdiCardList)
  1341.                 Debug-Output $(OdiNtNumberList)
  1342.                 CloseRegKey $(KeyIpxParameters)
  1343.             Endif
  1344.         Endif
  1345.     
  1346.         Ifstr(i) $(NtAdapterNumber) != ""
  1347.             Set DefaultOdiTitle = *($(OdiTitleList), ~($(OdiNtNumberList), $(NtAdapterNumber)))
  1348.         Endif
  1349.     
  1350.         Ifstr(i) $(DefaultOdiTitle) == ""
  1351.              Set DefaultOdiTitle = *($(OdiTitleList), 1)
  1352.         Endif
  1353.     
  1354.         Debug-Output "NWSUBS.INF: NwSelectIpxCard DefaultOdiTitle = "$(DefaultOdiTitle)
  1355.     
  1356.         read-syms IPXBindDlg$(!STF_LANGUAGE)
  1357.         ui start "IPXBIND" $(NwLibHandle)
  1358.         ui pop 1
  1359.         
  1360.         ifstr(i) $(DLGEVENT) == "BACK"
  1361.             set AdapterSelected = ""
  1362.         else
  1363.             Set AdapterSelected = *($(DefaultOdiTitle), 1)
  1364.         endif
  1365.     
  1366.         Debug-Output "NWSUBS.INF: AdapterSelected = "$(AdapterSelected)
  1367.     
  1368.         Ifstr(i) $(AdapterSelected) == ""
  1369.             Debug-Output "NWSUBS.INF: Cancel Selected"
  1370.             Set CardToBindTo = *($(OdiCardList), 1)
  1371.             Set CardInstance = 1
  1372.         Else
  1373.             Set CardToBindTo = *($(OdiCardList), ~($(OdiTitleList), $(AdapterSelected)))
  1374.             Debug-Output "CardToBindTo = "$(CardToBindTo)
  1375.     
  1376.             Set NtAdapterNumber = *($(OdiNtNumberList), ~($(OdiTitleList), $(AdapterSelected)))
  1377.             Debug-Output "3: NtAdapterNumber = "$(NtAdapterNumber)
  1378.     
  1379.             Set NtAdapterKeyName = $(NetworkCardsKeyName)"\"$(NtAdapterNumber)
  1380.             OpenRegKey $(!REG_H_LOCAL) "" $(NtAdapterKeyName) $(MAXIMUM_ALLOWED) KeyNtAdapter
  1381.             Ifstr(i) $(KeyNtAdapter) != ""
  1382.                 GetRegValue $(KeyNtAdapter),"ServiceName", ServiceNameList
  1383.                 Set ServiceName = *($(ServiceNameList), 4)
  1384.                 CloseRegKey $(KeyNtAdapter)
  1385.     
  1386.     
  1387.                 ; Open the lan man card's service\Parameters.
  1388.                 ;
  1389.                 OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  1390.                 Ifstr(i) $(KeyService) == ""
  1391.     
  1392.                     Debug-Output "NWSUBS.INF: NwSelectIpxCard, Can't open "$(ServiceName)
  1393.     
  1394.                 Else
  1395.                     ; Get the OdiLoad link.
  1396.                     ;
  1397.                     GetRegValue $(KeyService) $(OdiLinkName) CardInstanceList
  1398.                     Set CardInstanceName = *($(CardInstanceList), 4)
  1399.                     CloseRegKey $(KeyService)
  1400.         
  1401.                     OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName)"\"$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  1402.                     Ifstr(i) $(KeyOdiCard) != ""
  1403.                         GetRegValue $(KeyOdiCard) "BoardInstance" BoardInstanceList
  1404.                         Set CardInstance = *($(BoardInstanceList), 4)
  1405.                         Debug-Output "3: Selected CardInstance = "$(CardInstance)
  1406.                         CloseRegKey $(KeyOdiCard)
  1407.                     Endif
  1408.     
  1409.                 Endif
  1410.             Else
  1411.                 Debug-Output "Can't open "$(NtAdapterKeyName)
  1412.             Endif
  1413.     
  1414.         Endif
  1415.  
  1416.     Else
  1417.         Debug-Output "SelectIpxCard OdiCardList = "$(OdiCardList)
  1418.  
  1419.         Split-String $(OdiCardName) " " CardNameParts
  1420.         Set CardToBindTo = *($(CardNameParts),1)
  1421.     Endif
  1422.  
  1423.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  1424.     Ifstr(i) $(KeyIpxParameters) == ""
  1425.         Set Result = "Can't open IpxSpx service."
  1426.         Debug-Output "NWSUBS.INF: "$(Result)
  1427.     Else
  1428.         SetRegValue $(KeyIpxParameters) {$(IpxCardName),$(NoTitle),$(!REG_VT_SZ),$(CardToBindTo)}
  1429.         Ifstr(i) $(OdiCardInstance) == ""
  1430.             Debug-Output "NWSUBS.INF: NwSelectIpxCard, OdiCardInstance set to default."
  1431.             Set OdiCardInstance = "1"
  1432.         Endif
  1433.         SetRegValue $(KeyIpxParameters) {$(IpxCardInstance),$(NoTitle),$(!REG_VT_DWORD),$(OdiCardInstance)}
  1434.         SetRegValue $(KeyIpxParameters) {$(IpxNtCardInstance),$(NoTitle),$(!REG_VT_SZ),$(NtAdapterNumber)}
  1435.         Shell "" NwSetFrameType $(CardToBindTo) $(NtAdapterNumber) $(NwLibHandle)
  1436.  
  1437.         Set GUIResult = $($R0)
  1438.         Ifstr(i) $(GUIResult) != ""
  1439.             SetRegValue $(KeyIpxParameters) {"FrameType",$(NoTitle),$(!REG_VT_SZ),$(GUIResult)}
  1440.         Endif
  1441.         CloseRegKey $(KeyIpxParameters)
  1442.     Endif
  1443.  
  1444.     return $(Result)
  1445.  
  1446. [ReallyRemoveHardwareComponent]
  1447.      read-syms NwBaseVars
  1448.      Set Result = "NO_ERROR"
  1449.  
  1450.      Set Manufacturer = $($0)
  1451.      Set DriverName    = $($1)
  1452.      Set AdapterName    = $($2)
  1453.      set DriverKey    = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DriverName)"\CurrentVersion"
  1454.  
  1455.      Split-String $(AdapterName), "\", AdapterPathList
  1456.  
  1457.      Set AdapterNumber = *($(AdapterPathList),11)
  1458.      Set NetCardsBase    = *($(AdapterPathList),1)*($(AdapterPathList),2)*($(AdapterPathList),3)*($(AdapterPathList),4)*($(AdapterPathList),5)*($(AdapterPathList),6)*($(AdapterPathList),7)*($(AdapterPathList),8)*($(AdapterPathList),9)
  1459.  
  1460.      OpenRegKey $(!REG_H_LOCAL) "" $(NetCardsBase) $(MAXIMUM_ALLOWED) NetCardsKey
  1461.      Ifstr $(NetCardsKey) == ""
  1462.          Set Result = "Can't Open "$(NetCardsBase)
  1463.          Debug-Output "NWSUBS.INF: "$(Result)
  1464.          goto ReallyRemoveHardwareComponent_Return
  1465.      Endif
  1466.  
  1467.      OpenRegKey $(NetCardsKey) "" $(AdapterNumber) $(MAXIMUM_ALLOWED) AdapterNumberKey
  1468.      Ifstr $(AdapterNumberKey) == ""
  1469.          Set Result = "Can't Open "$(AdapterNumber)
  1470.          Debug-Output "NWSUBS.INF: "$(Result)
  1471.          goto ReallyRemoveHardwareComponent_Return
  1472.      endif
  1473.  
  1474.      GetRegValue $(AdapterNumberKey),"ServiceName", ServiceNameList
  1475.      Set ServiceName = *($(ServiceNameList), 4)
  1476.  
  1477.      CloseRegKey $(AdapterNumberKey)
  1478.      DeleteRegTree $(NetCardKey) $(AdapterNumber)
  1479.      CloseRegKey $(NetCardsKey)
  1480.      Shell $(UtilityInf), RemoveService, $(ServiceName), "NO"
  1481.      debug-output "remove netbios information..."
  1482.      LibraryProcedure Result, $(!NCPA_HANDLE), RemoveRouteFromNETBIOS, $(ServiceName)
  1483.  
  1484. ReallyRemoveHardwareComponent_Return = +
  1485.      return $(Result)
  1486.  
  1487. [ProgressCopyENG]
  1488.      !p:ProCaption    = "NetWare for Windows NT Setup"
  1489.      !p:ProCancel     = "Cancel"
  1490.      !p:ProCancelMsg = "NetWare for Windows NT is not correctly installed.    Are you sure you want "+
  1491.                              "to cancel copying files?"
  1492.      !p:ProCancelCap = "Setup Message"
  1493.      !p:ProText1        = "Copying:"
  1494.      !p:ProText2        = "To:"
  1495.      !p:Error            = "Unable to determine proper source disk location; copy cannot be performed."
  1496.  
  1497. [DoAskSource]
  1498.      Set DAS_CWDDIR    = $($0)
  1499.      Set DAS_SRCDIR    = $($1)
  1500.      Set DAS_BUILTIN = $($2)
  1501.      Set DAS_Result    = STATUS_FAILED
  1502.      Ifstr(i) $(!STF_SRCDIR_OVERRIDE) != ""
  1503.             Set DAS_SRCDIR = $(!STF_SRCDIR_OVERRIDE)
  1504.             Set DAS_Result = STATUS_SUCCESSFUL
  1505.             Goto DAS_exit
  1506.      Endif
  1507.      Ifstr(i) $(DAS_BUILTIN) == YES
  1508.             Ifstr(i) $(!NTN_InstallPhase) == primary
  1509.                 Ifstr(i) $(!STF_SRCDIR_WINNT) != ""
  1510.                      Set DAS_SRCDIR = $(!STF_SRCDIR_WINNT)
  1511.                 Endif
  1512.                 Set DAS_Result = STATUS_SUCCESSFUL
  1513.                 Goto DAS_exit
  1514.             Endif
  1515.      Endif
  1516.      Debug-Output "OEMNPRNW.INF: [DoAskSource] STF_CWDDIR = "$(DAS_CWDDIR)" STF_SRCDIR = "$(DAS_SRCDIR)
  1517.      Ifstr(i) $(DAS_SRCDIR) == ""
  1518.             Set DAS_SRCDIR = "A:\"
  1519.      Endif
  1520.      Ifstr(i) $(DAS_SRCDIR) == $(!STF_SRCDIR_USED)
  1521.             Set DAS_SRCDIR = $(!STF_SRCDIR_KEYED)
  1522.      Endif
  1523.      Set NetWareDlgText = "Please enter the full path of the NetWare for Windows NT distribution "+
  1524.                                  "files.    Then choose Continue."
  1525.      Shell "subroutn.inf" DoAskSourceEx $(DAS_SRCDIR) $(NetWareDlgText)
  1526.      ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1527.             Debug-Output "UTILITY.INF: shelling SUBROUTN.INF [DoAskSource] failed"
  1528.             goto DAS_exit
  1529.      endif
  1530.      Set DAS_Result = $($R0)
  1531.      Set DAS_SRCDIR = $($R1)
  1532.      Set !STF_SRCDIR_USED = $($R1)
  1533.      Set !STF_SRCDIR_KEYED = $($R3)
  1534. DAS_exit =+
  1535.      Read-syms ProgressCopy$(!STF_LANGUAGE)
  1536.      Return $(DAS_Result) $(DAS_SRCDIR)
  1537.  
  1538. [DoAskLANSource]
  1539.      Set DAS_CWDDIR    = $($0)
  1540.      Set DAS_SRCDIR    = $($1)
  1541.  
  1542.      Debug-Output "DAS_CWDDIR = "$(DAS_CWDDIR)
  1543.      Debug-Output "DAS_SRCDIR = "$(DAS_SRCDIR)
  1544.      Debug-Output "STF_SRCDIR_USED = "$(!STF_SRCDIR_USED)
  1545.      Debug-Output "STF_SRCDIR_KEYED = "$(!STF_SRCDIR_KEYED)
  1546.  
  1547.      Set DAS_BUILTIN = $($2)
  1548.      Set DAS_Result    = STATUS_FAILED
  1549.      Debug-Output "OEMNPRNW.INF: [DoAskSource] STF_CWDDIR = "$(DAS_CWDDIR)" STF_SRCDIR = "$(DAS_SRCDIR)
  1550.      Ifstr(i) $(DAS_SRCDIR) == ""
  1551.             Set DAS_SRCDIR = "A:\"
  1552.      Endif
  1553.      Ifstr(i) $(DAS_SRCDIR) == $(!STF_SRCDIR_USED)
  1554.             Set DAS_SRCDIR = $(!STF_SRCDIR_KEYED)
  1555.      Endif
  1556.      Set NetWareDlgText = "Please enter the full path of the NetWare ODI LAN Drivers disk."+
  1557.                                  "Then choose Continue."
  1558.      Shell "subroutn.inf" DoAskSourceEx $(DAS_SRCDIR) $(NetWareDlgText)
  1559.      ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1560.             Debug-Output "UTILITY.INF: shelling SUBROUTN.INF [DoAskLANSource] failed"
  1561.             goto DAS_exit
  1562.      endif
  1563.      Set DAS_Result = $($R0)
  1564.      Set DAS_SRCDIR = $($R1)
  1565.      Set !STF_SRCDIR_USED = $($R1)
  1566.      Set !STF_SRCDIR_KEYED = $($R3)
  1567. DAS_exit =+
  1568.      Read-syms ProgressCopy$(!STF_LANGUAGE)
  1569.      Return $(DAS_Result) $(DAS_SRCDIR)
  1570.  
  1571. ; ===========================================================================
  1572. ; NwSetFrameType
  1573. ;    Set the frame type for a loaded ODI adapter from the list of frames loaded
  1574. ;    by OdiLoad.
  1575. ;
  1576. ; INPUT:
  1577. ;     $($0) Base name of card to set to frame type for (ie NE2000).
  1578. ;     $($1) NT card instance (ie 01).
  1579. ;     $($2) Open handle to nwsubs or "" and I'll open it.
  1580. ;
  1581. ; OUTPUT:
  1582. ;     $($R0) Frame Selected or ""
  1583. ;
  1584. ; ===========================================================================
  1585.  
  1586. [NwSetFrameType]
  1587.     read-syms NwBaseVars
  1588.     read-syms IpxVars
  1589.     read-syms OdiVars
  1590.     read-syms OdiNSupVars
  1591.  
  1592.     Set CardToBindTo     = $($0)
  1593.     Set NtAdapterNumber = $($1)
  1594.     Set NwLibHandle        = $($2)
  1595.  
  1596.     Set CloseLibrary = FALSE
  1597.  
  1598.     Ifstr(i) $(NwLibHandle) == ""
  1599.         LoadLibrary "NetWare for Windows NT" nwsetup.dll NwLibHandle
  1600.         SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\english\nwnthelp.hlp" $(!MinimumID) $(!MaximumID)
  1601.         Set CloseLibrary = TRUE
  1602.     Endif
  1603.  
  1604.     Debug-Output "CardToBindTo = "$(CardToBindTo)
  1605.     Set-add TempAdapterNumber = $(NtAdapterNumber),0
  1606.     Set OdiLoadModuleName = $(CardToBindTo)" #"$(TempAdapterNumber)
  1607.     Debug-Output "OdiLoadModuleName = "$(OdiLoadModuleName)
  1608.  
  1609.     ; Set the frame type
  1610.     ;
  1611.     Set OdiParmList = {}
  1612.  
  1613.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiLoad\ODI_Modules\"$(OdiLoadModuleName) $(MAXIMUM_ALLOWED) KeyOdiModule
  1614.     Ifstr(i) $(KeyOdiModule) != ""
  1615.         GetRegValue $(KeyOdiModule), "Parameters", OdiParmInfo
  1616.         Set OdiParmList = *($(OdiParmInfo), 4)
  1617.         Debug-Output "OdiParmList = "$(OdiParmList)
  1618.         CloseRegKey $(KeyOdiModule)
  1619.      Endif
  1620.  
  1621.     Set FrameList = "AUTO DETECT"
  1622.     set ProtocolID = ""
  1623.     set FrameListDefault = ""
  1624.  
  1625.     ForListDo $(OdiParmList)
  1626.         Set Item = $($)
  1627.         Split-String $(Item) " " ParmParts
  1628.         Set ParmName = *($(ParmParts), 1)
  1629.         Ifstr(i) $(ParmName) == "Frame"
  1630.             Set ParmData = *($(ParmParts), 3)
  1631.             ifstr $(FrameList) == ""
  1632.                 Set FrameList = {$(ParmData)}
  1633.             else
  1634.                 Set FrameList = >($(FrameList), $(ParmData))
  1635.             endif
  1636.         Endif
  1637.     EndForListDo
  1638.  
  1639.     set StandardFrameList = $(FrameList)
  1640.  
  1641.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  1642.     Ifstr(i) $(KeyIpxParameters) != ""
  1643.         set CloseIPX = TRUE
  1644.         set ParameterList = {}
  1645.         GetRegValue $(KeyIpxParameters) "Protocol Id" ParameterList
  1646.         ifstr *($(ParameterList), 4) != ""
  1647.             set ProtocolID = *($(ParameterList), 4)
  1648.             set ParameterList = {}
  1649.             GetRegValue $(KeyIpxParameters) "Frame Type" ParameterList
  1650.             set FrameList = >($(FrameList), *($(ParameterList), 4))
  1651.             set NewFrameTypeName = *($(ParameterList), 4)
  1652.             set FrameListDefault = *($(ParameterList), 4)
  1653.         endif
  1654.     endif
  1655.  
  1656.     set FrameList = >($(FrameList), "Other Non-Standard Frame Type")
  1657.  
  1658.     Debug-Output "FrameList "$(FrameList)
  1659.  
  1660.     ifstr $(FrameListDefault) == ""
  1661.         Set FrameListDefault = *($(FrameList), 1)
  1662.     endif
  1663.  
  1664.     Debug-Output "FrameListDefault = "$(FrameListDefault)
  1665.  
  1666. dotheframedlg =+
  1667.     read-syms IPXDlg$(!STF_LANGUAGE)
  1668.     ui start "Framelist" $(NwLibHandle)
  1669.  
  1670.  
  1671.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  1672.         set GUIResult = *($(ComboOut), 1)
  1673.         Debug-Output "OK hit"
  1674.         ifcontains(i) $(GUIResult) IN $(StandardFrameList)
  1675.             DeleteRegValue $(KeyIpxParameters) "Protocol Id"
  1676.         else-ifstr(i) $(GUIResult) == "Other Non-Standard Frame Type"
  1677.             read-syms NewFrameTypeDlg$(!STF_LANGUAGE)
  1678.             ui start "NewFrameType" $(NwLibHandle)
  1679.             ui pop 1
  1680.             ifstr(i) $(DLGEVENT) == "CONTINUE"
  1681.                 Debug-Output "OK hit"
  1682.                 set GUIResult = *($(EditTextOut), 1)
  1683.                 set ProtocolID = *($(EditTextOut), 2)
  1684.                 set KeyValueList = {"Protocol Id",$(NoTitle),$(!REG_VT_DWORD),$(ProtocolID)}
  1685.                 SetRegValue $(KeyIpxParameters) $(KeyValueList)
  1686.             else-ifstr(i) $(DLGEVENT) == "BACK"
  1687.                 Debug-Output "Action: CANCEL"
  1688.                 goto dotheframedlg
  1689.             endif
  1690.         endif
  1691.     else-ifstr(i) $(DLGEVENT) == "BACK"
  1692.         ;
  1693.         ; if you hit DEFAULT, you get the default frame which is the first item in the list
  1694.         ;
  1695.         set GUIResult = *($(StandardFrameList), 1)
  1696.         DeleteRegValue $(KeyIpxParameters) "Protocol Id"
  1697.     endif
  1698.     ui pop 1
  1699.  
  1700.     Ifstr(i) $(CloseIPX) == TRUE
  1701.         CloseRegKey $(KeyIpxParameters)
  1702.     Endif
  1703.  
  1704.     Ifstr(i) $(CloseLibrary) == TRUE
  1705.          FreeLibrary $(NwLibHandle)
  1706.     Endif
  1707.  
  1708.     Debug-Output "Returning GUIResult = "$(GUIResult)
  1709.     Return $(GUIResult)
  1710.  
  1711. ; ===========================================================================
  1712. ; NwGetNICBusInfo
  1713. ;    Get Information about the BUS.  If there is only one BUS present then
  1714. ;    the information will be returned without any user intervention.  If there
  1715. ;    are more than one BUS, the user will need to select the BUS where the NIC
  1716. ;    will be installed.
  1717. ;
  1718. ; INPUT:
  1719. ;     $($0) Network Card Adapter Registry Name (Card type and instance i.e. NE2000)
  1720. ;     $($1) Bus Interface Type
  1721. ;     $($2) Bus Number
  1722. ;
  1723. ; OUTPUT:
  1724. ;     $($R0) Return Status
  1725. ;     $($R1) BusNumber
  1726. ;     $($R2) BusTypeName 
  1727. ;     $($R3) BusInterfaceType (ID)
  1728. ;
  1729. ; ===========================================================================
  1730.  
  1731. [NwGetNICBusInfo]
  1732.     
  1733.     set CardInstanceName = $($0)
  1734.     set BusInterfaceType = $($1)
  1735.     set BusNumber = $($2)
  1736.     set BusTypeName = ""
  1737.  
  1738.     Shell "UTILITY.INF", GetBusTypeDialog, $(CardInstanceName), $(BusInterfaceType), $(BusNumber)
  1739.  
  1740.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1741.         Debug-Output "OEMNADNH.INF: GetBusTypeDialog ShellCode error "$($ShellCode)
  1742.         goto NwGetNICBusInfoERROR
  1743.     else
  1744.  
  1745.         set BusInterfaceType = $($R1)
  1746.         set BusNumber = $($R2)
  1747.  
  1748.         ;This next section should be redone as a list and internationalized
  1749.         ;==================================================================
  1750.         ifint $(BusInterfaceType) == 0 
  1751.             set BusTypeName = "Internal"
  1752.         else-ifint $(BusInterfaceType) == 1  
  1753.             set BusTypeName = "ISA"
  1754.         else-ifint $(BusInterfaceType) == 2  
  1755.             set BusTypeName = "EISA"
  1756.         else-ifint $(BusInterfaceType) == 3  
  1757.             set BusTypeName = "MicroChannel"
  1758.         else-ifint $(BusInterfaceType) == 4  
  1759.             set BusTypeName = "TurboChannel"
  1760.         else-ifint $(BusInterfaceType) == 5  
  1761.             set BusTypeName = "PCIBus"
  1762.         else-ifint $(BusInterfaceType) == 6  
  1763.             set BusTypeName = "VMEBus"
  1764.         else-ifint $(BusInterfaceType) == 7  
  1765.             set BusTypeName = "NuBus"
  1766.         else-ifint $(BusInterfaceType) == 8  
  1767.             set BusTypeName = "PCMCIABus"
  1768.         else-ifint $(BusInterfaceType) == 9  
  1769.             set BusTypeName = "CBus"
  1770.         else-ifint $(BusInterfaceType) == 10 
  1771.             set BusTypeName = "MPIBus"
  1772.         else-ifint $(BusInterfaceType) == 11 
  1773.             set BusTypeName = "MPSABus"
  1774.         else 
  1775.             set BusTypeName = "***ERROR:Illegal Bus Type***"
  1776.         endif
  1777.     endif
  1778.  
  1779.  
  1780. NwGetNICBusInfoERROR = +
  1781.      
  1782.      Return $(ShellCode) $(BusNumber) $(BusTypeName) $(BusInterfaceType)
  1783.  
  1784. ;
  1785. ;
  1786. ; ===================================================================================
  1787. ;
  1788. ;                         GetTotalAdapterList
  1789. ; ===================================================================================
  1790. ;
  1791. ; Section to create a list of all installed ODI and NDIS adapters.    Used by OEMSETUP bindings.
  1792. ;
  1793. ; INPUT:
  1794. ;     NONE
  1795. ;
  1796. ; OUTPUT:
  1797. ;     $($R0)    List of installed ODI adapter names.
  1798. ;     $($R1)    List of installed ODI adapter titles.
  1799. ;     $($R2)    List of installed ODI adapter card numbers.
  1800. ;     $($R3)    Number of installed ODI adapters.
  1801. ;     $($R4)    List of installed NDIS adapter names.
  1802. ;     $($R5)    List of installed NDIS adapter titles.
  1803. ;     $($R6)    List of installed NDIS adapter card numbers.
  1804. ;     $($R7)    Number of installed NDIS adapters.
  1805. ;   $($R8)  Adapter card number of ODINSUP or "" if not loaded
  1806. ;
  1807. ; ===================================================================================
  1808.  
  1809. [GetTotalAdapterList]
  1810. ;
  1811. ; In this section we will create a list of all installed adapters.
  1812. ;
  1813.     read-syms NwBaseVars
  1814.     read-syms OdiVars
  1815.  
  1816.     Debug-Output "NWSUBS.INF: GetTotalAdapterList"
  1817.  
  1818.     Set OdiOnlyList = {}
  1819.     Set OdiTitleList = {}
  1820.     Set OdiCardList = {}
  1821.     Set NdisOnlyList = {}
  1822.     Set NdisTitleList = {}
  1823.     Set NdisCardList = {}
  1824.     Set NumberNdisAdapters = 0
  1825.     Set ODINSUPCardNumber = ""
  1826.     Set IsHidden = ""
  1827.     set OdiAdapter = ""
  1828.     Set NumberOdiAdapters = 0
  1829.  
  1830.  
  1831.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) $(MAXIMUM_ALLOWED) NetCardsKey
  1832.  
  1833.     Ifstr(i) $(NetCardsKey) == ""
  1834.         Debug-Output "NWSUBS.INF: Can't Open Registry key "$(NetworkCardsKeyName)
  1835.         set CommonStatus = STATUS_USERCANCEL
  1836.     Else
  1837.  
  1838.         FlushRegKey $(NetCardsKey)
  1839. ;
  1840. ;        Get a list of all installed network cards
  1841. ;
  1842.         EnumRegKey $(NetCardsKey) NetCardsList
  1843.  
  1844.         ForListDo $(NetCardsList)
  1845.             Set CardNumber = *($($), 1)
  1846.  
  1847.             OpenRegKey $(NetCardsKey) "" $(CardNumber) $(MAXIMUM_ALLOWED) CardKey
  1848.             Ifstr(i) $(CardKey) == ""
  1849.                 Debug-Output "NWSUBS.INF: Can't open adapter "$(Card)
  1850.             Else
  1851.                 GetRegValue $(CardKey) "Title" TitleValues
  1852.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1853.                     Set CardTitle = *($(TitleValues), 4)
  1854.                 Else
  1855.                     Set CardTitle = ""
  1856.                 Endif
  1857.                 GetRegValue $(CardKey) "ProductName" NameValues
  1858.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1859.                     Set CardName = *($(NameValues), 4)
  1860.                 Else
  1861.                     Set CardName = ""
  1862.                 Endif
  1863.                 GetRegValue $(CardKey) "Hidden" HiddenValues
  1864.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1865.                     Set IsHidden = *($(HiddenValues), 4)
  1866.                 Else
  1867.                     Set IsHidden = ""
  1868.                 Endif
  1869.                 GetRegValue $(CardKey) "OdiAdapter" OdiValueList
  1870.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1871.                     set OdiAdapter = *($(OdiValueList), 4)
  1872.                 Else
  1873.                     set OdiAdapter = ""
  1874.                 Endif
  1875.  
  1876.                 Ifstr(i) $(OdiAdapter) == "1"
  1877.                     ;
  1878.                     ; Must be an ODI Adapter so add it to our lists.
  1879.                     ;
  1880.                     Set-add NumberOdiAdapters = $(NumberOdiAdapters), 1
  1881.                     Set OdiOnlyList = >($(OdiOnlyList), $(CardNumber))
  1882.                     Set OdiTitleList = >($(OdiTitleList), $(CardTitle))
  1883.                     Set OdiCardList = >($(OdiCardList), $(CardName))
  1884.                 Else-Ifstr(i) $(CardName) == "ODINSUP"
  1885.                     Set ODINSUPCardNumber = $(CardNumber)
  1886.                 Else
  1887.                     ;
  1888.                     ;    Must be an NDIS Adapter so add it to our lists if it isn't hidden
  1889.                     ;
  1890.                     Ifstr(i) $(IsHidden) != "1"
  1891.                         Set-add NumberNdisAdapters = $(NumberNdisAdapters), 1
  1892.                         Set NdisOnlyList = >($(NdisOnlyList), $(CardNumber))
  1893.                         Set NdisTitleList = >($(NdisTitleList), $(CardTitle))
  1894.                         Set NdisCardList = >($(NdisCardList), $(CardName))
  1895.                     Endif
  1896.                 Endif
  1897.  
  1898.             CloseRegKey $(CardKey)
  1899.             Endif
  1900.         EndForListDo
  1901.  
  1902.         Debug-Output "NWSUBS.INF: OdiOnlyList         = "$(OdiOnlyList)
  1903.         Debug-Output "NWSUBS.INF: OdiTitleList        = "$(OdiTitleList)
  1904.         Debug-Output "NWSUBS.INF: OdiCardList         = "$(OdiCardList)
  1905.         Debug-Output "NWSUBS.INF: NumberOdiAdapters = "$(NumberOdiAdapters)
  1906.         Debug-Output "NWSUBS.INF: NdisOnlyList         = "$(NdisOnlyList)
  1907.         Debug-Output "NWSUBS.INF: NdisTitleList        = "$(NdisTitleList)
  1908.         Debug-Output "NWSUBS.INF: NdisCardList         = "$(NdisCardList)
  1909.         Debug-Output "NWSUBS.INF: NumberNdisAdapters = "$(NumberNdisAdapters)
  1910.         Debug-Output "NWSUBS.INF: ODINSUP card number = "$(ODINSUPCardNumber)
  1911.  
  1912.         CloseRegKey $(NetCardsKey)
  1913.     Endif
  1914.  
  1915.     return $(OdiCardList) $(OdiTitleList) $(OdiOnlyList) $(NumberOdiAdapters) $(NdisCardList) $(NdisTitleList) $(NdisOnlyList) $(NumberNdisAdapters) $(ODINSUPCardNumber)
  1916.  
  1917.  
  1918.  
  1919.  
  1920. ;
  1921. ;
  1922. ; ===================================================================================
  1923. ;
  1924. ;                         GetIpxCardList
  1925. ; ===================================================================================
  1926. ;
  1927. ; Section to create a combined list of all installed Odi and Ndis adapters.
  1928. ; Used by OEMSETUP when configuring IPX.
  1929. ;
  1930. ; INPUT:
  1931. ;     NONE
  1932. ;
  1933. ; OUTPUT:
  1934. ;     $($R0)    List of installed network cards.
  1935. ;     $($R1)    List of media type for installed network cards (ie {"ETHERNET","TOKEN-RING",...}).
  1936. ;     $($R2)    List of driver type for installed network cards (ie {"ODI","NDIS",...}).
  1937. ;     $($R3)    Number of installed network cards.
  1938. ;   $($R4)  Product name list.
  1939. ;   $($R5)  Service name list.
  1940. ;   $($R6)  NWIP installed ? (YES/NO)
  1941. ;   $($R7)  List of network card numbers.
  1942. ;
  1943. ; ===================================================================================
  1944.  
  1945. [GetIpxCardList]
  1946. ;
  1947. ; In this section we will create a list of all installed network cards.
  1948. ;
  1949.     read-syms NwBaseVars
  1950.     read-syms OdiVars
  1951.  
  1952.     Debug-Output "NWSUBS.INF: GetIpxCardList"
  1953.  
  1954.     Set NetworkCardList = {}
  1955.     Set MediaTypeList = {}
  1956.     Set DriverTypeList = {}
  1957.     Set NumberNetworkCards = 0
  1958.     Set ProductNameList = {}
  1959.     Set ServiceNameList = {}
  1960.     Set NWIPInstalled = ""
  1961.     Set CardNumberList = {}
  1962.  
  1963.     Set IsHidden = ""
  1964.     set OdiAdapter = ""
  1965.  
  1966.     ;
  1967.     ;  Check if NWIP installed
  1968.     ;
  1969.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWIP" $(MAXIMUM_ALLOWED) KeyNWIP
  1970.     Ifstr $(KeyNWIP) != $(KeyNull)
  1971.         GetRegValue $(KeyNWIP) "DeleteFlag" DeleteFlagList
  1972.         Set NWIPDeleteFlag = *($(DeleteFlagList), 4)
  1973.         Debug-Output "NWIPDeleteFlag = "$(NWIPDeleteFlag)
  1974.         Ifint $(NWIPDeleteFlag) != 1
  1975.             Set NWIPInstalled = YES
  1976.             Debug-Output "OEMNPRNW.INF: bindnetware, NWIP is installed"
  1977.         Else
  1978.             Set NWIPInstalled = ""
  1979.             Debug-Output "OEMNPRNW.INF: bindnetware, NWIP NOT installed"
  1980.         Endif
  1981.         CloseRegKey $(KeyNWIP)
  1982.     Endif
  1983.  
  1984.  
  1985.     ifstr(i) $(NWIPInstalled) == YES
  1986.         set NetworkCardList = {"Novell NetWare/IP Support"}
  1987.         set MediaTypeList = {"NWIP"}
  1988.         set DriverTypeList = {"ODI"}
  1989.         set NumberNetworkCards = 1
  1990.         set ProductNameList = {"NWIP"}
  1991.         set ServiceNameList = {"NWIP"}
  1992.         goto GetIpxCardListEXIT
  1993.     endif
  1994.  
  1995.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKeyName) $(MAXIMUM_ALLOWED) NetCardsKey
  1996.  
  1997.     Ifstr(i) $(NetCardsKey) == ""
  1998.         Debug-Output "NWSUBS.INF: Can't Open Registry key "$(NetworkCardsKeyName)
  1999.         set CommonStatus = STATUS_USERCANCEL
  2000.     Else
  2001.  
  2002.         FlushRegKey $(NetCardsKey)
  2003. ;
  2004. ;        Get a list of all installed network cards
  2005. ;
  2006.         EnumRegKey $(NetCardsKey) NetCardsList
  2007.  
  2008.         ForListDo $(NetCardsList)
  2009.             Set CardNumber = *($($), 1)
  2010.  
  2011.             OpenRegKey $(NetCardsKey) "" $(CardNumber) $(MAXIMUM_ALLOWED) CardKey
  2012.             Ifstr(i) $(CardKey) == ""
  2013.                 Debug-Output "NWSUBS.INF: Can't open adapter "$(Card)
  2014.             Else
  2015.                 GetRegValue $(CardKey) "Title" TitleValues
  2016.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2017.                     Set CardTitle = *($(TitleValues), 4)
  2018.                 Else
  2019.                     Set CardTitle = ""
  2020.                 Endif
  2021.                 GetRegValue $(CardKey) "ProductName" NameValues
  2022.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2023.                     Set CardName = *($(NameValues), 4)
  2024.                 Else
  2025.                     Set CardName = ""
  2026.                 Endif
  2027.                 GetRegValue $(CardKey) "Hidden" HiddenValues
  2028.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2029.                     Set IsHidden = *($(HiddenValues), 4)
  2030.                 Else
  2031.                     Set IsHidden = ""
  2032.                 Endif
  2033.                 GetRegValue $(CardKey) "OdiAdapter" OdiValueList
  2034.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2035.                     set OdiAdapter = *($(OdiValueList), 4)
  2036.                 Else
  2037.                     set OdiAdapter = ""
  2038.                 Endif
  2039.                 GetRegValue $(CardKey) "ServiceName" ValueList
  2040.                 Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2041.                     set ServiceName = *($(ValueList), 4)
  2042.                 Else
  2043.                     set ServiceName = ""
  2044.                 Endif
  2045.  
  2046.                 ifstr(i) $(IsHidden) != "1"
  2047.                     ;
  2048.                     ; It's not hidden so add it to the lists
  2049.                     ;
  2050.  
  2051.                     Set-add NumberNetworkCards = $(NumberNetworkCards), 1
  2052.                     Set NetworkCardList = >($(NetworkCardList), $(CardTitle))
  2053.                     Set ProductNameList = >($(ProductNameList), $(CardName))
  2054.                     Set ServiceNameList = >($(ServiceNameList), $(ServiceName))
  2055.                     Set CardNumberList  = >($(CardNumberList), $(CardNumber))
  2056.  
  2057.                     set MediaType = "UNKNOWN"
  2058.                     set ServiceParameters = $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters"
  2059.                     OpenRegKey $(!REG_H_LOCAL) ""  $(ServiceParameters) $(MAXIMUM_ALLOWED) ServiceParametersKey
  2060.                     ifstr(i) $(ServiceParametersKey) != ""
  2061.                         GetRegValue $(ServiceParametersKey) "MediaType" ValueList
  2062.                         Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2063.                             set NdisMediaType = *($(ValueList), 4)
  2064.                             ifstr(i) $(NdisMediaType) == "1"
  2065.                                 set MediaType = "ETHERNET"
  2066.                             else-ifstr(i) $(NdisMediaType) == "2"
  2067.                                 set MediaType = "TOKEN-RING"
  2068.                             else-ifstr(i) $(NdisMediaType) == "4"
  2069.                                 set MediaType = "FDDI"
  2070.                             else
  2071.                                 Debug-Output "NWSUBS.INF: Unknown media type "$(NdisMediaType)
  2072.                             endif
  2073.                         Endif
  2074.                         CloseRegKey $(ServiceParametersKey)
  2075.                     endif
  2076.                     set MediaTypeList = >($(MediaTypeList), $(MediaType))
  2077.  
  2078.  
  2079.                     Ifstr(i) $(OdiAdapter) == "1"
  2080.                         ;
  2081.                         ; Must be an ODI Adapter so add ODI to driver type list.
  2082.                         ;
  2083.                         Set DriverTypeList = >($(DriverTypeList), "ODI")
  2084.                     Else
  2085.                         ;
  2086.                         ;    Must be an NDIS Adapter so add NDIS to driver type list.
  2087.                         ;
  2088.                         Set DriverTypeList = >($(DriverTypeList), "NDIS")
  2089.                     Endif
  2090.  
  2091.                 endif
  2092.  
  2093.             CloseRegKey $(CardKey)
  2094.             Endif
  2095.         EndForListDo
  2096.  
  2097.         Debug-Output "NWSUBS.INF: NetworkCardList         = "$(NetworkCardList)
  2098.         Debug-Output "NWSUBS.INF: MediaTypeList       = "$(MediaTypeList)
  2099.         Debug-Output "NWSUBS.INF: DriverTypeList      = "$(DriverTypeList)
  2100.         Debug-Output "NWSUBS.INF: NumberNetworkCards  = "$(NumberNetworkCards)
  2101.  
  2102.         CloseRegKey $(NetCardsKey)
  2103.     Endif
  2104.  
  2105. GetIpxCardListEXIT = +
  2106.  
  2107.     return $(NetworkCardList) $(MediaTypeList) $(DriverTypeList) $(NumberNetworkCards) $(ProductNameList) $(ServiceNameList) $(NWIPInstalled) $(CardNumberList)
  2108.  
  2109.  
  2110. ;
  2111. ;
  2112. ; ===================================================================================
  2113. ;
  2114. ;
  2115. ; ===================================================================================
  2116. ;
  2117. ;  Section to check for needed drivers - ODINSUP
  2118. ;
  2119. ; INPUT:
  2120. ;     NONE
  2121. ;
  2122. ; OUTPUT:
  2123. ;     NONE
  2124. ; ===================================================================================
  2125.  
  2126. [CheckIfODINSUPIsNeeded]
  2127.  
  2128.     read-syms NwBaseVars
  2129.  
  2130.     Shell $(NwSubsInf), GetTotalAdapterList
  2131.  
  2132.     Set OdiProductNameList    = $($R0)
  2133.     Set OdiTitleList            = $($R1)
  2134.     Set OdiCardList            = $($R2)
  2135.     Set NumberOdiAdapters    = $($R3)
  2136.     Set NdisProductNameList    = $($R4)
  2137.     Set NdisTitleList            = $($R5)
  2138.     Set NdisCardList            = $($R6)
  2139.     Set NumberNdisAdapters    = $($R7)
  2140.     Set ODINSUPCardNumber    = $($R8)
  2141.  
  2142.     ;
  2143.     ; Is there an ODI driver installed?
  2144.     ;
  2145.     ifint $(NumberOdiAdapters) >= 1
  2146.         ;
  2147.         ;  turn on ODINSUP
  2148.         ;
  2149.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Odinsup" $(MAXIMUM_ALLOWED) KeyProduct
  2150.         ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2151.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),2}
  2152.             SetRegValue $(KeyProduct) $(KeyValueList)
  2153.             CloseRegKey $(KeyProduct)
  2154.         Endif
  2155.         ;
  2156.         ;  turn on Odiload
  2157.         ;
  2158.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Odiload" $(MAXIMUM_ALLOWED) KeyProduct
  2159.         ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2160.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),2}
  2161.             SetRegValue $(KeyProduct) $(KeyValueList)
  2162.             CloseRegKey $(KeyProduct)
  2163.         Endif
  2164.         ;
  2165.         ;  turn off VMLID
  2166.         ;
  2167.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiVMLID" $(MAXIMUM_ALLOWED) KeyProduct
  2168.         ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2169.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),4}
  2170.             SetRegValue $(KeyProduct) $(KeyValueList)
  2171.             CloseRegKey $(KeyProduct)
  2172.         Endif
  2173.     Else
  2174.         ;
  2175.         ;  turn off ODINSUP
  2176.         ;
  2177.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Odinsup" $(MAXIMUM_ALLOWED) KeyProduct
  2178.         Ifstr $(KeyProduct) != $(KeyNull)
  2179.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),4}
  2180.             SetRegValue $(KeyProduct) $(KeyValueList)
  2181.             CloseRegKey $(KeyProduct)
  2182.         Endif
  2183.         ;
  2184.         ;  turn off Odiload
  2185.         ;
  2186.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Odiload" $(MAXIMUM_ALLOWED) KeyProduct
  2187.         Ifstr $(KeyProduct) != $(KeyNull)
  2188.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),4}
  2189.             SetRegValue $(KeyProduct) $(KeyValueList)
  2190.             CloseRegKey $(KeyProduct)
  2191.         Endif
  2192.         ;
  2193.         ;  turn on VMLID
  2194.         ;
  2195.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiVMLID" $(MAXIMUM_ALLOWED) KeyProduct
  2196.         ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  2197.             Set KeyValueList = {"Start",$(NoTitle),$(!REG_VT_DWORD),2}
  2198.             SetRegValue $(KeyProduct) $(KeyValueList)
  2199.             CloseRegKey $(KeyProduct)
  2200.         Endif
  2201.     Endif
  2202.  
  2203.     Return
  2204.  
  2205.  
  2206. ;
  2207. ;
  2208. ; ===================================================================================
  2209. ;
  2210. ;                         NWConfigureSourceRouting
  2211. ; ===================================================================================
  2212. ;
  2213. ; Section to ask the user if they want source routing.
  2214. ;
  2215. ; INPUT:
  2216. ;     $($0)    "ODI" or "Novell"
  2217. ;
  2218. ; OUTPUT:
  2219. ;     NONE
  2220. ;
  2221. ; ===================================================================================
  2222.  
  2223. [NWConfigureSourceRouting]
  2224.     read-syms NwBaseVars
  2225.     read-syms OdiVars
  2226.  
  2227.     set SourceRoutingService = $(!NTN_ServiceBase)"\OdiSourceRouting"
  2228.  
  2229.     OpenRegKey $(!REG_H_LOCAL) "" $(SourceRoutingService) $(MAXIMUM_ALLOWED) KeySetup
  2230.     Ifstr(i) $(KeySetup) != ""
  2231.  
  2232.         set DlgType      = "MessageBox"
  2233.         set STF_MB_TITLE = "Configure "$($0)" Source Routing"
  2234.         set STF_MB_TEXT  = "Use "$($0)" Source Routing support?"
  2235.         set STF_MB_TYPE  = 3
  2236.         set STF_MB_ICON  = 1
  2237.         set STF_MB_DEF    = 2
  2238.     
  2239.         GetRegValue $(KeySetup) "Start" StartValueList
  2240.         set StartValue = *($(StartValueList), 4)
  2241.  
  2242.         Ifint $(StartValue) != 4
  2243.             set STF_MB_DEF = 1            
  2244.         Endif
  2245.  
  2246.         ui start "SourceRoutingBox"
  2247.     
  2248.         Ifstr(i) $(DLGEVENT) == "YES"
  2249.             set StartValue = 2
  2250.         Else
  2251.             set StartValue = 4
  2252.         Endif
  2253.     
  2254.         SetRegValue $(KeySetup) {Start,$(NoTitle),$(!REG_VT_DWORD), $(StartValue)}
  2255.         Debug-Output "NWSUBS.INF: Source Routing Start value set to "$(StartValue)
  2256.         CloseRegKey $(KeySetup)
  2257.     Endif
  2258.  
  2259.     Return
  2260.  
  2261.  
  2262. ;
  2263. ;
  2264. ; ===================================================================================
  2265. ;
  2266. ;                         MoveTcpIpInfo
  2267. ; ===================================================================================
  2268. ;
  2269. ; Section to move the Tcp/Ip info from one network card to another.
  2270. ;
  2271. ; INPUT:
  2272. ;     $($0)    Network Card to move the Tcp/Ip info from.
  2273. ;   $($1)   Network Card to move the Tcp/Ip info to.
  2274. ;
  2275. ; OUTPUT:
  2276. ;     $($R0)    Status of call.
  2277. ;
  2278. ; ===================================================================================
  2279.  
  2280. [MoveTcpIpInfo]
  2281.     read-syms NwBaseVars
  2282.     read-syms OdiVars
  2283.  
  2284.     set FromAdapter = $($0)
  2285.     set ToAdapter   = $($1)
  2286.  
  2287.     set Result = "STATUS_SUCCESSFUL"
  2288.     
  2289.  
  2290.     OpenRegKey $(!REG_H_LOCAL) "" $(FromAdapter) $(MAXIMUM_ALLOWED) FromAdapterKey
  2291.     Ifstr(i) $(FromAdapterKey) == ""
  2292.         Debug-Output "NWSUBS.INF: Can't open from adapter "$(FromAdapter)
  2293.     Else
  2294.         GetRegValue $(FromAdapterKey) "ServiceName" ServiceNameList
  2295.         Debug-Output "NWSUBS.INF: MoveTcpIpInfo: from ServiceNameList = "$(ServiceNameList)
  2296.         set FromServiceName = *($(ServiceNameList), 4)
  2297.         Debug-Output "NWSUBS.INF: MoveTcpIpInfo: From Service Name = "$(FromServiceName)
  2298.         CloseRegKey $(NdisCardKey)
  2299.         set FromTcpIp = $(!NTN_ServiceBase)"\"$(FromServiceName)"\Parameters\Tcpip"
  2300.         OpenRegKey $(!REG_H_LOCAL) "" $(FromTcpIp) $(MAXIMUM_ALLOWED) FromTcpIpKey
  2301.         Ifstr(i) $(FromTcpIpKey) != ""
  2302.             Debug-Output "NWSUBS.INF: MoveTcpIpInfo, found Tcp/Ip info for driver"
  2303.             EnumRegValue $(FromTcpIpKey) TcpIpInfoList
  2304.             Debug-Output "NWSUBS.INF: Tcp/Ip info = "$(TcpIpInfoList)
  2305.             OpenRegKey $(!REG_H_LOCAL) "" $(ToAdapter) $(MAXIMUM_ALLOWED) ToAdapterKey
  2306.             Ifstr(i) $(ToAdapterKey) == ""
  2307.                 Debug-Output "NWSUBS.INF: Can't open to adapter "$(ToAdapter)
  2308.             Else
  2309.                 GetRegValue $(ToAdapterKey) "ServiceName" ServiceNameList
  2310.                 Debug-Output "NWSUBS.INF: MoveTcpIpInfo: to ServiceNameList = "$(ServiceNameList)
  2311.                 set ToServiceName = *($(ServiceNameList), 4)
  2312.                 Debug-Output "NWSUBS.INF: MoveTcpIpInfo: To Service Name = "$(ToServiceName)
  2313.                 CloseRegKey $(ToAdapterKey)
  2314.                 set ToParameters = $(!NTN_ServiceBase)"\"$(ToServiceName)"\Parameters"
  2315.                 Debug-Output "NWSUBS.INF: ToParameters = "$(ToParameters)
  2316.                 OpenRegKey $(!REG_H_LOCAL) "" $(ToParameters) $(MAXIMUM_ALLOWED) ToParametersKey
  2317.                 Ifstr(i) $(ToParametersKey) == ""
  2318.                     Debug-Output "Can't open to adapter service parameters "$(ToParameters)
  2319.                 Else
  2320.                     CreateRegKey $(ToParametersKey) {"Tcpip",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ToTcpIpKey
  2321.                     Ifstr(i) $(ToTcpIpKey) == ""
  2322.                         Debug-Output "NWSUBS.INF: Can't create Tcp/Ip key"
  2323.                         Debug-Output "NWSUBS.INF: RegLastError = "$(RegLastError)
  2324.                         Debug-Output "NWSUBS.INF: Global RegLastError = "$(!RegLastError)
  2325.                     Else
  2326.                         ForListDo $(TcpIpInfoList)
  2327.                             set TcpIpValueList = $($)
  2328.                             Debug-Output "TcpIpValueList = "$(TcpIpValueList)
  2329.                             SetRegValue $(ToTcpIpKey) $(TcpIpValueList)
  2330.                         EndForListDo
  2331.                         CloseRegKey $(ToTcpIpKey)
  2332.                     Endif
  2333.                     CloseRegKey $(ToParametersKey)
  2334.                 Endif
  2335.  
  2336.             Endif
  2337.             CloseRegKey $(FromTcpIpKey)
  2338.         Endif
  2339.         CloseRegKey $(FromAdapterKey)
  2340.     Endif
  2341.  
  2342.     return $(Result)
  2343.  
  2344. [GetOptionTitle]
  2345.     Debug-Output "NWSUBS.INF: GetOptionTitle called"
  2346.     set Status      = STATUS_FILENOTFOUND
  2347.     set AdapterTitle = ""
  2348.     ForListDo $($1)
  2349.         set OptionFile = *($($), 1)
  2350.         set OptionList = *($($), 2)
  2351.         set OptionTitleList = *($($), 3)
  2352.         ForListDo $(OptionList)
  2353.             ifstr(i) $($) == $($0)
  2354.                 set Status = STATUS_SUCCESSFUL
  2355.                 set AdapterTitle = *($(OptionTitleList), $(#))
  2356.             endif
  2357.         EndForListDo
  2358.     EndForListDo
  2359.  
  2360. finish_GetOptionFile = +
  2361.     Debug-Output "NWSUBS.INF: GetOptionTitle status "$(Status)"; title: "$(AdapterTitle)
  2362.  
  2363.     Return $(Status) $(AdapterTitle)
  2364.  
  2365. ;
  2366. ;
  2367. ; ===================================================================================
  2368. ;
  2369. ;                         NwDetectNdisAdapter
  2370. ; ===================================================================================
  2371. ;
  2372. ; Section to get the lan adapter installed and it's settings from
  2373. ; the Ndis bindings and parameters.
  2374. ;
  2375. ; INPUT:
  2376. ;     $($0)    Source directory from the NetWare Client Services install
  2377. ;
  2378. ; OUTPUT:
  2379. ;     $($R0)    Status of call.
  2380. ;
  2381. ; ===================================================================================
  2382.  
  2383. [NwDetectNdisAdapter]
  2384.     read-syms NwBaseVars
  2385.     read-syms OdiVars
  2386.  
  2387.     set AdapterSrcDir = $($0)
  2388.     set Result = "STATUS_SUCCESSFUL"
  2389.  
  2390.     StartWait
  2391.  
  2392.     Shell $(NwSubsInf), GetTotalAdapterList
  2393.  
  2394.     Set OdiProductNameList    = $($R0)
  2395.     Set OdiTitleList            = $($R1)
  2396.     Set OdiCardList            = $($R2)
  2397.     Set NumberOdiAdapters    = $($R3)
  2398.     Set NdisProductNameList    = $($R4)
  2399.     Set NdisTitleList            = $($R5)
  2400.     Set NdisCardList            = $($R6)
  2401.     Set NumberNdisAdapters    = $($R7)
  2402.     Set ODINSUPCardNumber    = $($R8)
  2403.  
  2404.     ifint $(NumberNdisAdapters) > 0
  2405.         ;
  2406.         ; we found at least one Ndis adapter
  2407.         ;
  2408.         set NdisCardName = *($(NdisProductNameList), 1)
  2409.         Debug-Output "NwDetectNdisAdapter: Found an Ndis driver: "$(NdisCardName)
  2410.         set NdisCardNumber = *($(NdisCardList), 1)
  2411.         Debug-Output "NdisCardName = "$(NdisCardName)
  2412.         Debug-Output "NdisCardNumber = "$(NdisCardNumber)
  2413.         set NdisServiceName = ""
  2414.         set NdisNetworkCardKeyName = $(NetworkCardsKeyName)"\"$(NdisCardNumber)
  2415.         OpenRegKey $(!REG_H_LOCAL) "" $(NdisNetworkCardKeyName) $(MAXIMUM_ALLOWED) NdisCardKey
  2416.         Ifstr(i) $(NdisCardKey) == ""
  2417.             Debug-Output "NWSUBS.INF: Can't open adapter "$(NdisNetworkCardKeyName)
  2418.         Else
  2419.             GetRegValue $(NdisCardKey) "ServiceName" ServiceNameList
  2420.             Debug-Output "NWSUBS.INF: NwDetectNdisAdapter: ServiceNameList = "$(ServiceNameList)
  2421.             set NdisServiceName = *($(ServiceNameList), 4)
  2422.             Debug-Output "NWSUBS.INF: Ndis Service Name = "$(NdisServiceName)
  2423.             CloseRegKey $(NdisCardKey)
  2424.         Endif
  2425.  
  2426.         set NdisDriverTable = ^(DriverTable, 1)
  2427.         set OdiDriverTable = ^(DriverTable, 2)
  2428.         set DriverIndex = ~($(NdisDriverTable), $(NdisCardName))
  2429.         ifint $(DriverIndex) > 0
  2430.             ;
  2431.             ; we found the Ndis driver name in our table
  2432.             ; so get the coresponding Odi driver name
  2433.             ;
  2434.             set OdiDriverName = *($(OdiDriverTable), $(DriverIndex))
  2435.             Debug-Output "NwDetectNdisAdapter: OdiDriverName = "$(OdiDriverName)
  2436.             set AdapterHardwareDetected = ""
  2437.             set AdapterSystemSet = ""
  2438.             set AdapterDefault = $(OdiDriverName)
  2439.  
  2440.             ;
  2441.             ; get a list of all possible adapters
  2442.             ;
  2443.             Shell "NTLANMAN.INF" InitOptionVars $(!STF_LANGUAGE) NetAdapter +
  2444.                 $(AdapterHardwareDetected) $(AdapterSystemSet) $(AdapterDefault)
  2445.             Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2446.                 Debug-Output "NWSUBS.INF: InitOptionVars ShellCode error "$($ShellCode)
  2447.                 Set Result = "SHELL_CODE_ERROR"
  2448.                 goto NwDetectNdisAdapterExit
  2449.             Endif
  2450.  
  2451.             Ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  2452.                 set AdapterOurINFOptions = $($R1)
  2453.                 set AdapterOemINFOptions = $($R2)
  2454.                 set AdapterMergedOptions = $($R3)
  2455.                 set AdapterSpecialOption = $($R4)
  2456.                 set AdapterCurrentOption = $($R5)
  2457.                 set AdapterOption        = *($($R5), 1)
  2458.  
  2459.                 Debug-Output "NWSUBS.INF: AdapterOurINFOptions = "$(AdapterOurINFOptions)
  2460.                 Debug-Output "NWSUBS.INF: AdapterOemINFOptions = "$(AdapterOemINFOptions)
  2461.                 Debug-Output "NWSUBS.INF: AdapterMergedOptions = "$(AdapterMergedOptions)
  2462.                 Debug-Output "NWSUBS.INF: AdapterOption = "$(AdapterOption)
  2463.  
  2464.                 ;
  2465.                 ; get the INF filename the ODI adapter is in
  2466.                 ;
  2467.                 Shell "NTLANMAN.INF" GetOptionFile $(AdapterOption) $(AdapterOurINFOptions)
  2468.                 Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2469.                     Debug-Output "NWSUBS.INF: GetOptionFile ShellCode error "$($ShellCode)
  2470.                     Set Result = "SHELL_CODE_ERROR"
  2471.                     goto NwDetectNdisAdapterExit
  2472.                 Endif
  2473.                 ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  2474.                     set AdapterINF = $($R1)
  2475.  
  2476.                     Shell "" GetOptionTitle $(AdapterOption) $(AdapterOurINFOptions)
  2477.                     Ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  2478.                         Debug-Output "NWSUBS.INF: GetOptionTitle ODI status = "$($R0)
  2479.                         goto NwDetectNdisAdapterExit
  2480.                     Endif
  2481.                     set OdiAdapterTitle = $($R1)
  2482.  
  2483.                     Shell "" GetOptionTitle $(NdisCardName) $(AdapterOurINFOptions)
  2484.                     Ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  2485.                         Debug-Output "NWSUBS.INF: GetOptionTitle NDIS status = "$($R0)
  2486.                         goto NwDetectNdisAdapterExit
  2487.                     Endif
  2488.                     set NdisAdapterTitle = $($R1)
  2489.  
  2490.                     set MessageText = "For the best NetWare performance we recommend replacing your "$(NdisAdapterTitle)" driver with the Novell Certified"$(OdiAdapterTitle)" driver.  Replace driver?"
  2491.                     set DlgType = "MessageBox"
  2492.                     set STF_MB_TITLE = "Replace NDIS driver with ODI driver"
  2493.                     set STF_MB_TEXT  = $(MessageText)
  2494.                     set STF_MB_TYPE  = 3
  2495.                     set STF_MB_ICON  = 4
  2496.                     set STF_MB_DEF    = 1
  2497.                     ui start "ReplaceNdisDriver"
  2498.  
  2499.                     Ifstr(i) $(DLGEVENT) == "NO"
  2500.                         Debug-Output "NWSUBS.INF: Don't replace the Ndis driver"
  2501.                         goto NwDetectNdisAdapterExit
  2502.                     Endif
  2503.  
  2504.                     ;
  2505.                     ; get the ndis parameters for this adapter
  2506.                     ;
  2507.                     set NdisParameters = $(!NTN_ServiceBase)"\"$(NdisServiceName)"\Parameters"
  2508.                     Debug-Output "NdisParameters = "$(NdisParameters)
  2509.                     OpenRegKey $(!REG_H_LOCAL) "" $(NdisParameters) $(MAXIMUM_ALLOWED) NdisParametersKey
  2510.                     Ifstr(i) $(NdisParametersKey) == ""
  2511.                         Debug-Output "NWSUBS.INF: Can't open "$(NdisParameters)
  2512.                     Else
  2513.                         EnumRegValue $(NdisParametersKey) NdisParametersList
  2514.                         Debug-Output "NdisParametersList = "$(NdisParametersList)
  2515.                         CloseRegKey $(NdisParametersKey)
  2516.                     Endif
  2517.  
  2518.                     ;
  2519.                     ; run the INF file to install the ODI driver
  2520.                     ;
  2521.  
  2522.                     set NwAddCopy = "NO"
  2523.                     set NwDoCopy = "NO"
  2524.                     set NwDoConfig = "NO"
  2525.                     Shell $(AdapterINF) InstallOption $(!STF_LANGUAGE) $(AdapterOption) +
  2526.                         $(AdapterSrcDir) $(NwAddCopy) $(NwDoCopy) $(NwDoConfig) +
  2527.                         $(NdisParametersList)
  2528.                     set Status = $($R0)
  2529.                     Debug-Output "NWSUBS.INF: InstallOption Status = "$(Status)
  2530.  
  2531.                     ;
  2532.                     ; if the Ndis adapter has tcpip bound to it move the info
  2533.                     ; to the ODINSUP service.
  2534.                     ;
  2535.  
  2536.                     set ODINSUPNetworkCardKeyName = $(NetworkCardsKeyName)"\"$(ODINSUPCardNumber)
  2537.                     Debug-Output "NWSUBS: ODINSUPNetworkCardKeyName = "$(ODINSUPNetworkCardKeyName)
  2538.                     Shell "" MoveTcpIpInfo $(NdisNetworkCardKeyName) $(ODINSUPNetworkCardKeyName)
  2539.  
  2540.                     ;
  2541.                     ; run the INF file to remove the NDIS driver
  2542.                     ;
  2543.                     Shell "NTLANMAN.INF" GetOptionFile $(NdisCardName) $(AdapterOurINFOptions)
  2544.                     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  2545.                         Debug-Output "NWSUBS.INF: GetOptionFile ShellCode error "$($ShellCode)
  2546.                         Set Result = "SHELL_CODE_ERROR"
  2547.                         goto NwDetectNdisAdapterExit
  2548.                     Endif
  2549.                     ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  2550.                         set NdisAdapterINF = $($R1)
  2551.                         Debug-Output "NWSUBS.INF: shell to "$(NdisAdapterINF)" to remove "$(NdisCardName)
  2552.                         set TmpInstallMode = $(!NTN_InstallMode)
  2553.                         set TmpRegBase = $(!NTN_RegBase)
  2554.                         set !NTN_InstallMode = deinstall
  2555.                         set !NTN_RegBase = $(NdisNetworkCardKeyName)
  2556.                         Shell $(NdisAdapterINF) InstallOption $(!STF_LANGUAGE) $(NdisCardName) +
  2557.                             $(AdapterSrcDir) $(NwAddCopy) $(NwDoCopy) $(NwDoConfig)
  2558.                         set Status = $($R0)
  2559.                         set !NTN_InstallMode = $(TmpInstallMode)
  2560.                         set !NTN_RegBase = $(TmpRegBase)
  2561.                         Debug-Output "NWSUBS.INF: Remove Ndis Adapter Status = "$(Status)
  2562.                     Endif
  2563.  
  2564.                 endif
  2565.             Endif
  2566.  
  2567.         endif
  2568.  
  2569.     endif
  2570.  
  2571.  
  2572. NwDetectNdisAdapterExit = +
  2573.     EndWait
  2574.  
  2575.     Return $(Result)
  2576.  
  2577.  
  2578. ; ===================================================================================
  2579. ;
  2580. ; ===================================================================================
  2581.  
  2582. [DriverTable]
  2583.     NE2000,      ODI_NE2000
  2584.     NE1000,      ODI_NE2000
  2585.     AM1500T,     ODI_NE1500T
  2586.     AM1500T,     ODI_M1500
  2587.     AM1500T,     ODI_NE2100
  2588.     NONE,        ODI_M2100
  2589.     IBMTOK,      ODI_IBMTOK1    
  2590.     IBMTOK,      ODI_NTR2000
  2591.     EWORK,       ODI_EWRK3
  2592.     HP27247B,      ODI_HP27247B
  2593.     HP27252A,      ODI_HP27252A
  2594.     J2573A,        ODI_HPJ2573A
  2595.     NONE,        ODI_MADGEODI
  2596.     NONE,        ODI_SMC8216
  2597.     SMC8416,       ODI_SMC8416
  2598.     NONE,        ODI_SMC8115T
  2599.     NONE,        ODI_SMC8115T_A
  2600.     TC$4045e,      ODI_TC4045
  2601.     TC$4046e,      ODI_TC4046
  2602.     NE2000MCA,    ODI_NE2
  2603.     NONE,            ODI_NE232
  2604.     IBMTOKMC,    ODI_IBMTOKMC
  2605.     NONE,            ODI_MADGEODIMC
  2606.     NONE,            ODI_SMC8216MC
  2607.     NONE,            ODI_SMC8416MC
  2608.     NONE,            ODI_SMC8115TMC
  2609.     NONE,            ODI_SMC8115T_AMC
  2610.     NONE,            ODI_TCTOKHMC
  2611.     NE3200,      ODI_NE3200
  2612.     NONE,        ODI_ES3210
  2613.     NONE,            ODI_EWRK3EISA
  2614.     NONE,            ODI_HP27247BEISA
  2615.     NONE,            ODI_HP27252AEISA
  2616.     NONE,            ODI_HPJ2577AEISA
  2617.     NONE,            ODI_MADGEODIEISA
  2618.     NONE,            ODI_NE3300EISA
  2619.     NONE,            ODI_SMC8216EISA
  2620.     NONE,            ODI_SMC8416EISA
  2621.     NONE,            ODI_SMC8115TEISA
  2622.     NONE,            ODI_SMC8115T_AEISA
  2623.     SMC8232,        ODI_SMC8232EISA
  2624.     NONE,            ODI_SMC8332EISA
  2625.     NONE,            ODI_SMC9232
  2626.     NONE,            ODI_TCE32ESHEISA
  2627.     NONE,            ODI_TC4045EISA
  2628.     NONE,            ODI_TC4046EISA
  2629.  
  2630.  
  2631.