Changeset 122
- Timestamp:
- Dec 8, 2001, 11:14:27 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/stringh.h
r115 r122 32 32 #define STRINGH_HEADER_INCLUDED 33 33 34 VOID XWPENTRY strhStore(PSZ *ppszTarget, PCSZ pcszSource, PULONG pulLength); 35 34 36 PSZ XWPENTRY strhcpy(PSZ string1, const char *string2); 35 37 -
trunk/src/helpers/apps.c
r113 r122 782 782 * 783 783 * -- starting ".CMD" and ".BAT" files as 784 * PROGDETAILS.pszExecutable. 784 * PROGDETAILS.pszExecutable; 785 * 786 * -- starting apps which are not fully qualified 787 * and therefore assumed to be on the PATH. 785 788 * 786 789 * Unless it is "*", PROGDETAILS.pszExecutable must … … 814 817 * -- To start a session minimized, set SWP_MINIMIZE. 815 818 * 816 * -- To start a VIO session auto-close disabled, set817 * the half-documented SWP_NOAUTOCLOSE flag (0x8000)819 * -- To start a VIO session with auto-close disabled, 820 * set the half-documented SWP_NOAUTOCLOSE flag (0x8000) 818 821 * This flag is now in the newer toolkit headers. 819 822 * … … 843 846 * WinStartApp completely hangs the session manager 844 847 * if a Win-OS/2 full-screen session is started from 845 * a thread that is NOT thread 1, this willfail846 * with anerror for safety (V0.9.16).848 * a thread that is NOT thread 1, this will now fail 849 * with this error for safety (V0.9.16). 847 850 * 848 851 * -- ERROR_INVALID_PARAMETER: pcProgDetails or … … 866 869 *@@changed V0.9.16 (2001-10-19) [umoeller]: added prototype to return APIRET 867 870 *@@changed V0.9.16 (2001-10-19) [umoeller]: added thread-1 check 871 *@@changed V0.9.16 (2001-12-06) [umoeller]: now using doshSearchPath for finding pszExecutable if not qualified 868 872 */ 869 873 … … 886 890 // all this only makes sense if this contains something... 887 891 // besides, this crashed on string comparisons V0.9.9 (2001-01-27) [umoeller] 888 if (!ProgDetails.pszExecutable) 892 if ( (!ProgDetails.pszExecutable) 893 || (!(*(ProgDetails.pszExecutable))) 894 ) 889 895 arc = ERROR_INVALID_PARAMETER; 890 896 else if (doshMyTID() != 1) // V0.9.16 (2001-10-19) [umoeller] … … 893 899 { 894 900 ULONG ulIsWinApp; 901 902 CHAR szFQExecutable[CCHMAXPATH]; 895 903 896 904 XSTRING strParamsPatched; … … 1010 1018 else 1011 1019 { 1012 // now check if the executable is valid1013 // V0.9.16 (2001-10-19) [umoeller]1014 ULONG ulAttr;1015 _Pmpf((" %d now, checking %s", arc, ProgDetails.pszExecutable));1016 if (!(arc = doshQueryPathAttr(ProgDetails.pszExecutable,1017 &ulAttr)))1018 {1019 // make sure startup dir is really a directory1020 if (ProgDetails.pszStartupDir)1020 // check if the executable is fully qualified; if so, 1021 // check if the executable file exists 1022 if ( (ProgDetails.pszExecutable[1] == ':') 1023 && (strchr(ProgDetails.pszExecutable, '\\')) 1024 ) 1025 { 1026 ULONG ulAttr; 1027 if (!(arc = doshQueryPathAttr(ProgDetails.pszExecutable, 1028 &ulAttr))) 1021 1029 { 1022 _Pmpf((" checking %s", ProgDetails.pszStartupDir)); 1023 if (!(arc = doshQueryPathAttr(ProgDetails.pszStartupDir, 1024 &ulAttr))) 1025 if (!(ulAttr & FILE_DIRECTORY)) 1026 arc = ERROR_PATH_NOT_FOUND; 1027 // @@todo 1030 // make sure startup dir is really a directory 1031 if (ProgDetails.pszStartupDir) 1032 { 1033 if (!(arc = doshQueryPathAttr(ProgDetails.pszStartupDir, 1034 &ulAttr))) 1035 if (!(ulAttr & FILE_DIRECTORY)) 1036 arc = ERROR_PATH_NOT_FOUND; 1037 } 1028 1038 } 1029 1039 } 1030 1031 _Pmpf((" after checking %d", arc)); 1040 else 1041 { 1042 // _not_ fully qualified: look it up on the PATH then 1043 // V0.9.16 (2001-12-06) [umoeller] 1044 if (!(arc = doshSearchPath("PATH", 1045 ProgDetails.pszExecutable, 1046 szFQExecutable, 1047 sizeof(szFQExecutable)))) 1048 // alright, found it: 1049 ProgDetails.pszExecutable = szFQExecutable; 1050 } 1032 1051 1033 1052 if (!arc) -
trunk/src/helpers/comctl.c
r116 r122 1291 1291 * 1292 1292 *@@added V0.9.1 (99-12-19) [umoeller] 1293 *@@changed V0.9.16 (2001-12-08) [umoeller]: fixed empty entry field on tab key 1293 1294 */ 1294 1295 … … 1373 1374 if (flReturned & HEFL_SETTEXT) 1374 1375 WinSetWindowText(hwndEdit, hkn.szDescription); 1375 else 1376 WinSetWindowText(hwndEdit, ""); 1377 1378 if (flReturned & HEFL_FORWARD2OWNER) 1376 else if (flReturned & HEFL_FORWARD2OWNER) 1379 1377 WinPostMsg(hwndOwner, 1380 1378 WM_CHAR, 1381 1379 mp1, mp2); 1380 else 1381 // fixed V0.9.16 (2001-12-06) [umoeller]: 1382 // do not clear the entry field if we had HEFL_FORWARD2OWNER 1383 WinSetWindowText(hwndEdit, ""); 1384 1382 1385 1383 1386 mrc = (MPARAM)TRUE; // WM_CHAR processed flag; -
trunk/src/helpers/dialog.c
r113 r122 616 616 *@@added V0.9.15 (2001-08-26) [umoeller] 617 617 *@@changed V0.9.16 (2001-10-15) [umoeller]: fixed ugly group table spacings 618 *@@changed V0.9.16 (2001-12-08) [umoeller]: fixed entry field ES_MARGIN positioning 618 619 */ 619 620 … … 701 702 y -= 100; 702 703 cy += 100; 704 } 705 // the stupid entry field resizes itself if it has 706 // the ES_MARGIN style, so correlate that too... dammit 707 // V0.9.16 (2001-12-08) [umoeller] 708 else if ( ((ULONG)pControlDef->pcszClass == 0xffff0006L) 709 && (flStyle & ES_MARGIN) 710 ) 711 { 712 LONG cxMargin = 3 * WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER); 713 LONG cyMargin = 3 * WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER); 714 715 x += cxMargin; 716 y += cxMargin; 703 717 } 704 718 } … … 1728 1742 *@@changed V0.9.14 (2001-08-01) [umoeller]: fixed major memory leaks with nested tables 1729 1743 *@@changed V0.9.14 (2001-08-21) [umoeller]: fixed default push button problems 1744 *@@changed V0.9.16 (2001-12-06) [umoeller]: fixed bad owner if not direct desktop child 1730 1745 */ 1731 1746 … … 1746 1761 PDLGPRIVATE pDlgData = NULL; 1747 1762 1763 HWND hwndDesktop = WinQueryDesktopWindow(NULLHANDLE, NULLHANDLE); 1764 // works with a null HAB 1765 1748 1766 /* 1749 1767 * 1) parse the table and create structures from it … … 1765 1783 FRAMECDATA fcData = {0}; 1766 1784 ULONG flStyle = 0; 1785 HWND hwndOwnersParent; 1767 1786 1768 1787 fcData.cb = sizeof(FRAMECDATA); … … 1780 1799 // V0.9.14 (2001-07-07) [umoeller] 1781 1800 hwndOwner = NULLHANDLE; 1801 1802 // now, make sure the owner window is child of 1803 // HWND_DESKTOP... if it is not, we'll only disable 1804 // some dumb child window, which is not sufficient 1805 // V0.9.16 (2001-12-06) [umoeller] 1806 while ( (hwndOwner) 1807 && (hwndOwnersParent = WinQueryWindow(hwndOwner, QW_PARENT)) 1808 && (hwndOwnersParent != hwndDesktop) 1809 ) 1810 hwndOwner = hwndOwnersParent; 1782 1811 1783 1812 if (!(pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP, -
trunk/src/helpers/dosh.c
r121 r122 1837 1837 *@@added V0.9.16 (2001-10-19) [umoeller] 1838 1838 *@@changed V0.9.16 (2001-12-02) [umoeller]: added XOPEN_BINARY \r\n support 1839 *@@changed V0.9.16 (2001-12-06) [umoeller]: added check for pFile != NULL 1839 1840 */ 1840 1841 … … 1844 1845 { 1845 1846 APIRET arc = NO_ERROR; 1846 if ( !pcsz)1847 if ((!pFile) || (!pcsz)) 1847 1848 arc = ERROR_INVALID_PARAMETER; 1848 1849 else … … 1930 1931 * The internal string buffer is limited to 2000 1931 1932 * characters. Length checking is _not_ performed. 1933 * 1934 *@@added V0.9.16 (2001-10-19) [umoeller] 1935 *@@changed V0.9.16 (2001-12-06) [umoeller]: added check for pFile != NULL 1932 1936 */ 1933 1937 … … 1936 1940 ...) 1937 1941 { 1938 APIRET arc ;1939 1940 DATETIME dt;1941 CHAR szTemp[2000];1942 ULONG ulLength;1943 1944 DosGetDateTime(&dt);1945 if (ulLength = sprintf(szTemp,1946 "%04d-%02d-%02d %02d:%02d:%02d:%02d ",1947 dt.year, dt.month, dt.day, 1948 dt.hours, dt.minutes, dt.seconds, dt.hundredths))1949 {1950 if (!(arc = doshWrite(pFile,1951 szTemp,1952 ulLength)))1942 APIRET arc = NO_ERROR; 1943 1944 if ((!pFile) || (!pcszFormat)) 1945 arc = ERROR_INVALID_PARAMETER; 1946 else 1947 { 1948 DATETIME dt; 1949 CHAR szTemp[2000]; 1950 ULONG ulLength; 1951 1952 DosGetDateTime(&dt); 1953 if (ulLength = sprintf(szTemp, 1954 "%04d-%02d-%02d %02d:%02d:%02d:%02d ", 1955 dt.year, dt.month, dt.day, 1956 dt.hours, dt.minutes, dt.seconds, dt.hundredths)) 1953 1957 { 1954 va_list arg_ptr; 1955 va_start(arg_ptr, pcszFormat); 1956 ulLength = vsprintf(szTemp, pcszFormat, arg_ptr); 1957 va_end(arg_ptr); 1958 1959 if (pFile->flOpenMode & XOPEN_BINARY) 1960 // if we're in binary mode, we need to add \r too 1961 szTemp[ulLength++] = '\r'; 1962 szTemp[ulLength++] = '\n'; 1963 1964 arc = doshWrite(pFile, 1965 (PCSZ)szTemp, 1966 ulLength); 1958 if (!(arc = doshWrite(pFile, 1959 szTemp, 1960 ulLength))) 1961 { 1962 va_list arg_ptr; 1963 va_start(arg_ptr, pcszFormat); 1964 ulLength = vsprintf(szTemp, pcszFormat, arg_ptr); 1965 va_end(arg_ptr); 1966 1967 if (pFile->flOpenMode & XOPEN_BINARY) 1968 // if we're in binary mode, we need to add \r too 1969 szTemp[ulLength++] = '\r'; 1970 szTemp[ulLength++] = '\n'; 1971 1972 arc = doshWrite(pFile, 1973 (PCSZ)szTemp, 1974 ulLength); 1975 } 1967 1976 } 1968 1977 } -
trunk/src/helpers/stringh.c
r116 r122 67 67 * See stringh.c. 68 68 */ 69 70 /* 71 *@@ strhStore: 72 * stores a copy of the given string in the specified 73 * buffer. Uses strdup internally. 74 * 75 * If *ppszTarget != NULL, the previous string is freed 76 * and set to NULL. 77 * If pcszSource != NULL, a copy of it is stored in the 78 * buffer. 79 * 80 *@@added V0.9.16 (2001-12-06) [umoeller] 81 */ 82 83 VOID strhStore(PSZ *ppszTarget, 84 PCSZ pcszSource, 85 PULONG pulLength) // out: length of new string (ptr can be NULL) 86 { 87 ULONG ulLength = 0; 88 89 if (ppszTarget) 90 { 91 if (*ppszTarget) 92 free(*ppszTarget); 93 94 if ( (pcszSource) 95 && (ulLength = strlen(pcszSource)) 96 ) 97 { 98 if (*ppszTarget = (PSZ)malloc(ulLength + 1)) 99 memcpy(*ppszTarget, pcszSource, ulLength + 1); 100 } 101 else 102 *ppszTarget = NULL; 103 } 104 105 if (pulLength) 106 *pulLength = ulLength; 107 } 69 108 70 109 /*
Note:
See TracChangeset
for help on using the changeset viewer.