| 1 |
doda |
6806 |
/* |
| 2 |
|
|
* Copyright (C) 1994-1998 T. Teranishi |
| 3 |
nmaya |
9048 |
* (C) 2007- TeraTerm Project |
| 4 |
doda |
6806 |
* All rights reserved. |
| 5 |
|
|
* |
| 6 |
doda |
6841 |
* Redistribution and use in source and binary forms, with or without |
| 7 |
|
|
* modification, are permitted provided that the following conditions |
| 8 |
|
|
* are met: |
| 9 |
doda |
6806 |
* |
| 10 |
doda |
6841 |
* 1. Redistributions of source code must retain the above copyright |
| 11 |
|
|
* notice, this list of conditions and the following disclaimer. |
| 12 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
| 13 |
|
|
* notice, this list of conditions and the following disclaimer in the |
| 14 |
|
|
* documentation and/or other materials provided with the distribution. |
| 15 |
|
|
* 3. The name of the author may not be used to endorse or promote products |
| 16 |
|
|
* derived from this software without specific prior written permission. |
| 17 |
doda |
6806 |
* |
| 18 |
doda |
6841 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR |
| 19 |
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 20 |
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 21 |
|
|
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 22 |
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 23 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 |
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 |
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 |
doda |
6806 |
*/ |
| 29 |
maya |
3227 |
|
| 30 |
|
|
/* TERATERM.EXE, TTSET interface */ |
| 31 |
|
|
#include "teraterm.h" |
| 32 |
|
|
#include "tttypes.h" |
| 33 |
zmatsuo |
9244 |
#include "tttypes_key.h" |
| 34 |
maya |
3227 |
|
| 35 |
|
|
#include "ttsetup.h" |
| 36 |
|
|
#include "ttplug.h" /* TTPLUG */ |
| 37 |
|
|
|
| 38 |
doda |
6792 |
#include "ttwinman.h" |
| 39 |
|
|
|
| 40 |
maya |
3227 |
PReadIniFile ReadIniFile; |
| 41 |
|
|
PWriteIniFile WriteIniFile; |
| 42 |
|
|
PReadKeyboardCnf ReadKeyboardCnf; |
| 43 |
|
|
PCopyHostList CopyHostList; |
| 44 |
|
|
PAddHostToList AddHostToList; |
| 45 |
|
|
PParseParam ParseParam; |
| 46 |
|
|
PCopySerialList CopySerialList; |
| 47 |
|
|
PAddValueToList AddValueToList; |
| 48 |
|
|
|
| 49 |
|
|
static HANDLE HTTSET = NULL; |
| 50 |
|
|
|
| 51 |
|
|
#define IdReadIniFile 1 |
| 52 |
|
|
#define IdWriteIniFile 2 |
| 53 |
|
|
#define IdReadKeyboardCnf 3 |
| 54 |
|
|
#define IdCopyHostList 4 |
| 55 |
|
|
#define IdAddHostToList 5 |
| 56 |
|
|
#define IdParseParam 6 |
| 57 |
|
|
#define IdCopySerialList 7 |
| 58 |
|
|
#define IdAddValueToList 8 |
| 59 |
|
|
|
| 60 |
|
|
BOOL LoadTTSET() |
| 61 |
|
|
{ |
| 62 |
|
|
BOOL Err; |
| 63 |
|
|
|
| 64 |
|
|
if (HTTSET != NULL) return TRUE; |
| 65 |
doda |
6792 |
HTTSET = LoadHomeDLL("TTPSET.DLL"); |
| 66 |
maya |
3227 |
if (HTTSET == NULL) return FALSE; |
| 67 |
|
|
|
| 68 |
|
|
Err = FALSE; |
| 69 |
|
|
ReadIniFile = |
| 70 |
|
|
(PReadIniFile)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdReadIniFile)); |
| 71 |
|
|
if (ReadIniFile==NULL) Err = TRUE; |
| 72 |
|
|
|
| 73 |
|
|
WriteIniFile = |
| 74 |
|
|
(PWriteIniFile)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdWriteIniFile)); |
| 75 |
|
|
if (WriteIniFile==NULL) Err = TRUE; |
| 76 |
|
|
|
| 77 |
|
|
ReadKeyboardCnf = |
| 78 |
|
|
(PReadKeyboardCnf)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdReadKeyboardCnf)); |
| 79 |
|
|
if (ReadKeyboardCnf==NULL) Err = TRUE; |
| 80 |
|
|
|
| 81 |
|
|
CopyHostList = |
| 82 |
|
|
(PCopyHostList)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdCopyHostList)); |
| 83 |
|
|
if (CopyHostList==NULL) Err = TRUE; |
| 84 |
|
|
|
| 85 |
|
|
AddHostToList = |
| 86 |
|
|
(PAddHostToList)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdAddHostToList)); |
| 87 |
|
|
if (AddHostToList==NULL) Err = TRUE; |
| 88 |
|
|
|
| 89 |
|
|
ParseParam = |
| 90 |
|
|
(PParseParam)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdParseParam)); |
| 91 |
|
|
if (ParseParam==NULL) Err = TRUE; |
| 92 |
|
|
|
| 93 |
|
|
CopySerialList = |
| 94 |
|
|
(PCopySerialList)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdCopySerialList)); |
| 95 |
|
|
if (CopySerialList==NULL) Err = TRUE; |
| 96 |
|
|
|
| 97 |
|
|
AddValueToList = |
| 98 |
|
|
(PAddValueToList)GetProcAddress(HTTSET, MAKEINTRESOURCE(IdAddValueToList)); |
| 99 |
|
|
if (AddValueToList==NULL) Err = TRUE; |
| 100 |
|
|
|
| 101 |
|
|
if (Err) |
| 102 |
|
|
{ |
| 103 |
|
|
FreeLibrary(HTTSET); |
| 104 |
|
|
HTTSET = NULL; |
| 105 |
|
|
return FALSE; |
| 106 |
|
|
} |
| 107 |
|
|
TTXGetSetupHooks(); /* TTPLUG */ |
| 108 |
|
|
return TRUE; |
| 109 |
|
|
} |
| 110 |
|
|
|
| 111 |
|
|
void FreeTTSET() |
| 112 |
|
|
{ |
| 113 |
|
|
if (HTTSET != NULL) |
| 114 |
|
|
{ |
| 115 |
|
|
FreeLibrary(HTTSET); |
| 116 |
|
|
HTTSET = NULL; |
| 117 |
|
|
} |
| 118 |
|
|
} |