diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-01-12 19:27:48 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-01-12 19:27:48 +0000 |
commit | 1effc94df7e558de6319082e390803911cf45c24 (patch) | |
tree | f1b058ba18c1107621150bce9a2fc0eb410b4cb3 /src/plugger.h | |
parent | 4e0cd382dc4252306e0c2dc880c06b1fa4857c89 (diff) | |
download | libbu++-1effc94df7e558de6319082e390803911cf45c24.tar.gz libbu++-1effc94df7e558de6319082e390803911cf45c24.tar.bz2 libbu++-1effc94df7e558de6319082e390803911cf45c24.tar.xz libbu++-1effc94df7e558de6319082e390803911cf45c24.zip |
Plugger, and potentially anything that can use windows, can report windows
errors now...uh...woo?
Diffstat (limited to 'src/plugger.h')
-rw-r--r-- | src/plugger.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugger.h b/src/plugger.h index 37d6f19..2780356 100644 --- a/src/plugger.h +++ b/src/plugger.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #include "bu/fstring.h" | 14 | #include "bu/fstring.h" |
15 | #include <stddef.h> | 15 | #include <stddef.h> |
16 | 16 | ||
17 | #include "bu/config.h" | ||
18 | |||
17 | #ifdef WIN32 | 19 | #ifdef WIN32 |
18 | # include <windows.h> | 20 | # include <windows.h> |
19 | #else | 21 | #else |
@@ -197,29 +199,29 @@ namespace Bu | |||
197 | pReg->dlHandle = LoadLibrary( sFName.getStr() ); | 199 | pReg->dlHandle = LoadLibrary( sFName.getStr() ); |
198 | if( pReg->dlHandle == NULL ) | 200 | if( pReg->dlHandle == NULL ) |
199 | { | 201 | { |
200 | throw PluginException( 1, "Error opening %s: %s", sFName.getStr(), | 202 | throw PluginException( 1, "Error opening %s: %s", |
201 | "unknown error, fix this for windows" ); | 203 | sFName.getStr(), Bu::getLastWinError().getStr() ); |
202 | } | 204 | } |
203 | pReg->pInfo = (PluginInfo *)GetProcAddress( pReg->dlHandle, | 205 | pReg->pInfo = (PluginInfo *)GetProcAddress( pReg->dlHandle, |
204 | sPluginName.getStr() ); | 206 | sPluginName.getStr() ); |
205 | if( pReg->pInfo == NULL ) | 207 | if( pReg->pInfo == NULL ) |
206 | { | 208 | { |
207 | throw PluginException( 2, "Error mapping %s: %s", sFName.getStr(), | 209 | throw PluginException( 2, "Error mapping %s: %s", |
208 | "unknown error, fix this for windows" ); | 210 | sFName.getStr(), Bu::getLastWinError().getStr() ); |
209 | } | 211 | } |
210 | #else | 212 | #else |
211 | pReg->dlHandle = dlopen( sFName.getStr(), RTLD_NOW ); | 213 | pReg->dlHandle = dlopen( sFName.getStr(), RTLD_NOW ); |
212 | if( pReg->dlHandle == NULL ) | 214 | if( pReg->dlHandle == NULL ) |
213 | { | 215 | { |
214 | throw PluginException( 1, "Error opening %s: %s", sFName.getStr(), | 216 | throw PluginException( 1, "Error opening %s: %s", |
215 | dlerror() ); | 217 | sFName.getStr(), dlerror() ); |
216 | } | 218 | } |
217 | pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, | 219 | pReg->pInfo = (PluginInfo *)dlsym( pReg->dlHandle, |
218 | sPluginName.getStr() ); | 220 | sPluginName.getStr() ); |
219 | if( pReg->pInfo == NULL ) | 221 | if( pReg->pInfo == NULL ) |
220 | { | 222 | { |
221 | throw PluginException( 2, "Error mapping %s: %s", sFName.getStr(), | 223 | throw PluginException( 2, "Error mapping %s: %s", |
222 | dlerror() ); | 224 | sFName.getStr(), dlerror() ); |
223 | } | 225 | } |
224 | #endif | 226 | #endif |
225 | hPlugin.insert( pReg->pInfo->sID, pReg ); | 227 | hPlugin.insert( pReg->pInfo->sID, pReg ); |