DosQueryExtLIBPATH: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:DosQueryExtLIBPATH to DosQueryExtLIBPATH |
mNo edit summary |
||
Line 1: | Line 1: | ||
Returns the current path to be searched before or after the system LIBPATH when locating DLLs. | Returns the current path to be searched before or after the system LIBPATH when locating DLLs. | ||
==Syntax== | ==Syntax== | ||
ulrc = DosQueryExtLIBPATH(pszExtLIBPATH, flags); | |||
ulrc = DosQueryExtLIBPATH(pszExtLIBPATH, flags); | |||
===Parameters=== | |||
;pszExtLIBPATH (PSZ) - output : Extended LIBPATH string. | |||
:If the buffer pointed to by this parameter is not large enough to hold the extended LIBPATH or an extended LIBPATH is not currently defined, this parameter returns a pointer to a NULL string. | |||
;flags (ULONG) - output : Flag indicating when the new path is searched. | |||
:Possible values are described in the following list: | |||
::BEGIN_LIBPATH The new path is searched before the LIBPATH. | |||
::END_LIBPATH The new path is searched after the LIBPATH. | |||
===Return Code=== | |||
;ulrc (APIRET) - returns:DosQueryExtLIBPATH returns one of the following values: | |||
* 0 NO_ERROR | |||
* 87 ERROR_INVALID_PARAMETER | |||
* 122 ERROR_INSUFFICIENT_BUFER | |||
==Example Code== | ==Example Code== | ||
This example updates the paths to be searched before and after the system LIBPATH, when locating a DLL. | This example updates the paths to be searched before and after the system LIBPATH, when locating a DLL. | ||
<PRE> | <PRE> | ||
#define INCL_DOSMISC | #define INCL_DOSMISC | ||
Line 89: | Line 65: | ||
return NO_ERROR; | return NO_ERROR; | ||
} | } | ||
</PRE> | |||
==Related Functions== | ==Related Functions== | ||
* [[ | *[[DosSetExtLIBPATH]] | ||
[[Category: | [[Category:Dos]] |
Revision as of 08:49, 10 January 2017
Returns the current path to be searched before or after the system LIBPATH when locating DLLs.
Syntax
ulrc = DosQueryExtLIBPATH(pszExtLIBPATH, flags);
Parameters
- pszExtLIBPATH (PSZ) - output
- Extended LIBPATH string.
- If the buffer pointed to by this parameter is not large enough to hold the extended LIBPATH or an extended LIBPATH is not currently defined, this parameter returns a pointer to a NULL string.
- flags (ULONG) - output
- Flag indicating when the new path is searched.
- Possible values are described in the following list:
- BEGIN_LIBPATH The new path is searched before the LIBPATH.
- END_LIBPATH The new path is searched after the LIBPATH.
Return Code
- ulrc (APIRET) - returns
- DosQueryExtLIBPATH returns one of the following values:
- 0 NO_ERROR
- 87 ERROR_INVALID_PARAMETER
- 122 ERROR_INSUFFICIENT_BUFER
Example Code
This example updates the paths to be searched before and after the system LIBPATH, when locating a DLL.
#define INCL_DOSMISC #define INCL_DOSERRORS #include <os2.h> #include <stdio.h> int main(VOID) { UCHAR uchBeginLIBPATH[512] = ""; /* Begin LIBPATH value returned */ UCHAR uchEndLIBPATH[512] = ""; /* End LIBPATH value returned */ APIRET rc = NO_ERROR; /* Return code */ rc = DosSetExtLIBPATH("C:\\TOOL_X\\VERS_20\\DLL", BEGIN_LIBPATH); /* Add to beginning LIBPATH */ if (rc != NO_ERROR) { printf("DosSetExtLIBPATH error: return code = %u\n", rc); return 1; } rc = DosSetExtLIBPATH("C:\\TOOL_X\\VERS_10\\DLL", END_LIBPATH); /* Add to ending LIBPATH */ if (rc != NO_ERROR) { printf("DosSetExtLIBPATH error: return code = %u\n", rc); return 1; } rc = DosQueryExtLIBPATH(uchBeginLIBPATH, BEGIN_LIBPATH); /* Query the BeginLIBPATH */ if (rc != NO_ERROR) { printf("DosQueryExtLIBPATH error: return code = %u\n", rc); return 1; } rc = DosQueryExtLIBPATH(uchEndLIBPATH, END_LIBPATH); /* Query the EndLIBPATH */ if (rc != NO_ERROR) { printf("DosQueryExtLIBPATH error: return code = %u\n", rc); return 1; } printf(" BeginLIBPATH = %s\n", uchBeginLIBPATH); printf(" EndLIBPATH = %s\n", uchEndLIBPATH); return NO_ERROR; }