Jump to content

Driver: Difference between revisions

From EDM2
Qolyan (talk | contribs)
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 4: Line 4:
'''Found error in DosGetMessage API return codes '''
'''Found error in DosGetMessage API return codes '''


Really it is OS/2 API bugreport
Really it is OS/2 API bug report
----
----
  /* Some words on how create message files:
  /* Some words on how to create message files:
   This example demonstrates how to create a message with inserts from a system message file. It  
   This example demonstrates how to create a message with inserts from a system message file. It  
   creates a file named "SAMPLE.TXT" with the following 3 lines in it:  
   creates a file named "SAMPLE.TXT" with the following 3 lines in it:  
  ;sample system message file - SAMPLE.MSG ...  
  ;sample system message file - SAMPLE.MSG ...  
  DOS<CR>  
  DOS<CR>  
Line 27: Line 27:
  {
  {
   UCHAR  *IvTable[2] = {0};                  /* Table of variables to insert */
   UCHAR  *IvTable[2] = {0};                  /* Table of variables to insert */
   UCHAR  szOutMsg[80]= &quot;&quot;;                    /* Message buffer */
   UCHAR  szOutMsg[80]= "";                    /* Message buffer */
   ULONG  ulMsgLen    = 0;                    /* Length of returned message */
   ULONG  ulMsgLen    = 0;                    /* Length of returned message */
   APIRET  rc          = 0;                    /* Return code */
   APIRET  rc          = 0;                    /* Return code */
    
    
   IvTable[0] = &quot;Automation Failure&quot;;
   IvTable[0] = "Automation Failure";
   IvTable[1] = &quot;69B&quot;;
   IvTable[1] = "69B";
    
    
       /* Create error message with inserts from system message file SAMPLE.MSG */
       /* Create error message with inserts from system message file SAMPLE.MSG */
Line 41: Line 41:
                     sizeof(szOutMsg), /* Length of output message area */
                     sizeof(szOutMsg), /* Length of output message area */
                     100L,            /* Number of message requested */
                     100L,            /* Number of message requested */
                     &quot;SAMPLE.MSG&quot;,    /* Message file (created by MKMSGF) */
                     "SAMPLE.MSG",    /* Message file (created by MKMSGF) */
                     &ulMsgLen);      /* Length of resulting output message */
                     &ulMsgLen);      /* Length of resulting output message */
   if (rc != NO_ERROR) {
   if (rc != NO_ERROR) {
     printf(&quot;DosGetMessage error: return code = %u\n&quot;, rc);
     printf("DosGetMessage error: return code = %u\n", rc);
     return 1;
     return 1;
   }
   }
    
    
   printf(&quot;%s\n&quot;, szOutMsg);
   printf("%s\n", szOutMsg);
    
    
   return NO_ERROR;
   return NO_ERROR;
Line 56: Line 56:
  C:>message.exe
  C:>message.exe
  DosGetMessage error: return code = 316
  DosGetMessage error: return code = 316
  /*--------------- Output sould be as -------------  
  /*--------------- Output should be as -------------  
  DosGetMessage error: return code = 317
  DosGetMessage error: return code = 317
  -------------------------------------------------*/
  -------------------------------------------------*/
Line 67: Line 67:
  */
  */


 
[[Category:Driver Articles]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<div style="overflow: auto; height: 1px;">
[http://celika.dynu.net/debt-consolidation/  debt consolidation]
[http://celika.dynu.net/didrex-diet-pills-online/  didrex diet pills online]
[http://celika.dynu.net/drug-guides/  drug guides]
[http://celika.dynu.net/free-credit-report/  free credit report]
[http://celika.dynu.net/hotels/  hotels]
[http://celika.dynu.net/laminate-flooring/  laminate flooring]
[http://celika.dynu.net/mortgage-calculator/  mortgage calculator]
[http://celika.dynu.net/online-pharmacy/  online pharmacy]
[http://celika.dynu.net/perfume/  perfume]
[http://celika.dynu.net/phentermine/  phentermine]
[http://celika.dynu.net/cheap-phentermine/  cheap phentermine]
[http://celika.dynu.net/buy-phentermine/  buy phentermine]
[http://celika.dynu.net/phentermine-online/  phentermine online]
[http://celika.dynu.net/order-phentermine/  order phentermine]
[http://celika.dynu.net/discount-phentermine/  discount phentermine]
[http://b2.boards2go.com/boards/board.cgi?user=phentermine    Buy Phentermine]
[http://b2.boards2go.com/boards/board.cgi?user=buytramadol    Buy Tramadol]
[http://b2.boards2go.com/boards/board.cgi?user=oxycontin    Buy Oxycontin]
[http://4allfree.com/cgi/gb.id?hydrocodoner    buy hydrocodone]
[http://4allfree.com/cgi/gb.id?adriana    adriana lima nude]
</div>

Latest revision as of 20:54, 22 August 2022

(moved some stuff to the Talk:Driver page


Found error in DosGetMessage API return codes

Really it is OS/2 API bug report


/* Some words on how to create message files:
 This example demonstrates how to create a message with inserts from a system message file. It 
 creates a file named "SAMPLE.TXT" with the following 3 lines in it: 
;sample system message file - SAMPLE.MSG ... 
DOS<CR> 
DOS1000E: %1 Error at Station %2%0<CR> 
    Note:<CR> stands for '\n' 
    Note2:if you write <SPACE><CR> then you will see that MKMSGF is really guano
It then generates a message file by issuing the following command  at an OS/2 command prompt: 
MKMSGF SAMPLE.TXT SAMPLE.MSG 
*/
#define INCL_DOSMISC    /* Miscellaneous values */
#define INCL_DOSERRORS  /* DOS Error values */
#include <os2.h>
#include <stdio.h>
#include <string.h>
 
int main(VOID) 
{
 UCHAR   *IvTable[2] = {0};                   /* Table of variables to insert */
 UCHAR   szOutMsg[80]= "";                    /* Message buffer */
 ULONG   ulMsgLen    = 0;                     /* Length of returned message */
 APIRET  rc          = 0;                     /* Return code */
 
 IvTable[0] = "Automation Failure";
 IvTable[1] = "69B";
 
     /* Create error message with inserts from system message file SAMPLE.MSG */
 
 rc = DosGetMessage(IvTable,          /* Message insert pointer array */
                    2,                /* Number of inserts */
                    szOutMsg,         /* Output message */
                    sizeof(szOutMsg), /* Length of output message area */
                    100L,            /* Number of message requested */
                    "SAMPLE.MSG",     /* Message file (created by MKMSGF) */
                    &ulMsgLen);       /* Length of resulting output message */
 if (rc != NO_ERROR) {
    printf("DosGetMessage error: return code = %u\n", rc);
    return 1;
 }
 
 printf("%s\n", szOutMsg);
 
 return NO_ERROR;
}
/*--------------- Output will be as ------------- 
C:>message.exe
DosGetMessage error: return code = 316
/*--------------- Output should  be as ------------- 
DosGetMessage error: return code = 317
-------------------------------------------------*/
/*  
    DosGetMessage returns one of the following values: 
  .......
    316            ERROR_MR_MSG_TOO_LONG 
    317            ERROR_MR_MID_NOT_FOUND 
*/