Annotation of ntddk/src/setup/inf/subroutn.inf, revision 1.1.1.1

1.1       root        1: ;=====================================================================
                      2: ; THIS INF CONTAINS ALL THE SUBROUTINES COMMONLY USED IN THE SETUP INF
                      3: ;=====================================================================
                      4: ;
                      5: ;
                      6: ;========================================
                      7: ; MESSAGE REPORTING SUBROUTINES:
                      8: ;========================================
                      9: ;
                     10: ; 1. SetupMessage:  To display warnings, fatal errors, non fatal errors and
                     11: ;                   status messages.
                     12: ;
                     13: ; 2. QueryUserQuit: To ask if the user wants to quit setup.
                     14: ;
                     15: 
                     16: ;========================================
                     17: ; ALLOCATION AND DEALLOCATION OF DRIVES
                     18: ;========================================
                     19: ;
                     20: ; 1. AllocateUnusedDrive:  To allocate a drive letter to use for reassignment
                     21: ;
                     22: ; 2. FreeUnusedDrive: To free a drive to the unused drive list
                     23: ;
                     24: 
                     25: 
                     26: 
                     27: ;========================================
                     28: ; MESSAGE REPORTING SUBROUTINES:
                     29: ;========================================
                     30: 
                     31: ;-----------------------------------------------------------------------
                     32: ; ROUTINE:      SetupMessage
                     33: ;
                     34: ; DESCRIPTION:  This routine lets the user
                     35: ;
                     36: ; INPUTS:       $0:  Language To Use
                     37: ;               $1:  MessageType: WARNING | FATAL | NONFATAL | STATUS
                     38: ;               $2:  MessageText.
                     39: ;
                     40: ; OUTPUTS:      $R0: STATUS:   STATUS_SUCCESSFUL |
                     41: ;                              STATUS_NOLANGUAGE
                     42: ;                              STATUS_FAILED
                     43: ;
                     44: ;               $R1: DLGEVENT: OK | CANCEL
                     45: ;
                     46: ;------------------------------------------------------------------------
                     47: 
                     48: [SetupMessage]
                     49: 
                     50:     ;
                     51:     ; Initialize
                     52:     ;
                     53: 
                     54:     set Status     = STATUS_FAILED
                     55:     set UserAction = "CANCEL"
                     56: 
                     57:     ;
                     58:     ; See if the language indicated is supported
                     59:     ;
                     60:     ;
                     61:     ; Check if the language requested is supported
                     62:     ;
                     63:     set LanguageList = ^(LanguageID, 1)
                     64:     Ifcontains(i) $($0) in $(LanguageList)
                     65:         goto displaymessage
                     66:     else
                     67:         set Status = STATUS_NOLANGUAGE
                     68:         goto finish_SetupMessage
                     69:     endif
                     70: 
                     71:     ;
                     72:     ; examine the message type and accordingly read in the right dialog
                     73:     ; parameters
                     74:     ;
                     75: 
                     76: displaymessage = +
                     77:     set DlgText = $($2)
                     78: 
                     79:     ifstr(i) $($1) == "WARNING"
                     80:         read-syms WarningDlg$($0)
                     81: 
                     82:     else-ifstr(i) $($1) == "FATAL"
                     83:         read-syms FatalDlg$($0)
                     84: 
                     85:     else-ifstr(i) $($1) == "NONFATAL"
                     86:         read-syms NonfatalDlg$($0)
                     87: 
                     88:     else-ifstr(i) $($1) == "STATUS"
                     89:         read-syms StatusDlg$($0)
                     90: 
                     91:     else
                     92:         goto finish_SetupMessage
                     93: 
                     94:     endif
                     95: 
                     96:     ui start "SetupMessage"
                     97:     ifstr(i) $(DLGEVENT) == "OK"
                     98:         set Status     = STATUS_SUCCESSFUL
                     99:         set UserAction = $(DLGEVENT)
                    100: 
                    101:     else-ifstr(i) $(DLGEVENT) == "CANCEL"
                    102:         set Status     = STATUS_SUCCESSFUL
                    103:         set UserAction = $(DLGEVENT)
                    104:     else
                    105:     endif
                    106: 
                    107: finish_SetupMessage = +
                    108:     Return $(Status) $(UserAction)
                    109:     end
                    110: 
                    111: 
                    112: 
                    113: 
                    114: ;-----------------------------------------------------------------------
                    115: ; ROUTINE:      QueryUserQuit
                    116: ;
                    117: ; DESCRIPTION:  This routine queries whether the user wants to quit setup
                    118: ;
                    119: ; INPUTS:       $0:  Language To Use
                    120: ;
                    121: ; OUTPUTS:      $R0: Status:     STATUS_SUCCESSFUL |
                    122: ;                                STATUS_NOLANGUAGE |
                    123: ;                                STATUS_FAILED
                    124: ;
                    125: ;               $R1: UserAction: OK | CANCEL
                    126: ;
                    127: ;------------------------------------------------------------------------
                    128: 
                    129: [QueryUserQuit]
                    130: 
                    131:     set Status     = STATUS_FAILED
                    132:     set UserAction = CANCEL
                    133: 
                    134:     ;
                    135:     ; See if the language indicated is supported
                    136:     ;
                    137:     ;
                    138:     ; Check if the language requested is supported
                    139:     ;
                    140:     set LanguageList = ^(LanguageID, 1)
                    141:     Ifcontains(i) $($0) in $(LanguageList)
                    142:     else
                    143:         set Status = STATUS_NOLANGUAGE
                    144:         goto fin_QueryUserQuit
                    145:     endif
                    146: 
                    147:     ;
                    148:     ; read in quit message
                    149:     ;
                    150:     read-syms ExitWarningDlg$($0)
                    151:     ui start "ExitWarning"
                    152:     ifstr(i) $(DLGEVENT) == "YES"
                    153:         set Status     = STATUS_SUCCESSFUL
                    154:         set UserAction = "OK"
                    155: 
                    156:     else-ifstr(i) $(DLGEVENT) == "NO"
                    157:         set Status     = STATUS_SUCCESSFUL
                    158:         set UserAction = "CANCEL"
                    159:     else
                    160:     endif
                    161: 
                    162: fin_QueryUserQuit = +
                    163:     Return $(Status) $(UserAction)
                    164: 
                    165: 
                    166: 
                    167: ;-----------------------------------------------------------------------
                    168: ;
                    169: ; ROUTINE:     PushBillboard
                    170: ;
                    171: ; DESCRIPTION: Put up a billboard or update the text in the existing billboard
                    172: ;
                    173: ; INPUTS:      $0: Billboard template
                    174: ;              $1: Billboard message
                    175: ;
                    176: ; OUTPUTS:     None
                    177: ;------------------------------------------------------------------------
                    178: 
                    179: [PushBillboard]
                    180:     read-syms BillboardDlg$(!STF_LANGUAGE)
                    181:     ui start "Billboard"
                    182:     Return
                    183: 
                    184: 
                    185: ;-----------------------------------------------------------------------
                    186: ;
                    187: ; ROUTINE:     PopBillboard
                    188: ;
                    189: ; DESCRIPTION: Pop off a billboard
                    190: ;
                    191: ; INPUTS:      None
                    192: ;
                    193: ; OUTPUTS:     None
                    194: ;------------------------------------------------------------------------
                    195: 
                    196: [PopBillboard]
                    197:     ui pop 1
                    198:     Return
                    199: 
                    200: 
                    201: ;========================================
                    202: ; ALLOCATION AND DEALLOCATION OF DRIVES
                    203: ;========================================
                    204: 
                    205: ;-----------------------------------------------------------------------
                    206: ; ROUTINE:      AllocateUnusedDrive
                    207: ;
                    208: ; DESCRIPTION:  This routine lets the user allocate a drive from the unused
                    209: ;               drive pool.
                    210: ;
                    211: ; INPUTS:       None
                    212: ;
                    213: ; OUTPUTS:      $R0: STATUS:   STATUS_SUCCESSFUL |
                    214: ;                              STATUS_FAILED
                    215: ;               $R1: Drive allocated.
                    216: ;
                    217: ;------------------------------------------------------------------------
                    218: 
                    219: [AllocateUnusedDrive]
                    220:     ;
                    221:     ;
                    222:     set Status = STATUS_FAILED
                    223:     set Drive  = ""
                    224:     ;
                    225:     ifstr(i) $(!STF_UNUSEDDRIVES) == {}
                    226:         goto finish_allocate
                    227:     else-ifstr(i) $(!STF_UNUSEDDRIVES) == ""
                    228:         goto finish_allocate
                    229:     else
                    230:         set NewDriveList = {}
                    231:         ForListDo $(!STF_UNUSEDDRIVES)
                    232:             ifstr(i) $(#) != 1
                    233:                 set NewDriveList = >($(NewDriveList), $($))
                    234:             else
                    235:                 set Drive  = $($)
                    236:                 set Status = STATUS_SUCCESSFUL
                    237:             endif
                    238:         EndForListDo
                    239:         set !STF_UNUSEDDRIVES = $(NewDriveList)
                    240:     endif
                    241: 
                    242: finish_allocate = +
                    243:     Return $(Status) $(Drive)
                    244: 
                    245: 
                    246: ;-----------------------------------------------------------------------
                    247: ; ROUTINE:      FreeUnusedDrive
                    248: ;
                    249: ; DESCRIPTION:  This routine lets the user allocate a drive from the unused
                    250: ;               drive pool.
                    251: ;
                    252: ; INPUTS:       $0: Drive to free
                    253: ;
                    254: ; OUTPUTS:      None
                    255: ;
                    256: ;
                    257: ;------------------------------------------------------------------------
                    258: 
                    259: [FreeUnusedDrive]
                    260: 
                    261:     set !STF_UNUSEDDRIVES = >($(!STF_UNUSEDDRIVES), $($0))
                    262:     Return
                    263: 
                    264: 
                    265: ;-----------------------------------------------------------------------
                    266: ; ROUTINE:      DriversExist
                    267: ;
                    268: ; DESCRIPTION:  This routine informs the user that the drivers for the
                    269: ;               option he has selected exist on the destination and asks
                    270: ;               whether they should be replaced.
                    271: ;
                    272: ; INPUTS:       $0: Language To Use
                    273: ;               $1: Dialog Text
                    274: ;
                    275: ; OUTPUTS:      STATUS_CURRENT    if the current files are to be used
                    276: ;               STATUS_NEW        if new files are to be copied over
                    277: ;               STATUS_USERCANCEL if user chose to cancel installation
                    278: ;               STATUS_NOLANGUAGE if the language requested is not supported
                    279: ;               STATUS_FAILED     if any other failure exists
                    280: ;
                    281: ;------------------------------------------------------------------------
                    282: [DriversExist]
                    283: 
                    284:     set Status = STATUS_FAILED
                    285: 
                    286:     ;
                    287:     ; See if the language indicated is supported
                    288:     ;
                    289: 
                    290:     set LanguageList = ^(LanguageID, 1)
                    291:     Ifcontains(i) $($0) in $(LanguageList)
                    292:     else
                    293:         set Status = STATUS_NOLANGUAGE
                    294:         goto finish_DriversExist
                    295:     endif
                    296: 
                    297:     read-syms DriversExistDlg$($0)
                    298:     ui start "DriversExist"
                    299:     ifstr(i) $(DLGEVENT) == "DLGBUTTON0"
                    300:         set Status = STATUS_CURRENT
                    301:     else-ifstr(i) $(DLGEVENT) == "DLGBUTTON1"
                    302:         set Status = STATUS_NEW
                    303:     else-ifstr(i) $(DLGEVENT) == "BACK"
                    304:         set Status = STATUS_USERCANCEL
                    305:     endif
                    306:     ui pop 1
                    307: 
                    308: finish_DriversExist = +
                    309:     Return $(Status)
                    310: 
                    311: ;-----------------------------------------------------------------------
                    312: ;
                    313: ; ROUTINE:      DoAskSource
                    314: ;
                    315: ; DESCRIPTION:  This routine prompts the source of the windows nt files
                    316: ;
                    317: ; INPUTS:       $0:  Current Src
                    318: ;
                    319: ; OUTPUTS:      $R0: STATUS:   STATUS_SUCCESSFUL |
                    320: ;                              STATUS_USERCANCEL |
                    321: ;                              STATUS_FAILED
                    322: ;
                    323: ;               $R1: Diskette Src
                    324: ;
                    325: ;               $R2: Drive to Free or "" if none
                    326: ;
                    327: ;               $R3: Actual string returned from dialog
                    328: ;
                    329: ;------------------------------------------------------------------------
                    330: [DoAskSource]
                    331:     read-syms DoAskSourceDlgText$(!STF_LANGUAGE)
                    332:     shell "" DoAskSourceEx $($0) $(DlgText)
                    333:     Return $($R0) $($R1) $($R2) $($R3)
                    334: 
                    335: 
                    336: ;-----------------------------------------------------------------------
                    337: ;
                    338: ; ROUTINE:      DoAskSourceEx
                    339: ;
                    340: ; DESCRIPTION:  This routine prompts the source of the windows nt files
                    341: ;
                    342: ; INPUTS:       $0:  Current Src
                    343: ;               $1:  Dialog Text To Use
                    344: ;
                    345: ; OUTPUTS:      $R0: STATUS:   STATUS_SUCCESSFUL |
                    346: ;                              STATUS_USERCANCEL |
                    347: ;                              STATUS_FAILED
                    348: ;
                    349: ;               $R1: Diskette Src
                    350: ;
                    351: ;               $R2: Drive to Free or "" if none
                    352: ;
                    353: ;               $R3: Actual string returned from dialog
                    354: ;
                    355: ;------------------------------------------------------------------------
                    356: 
                    357: 
                    358: [DoAskSourceEx]
                    359:     ;
                    360:     ;
                    361:     set Status      = STATUS_FAILED
                    362:     set Src         = $($0)
                    363:     set DriveToFree = ""
                    364:     read-syms  AskSourceStrings$(!STF_LANGUAGE)
                    365: 
                    366: asksource = +
                    367:     read-syms DisketteDlg$(!STF_LANGUAGE)
                    368:     ui start "Diskette"
                    369:     ifstr(i) $(DLGEVENT) == "CONTINUE"
                    370:         LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(EditTextOut)
                    371:         ifstr(i) $(IsFullPath) == "NO"
                    372:             StartWait
                    373:             LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(EditTextOut)
                    374:             EndWait
                    375:             ifstr(i) $(STATUS) == "ERROR"
                    376:                 shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String1)
                    377:                 goto asksource
                    378:             else-ifstr(i) $(STATUS) == "NOT-UNC"
                    379:                 shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String2)
                    380:                 goto asksource
                    381:             else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
                    382:                 shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String4)
                    383:                 goto asksource
                    384:             else
                    385:                 set Src = $(STATUS)
                    386:             endif
                    387:         else
                    388:             set Src = $(EditTextOut)
                    389:         endif
                    390: 
                    391:         ui pop 1
                    392:         LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(Src)
                    393:         ifstr(i) $(STATUS) == "ERROR"
                    394:             goto finish_DoAskSource
                    395:         else
                    396:             set Src = $(STATUS)
                    397:             set Status = STATUS_SUCCESSFUL
                    398:             goto finish_DoAskSource
                    399:         endif
                    400: 
                    401:     else-ifstr(i) $(DLGEVENT) == "BACK"
                    402:         ui pop 1
                    403:         set Status = STATUS_USERCANCEL
                    404:         goto finish_DoAskSource
                    405:     else
                    406:         ui pop 1
                    407:         goto finish_DoAskSource
                    408:     endif
                    409: 
                    410: finish_DoAskSource = +
                    411:     Return $(Status) $(Src) $(DriveToFree) $(EditTextOut)
                    412: 
                    413: 
                    414: ;--------------------------------------------------------------------------
                    415: ; Setup.Hlp Context IDs
                    416: ; =====================
                    417: ;
                    418: ; The following are the help IDs used in the setup inf files.  The help IDs
                    419: ; are in the following ranges:
                    420: ;
                    421: ; 0    -  999  : Main Setup
                    422: ; 1000 - 1999  : Network Setup
                    423: ; 2000 - 2999  : MaintenanceModeSetup
                    424: ;
                    425: ;---------------------------------------------------------------------------
                    426: 
                    427: [SetupHelpIds]
                    428: 
                    429:     ;
                    430:     ; NOTE:  PLEASE UPDATE THE !MaximumID field whenever you add a new ID
                    431:     ;
                    432: 
                    433:     !MinimumID                 =    0
                    434:     !MaximumID                 = 5000
                    435:     !InitialContentsID         = 5
                    436: 
                    437:     ;
                    438:     ; Main Setup IDs
                    439:     ;
                    440: 
                    441:     !IDH_DB_COMPUTERNAMEQ_INS  =   10
                    442:     !IDH_DB_COMPUTERNAMEV_INS  =   11
                    443:     !IDH_DB_FULLNAMEQ_INS      =   30
                    444:     !IDH_DB_FULLNAMEV_INS      =   31
                    445:     !IDH_DB_ORGNAMEQ_INS       =   32
                    446:     !IDH_DB_ORGNAMEV_INS       =   33
                    447:     !IDH_DB_INSTALLMODE_INS    =   50
                    448:     !IDH_DB_OPTIONS_INS        =   60
                    449:     !IDH_DB_SYSTEM_INS         =   70
                    450:     !IDH_DB_VIRTUAL_INS        =   80
                    451:     !IDH_DB_REPAIR_INS         =   90
                    452:     !IDH_DB_PRNSETUP_INS       =  100
                    453:     !IDH_DB_OPTIONAL_INS       =  110
                    454:     !IDH_DB_CUSTOMISE_INS      =  111
                    455:     !IDH_DB_OEMSINGLESEL_INS   =  120
                    456:     !IDH_DB_OEMMULTISEL_INS    =  121
                    457:     !IDH_DB_ACCOUNTSETUP_INS   =  130
                    458:     !IDH_DB_ACCOUNTADMN_INS    =  131
                    459:     !IDH_DB_SEARCHDRIVE_INS    =  150
                    460:     !IDH_DB_APPCONFLICT_INS    =  151
                    461: 
                    462:     ;
                    463:     ; Maintenance mode setup IDs
                    464:     ;
                    465: 
                    466:     !IDH_DB_MAINTAIN_INS            = 1000
                    467:     !IDH_DB_MOPTIONAL_INS           = 1010
                    468:     !IDH_DB_MCUSTOMISE_INS          = 1011
                    469:     !IDH_DB_MSYSTEM_INS             = 1020
                    470:     !IDH_DB_MPROFILE_INS            = 1030
                    471:     !IDH_DB_SCSI_DRIVER_INS         = 1040
                    472:     !IDH_DB_SCSI_SELECTDRIVER_INS   = 1041
                    473:     !IDH_DB_DRIVEREXIST_INS         = 1042
                    474:     !IDH_DB_TAPE_DRIVER_INS         = 1043
                    475:     !IDH_DB_TAPE_SELECTDRIVER_INS   = 1044
                    476: 
                    477: 
                    478:     ;
                    479:     ; Network card inf Help ID
                    480:     ;
                    481: 
                    482:     !IDH_DB_CARDSELECTION_INS   = 3000  ; Net card selection dialog
                    483:     !IDH_DB_SOFTSELECTION_INS   = 3001  ; Software selection dialog
                    484:     !IDH_DB_OEMNADD1_INS        = 3500  ; Dec100
                    485:     !IDH_DB_OEMNADD2_INS        = 3510  ; Dec201
                    486:     !IDH_DB_OEMNADDE_INS        = 3520  ; Decstation
                    487:     !IDH_UB_OEMNADDP_INS        = 3521  ; DEC PC
                    488:     !IDH_DB_OEMNADE1_INS        = 3530  ; Elink 16
                    489:     !IDH_DB_OEMNADE2_INS        = 3540  ; Elink ii
                    490:     !IDH_DB_OEMNADE3_INS        = 3545  ; Elink 3
                    491:     !IDH_DB_OEMNADLB_INS        = 3546  ; MS Loop Back
                    492:     !IDH_DB_OEMNADAM_INS        = 3547  ; AMD
                    493:     !IDH_DB_OEMNADEM_INS        = 3550  ; Elink MC
                    494:     !IDH_DB_OEMNADN2_INS        = 3551  ; NE2000
                    495:     !IDH_DB_OEMNADN1_INS        = 3552  ; NE1000
                    496:     !IDH_DB_OEMNADNE_INS        = 3560  ; NE3200
                    497:     !IDH_DB_OEMNADIN_INS        = 3561  ; Intel EE16
                    498:     !IDH_DB_OEMNADP3_INS        = 3570  ; Proteon 1390
                    499:     !IDH_DB_OEMNADP9_INS        = 3580  ; Proteon 1990
                    500:     !IDH_DB_OEMNADSO_INS        = 3590  ; Sonic
                    501:     !IDH_DB_OEMNADTK_INS        = 3600  ; IBM Token
                    502:     !IDH_DB_OEMNADTM_INS        = 3605  ; IBM Token
                    503:     !IDH_DB_OEMNADUB_INS        = 3610  ; UB Card
                    504:     !IDH_DB_OEMNADWD_INS        = 3620  ; Western Digital
                    505:     !IDH_DB_OEMNADWM_INS        = 3630  ; Western Digital MicroChannel
                    506:     !IDH_DB_OEMNSVNB_INS        = 3640  ; Netbios
                    507:     !IDH_DB_OEMNSVRD_INS        = 3650  ; Redriector
                    508:     !IDH_DB_OEMNSVRE_INS        = 3660  ; Repl
                    509:     !IDH_DB_OEMNSVSV_INS        = 3670  ; Server
                    510:     !IDH_DB_OEMNSVWK_INS        = 3680  ; workstation
                    511:     !IDH_DB_OEMNXPDL_INS        = 3690  ; dlc
                    512:     !IDH_DB_OEMNXPNB_INS        = 3700  ; netbeui
                    513:     !IDH_DB_OEMNXPSN_INS        = 3710  ; snmp
                    514:     !IDH_DB_OEMNXPSN_1          = 3711  ; snmp - 1st dialog
                    515:     !IDH_DB_OEMNXPSN_2          = 3712  ; snmp - security dialog
                    516:     !IDH_DB_OEMNXPTC_INS        = 3720  ; tcpip
                    517:     !IDH_DB_OEMNXPTC_1          = 3721  ; tcpip - 1st dialog
                    518:     !IDH_DB_OEMNXPTC_2          = 3722  ; tcpip - 2nd dialog
                    519:     !IDH_DB_OEMNXPTC_3          = 3723  ; tcpip - 3nd dialog
                    520:     !IDH_DB_LMHOST_INS          = 3730  ; LMHOST dialog
                    521:     !IDH_DB_RPCLOCATE_INS       = 3740  ; RPC Name Service dialog
                    522: 
                    523:     !IDH_DB_GET_PROTOCOL        = 4000  ; Get Primary Protocol dialog
                    524:     !IDH_DB_VER_EXISTED         = 4010  ; software or netcard already existed
                    525:     !IDH_DB_DETECT_BYPASS       = 4020  ; Want to bypass netcard detection?
                    526:     !IDH_DB_DETECT_FOUND        = 4030  ; Detection found a netcard
                    527:     !IDH_DB_DETECT_FAILED       = 4040  ; Netcard detection failed
                    528:     !IDH_DB_DETECT_CHKRAS       = 4050  ; Detection failed-- want RAS?
                    529:        !IDH_DB_OEMNADLT_INS            = 4060  ; LocalTalk Card Config help
                    530: 
                    531: 
                    532: ;-----------------------------------------------------------------------
                    533: ; ROUTINE:      ReadSetupHelpIds
                    534: ;
                    535: ; DESCRIPTION:  This routine sets up the help context ids as globals
                    536: ;
                    537: ;
                    538: ; INPUTS:       $0: Drive to free
                    539: ;
                    540: ; OUTPUTS:      None
                    541: ;
                    542: ;
                    543: ;------------------------------------------------------------------------
                    544: 
                    545: [ReadSetupHelpIds]
                    546:     read-syms "SetupHelpIds"
                    547:     Return

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.