.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off
/*********************************************************************/
/*  SUBROUTINE NAME: MAIN                                            */
/*                                                                   */
/*  DESCRIPTION NAME: Return message text.                           */
/*                                                                   */
/*  FUNCTION: Retrieves a message from the specified message file(s) */
/*            (root & subs) and inserts variable information into    */
/*            the body of the message.                               */
/*                                                                   */
/*  NOTE: Variable data insertion does not depend on blank character */
/*        delimiters nor are blanks automatically inserted.          */
/*        The filename input parameter can be of the form pathname\  */
/*        filename.                                                  */
/*                                                                   */
/*  ENTRY POINT: DOSGETMESSAGE                                       */
/*                                                                   */
/*  INPUT: IVTABLE : Variable text table address(double word)        */
/*         IVCOUNT : Variable text count(word)                       */
/*         DATAAREA : Message buffer address(double word)            */
/*         DATALENGTH : Message buffer length(word)                  */
/*         MSGNUMBER : Message ID number(word)                       */
/*         FILENAME : Root message file name(double word)            */
/*         MSGLENGTH : Actual message length returned(double word)   */
/*                                                                   */
/*  EXIT-NORMAL: DATAAREA points to message buffer where contains    */
/*               the retrieved message.                              */
/*               MSGLENGTH points to the actual length of the        */
/*               returned message.                                   */
/*                                                                   */
/*  EXIT-ERROR:  Error setup and returned,                           */
/*                 . Message file not found                          */
/*                 . Message too long for buffer                     */
/*                 . Message ID number not found                     */
/*                 . Invalid message file format                     */
/*                 . Invalid insertion variable count                */
/*                 . Unable to perform requested function            */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: FIND_FILE, VAL_FORMAT, VAL_MID_NUM,         */
/*                       GET_MESSAGE.                                */
/*                                                                   */
/*  EXTERNAL REFERENCES: CHECK_DBCS, DosInsMessage, DosSemRequest,   */
/*                       DosClose, DosFreeSeg, DosSemClear,          */
/*                       DosGetCP.                                   */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    If NOT familyAPI                                               */
/*    then                                                           */
/*      EnterPROC(protect mode linkage setup)                        */
/*    else                                                           */
/*      RealENTER(real mode linkage setup)                           */
/*    Save caller's environment                                      */
/*    If NOT familyAPI                                               */
/*    then                                                           */
/*      Trace hook up                                                */
/*    Initial setup(Clear user_expanded_EXE_file_flag)               */
/*    Check insert variable count(range 0-9) from input              */
/*    If error                                                       */
/*    then                                                           */
/*      Return error code(invalid ivcount)                           */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    Call check_DBCS(with current system default)                   */
/*    If DBCS                                                        */
/*    then                                                           */
/*      Setup DBCS flag to TRUE                                      */
/*    If NOT familyAPI                                               */
/*    then                                                           */
/*      While TRUE                                                   */
/*      Do                                                           */
/*        Call DosSemRequest                                         */
/*        If semaphore OK                                            */
/*        then                                                       */
/*          Exit while loop                                          */
/*        else                                                       */
/*          If semaphore already owned by this process               */
/*          then                                                     */
/*            Exit while loop                                        */
/*      EndDo                                                        */
/*    Call DosGetCP                                                  */
/*    Clear subfile_flag(=0)                                         */
/*    Clear default root flag(=0)                                    */
/*    Call find_file(find root-message file)                         */
/*    If RAM message found flag was set                              */
/*    then                                                           */
/*      Call insert message(from expanded EXE file)                  */
/*      Exit MAIN                                                    */
/*    Move file pointer to the beginning of message file             */
/*    Read header of the root message file                           */
/*    If read error                                                  */
/*    then                                                           */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    If # of bytes read NOT match read count                        */
/*    then                                                           */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    Save version #, message count, base id, indicator, component id*/
/*    Get offset of the code page control data from root header      */
/*    If offset of code page NOT exists(=0)                          */
/*    then                                                           */
/*      Return error code(invalid message file)                      */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    Move file pointer to offset of code page                       */
/*    Read in code page control data                                 */
/*    If read error                                                  */
/*    then                                                           */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    If # of bytes read NOT match read count                        */
/*    then                                                           */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    Get code page counts                                           */
/*    If code page count == 0                                        */
/*    then                                                           */
/*      Set code_page_found_flag to TRUE                             */
/*    else                                                           */
/*      Get extended header size for last message use                */
/*      While code page counts <> 0                                  */
/*      Do                                                           */
/*        Get stored CP                                              */
/*        If current process CP <> stored CP                         */
/*        then                                                       */
/*          down code page counts by 1                               */
/*        else                                                       */
/*          Set code_page_found_flag to TRUE                         */
/*      EndDo                                                        */
/*    If code_page_found_flag is FALSE                               */
/*    then                                                           */
/*      If root message file extended header NOT exists(=0)          */
/*      then                                                         */
/*        Set default root flag to TRUE                              */
/*      else                                                         */
/*        Move file pointer to offset of extended header             */
/*        Read root message file extended header(4 bytes)            */
/*        If read error                                              */
/*        then                                                       */
/*          Call clean up                                            */
/*          Exit MAIN                                                */
/*        If # of bytes read NOT match read count                    */
/*        then                                                       */
/*          Call clean up                                            */
/*          Exit MAIN                                                */
/*        Get # of definition records                                */
/*        Read in first definition record(file pointer is OK here)   */
/*        Set definition_record_found_flag to FALSE                  */
/*        While (# of definition records <> 0) AND                   */
/*              (definition_record_found_flag is FALSE)              */
/*        Do                                                         */
/*          Get current def. record CP count(internal loop needed)   */
/*          If any of current def. record CP = current process CP    */
/*          then                                                     */
/*            Save sub message file name and related information     */
/*            Set definition_record_found_flag to TRUE               */
/*          else                                                     */
/*            Down # of definition records by 1                      */
/*            Read in next definition record                         */
/*          If definition_record_found_flag is FALSE                 */
/*          then                                                     */
/*            Reset subfile_flag(=0)                                 */
/*            Set default root flag to TRUE                          */
/*            Exit while loop                                        */
/*          else                                                     */
/*            Set subfile_flag(=1)                                   */
/*            Call find_file(try to find the sub-message file)       */
/*            If return code is OK                                   */
/*            then                                                   */
/*              Save current country ID                              */
/*              Exit while loop                                      */
/*            else                                                   */
/*              Down # of definition records by 1                    */
/*              Read in next definition record                       */
/*        EndDo                                                      */
/*    Call CHECK_DBCS(use the current CP & country ID)               */
/*    If user_expanded_EXE_file_flag is FALSE                        */
/*    then                                                           */
/*      If subfile_flag is set                                       */
/*      then                                                         */
/*        Call val_format                                            */
/*        If return code NOT OK & version # is 1(old)                */
/*        then                                                       */
/*          Call clean up                                            */
/*          Exit MAIN                                                */
/*      Call val_mid_num                                             */
/*      If return code NOT OK & version # is 1(old)                  */
/*      then                                                         */
/*        Call clean up                                              */
/*        Exit MAIN                                                  */
/*      Call get_message                                             */
/*      If return code NOT OK                                        */
/*      then                                                         */
/*        Call clean up                                              */
/*        Exit MAIN                                                  */
/*      Set up user's buffer to receive the message text             */
/*    Check message class                                            */
/*    If message class is 'E' or 'W'                                 */
/*    then                                                           */
/*      Set message_id_flag to TRUE                                  */
/*    If message_id_flag is TRUE                                     */
/*    then                                                           */
/*      Call copymsghd                                               */
/*      If return code NOT OK                                        */
/*      then                                                         */
/*        Call DosFreeSeg                                            */
/*        Call clean up                                              */
/*        Exit MAIN                                                  */
/*    Call DosInsMessage                                             */
/*    If message_id_flag is TRUE                                     */
/*    then                                                           */
/*      Call DosFreeSeg                                              */
/*      Call clean up                                                */
/*      Exit MAIN                                                    */
/*    Call clean up                                                  */
/*  END                                                              */
/*                                                                   */
/* .................. clean up ..................................... */
/*                                                                   */
/*  BEGIN                                                            */
/*    If message_file_handle_flag is FALSE                           */
/*    then                                                           */
/*      Call DosClose                                                */
/*    If return code is NOT OK and error code <> message too long    */
/*    then                                                           */
/*      Call copyretmsg(return error message to user buffer)         */
/*      If return code is NOT OK                                     */
/*      then                                                         */
/*        Restore the old return code                                */
/*    If NOT familyAPI                                               */
/*    then                                                           */
/*      Call DosSemClear                                             */
/*      Trace hook up                                                */
/*    Restore caller's environment                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/
.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: CHECK_DBCS                                      */
/*                                                                   */
/*  DESCRIPTION NAME: Get DBCS lead byte table.                      */
/*                                                                   */
/*  FUNCTION: Calls DosGetDBCSEv to get lead byte range table and    */
/*            save those information.                                */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: CHECK_DBCS                                          */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: Carry flag clear - Single byte.                     */
/*               Carry flag set - Double byte                        */
/*                                                                   */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosGetDBCSEv.                               */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Save caller's environment                                      */
/*    Set up DBCS segment data                                       */
/*    If 1st time check on DBCS                                      */
/*    then                                                           */
/*      Set DBCS flag checked                                        */
/*      Call DosGetDBCSEv                                            */
/*      If return code OK                                            */
/*      then                                                         */
/*        If first 2 bytes of DBCS environment are NOT zero          */
/*        then                                                       */
/*          Set carry flag                                           */
/*        else                                                       */
/*          Clear carry flag                                         */
/*      else                                                         */
/*        Clear carry flag                                           */
/*    else                                                           */
/*      If first 2 bytes of DBCS environment are NOT zero            */
/*      then                                                         */
/*        Set carry flag                                             */
/*      else                                                         */
/*        Clear carry flag                                           */
/*    Restore caller's environment                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: FIND_FILE                                       */
/*                                                                   */
/*  DESCRIPTION NAME: Open the requested message file.               */
/*                                                                   */
/*  FUNCTION: Open the requested message file and return the file    */
/*            handle.                                                */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: FIND_FILE                                           */
/*                                                                   */
/*  INPUT: Message file name(could be either root or sub).           */
/*                                                                   */
/*  EXIT-NORMAL: Return the message file handle.                     */
/*                                                                   */
/*  EXIT-ERROR: Error setup and returned.                            */
/*                 . Message file not found                          */
/*                 . Unable to perform requested function            */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: fold_up, filename_strip, do_open,           */
/*                       test_open_err, open_dpath, getbootroot,     */
/*                       xfer_filename                               */
/*                                                                   */
/*  EXTERNAL REFERENCES: ramfind, DosCaseMap, DosSearchPath.         */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Init setup(set user_expanded_EXE_file_flag off)                */
/*    Clear subfile_flag(=0)                                         */
/*    If subfile_flag is FALSE(=0)                                   */
/*    then                                                           */
/*      Get message file name from root                              */
/*    else                                                           */
/*      Get message file name from sub                               */
/*    Calculate length of message file name                          */
/*    Save message file name                                         */
/*    Call fold_up(convert file name to upper case)                  */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Exit find_file                                               */
/*    Call filename_strip(get file name only)                        */
/*    If MSG segment exists(selector <> 0)                           */
/*    then                                                           */
/*      Call ramfind(pass CPLIST(current process CP) as extra para)  */
/*      If user has expanded EXE file                                */
/*      then                                                         */
/*        Set user_expanded_EXE_file_flag to TRUE                    */
/*        Exit find_file                                             */
/*    Load # of message files name saved in table                    */
/*    Setup first table file name                                    */
/*    Set file_found_flag FALSE                                      */
/*    While(# of message files name saved <> 0) AND                  */
/*         (file_found_flag is FALSE)                                */
/*    Do                                                             */
/*      If message file name <> table saved file name                */
/*      then                                                         */
/*        Down # of message files name saved by 1                    */
/*        get next table saved file name                             */
/*      else                                                         */
/*        Set file_found_flag to TRUE                                */
/*    EndDo                                                          */
/*    If file_found_flag is FALSE                                    */
/*    then                                                           */
/*      Call do_open                                                 */
/*      Call test_open_err                                           */
/*      If error                                                     */
/*      then                                                         */
/*        If NOT familyAPI                                           */
/*        then                                                       */
/*          Save return code(open failed)                            */
/*        Call filename_strip(get file name only)                    */
/*        If NOT familyAPI                                           */
/*        then                                                       */
/*          Call open_dpath                                          */
/*        else                                                       */
/*          Call do_open                                             */
/*        Call test_open_err                                         */
/*        If error                                                   */
/*        then                                                       */
/*          Exit find_file                                           */
/*        Call getbootroot                                           */
/*        If familyAPI                                               */
/*        then                                                       */
/*          If NO drive letter found                                 */
/*          then                                                     */
/*            Set 'C' as default drive in user buffer                */
/*        Call xfer_filename(copy file name to user buffer)          */
/*        Call do_open                                               */
/*        Call test_open_err                                         */
/*        If error                                                   */
/*        then                                                       */
/*          Exit find_file                                           */
/*    Save opened handle and related information                     */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: VAL_FORMAT                                      */
/*                                                                   */
/*  DESCRIPTION NAME: Validate either root or sub message file format*/
/*                                                                   */
/*  FUNCTION: Validates the format of the requested root/sub message */
/*            file and reads the header information of it.           */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: VAL_FORMAT                                          */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0.                                             */
/*                                                                   */
/*  EXIT-ERROR: Error setup and returned.                            */
/*                 . Invalid message file format                     */
/*                 . Unable to perform requested function            */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: fold_up.                                    */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosRead, DosReallocSeg, DosClose.           */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    If subfile_flag is ON                                          */
/*    then                                                           */
/*      Init setup(set user supplied buffer pointer)                 */
/*      Move message file pointer to the beginning                   */
/*      Call DosRead(read message header)                            */
/*      If return code is NOT OK                                     */
/*      then                                                         */
/*        Set error code(read error)                                 */
/*        Call DosClose                                              */
/*        Exit val_format                                            */
/*    Check message header signature                                 */
/*    If NOT match                                                   */
/*    then                                                           */
/*      Set error code(invalid message format)                       */
/*      Call DosClose                                                */
/*      Exit val_format                                              */
/*    Check space for saving the message file handle and file name   */
/*    If NO space is available(only the first one was reserved)      */
/*    then                                                           */
/*      Call DosReallocSeg                                           */
/*      If return code is NOT OK                                     */
/*      then                                                         */
/*        Save message component ID on user stack                    */
/*        Set error code(reallocation error)                         */
/*        Call DosClose                                              */
/*        Exit val_format                                            */
/*    Save message file handle and file name                         */
/*    Call fold_up(convert file name into upper case)                */
/*    Save message component ID                                      */
/*    Save message file code page                                    */
/*    Save message file language family ID                           */
/*    Save message count                                             */
/*    Save message base_ MID                                         */
/*    Save message language family ID                                */
/*    Save message language version ID                               */
/*    Save message code page count                                   */
/*    Save message code pages which associate with this message file */
/*    Bump number of saved message files                             */
/*    Set message_file_handle_flag to TRUE                           */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: VAL_MID_NUM                                     */
/*                                                                   */
/*  DESCRIPTION NAME: Validate message ID number.                    */
/*                                                                   */
/*  FUNCTION: Validates the message number is within the valid range */
/*            as determined by base message ID and message count,    */
/*            then the offset of the requested message is returned.  */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: VAL_MID_NUM                                         */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0.                                             */
/*                                                                   */
/*  EXIT-ERROR: Error setup and returned.                            */
/*                 . Message ID number not found                     */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosRead, DosChgFilePtr.                     */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Init setup(get message number)                                 */
/*              (message base_MID)                                   */
/*              (message count)                                      */
/*    Check message number domain                                    */
/*    If error(either message number < message base_MID)             */
/*            (or message number > message base_MID + message count) */
/*    then                                                           */
/*      Set error code(invalid message ID)                           */
/*      Exit val_mid_num                                             */
/*    Get difference between message number and message base_MID     */
/*    Check first reserved byte(flag to identify where the messages) */
/*                             (are located)                         */
/*    If double word offset                                          */
/*    then                                                           */
/*      Multiple difference by 4                                     */
/*    else                                                           */
/*      Multiple difference bt 2                                     */
/*    Add message header size                                        */
/*    Call DosChgFilePtr                                             */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(move message file pointer error)              */
/*      Exit val_mid_num                                             */
/*    Call DosRead to get message number offset(either 4 or 8)       */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(read message file error)                      */
/*      Exit val_mid_num                                             */
/*    If message number is last message(   message number            */
/*                                       - message base_MID          */
/*                                       + 1                         */
/*                                       = message count)            */
/*    then                                                           */
/*      Call DosChgFilePtr                                           */
/*      If return code is NOT OK                                     */
/*      then                                                         */
/*        Set error code(move message file pointer error)            */
/*        Exit val_mid_num                                           */
/*      Get message length of last message                           */
/*      Exit val_mid_num                                             */
/*    Get message length of this message(corresponding to the)       */
/*                                      (user's message number)      */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: GET_MESSAGE                                     */
/*                                                                   */
/*  DESCRIPTION NAME: Get the requested message.                     */
/*                                                                   */
/*  FUNCTION: Read message text into local buffer from either the    */
/*            root message file or from the sub message file.        */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: GET_MESSAGE                                         */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0.                                             */
/*                                                                   */
/*  EXIT-ERROR: Error setup and returned.                            */
/*                 . Unable to perform requested function            */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosallocSeg, DosChgFilePtr, DosRead,        */
/*                       DosFreeSeg.                                 */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Get message number offset                                      */
/*    Get message number length                                      */
/*    Call DosAllocSeg                                               */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(allocate memory error)                        */
/*      Call DosFreeSeg                                              */
/*      Exit get_message                                             */
/*    Call DosChgFilePtr(move message file pointer to message number)*/
/*                      (offset)                                     */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(move file pointer error)                      */
/*      Call DosFreeSeg                                              */
/*      Exit get_message                                             */
/*    Call DosRead                                                   */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(read message file error)                      */
/*      Call DosFreeSeg                                              */
/*      Exit get_message                                             */
/*    Check actual bytes read = message text length                  */
/*    If NOT OK                                                      */
/*    then                                                           */
/*      Set error code(read message file error)                      */
/*      Call DosFreeSeg                                              */
/*      Exit get_message                                             */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off
/*********************************************************************/
/*  SUBROUTINE NAME: FOLD_UP                                         */
/*                                                                   */
/*  DESCRIPTION NAME: Fold message file name to upper case.          */
/*                                                                   */
/*  FUNCTION: Folds message file name to upper case. Skips all       */
/*            double byte characters. Once ASCIIZ string has been    */
/*            processed, DosCaseMap will be called to fold any       */
/*            character that is greater than 7fh.                    */
/*                                                                   */
/*  NOTE: Chk_lead_byte will return is_lead_byte TRUE or FALSE.      */
/*                                                                   */
/*  ENTRY POINT: fold_up                                             */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0.                                             */
/*                                                                   */
/*  EXIT-ERROR: Error setup and returned.                            */
/*                 . Unable to perform requested function            */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: Chk_lead_byte, DosCaseMap.                  */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Setup message file name pointer                                */
/*    While NOT end of message file name string                      */
/*    Do                                                             */
/*      Get byte                                                     */
/*      If(DBCS flag is TRUE) and (is_lead_byte is TRUE)             */
/*      then                                                         */
/*        Advances 2 characters                                      */
/*      else                                                         */
/*        If byte >='a' and byte <='z'                               */
/*        then                                                       */
/*          Converts byte to upper case                              */
/*        Advances 1 character                                       */
/*    EndDo                                                          */
/*    Call DosCaseMap                                                */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/
.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off
/*********************************************************************/
/*  SUBROUTINE NAME: CHK_LEAD_BYTE                                   */
/*                                                                   */
/*  DESCRIPTION NAME: Check for lead byte.                           */
/*                                                                   */
/*  FUNCTION: Determines that the character is the lead byte of      */
/*            a double byte character.                               */
/*                                                                   */
/*  NOTE: Valid lead byte range is country dependent.                */
/*                                                                   */
/*        China - People's of China       81H-FCH                    */
/*              - Republic's of China     81H-FCH                    */
/*                                                                   */
/*        Japan -                         81H-9FH & E0H-FCH          */
/*                                                                   */
/*        Korea -                         81H-BFH                    */
/*                                                                   */
/*  ENTRY POINT: chk_lead_byte                                       */
/*                                                                   */
/*  INPUT: Character to test                                         */
/*                                                                   */
/*  EXIT-NORMAL: Carry flag clear = single byte                      */
/*               Carry flag set   = double byte                      */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Init setup(set DBCS segment)                                   */
/*    If (char >= low range) and (char <= high range)                */
/*    then                                                           */
/*      Clear carry flag                                             */
/*    else                                                           */
/*      Set carry flag                                               */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/
.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off
/*********************************************************************/
/*  SUBROUTINE NAME: FILENAME_STRIP                                  */
/*                                                                   */
/*  DESCRIPTION NAME: Strip filename out of the input string.        */
/*                                                                   */
/*  FUNCTION: Points to stripped filename.                           */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: filename_strip                                      */
/*                                                                   */
/*  INPUT: Points to ASCIIZ input string                             */
/*                                                                   */
/*  EXIT-NORMAL: stripped filename                                   */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: Chk_lead_byte.                              */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Init setup(column count to zero)                               */
/*              (is_BC to zero)                                      */
/*    While NOT end of string                                        */
/*    Do                                                             */
/*      Get byte                                                     */
/*      If (DBCS flag is TRUE) and (is_lead_byte is TRUE)            */
/*      then                                                         */
/*        Advance 2 bytes                                            */
/*        Bump column count by 2                                     */
/*        Down input filename string by 2                            */
/*      else                                                         */
/*        If (byte = '\') or (byte = ':')                            */
/*        then                                                       */
/*          is_BC = column count                                     */
/*        Advance 1 byte                                             */
/*        Bump column count by 1                                     */
/*        Down input filename string by 1                            */
/*    EndDo                                                          */
/*    Setup pointer = pointer - (column count - is_BC)               */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/
.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: DO_OPEN                                         */
/*                                                                   */
/*  DESCRIPTION NAME: Performs DosOpen call.                         */
/*                                                                   */
/*  FUNCTION: Issue DosOpen call to open the message file.           */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: do_open                                             */
/*                                                                   */
/*  INPUT: Points to stripped file name                              */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0                                              */
/*                                                                   */
/*  EXIT-ERROR: AX = error code                                      */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosOpen.                                    */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Init setup(parameters for DosOpen)                             */
/*    Call DosOpen                                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: OPEN_DPATH                                      */
/*                                                                   */
/*  DESCRIPTION NAME: Search for the message file.                   */
/*                                                                   */
/*  FUNCTION: Issue DosSearchPath to find the message file.          */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: open_dpath                                          */
/*                                                                   */
/*  INPUT: Points to stripped file name                              */
/*                                                                   */
/*  EXIT-NORMAL: AX = 0                                              */
/*                                                                   */
/*  EXIT-ERROR: AX = error code                                      */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosSearchPath, DosAllocSeg, DosFreeSeg,     */
/*                       do_open.                                    */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Call DosAllocSeg                                               */
/*    If return code is NOT OK                                       */
/*    then                                                           */
/*      Set error code(allocate memory error)                        */
/*      Exit open_dpath                                              */
/*    Call DosSearchPath                                             */
/*    If return code is OK                                           */
/*    then                                                           */
/*      Call do_open                                                 */
/*    else                                                           */
/*      Set error code(search path error)                            */
/*    Call DosFreeSeg                                                */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: XFER_FILENAME                                   */
/*                                                                   */
/*  DESCRIPTION NAME: Boot drive letter + stripped message filename. */
/*                                                                   */
/*  FUNCTION: Add boot drive letter + ':' + message filename.        */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: xfer_filename                                       */
/*                                                                   */
/*  INPUT: Boot drive letter and length of message filename          */
/*                                                                   */
/*  EXIT-NORMAL: drive letter:\filename                              */
/*                                                                   */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Setup c:\ as the first 3 characters in temp buffer             */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: TEST_OPEN_ERR                                   */
/*                                                                   */
/*  DESCRIPTION NAME: Test for open_failed or path_not_found errors. */
/*                                                                   */
/*  FUNCTION: Test for open_failed or path_not_found errors.         */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: test_open_err                                       */
/*                                                                   */
/*  INPUT: AX =  error code                                          */
/*                                                                   */
/*  EXIT-NORMAL: CY = 1, Not error on open_failed and path_not_found.*/
/*               CY = 0, error code match above                      */
/*                                                                   */
/*  EXIT-ERROR: flags                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    If (AX = open_failed) OR (AX = path_not_found)                 */
/*    then                                                           */
/*      Set CARRY flag                                               */
/*    else                                                           */
/*      Clear CARRY flag                                             */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: GETBOOTROOT                                     */
/*                                                                   */
/*  DESCRIPTION NAME: Get boot disk drive letter from infoseg.       */
/*                                                                   */
/*  FUNCTION: Returns boot disk drive letter.                        */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: getbootroot                                         */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: drive letter                                        */
/*                                                                   */
/*  EXIT-ERROR: drive letter = 0                                     */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosGetInfoSeg.                              */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Call DosGetInfoSeg                                             */
/*    Set pointer to boot device offset in global segment            */
/*    Get boot device number                                         */
/*    Convert boot device number to boot drive letter                */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: COPYMSGHD                                       */
/*                                                                   */
/*  DESCRIPTION NAME: Copy message header.                           */
/*                                                                   */
/*  FUNCTION: Copies the component ID and message number at user's   */
/*            buffer and calls the DosInsMessage.                    */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: copymsghd                                           */
/*                                                                   */
/*  INPUT: message number.                                           */
/*                                                                   */
/*  EXIT-NORMAL: User's buffer and User's buffer length.             */
/*                                                                   */
/*  EXIT-ERROR: message too long error code.                         */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: decdump.                                    */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosInsMessage.                              */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Save caller's environment                                      */
/*    Call decdump(convert message ID to ASCII)                      */
/*    Store message component ID in user's buffer                    */
/*    Store message number in user's buffer                          */
/*    Add ':' to user's buffer                                       */
/*    Call DosInsMessage                                             */
/*    If return code is OK                                           */
/*    then                                                           */
/*      Adjust user's buffer pointer                                 */
/*      Adjust user's buffer length                                  */
/*    Restore caller's environment                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: DECDUMP                                         */
/*                                                                   */
/*  DESCRIPTION NAME: Converts message ID into ASCII format.         */
/*                                                                   */
/*  FUNCTION: Converts binary data into ASCII data.                  */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: decdump                                             */
/*                                                                   */
/*  INPUT: message number and pointer to output string.              */
/*                                                                   */
/*  EXIT-NORMAL: None.                                               */
/*                                                                   */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Save caller's environment                                      */
/*    Zero out the output string                                     */
/*    Setup pointer to the end of string                             */
/*    Setup quotient as message number                               */
/*    While (quotient <> 0)                                          */
/*    Do                                                             */
/*      Divide quotient by 10                                        */
/*      Convert remainder to ASCII                                   */
/*      Save ASCII remainder to the output string                    */
/*      Move pointer of the output string backward by 1              */
/*    Restore caller's environment                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
.pa
:h4.Multi-CodePage Message Intra-Component Interfaces
:h4.***** MSG.DLL - DosGetMessage *****
.fo off

/*********************************************************************/
/*  SUBROUTINE NAME: COPYRETMSG                                      */
/*                                                                   */
/*  DESCRIPTION NAME: Copies return message into user's buffer.      */
/*                                                                   */
/*  FUNCTION: Calls DosInsMessage to copy an error message into      */
/*            user's buffer.                                         */
/*                                                                   */
/*  NOTE: None.                                                      */
/*                                                                   */
/*  ENTRY POINT: copyretmsg                                          */
/*                                                                   */
/*  INPUT: None.                                                     */
/*                                                                   */
/*  EXIT-NORMAL: None.                                               */
/*                                                                   */
/*  EXIT-ERROR: None.                                                */
/*                                                                   */
/*  SIDE EFFECTS: None.                                              */
/*                                                                   */
/*  INTERNAL REFERENCES: None.                                       */
/*                                                                   */
/*  EXTERNAL REFERENCES: DosInsMessage, decdump.                     */
/*                                                                   */
/*  PSEUDO CODE:                                                     */
/*                                                                   */
/*  BEGIN                                                            */
/*    Save caller's environment                                      */
/*    If (error code <> error_mr_inv_ivcount) OR                     */
/*       (error code <> error_mr_un_perform)                         */
/*    then                                                           */
/*      If (error code <> error_file_not_found) OR                   */
/*         (error code <> error_mr_un_acc_msgf) OR                   */
/*         (error code <> error_mr_inv_msgf_format) OR               */
/*         (error code <> error_mr_mid_not_found)                    */
/*      then                                                         */
/*        Get message number to convert                              */
/*        Call decdump                                               */
/*        Setup ivtable for error                                    */
/*        Setup ivcount                                              */
/*      else                                                         */
/*        Setup message filename                                     */
/*        Setup ivtable for error                                    */
/*    Setup message segment                                          */
/*    Setup error message in ivtable based upon error code           */
/*    Call DosInsMessage                                             */
/*    Save return code                                               */
/*    Restore caller's environment                                   */
/*  END                                                              */
/*                                                                   */
/*********************************************************************/

.fo on
