\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.}}


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$ \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 \hyperlink{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}{dlclose} (void $\ast$handle)
\begin{DoxyCompactList}\small\item\em Close a dynamic-\/link library. \end{DoxyCompactList}\item 
void $\ast$ \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$ \hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror} (void)
\begin{DoxyCompactList}\small\item\em Get diagnostic information. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
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}
\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(const char $\ast$path, int mode)}{dlopen(const char *path, int mode)}}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ dlopen (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{path, }
\item[{int}]{mode}
\end{DoxyParamCaption}
)}\hypertarget{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}{}\label{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}


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 \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().



Referenced by ecore\+\_\+x\+\_\+init(), and eina\+\_\+module\+\_\+load().

\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(void $\ast$handle)}{dlclose(void *handle)}}]{\setlength{\rightskip}{0pt plus 5cm}int dlclose (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{handle}
\end{DoxyParamCaption}
)}\hypertarget{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}{}\label{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}


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 \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 \hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}.

Conformity\+: None.

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

Referenced by eina\+\_\+module\+\_\+load(), and eina\+\_\+module\+\_\+unload().

\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(void $\ast$handle, const char $\ast$symbol)}{dlsym(void *handle, const char *symbol)}}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ dlsym (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{handle, }
\item[{const char $\ast$}]{symbol}
\end{DoxyParamCaption}
)}\hypertarget{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}{}\label{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}


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 \hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}.

Conformity\+: None.

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

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



Referenced by ecore\+\_\+x\+\_\+init(), eina\+\_\+module\+\_\+load(), eina\+\_\+module\+\_\+symbol\+\_\+get(), and eina\+\_\+module\+\_\+unload().

\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(void)}{dlerror(void)}}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ dlerror (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{}\label{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}


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 \hyperlink{group__Evil__Dlfcn_ga7287ef9a037dbf96810a83ab770c2971}{dlopen()}, \hyperlink{group__Evil__Dlfcn_ga84cb8784df910bfcc3002dc5e9e2f406}{dlsym()}, or \hyperlink{group__Evil__Dlfcn_gaf483b6c4400965aa885f9f1a144138a5}{dlclose()}. If no such error has occurred, \hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()} returns a null pointer. At each call to \hyperlink{group__Evil__Dlfcn_ga541c343ae5cdf90926014c65972c86cc}{dlerror()}, the error indication is reset. Thus in the case of two calls to \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. 

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



Referenced by eina\+\_\+module\+\_\+load().

