\hypertarget{group__Evil__Dlfcn}{}\section{Functions that manage dynamic-\/link libraries.}
\label{group__Evil__Dlfcn}\index{Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}}


~\newline
x $\ast$ This header provides functions to load and unload dynamic-\/link libaries, to get the address of a symbol, and to get diagnostic information.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \mbox{\hyperlink{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}{dlopen}} (const char $\ast$path, int mode)
\begin{DoxyCompactList}\small\item\em Map a specified executable module (either a .dll or .exe file) into the address space of the user process. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}{dlclose}} (void $\ast$handle)
\begin{DoxyCompactList}\small\item\em Close a dynamic-\/link library. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}{dlsym}} (void $\ast$handle, const char $\ast$symbol)
\begin{DoxyCompactList}\small\item\em Get the address of a symbol. \end{DoxyCompactList}\item 
char $\ast$ \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror}} (void)
\begin{DoxyCompactList}\small\item\em Get diagnostic information. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
~\newline
x $\ast$ This header provides functions to load and unload dynamic-\/link libaries, to get the address of a symbol, and to get diagnostic information. 



\subsection{Function Documentation}
\mbox{\Hypertarget{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}\label{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}} 
\index{Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}!dlopen@{dlopen}}
\index{dlopen@{dlopen}!Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}}
\subsubsection{\texorpdfstring{dlopen()}{dlopen()}}
{\footnotesize\ttfamily void$\ast$ dlopen (\begin{DoxyParamCaption}\item[{const char $\ast$}]{path,  }\item[{int}]{mode }\end{DoxyParamCaption})}



Map a specified executable module (either a .dll or .exe file) into the address space of the user process. 


\begin{DoxyParams}{Parameters}
{\em path} & Name of the module. \\
\hline
{\em mode} & Unused. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer that represent the module, or {\ttfamily N\+U\+LL} on failure.
\end{DoxyReturn}
Map a specified executable module (either a .dll or .exe file) into the address space of the user process. If {\ttfamily path} is {\ttfamily N\+U\+LL}, then the module corresponding to the current process is returned. Otherwise the module specified by {\ttfamily path} is loaded if it exists. If not, {\ttfamily N\+U\+LL} is returned. The directory separators can be forward slash, or backward ones. Mapping a module can map other modules. {\ttfamily mode} is unused.

If an error occurred, an error string can be retrived with \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}}.

According to the OS, the search order of the module can change, according to the value of Safe\+Dll\+Search\+Mode.


\begin{DoxyItemize}
\item For Windows Vista, Windows Server 2003, and Windows XP S\+P2\+: Safe\+D\+L\+L\+Search\+Mode is enabled by default.
\item For Windows XP and Windows 2000 S\+P4\+: Safe\+D\+L\+L\+Search\+Mode is disabled by default.
\end{DoxyItemize}

If Safe\+Dll\+Search\+Mode is enabled
\begin{DoxyItemize}
\item The directory from which the application loaded.
\item The system directory. Use the Get\+System\+Directory() function to get the path of this directory.
\item The 16-\/bit system directory. There is no function that obtains the path of this directory, but it is searched.
\item The Windows directory. Use the Get\+Windows\+Directory() function to get the path of this directory.
\item The current directory.
\item The directories that are listed in the P\+A\+TH environment variable. Note that this does not include the per-\/application path specified by the App Paths registry key.
\end{DoxyItemize}

If Safe\+Dll\+Search\+Mode is disabled
\begin{DoxyItemize}
\item The directory from which the application loaded.
\item The current directory.
\item The system directory. Use the Get\+System\+Directory() function to get the path of this directory.
\item The 16-\/bit system directory. There is no function that obtains the path of this directory, but it is searched.
\item The Windows directory. Use the Get\+Windows\+Directory() function to get the path of this directory.
\item The directories that are listed in the P\+A\+TH environment variable. Note that this does not include the per-\/application path specified by the App Paths registry key.
\end{DoxyItemize}

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional. 

References evil\+\_\+char\+\_\+to\+\_\+wchar().

\mbox{\Hypertarget{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}\label{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}} 
\index{Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}!dlclose@{dlclose}}
\index{dlclose@{dlclose}!Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}}
\subsubsection{\texorpdfstring{dlclose()}{dlclose()}}
{\footnotesize\ttfamily int dlclose (\begin{DoxyParamCaption}\item[{void $\ast$}]{handle }\end{DoxyParamCaption})}



Close a dynamic-\/link library. 


\begin{DoxyParams}{Parameters}
{\em handle} & Handle that references a dynamic-\/link library. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O on sucess, -\/1 otherwise.
\end{DoxyReturn}
Release a reference to the dynamic-\/link library referenced by {\ttfamily handle}. If the reference count drops to 0, the handle is removed from the address space and is rendered invalid. {\ttfamily handle} is the value returned by a previous call to \mbox{\hyperlink{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}{dlopen()}}.

If no error occurred, the returned value is 0, otherwise the returned value is -\/1 and an error string can be retrived with \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}}.

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional. 

Referenced by elm\+\_\+quicklaunch\+\_\+cleanup().

\mbox{\Hypertarget{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}\label{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}} 
\index{Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}!dlsym@{dlsym}}
\index{dlsym@{dlsym}!Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}}
\subsubsection{\texorpdfstring{dlsym()}{dlsym()}}
{\footnotesize\ttfamily void$\ast$ dlsym (\begin{DoxyParamCaption}\item[{void $\ast$}]{handle,  }\item[{const char $\ast$}]{symbol }\end{DoxyParamCaption})}



Get the address of a symbol. 


\begin{DoxyParams}{Parameters}
{\em handle} & Handle that references a dynamic-\/link library. \\
\hline
{\em symbol} & {\ttfamily N\+U\+L\+L-\/terminated} string. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
O on sucess, N\+U\+LL otherwise.
\end{DoxyReturn}
Return the address of the code or data location specified by the string {\ttfamily symbol}. {\ttfamily handle} references a library that contains the function or variable {\ttfamily symbol}.

If no error occurred, the returned value is the code or data location, otherwise the returned value is N\+U\+LL and an error string can be retrived with \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}}.

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional. 

References evil\+\_\+char\+\_\+to\+\_\+wchar().

\mbox{\Hypertarget{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}\label{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}} 
\index{Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}!dlerror@{dlerror}}
\index{dlerror@{dlerror}!Functions that manage dynamic-\/link libraries.@{Functions that manage dynamic-\/link libraries.}}
\subsubsection{\texorpdfstring{dlerror()}{dlerror()}}
{\footnotesize\ttfamily char$\ast$ dlerror (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Get diagnostic information. 

\begin{DoxyReturn}{Returns}
A {\ttfamily N\+U\+L\+L-\/terminated} string if an error occurred, {\ttfamily N\+U\+LL} otherwise.
\end{DoxyReturn}
Return a {\ttfamily N\+U\+L\+L-\/terminated} character string describing the last error that occurred on this thread during a call to \mbox{\hyperlink{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}{dlopen()}}, \mbox{\hyperlink{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}{dlsym()}}, or \mbox{\hyperlink{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}{dlclose()}}. If no such error has occurred, \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}} returns a null pointer. At each call to \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}}, the error indication is reset. Thus in the case of two calls to \mbox{\hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}}, where the second call follows the first immediately, the second call will always return a null pointer.

Conformity\+: None.

Supported OS\+: Windows Vista, Windows XP or Windows 2000 Professional. 