Changeset 330 for trunk/dll/systemf.c
- Timestamp:
- Jul 25, 2006, 8:45:04 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/systemf.c
r123 r330 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2003, 2004 Steven H.Levine 10 11 Revisions 21 Nov 03 SHL - Comments 12 31 Jul 04 SHL - Indent -i2 13 01 Aug 04 SHL - Rework lstrip/rstrip usage 9 Copyright (c) 2003, 2006 Steven H.Levine 10 11 21 Nov 03 SHL Comments 12 31 Jul 04 SHL Indent -i2 13 01 Aug 04 SHL Rework lstrip/rstrip usage 14 17 Jul 06 SHL Use Runtime_Error 14 15 15 16 ***********************************************************************/ … … 19 20 #define INCL_DOS 20 21 #define INCL_DOSERRORS 21 22 22 #include <os2.h> 23 23 24 #include <stdlib.h> 24 25 #include <stdio.h> … … 27 28 #include <ctype.h> 28 29 #include <time.h> 30 29 31 #include "fm3dll.h" 30 32 #include "fm3dlg.h" 31 33 #include "fm3str.h" 32 34 35 static PSZ pszSrcFile = __FILE__; 36 33 37 #pragma alloc_text(SYSTEMF,ShowSession,ExecOnList,runemf2) 34 38 … … 39 43 BOOL ShowSession(HWND hwnd, PID pid) 40 44 { 41 42 45 HSWITCH hswitch; 43 46 SWCNTRL swctl; … … 64 67 char **list, char *prompt) 65 68 { 66 67 69 /* executes the command once for all files in list */ 68 70 … … 177 179 sprintf(&listfile[strlen(listfile)], "%s%03x", 178 180 LISTTEMPROOT, (clock() & 4095L)); 179 fp = fopen(listfile, "w");181 fp = xfopen(listfile, "w",pszSrcFile,__LINE__); 180 182 if (fp) 181 183 { … … 667 669 char *formatstring,...) 668 670 { 669 670 671 /* example: 671 672 … … 713 714 hwnd = HWND_DESKTOP; 714 715 715 rc = DosAllocMem((PVOID) &s,716 rc = DosAllocMem((PVOID)&s, 716 717 MAXSTRG, 717 718 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 718 if (rc) 719 if (rc) { 720 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); 719 721 return -1; 722 } 720 723 721 724 *savedir = 0; … … 761 764 p++; 762 765 temp = *p; 763 if (temp) 764 rc = DosAllocMem((PVOID) &s2,766 if (temp) { 767 rc = DosAllocMem((PVOID)&s2, 765 768 MAXSTRG * 2, 766 769 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE); 770 if (rc) 771 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); 772 } 767 773 else 768 774 s2 = NULL; … … 842 848 switch_to(directory); 843 849 } 844 ret = (int) DosQAppType(s, 845 &apptype); 850 ret = (int) DosQAppType(s,&apptype); 846 851 if (!strchr(s, '\\') && 847 852 !strchr(s, ':') && … … 851 856 if (ret) 852 857 { 853 DosBeep(50, 100);858 Dos_Error(MB_CANCEL,ret,hwnd,pszSrcFile,__LINE__,"DosQAppType"); 854 859 if (s) 855 860 DosFreeMem(s); … … 863 868 (apptype & FAPPTYP_PHYSDRV) || (apptype & FAPPTYP_PROTDLL)) 864 869 { 865 DosBeep(250, 100);870 Runtime_Error(pszSrcFile, __LINE__, "unexpected apptype"); 866 871 if (s) 867 872 DosFreeMem(s); … … 873 878 (apptype & FAPPTYP_WINDOWSPROT) || (apptype & 0x1000)) 874 879 { 875 DosBeep(500, 100);880 Runtime_Error(pszSrcFile, __LINE__, "unexpected apptype"); 876 881 if (s) 877 882 DosFreeMem(s); … … 893 898 if (directory && *directory) 894 899 switch_to(savedir); 895 if (ret) 896 Dos_Error(MB_ENTER, 897 ret, 898 hwnd, 899 __FILE__, 900 __LINE__, 900 if (ret) { 901 Dos_Error(MB_ENTER,ret,hwnd,pszSrcFile,__LINE__, 901 902 GetPString(IDS_DOSEXECPGMFAILEDTEXT)); 903 } 902 904 } 903 905 } … … 910 912 if (rc) 911 913 { 914 Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY)); 912 915 DosFreeMem(s); 913 916 return -1; … … 1141 1144 if (directory && *directory) 1142 1145 switch_to(savedir); 1143 if (ret && ret != ERROR_SMG_START_IN_BACKGROUND) 1144 Dos_Error(MB_CANCEL | MB_ICONEXCLAMATION, 1145 ret, 1146 hwnd, 1147 __FILE__, 1148 __LINE__, 1149 GetPString(IDS_DOSSTARTSESSIONFAILEDTEXT), 1150 s, 1151 s2); 1146 if (ret && ret != ERROR_SMG_START_IN_BACKGROUND) { 1147 Dos_Error(MB_CANCEL,ret,hwnd,pszSrcFile,__LINE__, 1148 GetPString(IDS_DOSSTARTSESSIONFAILEDTEXT),s,s2); 1149 } 1152 1150 else if (type & WAIT) 1153 1151 { … … 1157 1155 if (!hque) 1158 1156 { 1159 1160 1157 STATUSDATA sd; 1161 1158 … … 1226 1223 PROGTYPE * progt, ULONG fl, char *formatstring,...) 1227 1224 { 1228 1229 1225 PROGDETAILS pgd; 1230 1226 register char *p; … … 1238 1234 ulOptions |= SAF_STARTCHILDAPP; 1239 1235 1240 executable = malloc(MAXSTRG); 1241 if (executable) 1242 { 1243 memset(executable, 0, MAXSTRG); 1236 executable = xmallocz(MAXSTRG,pszSrcFile,__LINE__); 1237 if (executable) { 1244 1238 va_start(parguments, formatstring); 1245 1239 vsprintf(executable, formatstring, parguments); … … 1248 1242 if (*executable) 1249 1243 { 1250 parameters = malloc(MAXSTRG);1244 parameters = xmalloc(MAXSTRG,pszSrcFile,__LINE__); 1251 1245 if (parameters) 1252 1246 { … … 1288 1282 char *temp; 1289 1283 1290 temp = malloc(CCHMAXPATH * 2);1284 temp = xmalloc(CCHMAXPATH * 2,pszSrcFile,__LINE__); 1291 1285 if (temp) 1292 1286 {
Note:
See TracChangeset
for help on using the changeset viewer.