Changeset 1558
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/errutil.c
r1450 r1558 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 20 08Steven H. Levine9 Copyright (c) 2004, 2010 Steven H. Levine 10 10 11 11 12 Aug 04 SHL Comments … … 34 34 08 Mar 09 GKY Remove Dos_Error2 (unused) and Runtime_Error2 (no advantage over using Runtime_Error) 35 35 23 Jul 09 GKY Add low mem buffers for the msg file name so DosGetMessage 36 works in HIMEM builds 36 works in HIMEM builds 37 01 Dec 10 SHL Dos_Error - remap API errors code that with odd oso001*.msg messages 37 38 38 39 ***********************************************************************/ … … 51 52 #include "strutil.h" // GetPString 52 53 #include "fm3str.h" 53 #include "notebook.h" 54 #include "init.h" 54 #include "notebook.h" // fErrorBeepOff 55 #include "init.h" // Data declares 55 56 56 57 #pragma data_seg(DATA1) … … 84 85 if (!ul1stMSec) { 85 86 ul1stMSec = msec; 86 // ulLastMSec = msec; 87 // ulLastMSec = msec; // Avoid big delta 1st time 87 88 } 88 89 … … 115 116 //== Dos_Error: report Dos...() error using passed message string === 116 117 117 INT Dos_Error(ULONG mb_type, ULONG ulRC, HWND hwndOwner, 118 // 2010-12-01 SHL fixme for ULONG to be APIRET 119 120 INT Dos_Error(ULONG mb_type, ULONG apiret, HWND hwndOwner, 118 121 PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...) 119 122 { … … 122 125 ULONG Class; // Error class 123 126 ULONG action; // Error action 124 ULONG Locus; 127 ULONG Locus; // Error location 125 128 ULONG ulMsgLen; 129 APIRET mapped_apiret; 126 130 CHAR *pszMsgStart; 127 131 CHAR *psz; 128 132 va_list va; 129 133 130 if (! ulRC)134 if (!apiret) 131 135 return MBID_ENTER; // Should not have been called 132 136 … … 144 148 if (strchr(szMsg, ' ') == NULL) { 145 149 strcat(szMsg, " "); 146 strcat(szMsg, GetPString(IDS_FAILEDTEXT)); 147 } 148 149 DosErrClass( ulRC, &Class, &action, &Locus);150 strcat(szMsg, GetPString(IDS_FAILEDTEXT)); // Assume simple function name 151 } 152 153 DosErrClass(apiret, &Class, &action, &Locus); 150 154 151 155 sprintf(szMsg + strlen(szMsg), … … 153 157 pszSrcFile, 154 158 uSrcLineNo, 155 ulRC,159 apiret, 156 160 GetPString(IDS_ERRCLASS1TEXT + (Class - 1)), 157 161 GetPString(IDS_ERRACTION1TEXT + (action - 1)), 158 162 GetPString(IDS_ERRLOCUS1TEXT + (Locus - 1))); 159 163 pszMsgStart = szMsg + strlen(szMsg) + 1; 160 164 strcpy(szMsgFile, "OSO001.MSG"); 161 165 strcpy(szMsgFileH, "OSO001H.MSG"); 162 166 // Get message leaving space for NL separator 163 if (!DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, ulRC, szMsgFile, &ulMsgLen) 164 || !DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, ulRC, 165 szMsgFileH, &ulMsgLen)) { 167 // 2010-12-01 SHL Handle cases where message file message does not make sense relative to API error 168 switch (apiret) { 169 case ERROR_TIMEOUT: 170 mapped_apiret = ERROR_SEM_TIMEOUT; // Assume semaphore timeout 171 break; 172 default: 173 mapped_apiret = apiret; 174 } 175 if (!DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, mapped_apiret, szMsgFile, &ulMsgLen) 176 || !DosGetMessage(NULL, 0L, (PCHAR) pszMsgStart + 1, 1024, mapped_apiret, 177 szMsgFileH, &ulMsgLen)) { 166 178 // Got message 167 179 pszMsgStart[ulMsgLen + 1] = 0; // Terminate … … 227 239 if (strchr(pszBuf, ' ') == NULL) { 228 240 strcat(pszBuf, " "); 229 strcat(pszBuf, GetPString(IDS_FAILEDTEXT)); 241 strcat(pszBuf, GetPString(IDS_FAILEDTEXT)); // Assume simple function name 230 242 } 231 243 … … 311 323 if (strchr(szMsg, ' ') == NULL) { 312 324 strcat(szMsg, " "); 313 strcat(szMsg, GetPString(IDS_FAILEDTEXT)); 325 strcat(szMsg, GetPString(IDS_FAILEDTEXT)); // Assume simple function name 314 326 } 315 327 -
trunk/dll/errutil.h
r1402 r1558 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2008 Steven H. Levine9 Copyright (c) 2008, 2010 Steven H. Levine 10 10 11 11 05 Jan 08 SHL Move from fm3dll.h to here … … 23 23 24 24 VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...); 25 INT Dos_Error(ULONG mb_type, ULONG ulRC, HWND hwndOwner,25 INT Dos_Error(ULONG mb_type, APIRET apiret, HWND hwndOwner, 26 26 PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...); 27 27 ULONG GetMSecTimer(void);
Note:
See TracChangeset
for help on using the changeset viewer.