Changeset 132 for trunk/src/helpers/dosh.c
- Timestamp:
- Jan 19, 2002, 11:50:39 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dosh.c
r131 r132 2382 2382 pszContent[cbRead] = '\0'; 2383 2383 *ppszContent = pszContent; 2384 if (pcbRead) 2385 *pcbRead = cbRead + 1; 2384 2386 } 2385 2387 } … … 2978 2980 2979 2981 /* 2982 *@@ doshQueryProcAddr: 2983 * attempts to resolve the given procedure from 2984 * the given module name. Saves you from querying 2985 * the module handle and all that. 2986 * 2987 * This is intended for resolving undocumented 2988 * APIs from OS/2 system DLls such as PMMERGE 2989 * and DOSCALLS. It is assumed that the specified 2990 * module is already loaded. 2991 * 2992 * Returns: 2993 * 2994 * -- NO_ERROR 2995 * 2996 * -- ERROR_INVALID_NAME 2997 * 2998 * -- ERROR_INVALID_ORDINAL 2999 * 3000 * plus the error codes of DosLoadModule. 3001 * 3002 *@@added V0.9.16 (2002-01-13) [umoeller] 3003 */ 3004 3005 APIRET doshQueryProcAddr(PCSZ pcszModuleName, // in: module name (e.g. "PMMERGE") 3006 ULONG ulOrdinal, // in: proc ordinal 3007 PFN *ppfn) // out: proc address 3008 { 3009 HMODULE hmod; 3010 APIRET arc; 3011 if (!(arc = DosQueryModuleHandle((PSZ)pcszModuleName, 3012 &hmod))) 3013 { 3014 if ((arc = DosQueryProcAddr(hmod, 3015 ulOrdinal, 3016 NULL, 3017 ppfn))) 3018 { 3019 // the CP programming guide and reference says use 3020 // DosLoadModule if DosQueryProcAddr fails with this error 3021 if (arc == ERROR_INVALID_HANDLE) 3022 { 3023 if (!(arc = DosLoadModule(NULL, 3024 0, 3025 (PSZ)pcszModuleName, 3026 &hmod))) 3027 { 3028 arc = DosQueryProcAddr(hmod, 3029 ulOrdinal, 3030 NULL, 3031 ppfn); 3032 } 3033 } 3034 } 3035 } 3036 3037 return (arc); 3038 } 3039 3040 /* 2980 3041 *@@ doshResolveImports: 2981 3042 * this function loads the module called pszModuleName … … 2990 3051 */ 2991 3052 2992 APIRET doshResolveImports(P SZ pszModuleName, // in: DLL to load3053 APIRET doshResolveImports(PCSZ pcszModuleName, // in: DLL to load 2993 3054 HMODULE *phmod, // out: module handle 2994 P RESOLVEFUNCTION paResolves, // in/out: function resolves3055 PCRESOLVEFUNCTION paResolves, // in/out: function resolves 2995 3056 ULONG cResolves) // in: array item count (not array size!) 2996 3057 { … … 3000 3061 if (!(arc = DosLoadModule(szName, 3001 3062 sizeof(szName), 3002 pszModuleName,3063 (PSZ)pcszModuleName, 3003 3064 phmod))) 3004 3065 {
Note:
See TracChangeset
for help on using the changeset viewer.