Changeset 3386
- Timestamp:
- Jun 10, 2007, 1:56:39 PM (18 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/include/os2safe.h
r1757 r3386 42 42 #define DosSetDateTime SafeDosSetDateTime 43 43 #define DosStartSession SafeDosStartSession 44 #define DosQueryAppType SafeDosQueryAppType 45 #define DosWinUpper SafeDosWinUpper 44 46 45 47 #endif -
branches/libc-0.6/src/emx/src/libos2/safe/SafeDosQueryAppType.c
r3345 r3386 2 2 /** @file 3 3 * 4 * SafeDos DupHandle()4 * SafeDosQueryAppType() 5 5 * 6 * Copyright (c) 200 3 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net> 7 7 * 8 8 * … … 27 27 28 28 29 ULONG APIENTRY SafeDos DupHandle(HFILE hFile, PHFILE phFile);30 ULONG APIENTRY SafeDos DupHandle(HFILE hFile, PHFILE phFile)29 ULONG APIENTRY SafeDosQueryAppType(PCSZ pszName, PULONG pulFlags); 30 ULONG APIENTRY SafeDosQueryAppType(PCSZ pszName, PULONG pulFlags) 31 31 { 32 ULONG rc; 33 HFILE hf1; 34 PHFILE phf1 = NULL; 32 ULONG rc; 33 ULONG ful1; 34 PULONG pful1 = NULL; 35 SAFE_PCSZ(pszName); 35 36 36 if (p hFile)37 if (pulFlags) 37 38 { 38 hf1 = *phFile;39 p hf1 = &hf1;39 ful1 = *pulFlags; 40 pful1 = &ful1; 40 41 } 41 42 42 rc = Dos DupHandle(hFile, phf1);43 rc = DosQueryAppType(SAFE_PCSZ_USE(pszName), pful1); 43 44 44 if (p hFile)45 *p hFile = hf1;45 if (pulFlags) 46 *pulFlags = ful1; 46 47 48 SAFE_PCSZ_DONE(pszName); 49 SAFE_DOS_FAILURE(); 47 50 return rc; 48 51 } -
branches/libc-0.6/src/emx/src/libos2/safe/SafeWinUpper.c
r3345 r3386 2 2 /** @file 3 3 * 4 * Safe DosDupHandle()4 * SafeWinUpper() 5 5 * 6 6 * Copyright (c) 2003 knut st. osmundsen <bird-srcspam@anduin.net> … … 23 23 */ 24 24 25 #define INCL_ BASE25 #define INCL_PM 26 26 #include <os2.h> 27 #include "safe.h" 27 28 28 29 ULONG APIENTRY SafeDosDupHandle(HFILE hFile, PHFILE phFile); 30 ULONG APIENTRY SafeDosDupHandle(HFILE hFile, PHFILE phFile) 29 ULONG APIENTRY SafeWinUpper(HAB hab, ULONG idcp, ULONG idcc, PSZ psz); 30 ULONG APIENTRY SafeWinUpper(HAB hab, ULONG idcp, ULONG idcc, PSZ psz) 31 31 { 32 32 ULONG rc; 33 HFILE hf1; 34 PHFILE phf1 = NULL; 35 36 if (phFile) 33 if (SAFE_IS_HIGH(psz)) 37 34 { 38 hf1 = *phFile; 39 phf1 = &hf1; 35 size_t cch = strlen(psz); 36 char *pszTmp = _lmalloc(cch + 3); 37 if (pszTmp) 38 { 39 memcpy(pszTmp, psz, cch + 1); 40 pszTmp[cch + 1] = '\0'; 41 pszTmp[cch + 2] = '\0'; 42 rc = WinUpper(hab, idcp, idcc, pszTmp); 43 if (rc > 0) 44 memcpy(psz, pszTmp, rc <= cch ? rc + 1 : rc); 45 free(pszTmp); 46 } 47 else 48 { 49 PSZ pszStart = psz; 50 while (*psz) 51 { 52 PSZ pszNext = WinNextChar(hab, idcp, idcc, psz); 53 if (pszNext - psz == 1) 54 *psz = WinUpperChar(hab, idcp, idcc, *psz); 55 else if (pszNext - psz == 2) 56 *(PUSHORT)psz = WinUpperChar(hab, idcp, idcc, *(PUSHORT)psz); /* a wild guess. */ 57 else 58 break; 59 psz = pszNext; 60 } 61 rc = psz - pszStart; 62 } 40 63 } 41 42 rc = DosDupHandle(hFile, phf1); 43 44 if (phFile) 45 *phFile = hf1; 46 64 else 65 rc = WinUpper(hab, idcp, idcc, psz); 47 66 return rc; 48 67 }
Note:
See TracChangeset
for help on using the changeset viewer.