summaryrefslogtreecommitdiffstats
path: root/win/tclWinLoad.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-04-06 13:05:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-04-06 13:05:44 (GMT)
commita6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc (patch)
treeee0613bd7e8d75ba4fd80811c1b4aac49b00d308 /win/tclWinLoad.c
parent5e4e04d0e675c6fa2f437398bcdcab674c0cbd04 (diff)
downloadtcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.zip
tcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.tar.gz
tcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.tar.bz2
More generation of error codes (most platform-specific parts not already using
Tcl_PosixError).
Diffstat (limited to 'win/tclWinLoad.c')
-rw-r--r--win/tclWinLoad.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index e877ebe..3f4d4d9 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -125,20 +125,27 @@ TclpDlopen(
switch (lastError) {
case ERROR_MOD_NOT_FOUND:
+ Tcl_SetErrorCode(interp, "WIN_LOAD", "MOD_NOT_FOUND", NULL);
+ goto notFoundMsg;
case ERROR_DLL_NOT_FOUND:
+ Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_NOT_FOUND", NULL);
+ notFoundMsg:
Tcl_AppendResult(interp, "this library or a dependent library"
" could not be found in library path", NULL);
break;
case ERROR_PROC_NOT_FOUND:
+ Tcl_SetErrorCode(interp, "WIN_LOAD", "PROC_NOT_FOUND", NULL);
Tcl_AppendResult(interp, "A function specified in the import"
" table could not be resolved by the system. Windows"
" is not telling which one, I'm sorry.", NULL);
break;
case ERROR_INVALID_DLL:
+ Tcl_SetErrorCode(interp, "WIN_LOAD", "INVALID_DLL", NULL);
Tcl_AppendResult(interp, "this library or a dependent library"
" is damaged", NULL);
break;
case ERROR_DLL_INIT_FAILED:
+ Tcl_SetErrorCode(interp, "WIN_LOAD", "DLL_INIT_FAILED", NULL);
Tcl_AppendResult(interp, "the library initialization"
" routine failed", NULL);
break;
@@ -147,14 +154,18 @@ TclpDlopen(
Tcl_AppendResult(interp, Tcl_PosixError(interp), NULL);
}
return TCL_ERROR;
- } else {
- handlePtr = ckalloc(sizeof(struct Tcl_LoadHandle_));
- handlePtr->clientData = (ClientData) hInstance;
- handlePtr->findSymbolProcPtr = &FindSymbol;
- handlePtr->unloadFileProcPtr = &UnloadFile;
- *loadHandle = handlePtr;
- *unloadProcPtr = &UnloadFile;
}
+
+ /*
+ * Succeded; package everything up for Tcl.
+ */
+
+ handlePtr = ckalloc(sizeof(struct Tcl_LoadHandle_));
+ handlePtr->clientData = (ClientData) hInstance;
+ handlePtr->findSymbolProcPtr = &FindSymbol;
+ handlePtr->unloadFileProcPtr = &UnloadFile;
+ *loadHandle = handlePtr;
+ *unloadProcPtr = &UnloadFile;
return TCL_OK;
}
@@ -344,7 +355,7 @@ TclpTempFileNameForLibrary(Tcl_Interp* interp, /* Tcl interpreter */
}
if (dllDirectoryName == NULL) {
Tcl_AppendResult(interp, "couldn't create temporary directory: ",
- Tcl_PosixError(interp), NULL);
+ Tcl_PosixError(interp), NULL);
}
fileName = TclpNativeToNormalized(dllDirectoryName);
tail = TclPathPart(interp, path, TCL_PATH_TAIL);