summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-09-30 20:50:30 (GMT)
committerstanton <stanton>1998-09-30 20:50:30 (GMT)
commit10495954778ec63311c9f718313832e3fc6c8033 (patch)
treef20d0a322b712690bc6a8fd17b92aed766bacfcc
parent1acbb9ec28ae84c05c53c1d1128f1d29d3e9b460 (diff)
downloadtcl-10495954778ec63311c9f718313832e3fc6c8033.zip
tcl-10495954778ec63311c9f718313832e3fc6c8033.tar.gz
tcl-10495954778ec63311c9f718313832e3fc6c8033.tar.bz2
* makefile.vc: fixed so TCL_LIBRARY is set before running tcltest
* tclWinInit.c: lint * tclWin32Dll.c: removed TclpFinalize, cleanup of merges
-rw-r--r--win/makefile.vc3
-rw-r--r--win/tclWin32Dll.c74
-rw-r--r--win/tclWinInit.c3
3 files changed, 25 insertions, 55 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 5ded8d6..44a968c 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -4,7 +4,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
-# RCS: @(#) $Id: makefile.vc,v 1.1.2.2 1998/09/24 23:59:49 stanton Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.1.2.3 1998/09/30 20:50:30 stanton Exp $
# Does not depend on the presence of any environment variables in
# order to compile tcl; all needed information is derived from
@@ -302,6 +302,7 @@ tcltest: setup $(TCLTEST) dlls $(CAT16) $(CAT32)
plugin: setup $(TCLPLUGINDLL) $(TCLSHP)
install: install-binaries install-libraries
test: setup $(TCLTEST) dlls $(CAT16) $(CAT32)
+ set TCL_LIBRARY=$(ROOT)\library
$(TCLTEST) <<
cd ../tests
source all
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 2584b71..0d91141 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWin32Dll.c,v 1.1.2.2 1998/09/24 23:59:50 stanton Exp $
+ * RCS: @(#) $Id: tclWin32Dll.c,v 1.1.2.3 1998/09/30 20:50:31 stanton Exp $
*/
#include "tclWinInt.h"
@@ -236,6 +236,7 @@ TclWinSynchSpawn(void *args, int type, void **trans, Tcl_Pid *pidPtr)
UTUNREGISTER *utUnRegisterProc;
UT32PROC *ut32Proc;
char buffer[] = "TCL16xx.DLL";
+ int result;
hKernel = LoadLibraryA("kernel32.dll");
if (hKernel == NULL) {
@@ -249,8 +250,8 @@ TclWinSynchSpawn(void *args, int type, void **trans, Tcl_Pid *pidPtr)
utRegisterProc = (UTREGISTER *) GetProcAddress(hKernel, "UTRegister");
utUnRegisterProc = (UTUNREGISTER *) GetProcAddress(hKernel, "UTUnRegister");
if ((utRegisterProc == NULL) || (utUnRegisterProc == NULL)) {
- FreeLibrary(hKernel);
- return 0;
+ result = 0;
+ goto done;
}
/*
@@ -266,25 +267,30 @@ TclWinSynchSpawn(void *args, int type, void **trans, Tcl_Pid *pidPtr)
if ((*utRegisterProc)(hInstance, buffer, NULL, "UTProc", &ut32Proc,
NULL, NULL) == FALSE) {
- FreeLibrary(hKernel);
- return 0;
+ result = 0;
+ goto done;
}
- if (ut32Proc == NULL) {
+ if (ut32Proc != NULL) {
+ /*
+ * Invoke the thunk.
+ */
+
+ *pidPtr = 0;
+ (*ut32Proc)(args, type, trans);
+ result = 1;
+ } else {
/*
* The 16-bit thunking DLL wasn't found. Return error code that
* indicates this problem.
*/
- (*utUnRegisterProc)(hInstance);
- FreeLibrary(hKernel);
- return 0;
+ result = 0;
}
-
- *pidPtr = 0;
- (*ut32Proc)(args, type, trans);
(*utUnRegisterProc)(hInstance);
+
+ done:
FreeLibrary(hKernel);
- return 1;
+ return result;
}
/*
@@ -332,10 +338,10 @@ TclWinInit(hInst)
{
OSVERSIONINFO os;
- tclInstance = hInst;
+ hInstance = hInst;
os.dwOSVersionInfoSize = sizeof(os);
GetVersionEx(&os);
- tclPlatformId = os.dwPlatformId;
+ platformId = os.dwPlatformId;
/*
* The following code stops Windows 3.x from automatically putting
@@ -348,7 +354,7 @@ TclWinInit(hInst)
* when the above operations fail.
*/
- if (tclPlatformId == VER_PLATFORM_WIN32s) {
+ if (platformId == VER_PLATFORM_WIN32s) {
SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS);
}
@@ -358,42 +364,6 @@ TclWinInit(hInst)
/*
*----------------------------------------------------------------------
*
- * TclpFinalize --
- *
- * Clean up the Windows specific library state.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Unloads any DLLs and cleans up the thunking library, if
- * necessary.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclpFinalize()
-{
- /*
- * Unregister the Tcl thunk.
- */
-
- if (UTUnRegister != NULL) {
- UTUnRegister(tclInstance);
- UTUnRegister = NULL;
- }
-
- /*
- * Cleanup any dynamically loaded libraries.
- */
-
- UnloadLibraries();
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclWinGetPlatformId --
*
* Determines whether running under NT, 95, or Win32s, to allow
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index ec0acea..ef93cce 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinInit.c,v 1.1.2.2 1998/09/24 23:59:52 stanton Exp $
+ * RCS: @(#) $Id: tclWinInit.c,v 1.1.2.3 1998/09/30 20:50:31 stanton Exp $
*/
#include "tclWinInt.h"
@@ -330,7 +330,6 @@ AppendRegistry(
CONST char *lib)
{
HKEY key;
- char *subKey;
LONG result;
WCHAR wBuf[MAX_PATH + 64];
char buf[(MAX_PATH + LIBRARY_SIZE) * TCL_UTF_MAX];