Jump to content

DosQueryExtLIBPATH: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
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==
<PRE>
  ulrc = DosQueryExtLIBPATH(pszExtLIBPATH, flags);
#define INCL_DOSMISC
#include <os2.h>
 
PSZ      pszExtLIBPATH; /*  Extended LIBPATH string. */
ULONG    flags;          /*  Flag indicating when the new path is searched. */
APIRET    ulrc;          /*  Return Code. */
 
ulrc = DosQueryExtLIBPATH(pszExtLIBPATH, flags);
 
</PRE>
==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
===Parameters===
* 87        ERROR_INVALID_PARAMETER
;pszExtLIBPATH (PSZ) - output : Extended LIBPATH string.
* 122        ERROR_INSUFFICIENT_BUFER
: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.
==Remarks==
: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>


</PRE>
==Related Functions==
==Related Functions==
* [[OS2 API:CPI:DosSetExtLIBPATH|DosSetExtLIBPATH ]]
*[[DosSetExtLIBPATH]]
 


[[Category:The OS/2 API Project]]
[[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;
}

Related Functions