├── .gitignore ├── License.txt ├── ODBC 4.0 ├── bin │ ├── win32 │ │ ├── ODBC32.dll │ │ ├── ODBC32.pdb │ │ ├── ODBCCP32.dll │ │ ├── ODBCCP32.pdb │ │ ├── ODBCINT.dll │ │ ├── ODBCTRAC.dll │ │ └── ODBCTRAC.pdb │ └── x64 │ │ ├── ODBC32.dll │ │ ├── ODBC32.pdb │ │ ├── ODBCCP32.dll │ │ ├── ODBCCP32.pdb │ │ ├── ODBCINT.dll │ │ ├── ODBCTRAC.dll │ │ └── ODBCTRAC.pdb ├── inc │ ├── sql.h │ ├── sqlext.h │ ├── sqltypes.h │ └── sqlucode.h └── lib │ ├── win32 │ ├── ODBC32.lib │ ├── ODBCCP32.lib │ └── ODBCTRAC.lib │ └── x64 │ ├── ODBC32.lib │ ├── ODBCCP32.lib │ └── ODBCTRAC.lib ├── README.md ├── SECURITY.md └── src ├── License.txt ├── gatortst ├── ansi │ ├── gtrtst32.def │ ├── makefile │ └── sources ├── autotest.bmp ├── buildchk.wrn ├── commtest.c ├── commtest.h ├── dirs ├── dllpick.c ├── dllpick.h ├── file.c ├── file.h ├── gatortst.c ├── gatortst.h ├── gatortst.rc ├── gatortst.sln ├── gatortst.vcxproj ├── gatortst.vcxproj.filters ├── group.bmp ├── grppick.c ├── grppick.h ├── gtrhdrs.h ├── minus.bmp ├── plus.bmp ├── runtest.c ├── runtest.h ├── sources.inc ├── srcpick.c ├── srcpick.h ├── testcase.bmp ├── udl.c ├── udl.h └── unicode │ ├── gtrts32w.def │ ├── makefile │ └── sources ├── help ├── odbc.chi ├── odbc.chm ├── odbctest.chi └── odbctest.chm ├── include ├── autotest.h ├── bitarray.h ├── odbcss.h ├── odbcver.h ├── portable.h ├── standard.h └── version.h └── odbctest ├── ODBCTest.sln ├── ODBCTest.vcxproj ├── ODBCTest.vcxproj.filters ├── about.bmp ├── about16.bmp ├── about32.bmp ├── ansi ├── makefile └── sources ├── async.bmp ├── bigint.c ├── bigint.h ├── blddata.c ├── blddata.h ├── buttons.bmp ├── connect.ico ├── connwin.c ├── connwin.h ├── dirs ├── disabled.bmp ├── dlgbldr.c ├── dlgbldr.h ├── dlgdfts.h ├── dlgmngr.c ├── dlgmngr.h ├── dlgparms.c ├── dlgparms.h ├── dlgtmplt.c ├── dlgtmplt.h ├── dlgtools.c ├── dlgtools.h ├── enabled.bmp ├── fhattr.c ├── fhbind.c ├── fhcatl.c ├── fhconn.c ├── fhdesc.c ├── fhdiag.c ├── fhenv.c ├── fhenv.h ├── fhheader.h ├── fhhndl.c ├── fhinst.c ├── fhinst.h ├── fhlocatr.c ├── fhmisc.c ├── fhrslt.c ├── fhstmt.c ├── file.h ├── fileio.c ├── fileio.h ├── funchndl.h ├── gator.ico ├── gator.rc ├── gator32.def ├── gator32.ico ├── gatortst.h ├── globals.c ├── globals.h ├── gtrcomm.c ├── gtrcomm.h ├── handles.h ├── main.c ├── mem.c ├── mem.h ├── menus.h ├── options.h ├── optwin.c ├── outwin.c ├── outwin.h ├── outwin.ico ├── paramidx.h ├── picktype.c ├── picktype.h ├── pressed.bmp ├── resource.h ├── rsltwin.c ├── rsltwin.h ├── rsltwin.ico ├── runtest.c ├── runtest.h ├── sources.inc ├── statbar.c ├── statbar.h ├── strings.h ├── szserver ├── table.c ├── table.h ├── toolbar.c ├── toolbar.h ├── unicode ├── makefile └── sources └── usrwndp.c /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | build/ 19 | bld/ 20 | [Oo]bj/ 21 | 22 | # Visual Studo 2015 cache/options directory 23 | .vs/ 24 | 25 | # MSTest test Results 26 | [Tt]est[Rr]esult*/ 27 | [Bb]uild[Ll]og.* 28 | 29 | # NUNIT 30 | *.VisualState.xml 31 | TestResult.xml 32 | 33 | # Build Results of an ATL Project 34 | [Dd]ebugPS/ 35 | [Rr]eleasePS/ 36 | dlldata.c 37 | 38 | *_i.c 39 | *_p.c 40 | *_i.h 41 | *.ilk 42 | *.meta 43 | *.obj 44 | *.pch 45 | *.pgc 46 | *.pgd 47 | *.rsp 48 | *.sbr 49 | *.tlb 50 | *.tli 51 | *.tlh 52 | *.tmp 53 | *.tmp_proj 54 | *.log 55 | *.vspscc 56 | *.vssscc 57 | .builds 58 | *.pidb 59 | *.svclog 60 | *.scc 61 | 62 | # Chutzpah Test files 63 | _Chutzpah* 64 | 65 | # Visual C++ cache files 66 | ipch/ 67 | *.aps 68 | *.ncb 69 | *.opensdf 70 | *.sdf 71 | *.cachefile 72 | *.opendb 73 | 74 | # Visual Studio profiler 75 | *.psess 76 | *.vsp 77 | *.vspx 78 | 79 | # TFS 2012 Local Workspace 80 | $tf/ 81 | 82 | # Guidance Automation Toolkit 83 | *.gpState 84 | 85 | # ReSharper is a .NET coding add-in 86 | _ReSharper*/ 87 | *.[Rr]e[Ss]harper 88 | *.DotSettings.user 89 | 90 | # JustCode is a .NET coding addin-in 91 | .JustCode 92 | 93 | # TeamCity is a build add-in 94 | _TeamCity* 95 | 96 | # DotCover is a Code Coverage Tool 97 | *.dotCover 98 | 99 | # NCrunch 100 | _NCrunch_* 101 | .*crunch*.local.xml 102 | 103 | # MightyMoose 104 | *.mm.* 105 | AutoTest.Net/ 106 | 107 | # Web workbench (sass) 108 | .sass-cache/ 109 | 110 | # Installshield output folder 111 | [Ee]xpress/ 112 | 113 | # DocProject is a documentation generator add-in 114 | DocProject/buildhelp/ 115 | DocProject/Help/*.HxT 116 | DocProject/Help/*.HxC 117 | DocProject/Help/*.hhc 118 | DocProject/Help/*.hhk 119 | DocProject/Help/*.hhp 120 | DocProject/Help/Html2 121 | DocProject/Help/html 122 | 123 | # Click-Once directory 124 | publish/ 125 | 126 | # Publish Web Output 127 | *.[Pp]ublish.xml 128 | *.azurePubxml 129 | # TODO: Comment the next line if you want to checkin your web deploy settings 130 | # but database connection strings (with potential passwords) will be unencrypted 131 | *.pubxml 132 | *.publishproj 133 | 134 | # NuGet Packages 135 | *.nupkg 136 | # The packages folder can be ignored because of Package Restore 137 | **/packages/* 138 | # except build/, which is used as an MSBuild target. 139 | !**/packages/build/ 140 | # Uncomment if necessary however generally it will be regenerated when needed 141 | #!**/packages/repositories.config 142 | 143 | # Windows Azure Build Output 144 | csx/ 145 | *.build.csdef 146 | 147 | # Windows Store app package directory 148 | AppPackages/ 149 | 150 | # Others 151 | *.[Cc]ache 152 | ClientBin/ 153 | [Ss]tyle[Cc]op.* 154 | ~$* 155 | *~ 156 | *.dbmdl 157 | *.dbproj.schemaview 158 | *.pfx 159 | *.publishsettings 160 | node_modules/ 161 | bower_components/ 162 | 163 | # RIA/Silverlight projects 164 | Generated_Code/ 165 | 166 | # Backup & report files from converting an old project file 167 | # to a newer Visual Studio version. Backup files are not needed, 168 | # because we have git ;-) 169 | _UpgradeReport_Files/ 170 | Backup*/ 171 | UpgradeLog*.XML 172 | UpgradeLog*.htm 173 | 174 | # SQL Server files 175 | *.mdf 176 | *.ldf 177 | 178 | # Business Intelligence projects 179 | *.rdl.data 180 | *.bim.layout 181 | *.bim_*.settings 182 | 183 | # Microsoft Fakes 184 | FakesAssemblies/ 185 | 186 | # Node.js Tools for Visual Studio 187 | .ntvs_analysis.dat 188 | 189 | # Visual Studio 6 build log 190 | *.plg 191 | 192 | # Visual Studio 6 workspace options file 193 | *.opt 194 | /src/help/odbctest.chw 195 | /src/odbctest/ODBCTest.VC.db -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------ START OF LICENSE ----------------------------------------- 2 | ODBC Test 3 | Copyright (c) Microsoft Corporation 4 | All rights reserved. 5 | MIT License 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | ----------------------------------------------- END OF LICENSE ------------------------------------------ 10 | 11 | -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBC32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBC32.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBC32.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBC32.pdb -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBCCP32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBCCP32.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBCCP32.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBCCP32.pdb -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBCINT.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBCINT.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBCTRAC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBCTRAC.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/win32/ODBCTRAC.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/win32/ODBCTRAC.pdb -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBC32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBC32.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBC32.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBC32.pdb -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBCCP32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBCCP32.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBCCP32.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBCCP32.pdb -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBCINT.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBCINT.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBCTRAC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBCTRAC.dll -------------------------------------------------------------------------------- /ODBC 4.0/bin/x64/ODBCTRAC.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/bin/x64/ODBCTRAC.pdb -------------------------------------------------------------------------------- /ODBC 4.0/inc/sqltypes.h: -------------------------------------------------------------------------------- 1 | /******************************************************** 2 | * * 3 | * Copyright (C) Microsoft. All rights reserved. * 4 | * * 5 | ********************************************************/ 6 | 7 | //----------------------------------------------------------------------------- 8 | // File: sqltypes.h 9 | // 10 | // Contents: This file defines the types used in ODBC 11 | // 12 | // Comments: 13 | // 14 | //----------------------------------------------------------------------------- 15 | 16 | #if defined(_MSC_VER) && (_MSC_VER > 1000) 17 | #pragma once 18 | #endif 19 | 20 | #ifndef __SQLTYPES 21 | #define __SQLTYPES 22 | 23 | #include 24 | 25 | #pragma region Desktop Family 26 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 27 | 28 | 29 | /* if ODBCVER is not defined, default to ODBC 3.80 */ 30 | #ifndef ODBCVER 31 | #define ODBCVER 0x0380 32 | #endif /* ODBCVER */ 33 | 34 | #ifdef __cplusplus 35 | extern "C" { /* Assume C declarations for C++ */ 36 | #endif /* __cplusplus */ 37 | 38 | /* environment specific definitions */ 39 | #ifndef EXPORT 40 | #define EXPORT 41 | #endif 42 | 43 | #ifdef WIN32 44 | #define SQL_API __stdcall 45 | #else 46 | #define SQL_API 47 | #endif 48 | 49 | #ifndef RC_INVOKED 50 | 51 | /* API declaration data types */ 52 | typedef unsigned char SQLCHAR; 53 | #if (ODBCVER >= 0x0300) 54 | typedef signed char SQLSCHAR; 55 | typedef unsigned char SQLDATE; 56 | typedef unsigned char SQLDECIMAL; 57 | typedef double SQLDOUBLE; 58 | typedef double SQLFLOAT; 59 | #endif 60 | typedef long SQLINTEGER; 61 | typedef unsigned long SQLUINTEGER; 62 | 63 | #ifdef _WIN64 64 | typedef INT64 SQLLEN; 65 | typedef UINT64 SQLULEN; 66 | typedef UINT64 SQLSETPOSIROW; 67 | #else 68 | #define SQLLEN SQLINTEGER 69 | #define SQLULEN SQLUINTEGER 70 | #define SQLSETPOSIROW SQLUSMALLINT 71 | #endif 72 | 73 | //For Backward compatibility 74 | #ifdef WIN32 75 | typedef SQLULEN SQLROWCOUNT; 76 | typedef SQLULEN SQLROWSETSIZE; 77 | typedef SQLULEN SQLTRANSID; 78 | typedef SQLLEN SQLROWOFFSET; 79 | #endif 80 | 81 | #if (ODBCVER >= 0x0300) 82 | typedef unsigned char SQLNUMERIC; 83 | #endif 84 | typedef void * SQLPOINTER; 85 | #if (ODBCVER >= 0x0300) 86 | typedef float SQLREAL; 87 | #endif 88 | typedef short SQLSMALLINT; 89 | typedef unsigned short SQLUSMALLINT; 90 | #if (ODBCVER >= 0x0300) 91 | typedef unsigned char SQLTIME; 92 | typedef unsigned char SQLTIMESTAMP; 93 | typedef unsigned char SQLVARCHAR; 94 | #endif 95 | #if (ODBCVER >= 0x0400) 96 | typedef unsigned char SQLTIMEWITHTIMEZONE; 97 | typedef unsigned char SQLTIMESTAMPWITHTIMEZONE; 98 | #endif /* ODBCVER >= 0x0400 */ 99 | 100 | /* function return type */ 101 | typedef SQLSMALLINT SQLRETURN; 102 | 103 | /* generic data structures */ 104 | #if (ODBCVER >= 0x0300) 105 | #if defined(WIN32) || defined(_WIN64) 106 | typedef void* SQLHANDLE; 107 | #else 108 | typedef SQLINTEGER SQLHANDLE; 109 | #endif /* defined(WIN32) || defined(_WIN64) */ 110 | typedef SQLHANDLE SQLHENV; 111 | typedef SQLHANDLE SQLHDBC; 112 | typedef SQLHANDLE SQLHSTMT; 113 | typedef SQLHANDLE SQLHDESC; 114 | #else //ODBCVER < 0x0300 115 | #if defined(WIN32) || defined(_WIN64) 116 | typedef void* SQLHENV; 117 | typedef void* SQLHDBC; 118 | typedef void* SQLHSTMT; 119 | #else 120 | typedef SQLINTEGER SQLHENV; 121 | typedef SQLINTEGER SQLHDBC; 122 | typedef SQLINTEGER SQLHSTMT; 123 | #endif /* defined(WIN32) || defined(_WIN64) */ 124 | #endif /* ODBCVER >= 0x0300 */ 125 | 126 | /* SQL portable types for C */ 127 | typedef unsigned char UCHAR; 128 | typedef signed char SCHAR; 129 | typedef SCHAR SQLSCHAR; 130 | typedef long int SDWORD; 131 | typedef short int SWORD; 132 | typedef unsigned long int UDWORD; 133 | typedef unsigned short int UWORD; 134 | #ifndef _WIN64 135 | typedef UDWORD SQLUINTEGER; 136 | #endif 137 | 138 | typedef signed long SLONG; 139 | typedef signed short SSHORT; 140 | typedef unsigned long ULONG; 141 | typedef unsigned short USHORT; 142 | typedef double SDOUBLE; 143 | typedef double LDOUBLE; 144 | typedef float SFLOAT; 145 | 146 | typedef void* PTR; 147 | 148 | typedef void* HENV; 149 | typedef void* HDBC; 150 | typedef void* HSTMT; 151 | 152 | typedef signed short RETCODE; 153 | 154 | #if defined(WIN32) || defined(OS2) 155 | typedef HWND SQLHWND; 156 | #elif defined (UNIX) 157 | typedef Widget SQLHWND; 158 | #else 159 | /* placehold for future O/S GUI window handle definition */ 160 | typedef SQLPOINTER SQLHWND; 161 | #endif 162 | 163 | #ifndef __SQLDATE 164 | #define __SQLDATE 165 | /* transfer types for DATE, TIME, TIMESTAMP */ 166 | typedef struct tagDATE_STRUCT 167 | { 168 | SQLSMALLINT year; 169 | SQLUSMALLINT month; 170 | SQLUSMALLINT day; 171 | } DATE_STRUCT; 172 | 173 | #if (ODBCVER >= 0x0300) 174 | typedef DATE_STRUCT SQL_DATE_STRUCT; 175 | #endif /* ODBCVER >= 0x0300 */ 176 | 177 | typedef struct tagTIME_STRUCT 178 | { 179 | SQLUSMALLINT hour; 180 | SQLUSMALLINT minute; 181 | SQLUSMALLINT second; 182 | } TIME_STRUCT; 183 | 184 | #if (ODBCVER >= 0x0300) 185 | typedef TIME_STRUCT SQL_TIME_STRUCT; 186 | #endif /* ODBCVER >= 0x0300 */ 187 | 188 | typedef struct tagTIMESTAMP_STRUCT 189 | { 190 | SQLSMALLINT year; 191 | SQLUSMALLINT month; 192 | SQLUSMALLINT day; 193 | SQLUSMALLINT hour; 194 | SQLUSMALLINT minute; 195 | SQLUSMALLINT second; 196 | SQLUINTEGER fraction; 197 | } TIMESTAMP_STRUCT; 198 | 199 | #if (ODBCVER >= 0x0300) 200 | typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT; 201 | #endif /* ODBCVER >= 0x0300 */ 202 | 203 | typedef struct tagTIME_WITH_TIMEZONE_STRUCT 204 | { 205 | SQLUSMALLINT hour; 206 | SQLUSMALLINT minute; 207 | SQLUSMALLINT second; 208 | SQLSMALLINT timezone_hours; 209 | SQLUSMALLINT timezone_minutes; 210 | } TIME_WITH_TIMEZONE_STRUCT; 211 | 212 | #if (ODBCVER >= 0x0400) 213 | typedef TIME_WITH_TIMEZONE_STRUCT SQL_TIME_WITH_TIMEZONE_STRUCT; 214 | #endif /* ODBCVER >= 0x0400 */ 215 | 216 | typedef struct tagTIMESTAMP_WITH_TIMEZONE_STRUCT 217 | { 218 | SQLSMALLINT year; 219 | SQLUSMALLINT month; 220 | SQLUSMALLINT day; 221 | SQLUSMALLINT hour; 222 | SQLUSMALLINT minute; 223 | SQLUSMALLINT second; 224 | SQLUINTEGER fraction; 225 | SQLSMALLINT timezone_hours; 226 | SQLUSMALLINT timezone_minutes; 227 | } TIMESTAMP_WITH_TIMEZONE_STRUCT; 228 | 229 | #if (ODBCVER >= 0x0400) 230 | typedef TIMESTAMP_WITH_TIMEZONE_STRUCT SQL_TIMESTAMP_WITH_TIMEZONE_STRUCT; 231 | #endif /* ODBCVER >= 0x0400 */ 232 | 233 | /* 234 | * enumerations for DATETIME_INTERVAL_SUBCODE values for interval data types 235 | * these values are from SQL-92 236 | */ 237 | 238 | #if (ODBCVER >= 0x0300) 239 | typedef enum 240 | { 241 | SQL_IS_YEAR = 1, 242 | SQL_IS_MONTH = 2, 243 | SQL_IS_DAY = 3, 244 | SQL_IS_HOUR = 4, 245 | SQL_IS_MINUTE = 5, 246 | SQL_IS_SECOND = 6, 247 | SQL_IS_YEAR_TO_MONTH = 7, 248 | SQL_IS_DAY_TO_HOUR = 8, 249 | SQL_IS_DAY_TO_MINUTE = 9, 250 | SQL_IS_DAY_TO_SECOND = 10, 251 | SQL_IS_HOUR_TO_MINUTE = 11, 252 | SQL_IS_HOUR_TO_SECOND = 12, 253 | SQL_IS_MINUTE_TO_SECOND = 13 254 | } SQLINTERVAL; 255 | 256 | #endif /* ODBCVER >= 0x0300 */ 257 | 258 | #if (ODBCVER >= 0x0300) 259 | typedef struct tagSQL_YEAR_MONTH 260 | { 261 | SQLUINTEGER year; 262 | SQLUINTEGER month; 263 | } SQL_YEAR_MONTH_STRUCT; 264 | 265 | typedef struct tagSQL_DAY_SECOND 266 | { 267 | SQLUINTEGER day; 268 | SQLUINTEGER hour; 269 | SQLUINTEGER minute; 270 | SQLUINTEGER second; 271 | SQLUINTEGER fraction; 272 | } SQL_DAY_SECOND_STRUCT; 273 | 274 | typedef struct tagSQL_INTERVAL_STRUCT 275 | { 276 | SQLINTERVAL interval_type; 277 | SQLSMALLINT interval_sign; 278 | union { 279 | SQL_YEAR_MONTH_STRUCT year_month; 280 | SQL_DAY_SECOND_STRUCT day_second; 281 | } intval; 282 | 283 | } SQL_INTERVAL_STRUCT; 284 | 285 | #endif /* ODBCVER >= 0x0300 */ 286 | 287 | #endif /* __SQLDATE */ 288 | 289 | /* the ODBC C types for SQL_C_SBIGINT and SQL_C_UBIGINT */ 290 | #if (ODBCVER >= 0x0300) 291 | #if (_MSC_VER >= 900) 292 | #define ODBCINT64 __int64 293 | #endif 294 | 295 | /* If using other compilers, define ODBCINT64 to the 296 | approriate 64 bit integer type */ 297 | #ifdef ODBCINT64 298 | typedef ODBCINT64 SQLBIGINT; 299 | typedef unsigned ODBCINT64 SQLUBIGINT; 300 | #endif 301 | #endif /* ODBCVER >= 0x0300 */ 302 | 303 | /* internal representation of numeric data type */ 304 | #if (ODBCVER >= 0x0300) 305 | #define SQL_MAX_NUMERIC_LEN 16 306 | typedef struct tagSQL_NUMERIC_STRUCT 307 | { 308 | SQLCHAR precision; 309 | SQLSCHAR scale; 310 | SQLCHAR sign; /* 1 if positive, 0 if negative */ 311 | SQLCHAR val[SQL_MAX_NUMERIC_LEN]; 312 | } SQL_NUMERIC_STRUCT; 313 | #endif /* ODBCVER >= 0x0300 */ 314 | 315 | #if (ODBCVER >= 0x0350) 316 | #ifdef GUID_DEFINED 317 | typedef GUID SQLGUID; 318 | #else 319 | /* size is 16 */ 320 | typedef struct tagSQLGUID 321 | { 322 | DWORD Data1; 323 | WORD Data2; 324 | WORD Data3; 325 | BYTE Data4[ 8 ]; 326 | } SQLGUID; 327 | #endif /* GUID_DEFINED */ 328 | #endif /* ODBCVER >= 0x0350 */ 329 | 330 | typedef SQLULEN BOOKMARK; 331 | 332 | #ifdef _WCHAR_T_DEFINED 333 | typedef wchar_t SQLWCHAR; 334 | #else 335 | typedef unsigned short SQLWCHAR; 336 | #endif 337 | 338 | #ifdef UNICODE 339 | typedef SQLWCHAR SQLTCHAR; 340 | #else 341 | typedef SQLCHAR SQLTCHAR; 342 | #endif /* UNICODE */ 343 | 344 | 345 | #endif /* RC_INVOKED */ 346 | 347 | 348 | #ifdef __cplusplus 349 | } /* End of extern "C" { */ 350 | #endif /* __cplusplus */ 351 | 352 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ 353 | #pragma endregion 354 | 355 | #endif /* #ifndef __SQLTYPES */ 356 | -------------------------------------------------------------------------------- /ODBC 4.0/lib/win32/ODBC32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/win32/ODBC32.lib -------------------------------------------------------------------------------- /ODBC 4.0/lib/win32/ODBCCP32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/win32/ODBCCP32.lib -------------------------------------------------------------------------------- /ODBC 4.0/lib/win32/ODBCTRAC.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/win32/ODBCTRAC.lib -------------------------------------------------------------------------------- /ODBC 4.0/lib/x64/ODBC32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/x64/ODBC32.lib -------------------------------------------------------------------------------- /ODBC 4.0/lib/x64/ODBCCP32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/x64/ODBCCP32.lib -------------------------------------------------------------------------------- /ODBC 4.0/lib/x64/ODBCTRAC.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/ODBC 4.0/lib/x64/ODBCTRAC.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | These projects have been verified to build with platform toolset Visual Studio 2015 (v140). 2 | For details about ODBCTest, https://msdn.microsoft.com/en-us/library/ms712676(v=vs.85).aspx 3 | Happy coding! 4 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/License.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------ START OF LICENSE ----------------------------------------- 2 | ODBC Test 3 | Copyright (c) Microsoft Corporation 4 | All rights reserved. 5 | MIT License 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | ----------------------------------------------- END OF LICENSE ------------------------------------------ 10 | 11 | -------------------------------------------------------------------------------- /src/gatortst/ansi/gtrtst32.def: -------------------------------------------------------------------------------- 1 | HEAPSIZE 5120 2 | SECTIONS 3 | EXPORTS 4 | CenterDialog 5 | DrawBitmap 6 | GetLogFile 7 | ManageGroups 8 | ManageSources 9 | ManageTests 10 | RunAutoTest 11 | szMessageBox 12 | szLogPrintf 13 | AbortRun 14 | GetRCString 15 | IsChicago 16 | SetupFileInfo 17 | AddAutoTest 18 | LoadAutoTestDLL 19 | UnLoadAutoTestDLL 20 | FindAutoTestNode 21 | DeleteAutoTestNode 22 | DeleteAutoTestList 23 | VerifyTestCaseCount 24 | RefreshInstalledTestList 25 | GetIniNameUsage 26 | CElapsed 27 | FAbortCheck 28 | FindFileDir 29 | CreateTestList 30 | GetTestGroups 31 | GetAutoTests 32 | GetTestCases 33 | ResetForRunList 34 | GetSetLastRunInfo 35 | SetGatorIniPath 36 | GtrCreateFile 37 | GtrMessageBox 38 | GtrLoadString 39 | GtrWritePrivateProfileString 40 | GtrGetPrivateProfileString 41 | GtrFormatMessage 42 | EnumerateListBox 43 | Busy 44 | szEOS 45 | GtrGetPrivateProfileInt 46 | -------------------------------------------------------------------------------- /src/gatortst/ansi/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /src/gatortst/ansi/sources: -------------------------------------------------------------------------------- 1 | !include ..\sources.inc 2 | 3 | TARGETNAME=gtrtst32 4 | LOCALIZE_NO_MUI=0 #Make DLL or EXE end up in the testbin directory 5 | C_DEFINES=$(C_DEFINES) 6 | -------------------------------------------------------------------------------- /src/gatortst/autotest.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/gatortst/autotest.bmp -------------------------------------------------------------------------------- /src/gatortst/buildchk.wrn: -------------------------------------------------------------------------------- 1 | CreateFilesWithRetry(e:\sql11\public.build\lock) retry:0 Win32Error:0x5; try just deleting the file and if that fails use tlist or filemon or openfiles to find who has the file open 2 | 2>warnings in directory e:\sql11\testsrc\ntdbms\sqlncli\odbc\tools\odbctest\gatortst\unicode 3 | 2>e:\sql11\tools\vc\include\string.h(54) : warning RC4011: identifier truncated to '_CRT_SECURE_CPP_OVERLOAD_STANDA' 4 | 2>e:\sql11\tools\vc\include\string.h(76) : warning RC4011: identifier truncated to '_CRT_SECURE_CPP_OVERLOAD_SECURE' 5 | -------------------------------------------------------------------------------- /src/gatortst/dirs: -------------------------------------------------------------------------------- 1 | DIRS=ansi unicode 2 | -------------------------------------------------------------------------------- /src/gatortst/dllpick.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: DLLPICK.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros for the DLLPICK functions which allow 6 | //| the user to add and remove test DLL's from GATOR.INI. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef DLLPICK_DEFS 9 | #define DLLPICK_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | #define IDD_MANAGE_TESTS 101 16 | #define IDB_FROM 1000 17 | #define IDL_AVAILABLE 1001 18 | #define IDL_INSTALLED 1002 19 | #define IDB_ADD 1003 20 | #define IDB_REMOVE 1004 21 | #define IDT_DLL 1005 22 | #define IDE_DESCRIPTION 1006 23 | #define IDT_FROM 1007 24 | #define IDT_NAME 1008 25 | 26 | 27 | //---------------------------------------------------------------------------------- 28 | // Functions 29 | //---------------------------------------------------------------------------------- 30 | void EXTFUN ManageTests(HWND hwnd, HINSTANCE hInst); 31 | BOOL EXTFUN ManageTestsWndProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/gatortst/file.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: FILE.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros for the FileOpen Dialog 6 | //*--------------------------------------------------------------------------------- 7 | #ifndef FILE_DEFS 8 | 9 | #define FILE_DEFS 10 | //---------------------------------------------------------------------------------- 11 | // Defines and Macros 12 | //---------------------------------------------------------------------------------- 13 | 14 | 15 | #define IDD_OPEN 200 16 | #define IDD_CURDIR 201 17 | #define IDD_NAME 202 18 | #define IDD_FILELIST 203 19 | #define IDD_DIRLIST 204 20 | #define IDD_DRIVES 205 21 | #define IDD_FILE_TYPES 206 22 | #define IDC_APPEND_FILE 207 23 | #define IDD_DRIVES_TXT 208 24 | #define IDNETWORK 209 25 | 26 | #define MAX_NUM_DRIVES 30 27 | #define SMALLBUFF 256 28 | #define MEDBUFF 512 29 | #define LARGEBUFF 1048 30 | #define XLARGEBUFF 2048 31 | 32 | 33 | typedef struct tagDriveInfo 34 | { 35 | int nNum; 36 | TCHAR szLetter[_MAX_PATH]; 37 | TCHAR szVol[MEDBUFF]; 38 | 39 | } DRIVEINFO, *lpDRIVEINFO; 40 | 41 | 42 | LRESULT EXTFUN OpenDlgProc(HWND hdlg,UINT wMsg,WPARAM wParam,LPARAM lParam); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/gatortst/gatortst.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| File: GATORTST.C 3 | //| Copyright (c) Microsoft Corporation, All rights reserved 4 | //| 5 | //| Purpose: 6 | //| This module conatins the main entry points which are required by 7 | //| all DLL's to be loaded. 8 | //*--------------------------------------------------------------------------------- 9 | #include "gtrhdrs.h" 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Globals 14 | //---------------------------------------------------------------------------------- 15 | VszFile; 16 | HINSTANCE hThisInst; 17 | 18 | 19 | //------------------------------------------------------------------------- 20 | // For WIN32 programs, there is only one entry point which takes care of 21 | // everything. Call the _CRT_INIT function to enable the C run-time 22 | // functions which are used heavily in the auto tests. 23 | //------------------------------------------------------------------------- 24 | #ifdef WIN32 25 | #include 26 | 27 | int EXTFUN DllMain(HANDLE hInst, DWORD fdwReason, LPVOID lpReserved) 28 | { 29 | 30 | switch(fdwReason) { 31 | case DLL_PROCESS_ATTACH: 32 | case DLL_THREAD_ATTACH: 33 | hThisInst = hInst; 34 | // InstallRemoveHelpHook(TRUE); 35 | break; 36 | 37 | // Free the thunking DLL for internal test functions 38 | case DLL_PROCESS_DETACH: 39 | case DLL_THREAD_DETACH: 40 | // InstallRemoveHelpHook(FALSE); 41 | break; 42 | } 43 | 44 | return TRUE; 45 | } 46 | 47 | #else 48 | 49 | 50 | //*--------------------------------------------------------------------------------- 51 | //| LibMain: 52 | //| This entry point will simply take care of our data segment. 53 | //| Parms: 54 | //| in hInst Current hInstance (data segment) 55 | //| in wDataSeg 56 | //| in cbHeapSize 57 | //| in szCmdLine Command line arguments 58 | //| Returns: 59 | //| TRUE if successful, FALSE on a failure 60 | //*--------------------------------------------------------------------------------- 61 | int EXTFUN LibMain(HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, 62 | LPTSTR szCmdLine) 63 | { 64 | hThisInst = hinst; 65 | InstallRemoveHelpHook(TRUE); 66 | 67 | return TRUE; 68 | } 69 | 70 | 71 | 72 | //*--------------------------------------------------------------------------------- 73 | //| WEP: 74 | //| This is the windows exit procedure. We will be passed a flag which 75 | //| tells us if we are being unloaded by a normal Unload call or if 76 | //| the system is shutting down. 77 | //| Parms: 78 | //| int fParm What type of unload? 79 | //| Returns: 80 | //| TRUE always 81 | //*--------------------------------------------------------------------------------- 82 | int EXTFUN WEP(int fParm) 83 | { 84 | InstallRemoveHelpHook(FALSE); 85 | 86 | switch (fParm) { 87 | case WEP_SYSTEM_EXIT: 88 | case WEP_FREE_DLL: 89 | default: 90 | return TRUE; 91 | } 92 | } 93 | 94 | 95 | #endif 96 | 97 | 98 | -------------------------------------------------------------------------------- /src/gatortst/gatortst.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: GATORTST.H 3 | //| Copyright (c) Microsoft Corporation, All rights reserved 4 | //| 5 | //| This file contains all of the headers which each module needs to include. It 6 | //| also contains constants for conditional compilation. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef GATORTST_DEFS 9 | #define GATORTST_DEFS 10 | 11 | //---------------------------------------------------------------------------------- 12 | // Name resolution for compilcation objects is different from C to C++. Because 13 | // of this, if we create a DLL using C and need to find it in a C++ program, 14 | // we must override the default C++ naming method to C so that it can be found. 15 | // The following will do so for a C++ program. All prototypes between the { 16 | // and } are handled this way. 17 | //---------------------------------------------------------------------------------- 18 | #ifdef __cplusplus 19 | extern "C" { /* Assume C declarations for C++ */ 20 | #endif /* __cplusplus */ 21 | 22 | #include "gtrhdrs.h" 23 | 24 | 25 | //---------------------------------------------------------------------------------- 26 | // Defines and Macros 27 | //---------------------------------------------------------------------------------- 28 | 29 | #ifdef WIN32 30 | #define SEGMENT LPVOID 31 | #else 32 | #define SEGMENT _segment 33 | #define SELF _self 34 | #endif 35 | 36 | 37 | 38 | 39 | //---------------------------------------------------------------------------------- 40 | // Function prototypes 41 | //---------------------------------------------------------------------------------- 42 | 43 | 44 | #ifdef __cplusplus 45 | } /* End of extern "C" { */ 46 | #endif /* __cplusplus */ 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /src/gatortst/gatortst.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gatortst", "gatortst.vcxproj", "{D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|Win32.Build.0 = Debug|Win32 16 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|Win32.ActiveCfg = Release|Win32 17 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/gatortst/gatortst.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0} 23 | Win32Proj 24 | 8.1 25 | 26 | 27 | 28 | DynamicLibrary 29 | true 30 | v140 31 | Unicode 32 | 33 | 34 | DynamicLibrary 35 | true 36 | v140 37 | Unicode 38 | 39 | 40 | DynamicLibrary 41 | false 42 | v140 43 | Unicode 44 | 45 | 46 | DynamicLibrary 47 | false 48 | v140 49 | Unicode 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | true 69 | gtrtst32w 70 | $(LibraryPath) 71 | ..\include;$(IncludePath) 72 | .dll 73 | 74 | 75 | true 76 | gtrtst32w 77 | $(LibraryPath) 78 | ..\include;$(IncludePath) 79 | .dll 80 | 81 | 82 | true 83 | ..\include;$(IncludePath) 84 | .dll 85 | gtrtst32w 86 | $(LibraryPath) 87 | 88 | 89 | true 90 | ..\include;$(IncludePath) 91 | .dll 92 | gtrtst32w 93 | $(LibraryPath) 94 | 95 | 96 | 97 | WIN32;_DEBUG;_WINDOWS;_USRDLL;GATORTST_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 98 | MultiThreadedDLL 99 | Level3 100 | ProgramDatabase 101 | Disabled 102 | 103 | 104 | MachineX86 105 | true 106 | Windows 107 | MPR.LIB;%(AdditionalDependencies) 108 | unicode\gtrts32w.def 109 | 110 | 111 | 112 | 113 | WIN32;_DEBUG;_WINDOWS;_USRDLL;GATORTST_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 114 | MultiThreadedDLL 115 | Level3 116 | ProgramDatabase 117 | Disabled 118 | 119 | 120 | true 121 | Windows 122 | MPR.LIB;%(AdditionalDependencies) 123 | unicode\gtrts32w.def 124 | 125 | 126 | 127 | 128 | WIN32;NDEBUG;_WINDOWS;_USRDLL;GATORTST_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 129 | MultiThreadedDLL 130 | Level3 131 | ProgramDatabase 132 | 133 | 134 | MachineX86 135 | true 136 | Windows 137 | unicode\gtrts32w.def 138 | MPR.LIB;%(AdditionalDependencies) 139 | 140 | 141 | 142 | 143 | WIN32;NDEBUG;_WINDOWS;_USRDLL;GATORTST_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 144 | MultiThreadedDLL 145 | Level3 146 | ProgramDatabase 147 | 148 | 149 | true 150 | Windows 151 | unicode\gtrts32w.def 152 | MPR.LIB;%(AdditionalDependencies) 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /src/gatortst/gatortst.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | 44 | 45 | Header Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | 55 | 56 | Header Files 57 | 58 | 59 | Header Files 60 | 61 | 62 | Header Files 63 | 64 | 65 | Header Files 66 | 67 | 68 | Header Files 69 | 70 | 71 | Header Files 72 | 73 | 74 | Header Files 75 | 76 | 77 | Header Files 78 | 79 | 80 | Header Files 81 | 82 | 83 | 84 | 85 | Resource Files 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/gatortst/group.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/gatortst/group.bmp -------------------------------------------------------------------------------- /src/gatortst/grppick.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: GRPPICK.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros for the GRPPICK functions which allow 6 | //| the user to add and remove groups from GATOR.INI. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef GRPPICK_DEFS 9 | #define GRPPICK_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | #define IDD_MANAGE_GROUPS 120 16 | #define IDT_GROUP 1200 17 | #define IDC_GROUPS 1201 18 | #define IDB_NEW 1202 19 | #define IDB_DELETE 1203 20 | #define IDT_GROUP_INSTALLED 1204 21 | #define IDT_GROUP_AVAIL 1205 22 | 23 | #define IDD_NEW_GROUP 1230 24 | #define IDE_GROUP 1231 25 | //#define IDT_GROUP_SOURCE_TITLE 1232 26 | 27 | #define USER_RESET_GROUPS WM_USER + 156 28 | 29 | 30 | //---------------------------------------------------------------------------------- 31 | // Functions 32 | //---------------------------------------------------------------------------------- 33 | void EXTFUN ManageGroups(HWND hwnd, HINSTANCE hInst); 34 | BOOL EXTFUN ManageGroupsWndProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/gatortst/gtrhdrs.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| Title: Headers.h 6 | //| 7 | //| Purpose: 8 | //| ODBCTest precompiled headers 9 | //| 10 | //*--------------------------------------------------------------------------------- 11 | 12 | 13 | #ifndef WINVER 14 | #define WINVER 0x0400 15 | #endif 16 | 17 | #ifndef RC_INVOKED 18 | #include 19 | #endif 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #ifndef RC_INVOKED 26 | #include 27 | #include 28 | #endif 29 | #include "portable.h" 30 | #include "standard.h" 31 | #include "sql.h" 32 | #include "sqlext.h" 33 | #include "bitarray.h" 34 | #include "autotest.h" 35 | #include "commtest.h" 36 | #include "udl.h" 37 | #include "dllpick.h" 38 | #include "grppick.h" 39 | #include "srcpick.h" 40 | #include "runtest.h" 41 | -------------------------------------------------------------------------------- /src/gatortst/minus.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/gatortst/minus.bmp -------------------------------------------------------------------------------- /src/gatortst/plus.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/gatortst/plus.bmp -------------------------------------------------------------------------------- /src/gatortst/runtest.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: RUNTEST.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros for the DLLPICK functions which allow 6 | //| the user to add and remove test DLL's from GATOR.INI. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef RUNTEST_DEFS 9 | #define RUNTEST_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | #define IDD_RUN_TESTS 110 16 | #define IDL_AUTO_TESTS 1100 17 | #define IDL_SOURCES 1101 18 | #define IDX_LOG 1102 19 | #define IDX_SCREEN 1103 20 | #define IDX_DEBUG 1104 21 | #define IDX_ISOLATE 1105 22 | #define IDX_CURSOR_LIB 1106 23 | #define IDB_LOG 1107 24 | #define IDT_LOG 1108 25 | #define IDB_RUNLISTS 1109 26 | #define IDC_RUNLISTS 1110 27 | 28 | #define IDD_RUN_LISTS 111 29 | #define IDT_CURRENT 1130 30 | #define IDL_RUNLISTS 1131 31 | #define IDB_SAVE 1132 32 | #define IDB_SAVEAS 1133 33 | #define IDB_DELETERL 1134 34 | 35 | #define IDD_NEW_RUNLIST 112 36 | 37 | #define USER_SET_BUTTON_STATE WM_USER + 151 38 | #define USER_RESET_INSTALLED WM_USER + 152 39 | #define USER_RESET_AVAILABLE WM_USER + 153 40 | #define USER_ADD_ITEM WM_USER + 154 41 | #define USER_REMOVE_ITEM WM_USER + 155 42 | #define USER_RESET_RUNLISTS WM_USER + 156 43 | 44 | #define GRAYED_BUTTON 2 45 | 46 | //---------------------------------------------------------------------------------- 47 | // Function prototypes 48 | //---------------------------------------------------------------------------------- 49 | void EXTFUN RunAutoTest(HWND hwnd, HINSTANCE hInst, 50 | HENV henv, HDBC hdbc, HSTMT hstmt,lpRUNTESTLIST lpRtl, 51 | HANDLE hConsole); 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/gatortst/sources.inc: -------------------------------------------------------------------------------- 1 | TARGETTYPE=DYNLINK 2 | !INCLUDE $(PROJROOT)\user.mk 3 | 4 | 5 | PRECOMPILED_INCLUDE=..\gtrhdrs.h 6 | 7 | UMTYPE=windows 8 | 9 | USE_LIBCMT=1 10 | USE_ATL=1 11 | 12 | C_DEFINES=$(C_DEFINES) 13 | 14 | TARGETLIBS=\ 15 | $(SDK_LIB_PATH)\kernel32.lib \ 16 | $(SDK_LIB_PATH)\gdi32.lib \ 17 | $(SDK_LIB_PATH)\user32.lib \ 18 | $(SDK_LIB_PATH)\comdlg32.lib \ 19 | $(SDK_LIB_PATH)\mpr.lib \ 20 | $(SDK_LIB_PATH)\odbc32.lib 21 | 22 | INCLUDES=..;..\..\include 23 | 24 | SOURCES=\ 25 | ..\gatortst.rc \ 26 | ..\commtest.c \ 27 | ..\dllpick.c \ 28 | ..\file.c \ 29 | ..\gatortst.c \ 30 | ..\grppick.c \ 31 | ..\runtest.c \ 32 | ..\srcpick.c \ 33 | ..\udl.c 34 | -------------------------------------------------------------------------------- /src/gatortst/srcpick.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: SRCPICK.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros for the SRCPICK functions which allow 6 | //| the user to add and remove sources from GATOR.INI. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef SRCPICK_DEFS 9 | #define SRCPICK_DEFS 10 | 11 | //---------------------------------------------------------------------------------- 12 | // Defines and Macros 13 | //---------------------------------------------------------------------------------- 14 | #define IDD_MANAGE_SOURCES 130 15 | #define IDD_NEW_SOURCE 131 16 | 17 | #define IDE_SOURCE 215 18 | 19 | #define IDC_SOURCES 200 20 | #define IDC_DSN0 201 21 | #define IDE_UID0 202 22 | #define IDE_PWD0 203 23 | #define IDE_KEYWORDS 204 24 | #define IDT_DSN0 205 25 | #define IDT_UID0 206 26 | #define IDT_PWD0 207 27 | #define IDT_KEYWORDS 208 28 | #define IDT_PARMS 209 29 | #define IDT_TEST_SOURCES 210 30 | #define FIRST_SRC_CONTROL 201 31 | #define LAST_SRC_CONTROL 209 32 | 33 | 34 | //---------------------------------------------------------------------------------- 35 | // Functions 36 | //---------------------------------------------------------------------------------- 37 | void EXTFUN ManageSources(HWND hwnd, HINSTANCE hInst); 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/gatortst/testcase.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/gatortst/testcase.bmp -------------------------------------------------------------------------------- /src/gatortst/udl.h: -------------------------------------------------------------------------------- 1 | //*----------------------------------------------------------------------- 2 | //| Copyright (c) Microsoft Corporation 3 | //| This include file contains the constants required for the control 4 | //| dialog of the ODBC Translate tool. 5 | //*----------------------------------------------------------------------- 6 | #ifndef UDL_DEFS 7 | #define UDL_DEFS 8 | 9 | //------------------------------------------------------------------------ 10 | // Defines 11 | //------------------------------------------------------------------------ 12 | #define GROUP_LEVEL 0 13 | #define AUTOT_LEVEL 1 14 | #define TESTC_LEVEL 2 15 | 16 | #define IDBT_PLUS 900 17 | #define IDBT_MINUS 901 18 | 19 | #define IDBT_GROUP 905 20 | #define IDBT_AUTOT 906 21 | #define IDBT_TESTC 907 22 | 23 | #define UDL_SELCHANGE (WM_USER + 1000) 24 | #define UDL_EXPAND (WM_USER + 1001) 25 | #define UDL_SETTOP (WM_USER + 1002) 26 | #define UDL_LINEUP (WM_USER + 1003) 27 | #define UDL_LINEDOWN (WM_USER + 1004) 28 | #define UDL_PAGEUP (WM_USER + 1005) 29 | #define UDL_PAGEDOWN (WM_USER + 1006) 30 | 31 | #define UDL_SELECTION_CHANGED (WM_USER + 1010) 32 | 33 | #define GETUDLINFOBOX(hwnd) (lpUDLINFOBOX)GetWindowLongPtr(hwnd, 0) 34 | 35 | #define DFTBITMAPWIDTH 14 36 | #define DFTBITMAPHEIGHT 12 37 | typedef unsigned long int UDWORD; 38 | 39 | 40 | // Following structure used to track top level items, changes 41 | // in selection status, and other items 42 | #define UDL_GROUP 0 43 | #define UDL_AUTOT 1 44 | #define UDL_TESTC 2 45 | 46 | #define UDL_UP 1 47 | #define UDL_DOWN 2 48 | 49 | #define UDL_NO_RELATIVE_SCROLL ((UINT)-1) 50 | 51 | #define UDL_GROUP_ON_TOP 1 52 | #define UDL_AUTOT_ON_TOP 2 53 | #define UDL_TESTC_ON_TOP 4 54 | typedef struct tagLVLINDEX { 55 | UINT fOpt; // Bitmask for operation 56 | UINT group; // Group index 57 | UINT autot; // Auto test within group 58 | UINT testc; // Test within auto test 59 | } LVLINDEX; 60 | typedef LVLINDEX * lpLVLINDEX; 61 | 62 | 63 | // Typedef for the strings 64 | typedef struct tagARRAYLPTSTR { 65 | LPTSTR str; 66 | } ARRAYLPTSTR; 67 | typedef ARRAYLPTSTR * lpARRAYLPTSTR; 68 | 69 | 70 | // This structure is used to the attributes which all levels 71 | // at a level have in common 72 | typedef struct tagUDLLEVELDESC { 73 | UINT fx; // Free space width 74 | UINT bx; // Bitmap width 75 | UINT by; // Bitmap height 76 | UINT ux; // User text width (pixels) 77 | HBITMAP hMap; // Handle to bitmap for this level 78 | } UDLLEVELDESC; 79 | typedef UDLLEVELDESC * lpUDLLEVELDESC; 80 | 81 | 82 | // Information on an actual physical level including all user test and 83 | // selection/expansion information. Next is an array of items below this level 84 | typedef struct tagUDLINFOLEVEL { 85 | UINT level; // Which level is this (0 based) 86 | UINT cItems; // How many items at this level 87 | BOOL fLoaded; // TRUE if szItems have been set 88 | lpARRAYLPTSTR szItems; // Array of pointers to item data 89 | UINT * aSelected; // Bitmask of selected item 90 | UINT * aPartial; // Upper level partial select 91 | UINT * aExpanded; // Bitmask of expanded items 92 | UDWORD cNextItems; // How many items at next level 93 | UINT pdex; // Parent index 94 | struct tagUDLINFOLEVEL * prev; // Owner level, NULL for parent 95 | struct tagUDLINFOLEVEL * * next; // Array of levels below this 96 | } UDLINFOLEVEL; 97 | typedef UDLINFOLEVEL * lpUDLINFOLEVEL; 98 | 99 | // Information about the box including everything required for drawing the 100 | // elements and points to the correct structures 101 | typedef struct tagUDLINFOBOX { 102 | HINSTANCE hInst; // Instance handle of this owner 103 | HWND hwnd; // Window handle of control 104 | HWND hwndOwner; // Owner window on create 105 | HWND hwndScroll; // Handle of scrollbar 106 | BOOL fhwndScroll; // TRUE if enabled 107 | HWND hwndBox; // Handle of client draw area 108 | UINT cLevels; // How many levels are there? 109 | UINT dx; // Width of hwndBox 110 | UINT dy; // Height of hwndBox 111 | UINT ly; // Line height max 112 | LVLINDEX top; // Top level information 113 | UDWORD cVisible; // Total rows that will fit in box 114 | UINT cCurRelative; // Current realtive row number 115 | UINT cScrollPos; // Relative to over-all scroll 116 | UINT cRange; // Range for scroll bar 117 | HFONT hFont; // The font to use for drawing 118 | UINT cx; // Average width of character 119 | UINT cy; // Height of average character 120 | UINT cbExtra; // White space to use for drawing 121 | HBITMAP hPlus; // More levels to be seen 122 | HBITMAP hMinus; // No more levels to be seen 123 | UINT ex; // Expansion indicator width 124 | UDWORD cTotItems; // Total items for all levels 125 | UDWORD cTotVisible; // Total visible items for all levels 126 | lpUDLLEVELDESC lpdesc; // Array of level descriptors 127 | lpUDLINFOLEVEL lplvl; // First level descriptor 128 | } UDLINFOBOX; 129 | typedef UDLINFOBOX * lpUDLINFOBOX; 130 | 131 | // Following structure is used to track the selected auto tests 132 | typedef struct tagRUNTESTLIST { 133 | BOOL fRun; // TRUE if we should run 134 | BOOL fAppend; // TRUE if we should append to existing log files 135 | HINSTANCE hInst; // Instance handle of owner 136 | HWND hRunDlg; // Window handle of Run Auto Tests 137 | LPTSTR szSource; // Dbl-null list of sources 138 | TCHAR szRunList[MAXFILELEN]; // Name of Run List we're using 139 | lpSERVERINFO rs; // Pointer to struct to file out 140 | lpAUTOTESTINFO head; // Auto test list for run-info 141 | lpUDLINFOBOX lpbox; // The user drawn list of groups 142 | } RUNTESTLIST; 143 | typedef RUNTESTLIST * lpRUNTESTLIST; 144 | 145 | 146 | 147 | 148 | //------------------------------------------------------------------------ 149 | // Globals 150 | //------------------------------------------------------------------------ 151 | 152 | 153 | //------------------------------------------------------------------------ 154 | // Function prototypes 155 | //------------------------------------------------------------------------ 156 | BOOL UDLInit(HANDLE hInst); 157 | UDLINFOBOX * EXTFUNCDECL UDLCreateBox(UINT cLevels, HWND hwnd, HINSTANCE hInst, 158 | int nLeft, int nTop, int dx, int dy); 159 | VOID EXTFUN UDLFreeBox(lpUDLINFOBOX lpbox); 160 | BOOL EXTFUN UDLCreateLevelDesc( 161 | lpUDLINFOBOX lpbox, 162 | UINT level, 163 | HINSTANCE hInst, 164 | LPTSTR szBit, 165 | UINT bx, 166 | UINT by); 167 | void EXTFUN UDLFreeLevelDesc(lpUDLINFOBOX lpbox, UINT level); 168 | UDLINFOLEVEL * EXTFUNCDECL UDLCreateLevel(lpUDLINFOLEVEL parent, UINT pdex, 169 | UINT cLevel, UINT cItems, BOOL fLastLevel); 170 | VOID EXTFUN UDLFreeLevel(lpUDLINFOLEVEL lplvl); 171 | BOOL EXTFUN UDLSetLevelText(lpUDLINFOLEVEL lplvl, 172 | UINT index, LPTSTR szStr); 173 | VOID EXTFUN UDLFreeLevelText(lpUDLINFOLEVEL lplvl); 174 | UINT INTFUN UDLHowManySelections(lpUDLINFOLEVEL lplvl); 175 | UINT INTFUN UDLHowManyPartials(lpUDLINFOLEVEL lplvl); 176 | 177 | //long EXTFUN UDLWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 178 | UDWORD INTFUN UDLVisibleItems(lpUDLINFOBOX lpbox); 179 | VOID UDLAdjustScrollBar(lpUDLINFOBOX lpbox); 180 | void INTFUN UDLAdjustPartial(lpUDLINFOLEVEL lplvl, UINT dex); 181 | 182 | 183 | #endif 184 | -------------------------------------------------------------------------------- /src/gatortst/unicode/gtrts32w.def: -------------------------------------------------------------------------------- 1 | HEAPSIZE 5120 2 | SECTIONS 3 | EXPORTS 4 | CenterDialog 5 | DrawBitmap 6 | GetLogFile 7 | ManageGroups 8 | ManageSources 9 | ManageTests 10 | RunAutoTest 11 | szMessageBox 12 | szLogPrintf 13 | AbortRun 14 | GetRCString 15 | IsChicago 16 | SetupFileInfo 17 | AddAutoTest 18 | LoadAutoTestDLL 19 | UnLoadAutoTestDLL 20 | FindAutoTestNode 21 | DeleteAutoTestNode 22 | DeleteAutoTestList 23 | VerifyTestCaseCount 24 | RefreshInstalledTestList 25 | GetIniNameUsage 26 | CElapsed 27 | FAbortCheck 28 | FindFileDir 29 | CreateTestList 30 | GetTestGroups 31 | GetAutoTests 32 | GetTestCases 33 | ResetForRunList 34 | GetSetLastRunInfo 35 | SetGatorIniPath 36 | GtrCreateFile 37 | GtrMessageBox 38 | GtrLoadString 39 | GtrWritePrivateProfileString 40 | GtrGetPrivateProfileString 41 | GtrFormatMessage 42 | EnumerateListBox 43 | Busy 44 | szEOS 45 | GtrGetPrivateProfileInt 46 | -------------------------------------------------------------------------------- /src/gatortst/unicode/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /src/gatortst/unicode/sources: -------------------------------------------------------------------------------- 1 | !include ..\sources.inc 2 | 3 | TARGETNAME=gtrts32w 4 | LOCALIZE_NO_MUI=0 #Make DLL or EXE end up in the testbin directory 5 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE 6 | -------------------------------------------------------------------------------- /src/help/odbc.chi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/help/odbc.chi -------------------------------------------------------------------------------- /src/help/odbc.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/help/odbc.chm -------------------------------------------------------------------------------- /src/help/odbctest.chi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/help/odbctest.chi -------------------------------------------------------------------------------- /src/help/odbctest.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/help/odbctest.chm -------------------------------------------------------------------------------- /src/include/bitarray.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Simple bitmap functions. Assume that a long is four words 3 | ** 4 | ** 5 | ** BITARRAYSIZE: How big of a BITCELL array to declare to handle n bits 6 | ** BITTEST: Return TRUE if a bit is on 7 | ** BITSET: Set a bit on 8 | ** BITCLEAR: Set a bit off 9 | */ 10 | 11 | #ifndef BITARRAY_DEFS 12 | #define BITARRAY_DEFS 13 | 14 | 15 | // Following macros are used to decide how many UINTs are required to have enough 16 | // bits to represent (items) of data. 17 | #define CBITS (sizeof(UINT) * 8) 18 | #define BitSet(lpa, pos) \ 19 | (lpa[((pos) / CBITS)] |= 1 << ((pos) - (CBITS * ((pos) / CBITS)))) 20 | #define BitClear(lpa, pos) \ 21 | (lpa[((pos) / CBITS)] &= ~(1 << ((pos) - (CBITS * ((pos) / CBITS))))) 22 | #define BitGet(lpa, pos) \ 23 | (lpa[((pos) / CBITS)] & (1 << ((pos) - (CBITS * ((pos) / CBITS))))) 24 | #define BitFlip(lpa,pos) \ 25 | (BitGet(lpa,pos)) ? BitClear(lpa,pos) : BitSet(lpa,pos) 26 | #define MINREQUIREDINTS(items) (UINT)((items / CBITS) + ((items % CBITS) ? 1 : 0)) 27 | 28 | 29 | #define getbit(p1,p2) BitGet(p1,(p2)-1) 30 | #define setbit(p1,p2) BitSet(p1,p2) 31 | 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /src/include/odbcver.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | ODBCVer.h -- ODBC Version info 3 | --------------------------------------------------------------------------*/ 4 | 5 | 6 | // Includes ---------------------------------------------------------------- 7 | // WIN16 is only defined in building odbc16gt.dll and ds16gt.dll 8 | #ifdef WIN16 9 | #include 10 | #endif 11 | 12 | #define VER_FILEFLAGSMASK (VS_FF_DEBUG | VS_FF_PRERELEASE) 13 | #ifdef DEBUG 14 | #define VER_FILEFLAGS (VS_FF_DEBUG) 15 | #else 16 | #define VER_FILEFLAGS (0) 17 | #endif 18 | 19 | #ifdef WIN16 20 | #define VER_FILEOS VOS_DOS_WINDOWS16 21 | #else 22 | #define VER_FILEOS VOS__WINDOWS32 23 | #endif 24 | 25 | #define VER_COMPANYNAME_STR "Microsoft Corporation\0" 26 | #define VER_PRODUCTNAME_STR "Microsoft Open Database Connectivity\0" 27 | #define VER_LEGALCOPYRIGHT_STR "Copyright (C) Microsoft Corporation\0" 28 | 29 | // compare the version of this DLL (e.g. DM, Cursor lib etc) with the version 30 | // of resource DLL. They must match 31 | #ifndef KAGERA 32 | __inline BOOL DLLSameVer(HINSTANCE hDLL1, HINSTANCE hDLL2) 33 | { 34 | CHAR szDLLPath1[MAX_PATH + 1]; 35 | CHAR szDLLPath2[MAX_PATH + 1]; 36 | DWORD dwVerInfoSize1; 37 | DWORD dwVerInfoSize2; 38 | BOOL fRet = FALSE; 39 | DWORD dwVerHnd1; 40 | DWORD dwVerHnd2; 41 | UINT uiLen; 42 | 43 | 44 | GetModuleFileNameA(hDLL1, szDLLPath1, sizeof(szDLLPath1)); 45 | GetModuleFileNameA(hDLL2, szDLLPath2, sizeof(szDLLPath2)); 46 | 47 | dwVerInfoSize1 = GetFileVersionInfoSizeA(szDLLPath1, &dwVerHnd1); 48 | dwVerInfoSize2 = GetFileVersionInfoSizeA(szDLLPath2, &dwVerHnd2); 49 | 50 | if (dwVerInfoSize1 && dwVerInfoSize2) 51 | { 52 | VOID * pvVerInfo1; 53 | VOID * pvVerInfo2; 54 | VS_FIXEDFILEINFO * pFileInfo1; 55 | VS_FIXEDFILEINFO * pFileInfo2; 56 | 57 | // Get a block big enough to hold version info 58 | pvVerInfo1 = malloc(dwVerInfoSize1); 59 | pvVerInfo2 = malloc(dwVerInfoSize2); 60 | 61 | // Get the info and format a version string. 62 | if(pvVerInfo1 && pvVerInfo2) 63 | { 64 | if(GetFileVersionInfoA(szDLLPath1, 0L, dwVerInfoSize1, pvVerInfo1) && 65 | GetFileVersionInfoA(szDLLPath2, 0L, dwVerInfoSize2, pvVerInfo2)) 66 | { 67 | if(VerQueryValueA(pvVerInfo1, "\\", (VOID **) &pFileInfo1, &uiLen) && 68 | VerQueryValueA(pvVerInfo2, "\\", (VOID **) &pFileInfo2, &uiLen)) 69 | { 70 | if(pFileInfo1->dwFileVersionMS == pFileInfo2->dwFileVersionMS && 71 | pFileInfo1->dwFileVersionLS == pFileInfo2->dwFileVersionLS) 72 | { 73 | fRet = TRUE; 74 | } 75 | } 76 | } 77 | } 78 | 79 | if(pvVerInfo1) 80 | { 81 | free(pvVerInfo1); 82 | } 83 | if(pvVerInfo2) 84 | { 85 | free(pvVerInfo2); 86 | } 87 | } 88 | return fRet; 89 | } 90 | #endif 91 | -------------------------------------------------------------------------------- /src/include/standard.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: STANDARD.H 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| This file contains defines and macros which are generic in nature, that is 6 | //| they do not relate to our functions, but are for any file to use. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef STANDARD_DEFS 9 | #define STANDARD_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | typedef VOID * lpVOID; 16 | 17 | #define NumItems(s) (sizeof(s) / sizeof(s[0])) 18 | 19 | 20 | // Dialog macros 21 | #define RemoveListBoxString(hdlg, id, string) \ 22 | { \ 23 | HWND hwnd=GetDlgItem(hdlg, id); \ 24 | SendMessage(hwnd, LB_DELETESTRING, \ 25 | (WPARAM)SendMessage(hwnd, LB_FINDSTRINGEXACT, \ 26 | (WPARAM)-1, (LPARAM)(LPTSTR)string), \ 27 | 0L); \ 28 | } 29 | #define GetText(h,s) \ 30 | { \ 31 | SendMessage(h, WM_GETTEXT, \ 32 | (WPARAM)SendMessage(h, WM_GETTEXTLENGTH, 0, 0L) + 1, \ 33 | (LPARAM)(LPTSTR)s); \ 34 | } 35 | #define GetLBText(h, s) \ 36 | { \ 37 | WPARAM dex; \ 38 | if(LB_ERR == (dex = (WPARAM)SendMessage(h, LB_GETCURSEL, 0, 0L))) \ 39 | *s = '\0'; \ 40 | else \ 41 | SendMessage(h, LB_GETTEXT, dex, (LPARAM)(LPTSTR)s); \ 42 | } 43 | #define GetCBText(h,s) \ 44 | { \ 45 | WPARAM dex; \ 46 | if(CB_ERR == (dex = (WPARAM)SendMessage(h, CB_GETCURSEL, 0, 0L))) \ 47 | *s = '\0'; \ 48 | else \ 49 | SendMessage(h, CB_GETLBTEXT, dex, (LPARAM)(LPTSTR)s); \ 50 | } 51 | #define IsRadioButtonOn(hwnd) SendMessage(hwnd, BM_GETCHECK, 0, 0L) 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/include/version.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: VERSION.H 6 | //| 7 | //| Purpose: 8 | //| Contains the strings which appear in the About box and version 9 | //| information and may change often. 10 | //*--------------------------------------------------------------------------------- 11 | #ifndef VERSION_DEFS 12 | #define VERSION_DEFS 13 | 14 | 15 | //--------------------------------------------------------------------------------- 16 | // About box constants 17 | //--------------------------------------------------------------------------------- 18 | #define ABOUT_VER "Version 9.00, 90.00.786" 19 | 20 | 21 | //--------------------------------------------------------------------------------- 22 | // Version information 23 | //--------------------------------------------------------------------------------- 24 | #define VER_FILEVERSION 90,00,78.6 25 | #define VER_FILEVERSION_STR "90.00.786\0" 26 | #define VER_PRODUCTVERSION 90,00,78.6 27 | #define VER_PRODUCTVERSION_STR "90.00.786\0" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/odbctest/ODBCTest.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ODBCTest", "ODBCTest.vcxproj", "{0C0FF459-0013-4816-A8A0-E01682170589}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0} = {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gatortst", "..\gatortst\gatortst.vcxproj", "{D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Win32 = Debug|Win32 16 | Debug|x64 = Debug|x64 17 | Release|Win32 = Release|Win32 18 | Release|x64 = Release|x64 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {0C0FF459-0013-4816-A8A0-E01682170589}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {0C0FF459-0013-4816-A8A0-E01682170589}.Debug|Win32.Build.0 = Debug|Win32 23 | {0C0FF459-0013-4816-A8A0-E01682170589}.Debug|x64.ActiveCfg = Debug|x64 24 | {0C0FF459-0013-4816-A8A0-E01682170589}.Debug|x64.Build.0 = Debug|x64 25 | {0C0FF459-0013-4816-A8A0-E01682170589}.Release|Win32.ActiveCfg = Release|Win32 26 | {0C0FF459-0013-4816-A8A0-E01682170589}.Release|Win32.Build.0 = Release|Win32 27 | {0C0FF459-0013-4816-A8A0-E01682170589}.Release|x64.ActiveCfg = Release|x64 28 | {0C0FF459-0013-4816-A8A0-E01682170589}.Release|x64.Build.0 = Release|x64 29 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|Win32.ActiveCfg = Debug|Win32 30 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|Win32.Build.0 = Debug|Win32 31 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|x64.ActiveCfg = Debug|x64 32 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Debug|x64.Build.0 = Debug|x64 33 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|Win32.ActiveCfg = Release|Win32 34 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|Win32.Build.0 = Release|Win32 35 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|x64.ActiveCfg = Release|x64 36 | {D64BC2E7-2D3B-4A1C-84B0-7B5C2ADF87A0}.Release|x64.Build.0 = Release|x64 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /src/odbctest/ODBCTest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | Source Files 80 | 81 | 82 | Source Files 83 | 84 | 85 | Source Files 86 | 87 | 88 | Source Files 89 | 90 | 91 | Source Files 92 | 93 | 94 | Source Files 95 | 96 | 97 | Source Files 98 | 99 | 100 | Source Files 101 | 102 | 103 | Source Files 104 | 105 | 106 | Source Files 107 | 108 | 109 | Source Files 110 | 111 | 112 | Source Files 113 | 114 | 115 | Source Files 116 | 117 | 118 | Source Files 119 | 120 | 121 | Source Files 122 | 123 | 124 | 125 | 126 | Source Files 127 | 128 | 129 | Header Files 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | Header Files 139 | 140 | 141 | Header Files 142 | 143 | 144 | Header Files 145 | 146 | 147 | Header Files 148 | 149 | 150 | Header Files 151 | 152 | 153 | Header Files 154 | 155 | 156 | Header Files 157 | 158 | 159 | Header Files 160 | 161 | 162 | Header Files 163 | 164 | 165 | Header Files 166 | 167 | 168 | Header Files 169 | 170 | 171 | Header Files 172 | 173 | 174 | Header Files 175 | 176 | 177 | Header Files 178 | 179 | 180 | Header Files 181 | 182 | 183 | Header Files 184 | 185 | 186 | Header Files 187 | 188 | 189 | Header Files 190 | 191 | 192 | Header Files 193 | 194 | 195 | Header Files 196 | 197 | 198 | Header Files 199 | 200 | 201 | Header Files 202 | 203 | 204 | Header Files 205 | 206 | 207 | Header Files 208 | 209 | 210 | Header Files 211 | 212 | 213 | Header Files 214 | 215 | 216 | Header Files 217 | 218 | 219 | Header Files 220 | 221 | 222 | Header Files 223 | 224 | 225 | Header Files 226 | 227 | 228 | Header Files 229 | 230 | 231 | Header Files 232 | 233 | 234 | Header Files 235 | 236 | 237 | Header Files 238 | 239 | 240 | Header Files 241 | 242 | 243 | Header Files 244 | 245 | 246 | Header Files 247 | 248 | 249 | Header Files 250 | 251 | 252 | Header Files 253 | 254 | 255 | 256 | 257 | Resource Files 258 | 259 | 260 | -------------------------------------------------------------------------------- /src/odbctest/about.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/about.bmp -------------------------------------------------------------------------------- /src/odbctest/about16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/about16.bmp -------------------------------------------------------------------------------- /src/odbctest/about32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/about32.bmp -------------------------------------------------------------------------------- /src/odbctest/ansi/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /src/odbctest/ansi/sources: -------------------------------------------------------------------------------- 1 | !include ..\sources.inc 2 | 3 | TARGETNAME=odbcte32 4 | LOCALIZE_NO_MUI=0 #Make DLL or EXE end up in the testbin directory 5 | C_DEFINES=$(C_DEFINES) 6 | TARGETLIBS=$(TARGETLIBS) \ 7 | $(PROJROOT_OBJ)\ODBC\Tools\OdbcTest\gatortst\ansi\$(O)\gtrtst32.lib 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/odbctest/async.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/async.bmp -------------------------------------------------------------------------------- /src/odbctest/bigint.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: BIGINT.H 6 | //| 7 | //| Purpose: 8 | //| Contains constants and prototypes for functions in BIGINT.C 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef BIGINT_DEFS 11 | #define BIGINT_DEFS 12 | 13 | 14 | #define CVT_NO_ERROR 0 // if no conversion errors. 15 | #define CVT_TRUNC 1 16 | #define CVT_PREC 2 17 | #define CVT_ERROR 3 18 | #define CVT_DT_ERROR 4 19 | #define CVT_TM_ERROR 5 20 | #define CVT_TS_ERROR 6 21 | #define CVT_ILLEGAL 7 22 | 23 | #ifdef WIN32 24 | #define MIN_LIMIT_ADJUST 0 25 | #else 26 | #define MIN_LIMIT_ADJUST 1 27 | #endif 28 | 29 | #if defined(WIN32) 30 | #define MATH64 31 | 32 | #define MAXPREC DWORDLONG /* Use 64 bit integer arithmetic */ 33 | #define MAXCHUNK ULONG 34 | #define DWLONG DWORDLONG 35 | #define LLONG LONGLONG 36 | #else 37 | #define MAXPREC ULONG /* Use 32 bit integer arithmetic */ 38 | #define MAXCHUNK UWORD 39 | 40 | typedef struct { 41 | UDWORD Lower; 42 | UDWORD Upper; 43 | } DWLONG; 44 | 45 | typedef struct { 46 | UDWORD Lower; 47 | SDWORD Upper; 48 | } LLONG; 49 | 50 | typedef struct dbmoney 51 | { // Internal representation of MONEY data type 52 | LONG mnyhigh; // Money value *10,000 (High 32 bits/signed) 53 | ULONG mnylow; // Money value *10,000 (Low 32 bits/unsigned) 54 | } DBMONEY; 55 | 56 | #endif 57 | 58 | typedef struct numvalue { 59 | INT len; 60 | BYTE sign; 61 | BYTE *data; 62 | } NUMVALUE; 63 | 64 | #ifndef _I64_MIN 65 | /* minimum signed 64 bit value */ 66 | #define _I64_MIN (-9223372036854775807i64 - 1) 67 | #endif 68 | 69 | #ifndef _I64_MAX 70 | /* maximum signed 64 bit value */ 71 | #define _I64_MAX 9223372036854775807i64 72 | #endif 73 | 74 | #ifndef _UI64_MAX 75 | /* maximum unsigned 64 bit value */ 76 | #define _UI64_MAX 0xffffffffffffffffui64 77 | #endif 78 | 79 | 80 | 81 | #define BASE_10 10 82 | #define BASE_BITS (8) 83 | #define BASE_MOD (1 << BASE_BITS) 84 | 85 | 86 | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 87 | // Prototypes 88 | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 89 | 90 | BOOL INTFUN NegateBigint (LLONG *pValue); 91 | UWORD INTFUN CharToBigint (TCHAR *charstr, SDWORD srclen, 92 | DWLONG *pValue, UWORD Scale, BOOL fUnsigned); 93 | SWORD INTFUN bigint_shift10add (DWLONG *pValue, SWORD scale, 94 | BYTE value); 95 | SHORT INTFUN BigintToChar (DWLONG *, BYTE *, UWORD, BOOL); 96 | VOID INTFUN numeric_shift10add(NUMVALUE *, BYTE); 97 | VOID INTFUN numeric_add(NUMVALUE *, LONG); 98 | BOOL INTFUN numeric_div10(NUMVALUE * result, NUMVALUE * number, ULONG * rem); 99 | UWORD INTFUN stringtonumeric(TCHAR *str, SWORD cbstr, SQL_NUMERIC_STRUCT * retvalue, SDWORD *); 100 | BOOL INTFUN numerictostring(SQL_NUMERIC_STRUCT * value, BYTE valuelen, TCHAR * str, int cbstr); 101 | SDWORD INTFUN FindSigNumber(TCHAR * *, SDWORD); 102 | BOOL INTFUN IsValidBigInt(TCHAR *charstr,SDWORD srclen,UWORD Scale, BOOL fUnsigned,LPTSTR szFieldName); 103 | 104 | #endif 105 | 106 | -------------------------------------------------------------------------------- /src/odbctest/blddata.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: BLDDATA.H 6 | //| 7 | //| Purpose: 8 | //| Contains prototypes for functions in BLDDATA.C 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef BLDDATA_DEFS 11 | #define BLDDATA_DEFS 12 | 13 | 14 | //---------------------------------------------------------------------------------- 15 | // Function Prototypes 16 | //---------------------------------------------------------------------------------- 17 | BOOL INTFUN GetCharValueFromParm(LPTSTR szOut, DWORD cbOut, lpPARAMITEM lpParm, 18 | BOOL fIn, 19 | HENV * phenv, HDBC * phdbc, 20 | HSTMT * phstmt, SQLHDESC *phdesc, 21 | UINT uStmtNum, 22 | HWND hwndOut); 23 | BOOL INTFUN ValidateEditWindowByType(HWND hDlg, int id, LPTSTR szFieldName, SWORD fCType); 24 | VOID INTFUN RemoveDlgFormat(LPTSTR str); 25 | VOID INTFUN InitUnModified(PTR lpBytes, UDWORD udchk); 26 | BOOL INTFUN ValidateTypeData(LPTSTR szFieldName, SWORD fCType, BOOL fVocal, LPTSTR lpStr); 27 | //sumit 28 | BOOL INTFUN IsValidateFlagSet(HWND hDlg,lpPARAMITEM lpParm, lpCONTROL lpCtl); 29 | 30 | 31 | 32 | //*--------------------------------------------------------------------------------- 33 | //| IsHexString: 34 | //| This function will return TRUE if lpString is in the form of 35 | //| "0x1234567" 36 | //| Parms: 37 | //| lpString string to examine 38 | //| Returns: 39 | //| TRUE if the string is a hex string otherwise FALSE 40 | //*--------------------------------------------------------------------------------- 41 | _inline BOOL INTFUN IsHexString(LPTSTR lpString) 42 | { 43 | LPCTSTR lpHex=TEXT("0x"); 44 | 45 | if (!lpString) 46 | return (FALSE); 47 | 48 | return (!_tcsnicmp(lpString,lpHex,lstrlen(lpHex))); 49 | 50 | } //IsHexString() 51 | 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/odbctest/buttons.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/buttons.bmp -------------------------------------------------------------------------------- /src/odbctest/connect.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/connect.ico -------------------------------------------------------------------------------- /src/odbctest/connwin.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: CONNWIN.H 6 | //| 7 | //| Purpose: 8 | //| Header file for Connection Window information used to track connections. 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef CONNWIN_DEFS 11 | #define CONNWIN_DEFS 12 | 13 | #include 14 | #include "portable.h" 15 | #include "standard.h" 16 | #include "handles.h" 17 | 18 | 19 | //---------------------------------------------------------------------------------- 20 | // Defines and macros 21 | //---------------------------------------------------------------------------------- 22 | 23 | 24 | 25 | //---------------------------------------------------------------------------------- 26 | // Globals 27 | //---------------------------------------------------------------------------------- 28 | extern lpCONNECTIONINFO lpConnWin; // Head node for connection windows 29 | extern lpCONNECTIONINFO lpActiveConnWin; // The currently active connection window 30 | extern UINT cNextConnect; // Current count of connections 31 | 32 | 33 | 34 | 35 | 36 | //---------------------------------------------------------------------------------- 37 | // Function Prototypes 38 | //---------------------------------------------------------------------------------- 39 | CONNECTIONINFO * CreateConnectionWindow(HWND hwndClient, HINSTANCE hInst, 40 | lpENVIRONMENTINFO lpActiveEi); 41 | VOID INTFUN DestroyConnectionWindow(lpCONNECTIONINFO ci); 42 | HWND INTFUN GetEditWindow(); 43 | VOID INTFUN SetCurrentHstmtFromList(lpCONNECTIONINFO lpci); 44 | VOID INTFUN SetCurrentStmt(lpCONNECTIONINFO lpci, lpSTATEMENTINFO lpTarget); 45 | VOID INTFUN AdjustDropDownBox(HWND hwnd); 46 | VOID INTFUN HideDropDowns(lpCONNECTIONINFO lpci); 47 | VOID INTFUN ConnWinMoveWindowFocus(lpCONNECTIONINFO lpci); 48 | VOID INTFUN GetConnWinnDescText(lpCONNECTIONINFO lpci, LPTSTR szOut, int cbOut); 49 | VOID INTFUN InitConnectionInfo(lpCONNECTIONINFO ci,lpENVIRONMENTINFO lpEi); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/odbctest/dirs: -------------------------------------------------------------------------------- 1 | DIRS=ansi unicode 2 | -------------------------------------------------------------------------------- /src/odbctest/disabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/disabled.bmp -------------------------------------------------------------------------------- /src/odbctest/dlgbldr.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: DLGBLDR.C 6 | //| 7 | //| Purpose: 8 | //| This module loads the dialog Parameters (dlgparms.c) and dialog templates 9 | //| (dlgtmplt.c) in the their appropriate structures. 10 | //*--------------------------------------------------------------------------------- 11 | 12 | #include 13 | #include 14 | #include "fhheader.h" 15 | 16 | //---------------------------------------------------------------------------------- 17 | // Globals 18 | //---------------------------------------------------------------------------------- 19 | VszFile; 20 | 21 | // Following array tracks dialogs for every function 22 | lpDIALOGDESC Dialogs[NUM_ODBC_APIS]; 23 | 24 | 25 | //*--------------------------------------------------------------------------------- 26 | //| DestroyDialogs: 27 | //| This function will free all allocated memory for all dialogs, as well as 28 | //| any memory allocated for parameter values. 29 | //| Parms: 30 | //| index -1 for all to be freed, otherwise specific index 31 | //| Returns: 32 | //| Nothing 33 | //*--------------------------------------------------------------------------------- 34 | VOID INTFUN DestroyDialogs(UINT index) 35 | { 36 | UINT dex, pdex; 37 | UINT begdex=0; 38 | UINT enddex = GetNumItemsInArray(rgApiList); 39 | LPVOID lpData; 40 | 41 | if(index != -1) 42 | { 43 | begdex = index; 44 | enddex = index + 1; 45 | } 46 | 47 | for(dex=begdex; dexlpCtl); 52 | 53 | // Release each allocated parameter, followed by the arrays 54 | for(pdex=0; pdexcParms; pdex++) 55 | if(lpData = Dialogs[dex]->lpParms[pdex]->lpData) 56 | FREE_PTR(lpData); 57 | FREE_PTR(Dialogs[dex]->lpParms); 58 | 59 | // Now for the dialog node 60 | FREE_PTR(Dialogs[dex]); 61 | } 62 | } 63 | } 64 | 65 | 66 | //*--------------------------------------------------------------------------------- 67 | //| DialogBuilder: 68 | //| This component will create a dialog template in memory based on the 69 | //| description of an ODBC function. 70 | //| Parms: 71 | //| dex Index to the function to call 72 | //| Returns: 73 | //| TRUE if successful, FALSE on error 74 | //*--------------------------------------------------------------------------------- 75 | lpDIALOGDESC DialogBuilder(int dex) 76 | { 77 | lpDIALOGDESC lpDlg; 78 | static BOOL fGetVer; 79 | 80 | // No need to build it if we already have it 81 | if (!(lpDlg = Dialogs[dex])) 82 | { 83 | // Need memory for the dialog descriptor 84 | if (!(lpDlg = Dialogs[dex] = AllocateMemory(sizeof(DIALOGDESC)))) 85 | return NULL; 86 | } 87 | 88 | // Get function name and tell user what we're doing 89 | if(!lpDlg->szFuncName) 90 | lpDlg->szFuncName = GetApiName(dex, lpDlg->szFuncName); 91 | 92 | if ((lpDlg->lpCtl = GetControlInfo(dex, &lpDlg->cCtlItems)) && // Control array 93 | (lpDlg->lpParms = GetParmInfo(dex, &lpDlg->cParms))) // Parameter array 94 | { 95 | SetParamPtrs(lpDlg); 96 | return(lpDlg); 97 | } 98 | 99 | FREE_PTR(lpDlg); 100 | 101 | return NULL; 102 | } 103 | 104 | 105 | 106 | //*--------------------------------------------------------------------------------- 107 | //| SetParamPtrs: 108 | //| This function will set the rgb and pcb ptrs of the parameters. 109 | //| 110 | //| Parms: 111 | //| lpDIALOGDESC 112 | //| 113 | //| 114 | //*--------------------------------------------------------------------------------- 115 | VOID SetParamPtrs(lpDIALOGDESC lpDlg ) 116 | { 117 | 118 | UINT dex, dex2; 119 | UDWORD lDataStyle; 120 | 121 | 122 | 123 | //loop through all the controls and set the rgb and pcb ptrs in the param array. 124 | for ( dex = 0; dex < lpDlg->cCtlItems ; dex++) 125 | { 126 | 127 | if( lpDlg->lpCtl[dex]->wLengthID ) 128 | { 129 | 130 | lDataStyle = lpDlg->lpCtl[dex]->lDataStyle; 131 | dex2 = GetIndexFromControlID(lpDlg, (UINT)lpDlg->lpCtl[dex]->wLengthID); 132 | 133 | if(lDataStyle & CBO_LINKED_FIELD) //it's an rgb value 134 | lpDlg->lpParms[lpDlg->lpCtl[dex]->iParmNum]->lpParmrgb = lpDlg->lpParms[lpDlg->lpCtl[dex2]->iParmNum]; 135 | else 136 | lpDlg->lpParms[lpDlg->lpCtl[dex]->iParmNum]->lpParmpcb = lpDlg->lpParms[lpDlg->lpCtl[dex2]->iParmNum]; 137 | } 138 | if ( lpDlg->lpCtl[dex]->wDataID) 139 | { 140 | 141 | dex2 = GetIndexFromControlID(lpDlg, (UINT)lpDlg->lpCtl[dex]->wDataID); 142 | lpDlg->lpParms[lpDlg->lpCtl[dex]->iParmNum]->lpParmrgb = lpDlg->lpParms[lpDlg->lpCtl[dex2]->iParmNum]; 143 | } 144 | 145 | } 146 | 147 | 148 | } 149 | -------------------------------------------------------------------------------- /src/odbctest/dlgbldr.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: DLGBLDR.H 6 | //| 7 | //| Purpose: 8 | //| Prototypes and defines for Dialog Builder. 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef DLGBLDR_DEFS 11 | #define DLGBLDR_DEFS 12 | 13 | #include 14 | #include "gtrcomm.h" 15 | #include "portable.h" 16 | #include "standard.h" 17 | #include "dlgmngr.h" 18 | 19 | 20 | // Control styles, Note that 0x99 is translated to DLG_BUTTON with style BS_AUTOCHECKBOX 21 | #define DLG_BUTTON 0x0080 22 | #define DLG_EDIT 0x0081 23 | #define DLG_STATIC 0x0082 24 | #define DLG_LISTBOX 0x0083 25 | #define DLG_SCROLLBAR 0x0084 26 | #define DLG_COMBO 0x0085 27 | #define DLG_CKBOX 0x0099 28 | 29 | 30 | //---------------------------------------------------------------------------------- 31 | // Function Prototypes 32 | //---------------------------------------------------------------------------------- 33 | lpDIALOGDESC DialogBuilder(int dex); 34 | VOID INTFUN DestroyDialogs(UINT index); 35 | VOID SetParamPtrs(lpDIALOGDESC lpDlg ); 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/odbctest/dlgparms.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: DLGPARMS.H 6 | //| 7 | //| Purpose: 8 | //| Defines some utility functions used to return information about 9 | //| parameters. 10 | //*--------------------------------------------------------------------------------- 11 | #ifndef DLGPARMS_DEFS 12 | #define DLGPARMS_DEFS 13 | 14 | //---------------------------------------------------------------------------------- 15 | // Function Prototypes 16 | //---------------------------------------------------------------------------------- 17 | int INTFUN GetApiCount(); 18 | lpFUNCHNDLR GetFunctionHandler(UINT dex); 19 | LPTSTR INTFUN GetApiName(UINT dex, LPTSTR str); 20 | lpPARAMITEM * GetParmInfo(UINT dex, UINT * pNumParms); 21 | LPTSTR INTFUN GetApiConstant(UINT dex, LPTSTR str); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/odbctest/dlgtmplt.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: DLGTMPLT.H 6 | //| 7 | //| Purpose: 8 | //| Defines some utility functions used to return information about 9 | //| parameters. 10 | //*--------------------------------------------------------------------------------- 11 | #ifndef DLGTMPLT_DEFS 12 | #define DLGTMPLT_DEFS 13 | 14 | #include 15 | #include "gtrcomm.h" 16 | #include "portable.h" 17 | #include "standard.h" 18 | 19 | #define NUM_CONTROL_BUTTONS 3 20 | 21 | //---------------------------------------------------------------------------------- 22 | // Function Prototypes 23 | //---------------------------------------------------------------------------------- 24 | lpCONTROL * GetControlInfo(int dex, UINT * pNumCtls); 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/odbctest/dlgtools.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: DLGTOOLS.H 6 | //| 7 | //| Purpose: 8 | //| Contains prototypes for functions in DLGTOOLS.H 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef DLGTOOLS_DEFS 11 | #define DLGTOOLS_DEFS 12 | 13 | //---------------------------------------------------------------------------------- 14 | // Function Prototypes 15 | //---------------------------------------------------------------------------------- 16 | BOOL INTFUN ValidateParameters(HWND hDlg, lpDIALOGDESC lpDlg); 17 | BOOL INTFUN ParameterBuilder(HWND hDlg, lpDIALOGDESC lpDlg); 18 | BOOL INTFUN FormatCheckBox(LPTSTR szOutBuff, BOOL fNull); 19 | BOOL INTFUN DoubleToChar(LPTSTR szOut,SDOUBLE psdouble, int iprec); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/odbctest/enabled.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/enabled.bmp -------------------------------------------------------------------------------- /src/odbctest/fhenv.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: FHENV.H 6 | //| 7 | //| Purpose: 8 | //| This header file contains the function prototypes in fhenv.c 9 | //*--------------------------------------------------------------------------------- 10 | 11 | #ifndef FHENV_DEFS 12 | #define FHENV_DEFS 13 | 14 | VOID INTFUN SetCurrentHdbcFromList(lpENVIRONMENTINFO lpei); 15 | BOOL INTFUN DropAllConns(lpENVIRONMENTINFO lpei, BOOL fNeedToFree); 16 | VOID INTFUN DoDropConn(lpENVIRONMENT ei); 17 | lpENVIRONMENTINFO INTFUN FindActiveEnvNode(lpENVIRONMENTINFO lpEnv,lpCONNECTIONINFO lpActiveConnWin); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/odbctest/fhheader.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: Headers.h 6 | //| 7 | //| Purpose: 8 | //| ODBCTest precompiled headers 9 | //| 10 | //*--------------------------------------------------------------------------------- 11 | 12 | 13 | #ifndef WINVER 14 | #define WINVER 0x0400 15 | #endif 16 | 17 | #ifndef RC_INVOKED 18 | #include 19 | #include // message crackers 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include "standard.h" 30 | #include "portable.h" 31 | #include "gtrcomm.h" 32 | #include "dlgmngr.h" 33 | #include "dlgtools.h" 34 | #include "dlgtmplt.h" 35 | #include "dlgparms.h" 36 | #include "connwin.h" 37 | #include "commdlg.h" 38 | #endif 39 | 40 | #include "options.h" 41 | 42 | #ifndef RC_INVOKED 43 | #include "bitarray.h" 44 | #include "dlgbldr.h" 45 | #include "fileio.h" 46 | #endif 47 | 48 | #include "funchndl.h" 49 | #include "gatortst.h" 50 | #include "globals.h" 51 | #include "handles.h" 52 | #include "mem.h" 53 | #include "menus.h" 54 | #include "outwin.h" 55 | #include "rsltwin.h" 56 | #include "statbar.h" 57 | #include "strings.h" 58 | #include "sql.h" 59 | #include "sqlext.h" 60 | #include "sqlucode.h" 61 | #include "odbcss.h" 62 | #include "toolbar.h" 63 | #include "file.h" 64 | #include "paramidx.h" 65 | 66 | -------------------------------------------------------------------------------- /src/odbctest/fhinst.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: FHINST.H 6 | //| 7 | //| Purpose: 8 | //| Contains constants and prototypes for functions in FHINST.C 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef FHINST_DEFS 11 | #define FHINST_DEFS 12 | 13 | 14 | #define DFT_TEXT_LEN 100 15 | 16 | 17 | 18 | 19 | typedef struct tagINSTALLER { 20 | HWND hwndParent; 21 | 22 | TCHAR szArgs[MEDBUFF]; 23 | TCHAR szInfFile[MEDBUFF]; 24 | TCHAR szTranslator[MEDBUFF]; 25 | TCHAR szPathIn[MEDBUFF]; 26 | TCHAR szDriver[MEDBUFF]; 27 | 28 | DWORD dwUsageCount; 29 | 30 | TCHAR szMsg[MEDBUFF]; 31 | TCHAR szPathOut[MEDBUFF]; 32 | 33 | WORD cbPathOutMax; 34 | WORD fRequest; 35 | WORD cbMsgMax; 36 | 37 | WORD cbPathOut; 38 | WORD cbMsgOut; 39 | 40 | RETCODE fRemoveDSN; 41 | 42 | } INSTALLER, *lpINSTALLER; 43 | 44 | 45 | #define STD_INST_PARMS lpINSTALLER lpInst 46 | #define STD_ACTUAL_INST_PARMS lpInst 47 | 48 | //@INSTALLER 49 | RETCODE INTFUN lpSQLRemoveDriver(STD_FH_PARMS); 50 | RETCODE INTFUN lpSQLRemoveDriverManager(STD_FH_PARMS); 51 | RETCODE INTFUN lpSQLInstallTranslator(STD_FH_PARMS); 52 | RETCODE INTFUN lpSQLInstallTranslatorEx(STD_FH_PARMS); 53 | RETCODE INTFUN lpSQLRemoveTranslator(STD_FH_PARMS); 54 | RETCODE INTFUN lpConfigTranslator(STD_FH_PARMS); 55 | RETCODE INTFUN lpConfigDSN(STD_FH_PARMS); 56 | RETCODE INTFUN lpSQLConfigDriver(STD_FH_PARMS); 57 | RETCODE INTFUN lpSQLConfigDataSource(STD_FH_PARMS); 58 | RETCODE INTFUN lpSQLGetInstalledDrivers(STD_FH_PARMS); 59 | RETCODE INTFUN lpSQLGetPrivateProfileString(STD_FH_PARMS); 60 | RETCODE INTFUN lpSQLInstallDriver(STD_FH_PARMS); 61 | RETCODE INTFUN lpSQLInstallDriverManager(STD_FH_PARMS); 62 | RETCODE INTFUN lpSQLManageDataSources(STD_FH_PARMS); 63 | RETCODE INTFUN lpSQLRemoveDefaultDataSource(STD_FH_PARMS); 64 | RETCODE INTFUN lpSQLRemoveDSNFromIni(STD_FH_PARMS); 65 | RETCODE INTFUN lpSQLValidDSN(STD_FH_PARMS); 66 | RETCODE INTFUN lpSQLWriteDSNToIni(STD_FH_PARMS); 67 | RETCODE INTFUN lpSQLWritePrivateProfileString(STD_FH_PARMS); 68 | RETCODE INTFUN lpSQLGetTranslator(STD_FH_PARMS); 69 | BOOL EXTFUN GetInstallerInfoWndProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); 70 | 71 | RETCODE INTFUN lpSQLConfigTranslator(STD_FH_PARMS); 72 | RETCODE INTFUN lpSQLRemoveDSNFromIni(STD_FH_PARMS); 73 | RETCODE INTFUN lpSQLCreateDataSource(STD_FH_PARMS); 74 | RETCODE INTFUN lpSQLInstallerError(STD_FH_PARMS); 75 | RETCODE INTFUN lpSQLInstallDriverEx(STD_FH_PARMS); 76 | RETCODE INTFUN lpSQLPostInstallerError(STD_FH_PARMS); 77 | RETCODE INTFUN lpSQLWriteFileDSN(STD_FH_PARMS); 78 | RETCODE INTFUN lpSQLReadFileDSN(STD_FH_PARMS); 79 | RETCODE INTFUN lpSQLGetConfigMode(STD_FH_PARMS); 80 | RETCODE INTFUN lpSQLSetConfigMode(STD_FH_PARMS); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/odbctest/fhlocatr.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: FHLOCATR.C 6 | //| 7 | //| Purpose: 8 | //| This module contains the function handlers for the Misc menu. 9 | //| Note that each function can be found in the order that it appears 10 | //| on the menu. 11 | //*--------------------------------------------------------------------------------- 12 | #include "fhheader.h" 13 | #pragma warning(disable:4996) 14 | 15 | //---------------------------------------------------------------------------------- 16 | // Globals 17 | //---------------------------------------------------------------------------------- 18 | VszFile; 19 | extern TCHAR szOutBuff[MAXOUTBUFF]; 20 | extern HINSTANCE hInst; // For this app 21 | extern HWND hwndClient; // For MDI children 22 | extern HWND hwndStatBar; // For status bar updates 23 | extern lpUSROPTIONS lpUsrOptions; // Global user options 24 | extern lpDFTARRAY lpdftGetFunct; 25 | extern UINT ciGetFunct; 26 | extern lpDFTARRAY lpdftTrueFalse; 27 | extern UINT ciTrueFalse; 28 | 29 | #ifdef SQL_API_SQLLOCATOR 30 | 31 | 32 | 33 | //*--------------------------------------------------------------------------------- 34 | //| lpSQLLocator: 35 | //| This function is used to hold or free locators 36 | //| Parms: 37 | //| lpDlg The dialog descriptor 38 | //| ci Current connection information (always NULL) 39 | //| lpParms Pointer to the paramter array to use for the request 40 | //| Returns: 41 | //| The return code from the function 42 | //*--------------------------------------------------------------------------------- 43 | 44 | SQLRETURN INTFUN lpSQLLocator(STD_FH_PARMS) 45 | { 46 | 47 | SQLRETURN rc=SQL_SUCCESS; 48 | lpSTATEMENTINFO lpStmt = ci ? ci->lpCurStmt : NULL; 49 | SQLHSTMT hstmt = lpParms[0]->fNull ? NULL : lpStmt->hstmt; 50 | SQLHLOC hLocator = *(SQLHLOC *)lpParms[1]->lpData; 51 | UWORD fOperation =*(UWORD *)lpParms[2]->lpData; 52 | 53 | 54 | // Log input parameters 55 | LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE); 56 | 57 | rc=SQLLocator(hstmt,hLocator,fOperation); 58 | 59 | // Log return code information 60 | LOGRETURNCODE(NULL, ci, rc); 61 | 62 | // Check for errors, wait until stmt's are changed to avoid use of bad HSTMT 63 | AUTOLOGERRORSI(ci,rc); 64 | 65 | return rc; 66 | 67 | } //lpSQLLocator() 68 | 69 | 70 | 71 | 72 | //*--------------------------------------------------------------------------------- 73 | //| lpSQLGetLength: 74 | //| This function retrieves the length of a string value represented by a 75 | //| LOB locator 76 | //| Parms: 77 | //| lpDlg The dialog descriptor 78 | //| ci Current connection information (always NULL) 79 | //| lpParms Pointer to the paramter array to use for the request 80 | //| Returns: 81 | //| The return code from the function 82 | //*--------------------------------------------------------------------------------- 83 | 84 | SQLRETURN INTFUN lpSQLGetLength(STD_FH_PARMS) 85 | { 86 | 87 | SQLRETURN rc=SQL_SUCCESS; 88 | lpSTATEMENTINFO lpStmt = ci ? ci->lpCurStmt : NULL; 89 | SQLHSTMT hstmt = lpParms[0]->fNull ? NULL : lpStmt->hstmt; 90 | SWORD fLocatorType = *(SWORD *)lpParms[1]->lpData; 91 | 92 | 93 | // Log input parameters 94 | LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE); 95 | 96 | rc=SQLGetLength(hstmt, 97 | fLocatorType, 98 | *(SQLHLOC *)lpParms[2]->lpData, 99 | (SDWORD *)lpParms[3]->lpData, 100 | (SDWORD *)lpParms[4]->lpData); 101 | 102 | // Log return code information 103 | LOGRETURNCODE(NULL, ci, rc); 104 | 105 | // Check for errors, wait until stmt's are changed to avoid use of bad HSTMT 106 | AUTOLOGERRORSI(ci,rc); 107 | 108 | return rc; 109 | 110 | } //lpSQLGetLength() 111 | 112 | 113 | //*--------------------------------------------------------------------------------- 114 | //| lpSQLGetPosition: 115 | //| This function gets the starting position of a (search) string value 116 | //| within another (source) string value where the source string value 117 | //| is represented by a LOB locator 118 | //| Parms: 119 | //| lpDlg The dialog descriptor 120 | //| ci Current connection information (always NULL) 121 | //| lpParms Pointer to the paramter array to use for the request 122 | //| Returns: 123 | //| The return code from the function 124 | //*--------------------------------------------------------------------------------- 125 | 126 | SQLRETURN INTFUN lpSQLGetPosition(STD_FH_PARMS) 127 | { 128 | 129 | SQLRETURN rc=SQL_SUCCESS; 130 | lpSTATEMENTINFO lpStmt = ci ? ci->lpCurStmt : NULL; 131 | SQLHSTMT hstmt = lpParms[0]->fNull ? NULL : lpStmt->hstmt; 132 | SWORD fLocatorType = *(SWORD *)lpParms[1]->lpData; 133 | SQLHLOC hSourceLocator= *(SQLHLOC *)lpParms[2]->lpData; 134 | SQLHLOC hTargetLocator= *(SQLHLOC *)lpParms[3]->lpData; 135 | LPSTR szSearchString= (LPSTR)lpParms[4]->lpData; 136 | SDWORD cbSearchString =*(SDWORD *)lpParms[5]->lpData; 137 | SDWORD iFromPosition = *(SDWORD *)lpParms[6]->lpData; 138 | SDWORD *pibLocatedAt = (SDWORD *)lpParms[7]->lpData; 139 | SDWORD *pfIndicator = (SDWORD *)lpParms[8]->lpData; 140 | 141 | 142 | // Log input parameters 143 | LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE); 144 | 145 | rc=SQLGetPosition(hstmt, 146 | fLocatorType, 147 | hSourceLocator, 148 | hTargetLocator, 149 | szSearchString, 150 | cbSearchString, 151 | iFromPosition, 152 | pibLocatedAt, 153 | pfIndicator); 154 | 155 | 156 | // Log return code information 157 | LOGRETURNCODE(NULL, ci, rc); 158 | 159 | // Check for errors, wait until stmt's are changed to avoid use of bad HSTMT 160 | AUTOLOGERRORSI(ci,rc); 161 | 162 | return rc; 163 | 164 | } //lpSQLGetPosition() 165 | 166 | 167 | //*--------------------------------------------------------------------------------- 168 | //| lpSQLGetSubString: 169 | //| This function gets an individual descriptor field 170 | //| Parms: 171 | //| lpDlg The dialog descriptor 172 | //| ci Current connection information (always NULL) 173 | //| lpParms Pointer to the paramter array to use for the request 174 | //| Returns: 175 | //| The return code from the function 176 | //*--------------------------------------------------------------------------------- 177 | 178 | SQLRETURN INTFUN lpSQLGetSubString(STD_FH_PARMS) 179 | { 180 | 181 | SQLRETURN rc=SQL_SUCCESS; 182 | lpSTATEMENTINFO lpStmt = ci ? ci->lpCurStmt : NULL; 183 | SQLHSTMT hstmt = lpParms[0]->fNull ? NULL : lpStmt->hstmt; 184 | SWORD fLocatorType = *(SWORD *)lpParms[1]->lpData; 185 | SQLHLOC hSourceLocator=*(SQLHLOC *)lpParms[2]->lpData; 186 | SDWORD iFromPosition =*(SDWORD *)lpParms[3]->lpData; 187 | SDWORD cbForLength = *(SDWORD *)lpParms[4]->lpData; 188 | SWORD fTargetType = *(SWORD *)lpParms[5]->lpData; 189 | SQLPOINTER rgbValue = (SQLPOINTER *)lpParms[6]->lpData; 190 | SDWORD cbValueMax = *(SDWORD *)lpParms[7]->lpData; 191 | SDWORD *pcbValue = (SDWORD *)lpParms[8]->lpData; 192 | SDWORD *pfIndicator = (SDWORD *)lpParms[9]->lpData; 193 | 194 | 195 | // Log input parameters 196 | LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE); 197 | 198 | rc=SQLGetSubString(hstmt, 199 | fLocatorType, 200 | hSourceLocator, 201 | iFromPosition, 202 | cbForLength, 203 | fTargetType, 204 | rgbValue, 205 | cbValueMax, 206 | pcbValue, 207 | pfIndicator); 208 | 209 | 210 | // Log return code information 211 | LOGRETURNCODE(NULL, ci, rc); 212 | 213 | // Check for errors, wait until stmt's are changed to avoid use of bad HSTMT 214 | AUTOLOGERRORSI(ci,rc); 215 | 216 | return rc; 217 | 218 | } //lpSQLGetSubString() 219 | 220 | 221 | //*--------------------------------------------------------------------------------- 222 | //| lpSQLLocatedUpdate: 223 | //| This function gets an individual descriptor field 224 | //| Parms: 225 | //| lpDlg The dialog descriptor 226 | //| ci Current connection information (always NULL) 227 | //| lpParms Pointer to the paramter array to use for the request 228 | //| Returns: 229 | //| The return code from the function 230 | //*--------------------------------------------------------------------------------- 231 | 232 | SQLRETURN INTFUN lpSQLLocatedUpdate(STD_FH_PARMS) 233 | { 234 | 235 | SQLRETURN rc=SQL_SUCCESS; 236 | lpSTATEMENTINFO lpStmt = ci ? ci->lpCurStmt : NULL; 237 | SQLHSTMT hstmt = lpParms[0]->fNull ? NULL : lpStmt->hstmt; 238 | SQLSMALLINT fTargetType = *(SQLSMALLINT *)lpParms[1]->lpData; 239 | SQLHLOC hTargetLocator=*(SQLHLOC *)lpParms[2]->lpData; 240 | SQLINTEGER iFromPosition =*(SQLINTEGER *)lpParms[3]->lpData; 241 | SQLINTEGER cbForLength = *(SQLINTEGER *)lpParms[4]->lpData; 242 | SQLSMALLINT fSourceType = *(SQLSMALLINT *)lpParms[5]->lpData; 243 | SQLPOINTER rgbValue = (SQLPOINTER *)lpParms[6]->lpData; 244 | SQLINTEGER cbValue = *(SQLINTEGER *)lpParms[7]->lpData; 245 | SQLINTEGER fIndicator = *(SQLINTEGER *)lpParms[8]->lpData; 246 | 247 | 248 | // Log input parameters 249 | LOGPARAMETERS(szFuncName, lpParms, cParms, ci, TRUE); 250 | 251 | rc=SQLLocatedUpdate(hstmt, 252 | fTargetType, 253 | hTargetLocator, 254 | iFromPosition, 255 | cbForLength, 256 | fSourceType, 257 | rgbValue, 258 | cbValue, 259 | fIndicator); 260 | 261 | // Log return code information 262 | LOGRETURNCODE(NULL, ci, rc); 263 | 264 | // Check for errors, wait until stmt's are changed to avoid use of bad HSTMT 265 | AUTOLOGERRORSI(ci,rc); 266 | 267 | return rc; 268 | 269 | } //lpSQLLocatedUpdate() 270 | 271 | 272 | 273 | #endif 274 | -------------------------------------------------------------------------------- /src/odbctest/file.h: -------------------------------------------------------------------------------- 1 | //| ODBC Test Tool 2 | //| Copyright (c) Microsoft, All rights reserved 3 | //| 4 | //| Title: ENTRYPT.H 5 | //| 6 | //| Purpose: 7 | //| Contains prototypes for functions in FILE.CPP 8 | //*--------------------------------------------------------------------------------- 9 | #ifndef ENTRYPT_DEFS 10 | #define ENTRYPT_DEFS 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Function Prototypes 14 | //---------------------------------------------------------------------------------- 15 | void IHSetValue(int iValue); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /src/odbctest/fileio.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: FILEIO.C 6 | //| 7 | //| Purpose: 8 | //| This module contains the file I/O functions. 9 | //*--------------------------------------------------------------------------------- 10 | #include "fhheader.h" 11 | #include 12 | #include "fileio.h" 13 | 14 | 15 | BOOL EXTFUN IsWindowsWOW(void); 16 | BOOL EXTFUN IsWin32s(void); 17 | BOOL EXTFUN IsWindowsMIPS(void); 18 | BOOL EXTFUN IsWindowsDEC(void); 19 | BOOL EXTFUN IsWindowsIntel(void); 20 | LPTSTR EXTFUN DLLGetEnv (LPTSTR lpszVariableName); 21 | BOOL EXTFUN IsChicago(void); 22 | VOID INTFUN SetupFileInfo(HWND hwnd, HINSTANCE hInst, LPTSTR szTitle, 23 | LPTSTR szFilter, LPTSTR szDftExt, LPTSTR szFile, UINT uAttrib, BOOL FAR * lpfAppend, 24 | OPENFILENAME *lpofn); 25 | 26 | 27 | OPENFILENAME ofnGlobal; 28 | 29 | //*--------------------------------------------------------------------------------- 30 | //| FileExist: 31 | //| This function will return TRUE if file exist, otherwise FALSE 32 | //| FALSE 33 | //| Parms: 34 | //| szFile File to search for 35 | //| Returns: 36 | //| HANDLE handle to file 37 | //*--------------------------------------------------------------------------------- 38 | 39 | BOOL INTFUN FileExist(LPCTSTR szFile) 40 | { 41 | HANDLE hf; 42 | 43 | hf = GtrCreateFile(szFile, 44 | GENERIC_READ, 45 | FILE_SHARE_READ, 46 | NULL, 47 | OPEN_EXISTING, // if not exist flag error 48 | FILE_ATTRIBUTE_NORMAL, // file attributes 49 | NULL); // handle of file with attributes to copy 50 | 51 | if (hf != INVALID_HANDLE_VALUE) { 52 | CloseHandle(hf); 53 | } 54 | 55 | return hf != INVALID_HANDLE_VALUE; 56 | 57 | } //FileExist() 58 | 59 | 60 | //*--------------------------------------------------------------------------------- 61 | //| GetFilePath: 62 | //| This function will return the file's full path + file name 63 | //| FALSE 64 | //| Parms: 65 | //| szFile File to search for 66 | //| szFileSpec Full Path to file + file name 67 | //| Returns: 68 | //| HANDLE handle to file 69 | //*--------------------------------------------------------------------------------- 70 | 71 | LPTSTR INTFUN GetFilePath(LPCTSTR szFile) 72 | { 73 | LPTSTR szFileSpec=NULL; 74 | SECURITY_ATTRIBUTES sa; 75 | HANDLE hTemplateFile=NULL, 76 | hf; 77 | 78 | hf=GtrCreateFile(szFile, 79 | GENERIC_WRITE, 80 | FILE_SHARE_WRITE, 81 | &sa, 82 | OPEN_EXISTING, // if not exist flag error 83 | FILE_ATTRIBUTE_NORMAL, // file attributes 84 | hTemplateFile); // handle of file with attributes to copy 85 | 86 | if (hf !=INVALID_HANDLE_VALUE) 87 | return(szFileSpec); 88 | else 89 | return(NULL); 90 | 91 | } //GetFilePath() 92 | 93 | 94 | //*--------------------------------------------------------------------------------- 95 | //| GtrOpenFile: 96 | //| This function will open the specified file 97 | //| Parms: 98 | //| szFile File to search for 99 | //| szFileSpec Full Path to file + file name 100 | //| dwMode Mode to open file in 101 | //| fRead Read from file or Write to file 102 | //| ids ids of message to display upon error 103 | //| Returns: 104 | //| HANDLE handle to file 105 | //*--------------------------------------------------------------------------------- 106 | 107 | HANDLE INTFUN GtrOpenFile(HWND hwndIn,LPTSTR szFile,DWORD dwMode, 108 | BOOL fRead,UINT ids) 109 | { 110 | TCHAR szOutBuff[MAXOUTBUFF]; 111 | LPTSTR szFileSpec=NULL; 112 | HANDLE hf=NULL; 113 | DWORD dwDesiredAccess; 114 | DWORD dwShareMode; 115 | 116 | if (fRead) 117 | { 118 | dwDesiredAccess=GENERIC_READ; 119 | dwShareMode=FILE_SHARE_READ; 120 | } 121 | else 122 | { 123 | dwDesiredAccess=GENERIC_WRITE; 124 | dwShareMode=FILE_SHARE_WRITE; 125 | } 126 | 127 | hf=GtrCreateFile(szFile, 128 | dwDesiredAccess, 129 | dwShareMode, 130 | NULL, 131 | dwMode, // if not exist flag error 132 | FILE_ATTRIBUTE_NORMAL, // file attributes 133 | 0); // handle of file with attributes to copy 134 | 135 | if (ids && (hf == INVALID_HANDLE_VALUE)) 136 | { 137 | szMessageBox(hwndIn, 138 | MB_ICONEXCLAMATION | MB_OK, 139 | NULL, 140 | GetGtrString(szOutBuff, MAXOUTBUFF, ids), 141 | (LPTSTR)szFile); 142 | } 143 | 144 | return(hf); 145 | 146 | } //GetFilePath() 147 | 148 | 149 | 150 | //*--------------------------------------------------------------------------------- 151 | //| GtrWriteFile: 152 | //| This function will return the file's full path + file name 153 | //| FALSE 154 | //| Parms: 155 | //| szFile File to search for 156 | //| szFileSpec Full Path to file + file name 157 | //| Returns: 158 | //| HANDLE handle to file 159 | //*--------------------------------------------------------------------------------- 160 | 161 | UINT INTFUN GtrWriteFile(HWND hwndIn,HANDLE hFile,LPTSTR szFile,UWORD uLen) 162 | { 163 | TCHAR szOutBuff[MAXOUTBUFF]; 164 | DWORD uCb=0; 165 | CHAR* szBuf =AllocateMemory(uLen); 166 | 167 | 168 | #ifdef _UNICODE 169 | WideCharToMultiByte(CP_ACP,0,szFile,uLen,szBuf,uLen,NULL,NULL); 170 | #else 171 | lstrcpy(szBuf,szFile); 172 | #endif 173 | 174 | CharToOemA(szBuf,szBuf); 175 | WriteFile(hFile, szBuf, uLen, &uCb, NULL); 176 | 177 | if(uCb < (UINT)uLen || uCb == HFILE_ERROR) 178 | szMessageBox(hwndIn, 179 | MB_ICONEXCLAMATION | MB_OK, 180 | NULL, 181 | GetGtrString(szOutBuff, MAXOUTBUFF, idsErrSaveFileNoBytes), 182 | szFile); 183 | 184 | free(szBuf); 185 | 186 | return(uCb); 187 | 188 | } //GtrWriteFile() 189 | 190 | 191 | 192 | //*--------------------------------------------------------------------------------- 193 | //| GtrCloseFile: 194 | //| This function will closes the specified file 195 | //| FALSE 196 | //| Parms: 197 | //| hFile handle of file to close 198 | //| Returns: 199 | //| HANDLE handle to file 200 | //*--------------------------------------------------------------------------------- 201 | 202 | HFILE INTFUN GtrCloseFile(HANDLE hFile) 203 | { 204 | CloseHandle(hFile); 205 | return 0; 206 | 207 | } //GtrCloseFile() 208 | 209 | 210 | //*--------------------------------------------------------------------------------- 211 | //| GtrSeekFile: 212 | //| This function will perform a seek on the specified file 213 | //| FALSE 214 | //| Parms: 215 | //| hFile handle of file to seek 216 | //| lOffset Specifies the number of bytes the file pointer is to be moved. 217 | //| iOrigin Specifies the starting position and direction of the file 218 | //| pointer. This parameter must be one of the following values: 219 | //| Returns: 220 | //| the new offset of the pointer, in bytes, from the beginning of the file. 221 | //*--------------------------------------------------------------------------------- 222 | 223 | LONG INTFUN GtrSeekFile(HANDLE hFile, LONG lOffset, int iOrigin) 224 | { 225 | // return(_llseek((HFILE)hFile, 0L, 2)); 226 | return SetFilePointer(hFile, 0, 0, FILE_END); 227 | 228 | } //GtrSeekFile() 229 | 230 | 231 | //*--------------------------------------------------------------------------------- 232 | //| GetRecordFile: 233 | //| Invoke common dialog function to open a file which must exist. 234 | //| Parms: 235 | //| hwnd Window handle for displays 236 | //| hInst Instance handle of this DLL (CTL3D requirement) 237 | //| szTitle Title for dialog 238 | //| szFilter A filter for file names 239 | //| Ex: "Log Files|*.LOG|SQL Files|*.SQL|" 240 | //| szDftExt The default extension, eg: "log" 241 | //| szFile Output for file name if successful 242 | //| uAttrib Add'l style beyond default 243 | //| Returns: 244 | //| TRUE if a new file was found, false otherwise 245 | //*--------------------------------------------------------------------------------- 246 | BOOL EXTFUN GetRecordFile(HWND hwnd, HINSTANCE hInst, LPTSTR szTitle, 247 | LPTSTR szFilter, LPTSTR szDftExt, LPTSTR szFile, UINT uAttrib, BOOL FAR * lpfAppend) 248 | { 249 | OPENFILENAME ofn; 250 | DWORD dwMode=CREATE_ALWAYS; 251 | FILE *fhRecFile=NULL; 252 | DWORD dwWritten=0; 253 | TCHAR szTmpFile[_MAX_PATH]=TEXT(""); 254 | 255 | 256 | //SetupFileInfo(hwnd,hInst,szTitle,szFilter,szDftExt,szFile,uAttrib,lpfAppend,&ofn); 257 | 258 | lstrcpy((LPTSTR)szTmpFile, szFile); 259 | 260 | _fmemset(&ofn, 0, sizeof(ofn)); 261 | ofn.lStructSize = sizeof(ofn); 262 | ofn.hwndOwner = hwnd; 263 | ofn.hInstance = hInst; 264 | ofn.lpstrTitle = szTitle; 265 | ofn.lpstrFilter = szFilter; 266 | ofn.lpstrFile = szTmpFile; 267 | ofn.nMaxFile = _MAX_PATH; 268 | ofn.lpstrDefExt = szDftExt; 269 | ofn.lpstrInitialDir = NULL; 270 | ofn.Flags = OFN_HIDEREADONLY | 271 | OFN_PATHMUSTEXIST | 272 | OFN_OVERWRITEPROMPT | 273 | OFN_NOCHANGEDIR; 274 | 275 | if (GetSaveFileName(&ofn)) 276 | { 277 | HFILE hFile=0; 278 | 279 | lstrcpy(szFile, ofn.lpstrFile); 280 | *lpfAppend=(BOOL)ofnGlobal.lCustData; 281 | 282 | fhRecFile = _tfsopen(szFile,TEXT("a"),_SH_DENYNO); 283 | 284 | if (fhRecFile) 285 | fclose(fhRecFile); 286 | 287 | return TRUE; 288 | } 289 | 290 | 291 | return FALSE; // Canceled or whatever 292 | } 293 | 294 | 295 | //*--------------------------------------------------------------------------------- 296 | //| WriteRecordFile: 297 | //| This function will return the file's full path + file name 298 | //| FALSE 299 | //| Parms: 300 | //| szFile File to search for 301 | //| szFileSpec Full Path to file + file name 302 | //| Returns: 303 | //| HANDLE handle to file 304 | //*--------------------------------------------------------------------------------- 305 | 306 | int INTFUN WriteRecordFile(HWND hwndIn,FILE *fhRecordFile,LPTSTR szBuffer,UWORD cbBuff) 307 | { 308 | TCHAR szOutBuff[MAXOUTBUFF]; 309 | int numwritten=0; 310 | 311 | numwritten=(unsigned int)fwrite(szBuffer, lstrlen(szBuffer),1,fhRecordFile); 312 | 313 | if(numwritten < cbBuff) 314 | szMessageBox(hwndIn, 315 | MB_ICONEXCLAMATION | MB_OK, 316 | NULL, 317 | GetGtrString(szOutBuff, MAXOUTBUFF, idsErrSaveFileNoBytes), 318 | szBuffer); 319 | 320 | return(numwritten); 321 | 322 | } //WriteRecordFile() 323 | 324 | 325 | 326 | //*--------------------------------------------------------------------------------- 327 | //| CloseRecordFile: 328 | //| This function will closes the specified file 329 | //| FALSE 330 | //| Parms: 331 | //| fhRecordFile handle of file to close 332 | //| Returns: 333 | //| HANDLE handle to file 334 | //*--------------------------------------------------------------------------------- 335 | 336 | int INTFUN CloseRecordFile(FILE *fhRecordFile) 337 | { 338 | return(fclose(fhRecordFile)); 339 | 340 | } //CloseRecordFile() 341 | -------------------------------------------------------------------------------- /src/odbctest/fileio.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: FILEIO.H 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| This file prototypes the File I/O functions. 6 | //*--------------------------------------------------------------------------------- 7 | #ifndef FILEIO_DEFS 8 | #define FILEIO_DEFS 9 | 10 | //Used by WriteLogInfo() 11 | #define LOG_CONTINUE 1 //No error continue to log 12 | #define LOG_ERROR_CONTINUE 0 //Error but user wants to continue to log 13 | #define LOG_STOP -1 //Stop logging 14 | 15 | #define WRITETOFILE 0 16 | #define READFROMFILE 1 17 | 18 | 19 | BOOL INTFUN FileExist(LPCTSTR szFile); 20 | LPTSTR INTFUN GetFilePath(LPCTSTR szFile); 21 | HANDLE INTFUN GtrOpenFile(HWND hwndIn,LPTSTR szFile,DWORD dwMode, 22 | BOOL fRead,UINT ids); 23 | UINT INTFUN GtrWriteFile(HWND hwndIn,HANDLE hFile,LPTSTR lpstr,UWORD uLen); 24 | LONG INTFUN GtrSeekFile(HANDLE hFile, LONG lOffset, int iOrigin); 25 | HFILE INTFUN GtrCloseFile(HANDLE hFile); 26 | BOOL EXTFUN GetRecordFile(HWND hwnd, HINSTANCE hInst, LPTSTR szTitle, 27 | LPTSTR szFilter, LPTSTR szDftExt, LPTSTR szFile, UINT uAttrib, BOOL FAR * lpfAppend); 28 | int INTFUN WriteRecordFile(HWND hwndIn,FILE *fhRecordFile,LPTSTR szBuffer,UWORD cbBuff); 29 | int INTFUN CloseRecordFile(FILE *fhRecordFile); 30 | 31 | _inline VOID INTFUN WriteNewLine(FILE *fhFile) 32 | { 33 | LPSTR lpCRLF=");\r\n"; 34 | fwrite(lpCRLF, strlen(lpCRLF),1,fhFile); 35 | 36 | } //WriteNewLine() 37 | 38 | 39 | #endif 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/odbctest/gator.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/gator.ico -------------------------------------------------------------------------------- /src/odbctest/gator.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/gator.rc -------------------------------------------------------------------------------- /src/odbctest/gator32.def: -------------------------------------------------------------------------------- 1 | HEAPSIZE 2048 2 | 3 | EXPORTS 4 | ClearOutWndProc 5 | ConnectWndProc 6 | DialogWndProc 7 | SetDftWndProc 8 | AboutWndProc 9 | WndProc 10 | WinMain 11 | StatusWndProc 12 | ToolWndProc 13 | -------------------------------------------------------------------------------- /src/odbctest/gator32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/gator32.ico -------------------------------------------------------------------------------- /src/odbctest/gatortst.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: GATORTST.H 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| This file prototypes some of the functions we're going to borrow 6 | //| from GATORTST.DLL. This file is used when building the retail 7 | //| version of Gator. 8 | //*--------------------------------------------------------------------------------- 9 | #ifndef GATORTST_DEFS 10 | #define GATORTST_DEFS 11 | 12 | #include 13 | #include 14 | #include 15 | #include "portable.h" 16 | #include "standard.h" 17 | #include "tchar.h" 18 | #include "wchar.h" 19 | 20 | 21 | 22 | //---------------------------------------------------------------------------------- 23 | // Defines and Macros 24 | //---------------------------------------------------------------------------------- 25 | #define VszFile static TCHAR vszFile[]=TEXT(__FILE__) 26 | #define USER_FUNCTION_HELP (WM_USER + 400) 27 | 28 | #ifndef WIN32 29 | #define LPTSTR LPSTR 30 | #endif 31 | 32 | // Debug constants 33 | #ifdef _MEM_CHECK 34 | void * EXTFUNCDECL DebugGetMemory(DWORD size, LPTSTR szFile, int cbLine); 35 | void EXTFUN DebugReleaseMemory(LPVOID ptr, LPTSTR szFile, int cbLine); 36 | #define AllocateMemory(size) DebugGetMemory(size, (LPTSTR)vszFile, __LINE__) 37 | #define ReleaseMemory(ptr) DebugReleaseMemory(ptr, (LPTSTR)vszFile, __LINE__) 38 | #else 39 | void * EXTFUNCDECL DoGtrGetMemory(SIZE_T size); 40 | #define AllocateMemory(size) DoGtrGetMemory(size) 41 | #define ReleaseMemory(ptr) if (ptr) GlobalFreePtr(ptr) 42 | #endif 43 | 44 | // Further redefine based on debug 45 | #ifdef _DEBUG 46 | #undef ReleaseMemory 47 | void INTFUN DbgReleaseMemory(LPVOID ptr, LPTSTR szFile, UINT iLine); 48 | #define ReleaseMemory(ptr) DbgReleaseMemory(ptr, (LPTSTR)vszFile, __LINE__) 49 | #endif 50 | 51 | 52 | //---------------------------------------------------------------------------------- 53 | // Globals 54 | //---------------------------------------------------------------------------------- 55 | 56 | 57 | //---------------------------------------------------------------------------------- 58 | // Functions 59 | //---------------------------------------------------------------------------------- 60 | void EXTFUN ManageSources(HWND hwnd, HINSTANCE hInst); 61 | void EXTFUN ManageTests(HWND hwnd, HINSTANCE hInst); 62 | void EXTFUN ManageGroups(HWND hwnd, HINSTANCE hInst); 63 | void EXTFUN RunAutoTest(HWND hwnd, HINSTANCE hInst, void *, void *, void *,void *,HANDLE); 64 | void EXTFUN SetGatorIniPath(LPTSTR); 65 | 66 | 67 | int EXTFUNCDECL CDECL szMessageBox(HWND hwnd, UINT style, LPTSTR szTitle, LPTSTR szFmt, ...); 68 | BOOL EXTFUN FAbortCheck(); 69 | TIMEINFO * EXTFUNCDECL CElapsed(lpTIMEINFO start, lpTIMEINFO end, lpTIMEINFO elapsed); 70 | void EXTFUN CenterDialog(HWND hdlg); 71 | LPTSTR INTFUN FindFileDir(LPTSTR szFile, LPTSTR szPath); 72 | BOOL EXTFUN GetLogFile(HWND hwnd, HINSTANCE hInst, LPTSTR szTitle, 73 | LPTSTR szFilter, LPTSTR szDftExt, LPTSTR szFile, UINT uAttrib, BOOL * lpfAppend); 74 | BOOL EXTFUN BrowseDirs(HWND hdlg, HINSTANCE hInst, LPTSTR lpszDrive); 75 | UINT EnumerateListBox(HWND hwndParent, HWND hwndList, unsigned msg); 76 | LPTSTR BuildSelList(HWND hwndList); 77 | BOOL IsValidTestName(LPTSTR szName); 78 | UINT INTFUN CountNullArray(LPTSTR instr); 79 | VOID EXTFUN DrawBitmap(HDC hdc, HBITMAP hBitmap, int xStart, int yStart); 80 | 81 | 82 | 83 | // Memory functions 84 | void * EXTFUNCDECL DoGetMemory(DWORD size); 85 | void EXTFUN DoReleaseMemory(LPVOID ptr); 86 | 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /src/odbctest/globals.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: COMMON.C 6 | //| 7 | //| Purpose: 8 | //| Header file for utility functions. 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef GLOBALS_DEFS 11 | #define GLOBALS_DEFS 12 | 13 | #define tsizeof(szBuff) sizeof(szBuff)/sizeof(TCHAR) 14 | 15 | typedef struct tagODBCAPI 16 | { 17 | int iAPINum; // the API number in SQLGetFunctions (i.e. SQL_API_????) 18 | int iOrdinalNum; // the ordinal number 19 | LPTSTR szAPIName; // SQL_API_??? as a string 20 | LPTSTR szName; // the function name 21 | BOOL fODBC30; // Is this a ODBC 3.0 function 22 | int iDD; // ID of it's associated dialog box 23 | } ODBCAPI_LIST; 24 | 25 | 26 | extern const ODBCAPI_LIST rgApiList[NUM_ODBC_APIS]; 27 | LPTSTR INTFUN GetApiConstant(UINT dex, LPTSTR str); 28 | 29 | 30 | int GtrMessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType); 31 | BOOL GatorSetWindowText(HWND hWnd,LPCTSTR lpString); 32 | DWORD GtrSearchPath(LPCTSTR lpPath,LPCTSTR lpFileName,LPCTSTR lpExtensions, DWORD nBufferLength, 33 | LPTSTR lpBuffer,LPTSTR *lpFilePart); 34 | HINSTANCE GtrLoadLibrary( LPCTSTR lpLibFileName); 35 | HANDLE GtrCreateFile(LPCTSTR lpFileName,DWORD dwDesiredAccess,DWORD dwSharedMode,LPSECURITY_ATTRIBUTES 36 | lpSecurityAttributes,DWORD dwCreationDistribution,DWORD FlagsAndAttributes, 37 | HANDLE hTemplateFile); 38 | DWORD GtrFormatMessage(DWORD dwFlags,LPCVOID lpSource, DWORD dwMessageid, DWORD dwLanguageid, 39 | LPTSTR lpBuffer,DWORD nSize,va_list * Arguments); 40 | int GtrLoadString(HINSTANCE hInstance,UINT uID, LPTSTR lpBuffer, int nBufferMax); 41 | BOOL GtrWritePrivateProfileString(LPCTSTR lpAppName,LPCTSTR lpKeyName, LPCTSTR lpString, 42 | LPCTSTR lpFileName); 43 | DWORD GtrGetPrivateProfileString(LPCTSTR lpAppName,LPCTSTR lpKeyName, LPCTSTR lpDefault, 44 | LPTSTR lpReturnedString, DWORD nSize,LPCTSTR lpFileName); 45 | UINT GtrGetPrivateProfileInt(LPCTSTR lpAppName,LPCTSTR lpKeyName, INT nDefault,LPCTSTR lpFileName); 46 | int _openA(const wchar_t *filename,int oflag,int pmode); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/odbctest/mem.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: MEM.C 6 | //| 7 | //| Purpose: 8 | //| This module will abstract some of the memory management functions 9 | //| required. This is necessary since there are several pitfalls with 10 | //| Windows memory management. For example: 11 | //| 12 | //| o Under NT, a GlobalReAllocPtr can move the physical pointer 13 | //| location which means you could not expand a bound column without 14 | //| doing a rebind 15 | //| o A 16-bit app is limited to 8192 selectors which could get eaten 16 | //| up quite quickly when doing bound columns and results sets. 17 | //*--------------------------------------------------------------------------------- 18 | #include "fhheader.h" 19 | 20 | 21 | //---------------------------------------------------------------------------------- 22 | // Globals 23 | //---------------------------------------------------------------------------------- 24 | VszFile; 25 | extern HINSTANCE hInst; 26 | extern lpUSROPTIONS lpUsrOptions; 27 | extern TCHAR szOutBuff[MAXOUTBUFF]; 28 | DWORD cbPageSize=DFTPAGESIZE; 29 | 30 | extern LPCTSTR szErrTitle; 31 | 32 | 33 | 34 | #ifdef WIN32 35 | //*--------------------------------------------------------------------------------- 36 | //| AdjMemInit: 37 | //| Call this function once when the app starts. It will find out the default 38 | //| page size for the machine and store that value. 39 | //| Parms: 40 | //| 41 | //| lpDlg The dialog descriptor 42 | //| ci Current connection informaiton (always NULL) 43 | //| lpParms Pointer to the paramter array to use for the request 44 | //| Returns: 45 | //| The return code from the function 46 | //*--------------------------------------------------------------------------------- 47 | VOID AdjMemInit(void) 48 | { 49 | SYSTEM_INFO si; 50 | 51 | GetSystemInfo(&si); 52 | cbPageSize = si.dwPageSize; 53 | } 54 | #endif 55 | 56 | 57 | //*--------------------------------------------------------------------------------- 58 | //| AllocateAdjMem: 59 | //| Allocates adjustable memory. This will map to either a VirtualAlloc 60 | //| for NT or a GlobalAlloc for 16-bit. 61 | //| Parms: 62 | //| 63 | //| lpDlg The dialog descriptor 64 | //| ci Current connection informaiton (always NULL) 65 | //| lpParms Pointer to the paramter array to use for the request 66 | //| Returns: 67 | //| The return code from the function 68 | //*--------------------------------------------------------------------------------- 69 | LPVOID AllocateAdjMem(DWORD cbBytes) 70 | { 71 | LPVOID ptr; 72 | 73 | #ifndef WIN32 74 | 75 | ASSERTCHECK((!cbBytes), TEXT("Cannot allocate 0 bytes")); 76 | 77 | // Allocate memory. Return value is selector:offset which abstracts physical 78 | // location so we won't have problems with the value changing on realloc 79 | ptr = GlobalAllocPtr(GHND, cbBytes); 80 | if(!ptr) 81 | return NULL; 82 | else 83 | return ptr; 84 | 85 | #else 86 | 87 | // Reserver enough virtual memory so that we can grow the memory if required. 88 | // This memory is not yet in physical memory, but precludes other functions 89 | // from using our range. If we require more physical memory, we can commit 90 | // pages from our range and the pointer won't change. 91 | ptr = VirtualAlloc(NULL, // Windows figures out good location 92 | MAXVIRTMEM, // Ask for a range of pages 93 | MEM_RESERVE, // Don't commit yet, just reserve address space 94 | PAGE_READWRITE); // Need both access types 95 | if(!ptr) 96 | return NULL; 97 | 98 | // Must commit enough pages to give user cbBytes of memory 99 | if(ReAllocAdjMem(ptr, 0, cbBytes)) 100 | return ptr; 101 | else { 102 | VirtualFree(ptr, 0, MEM_RELEASE); 103 | return NULL; 104 | } 105 | 106 | #endif 107 | } 108 | 109 | 110 | //*--------------------------------------------------------------------------------- 111 | //| ReAllocAdjMem: 112 | //| This function will commit/decommit pages from a virtual range. We still 113 | //| reserve our virtual range, we're just freeing/allocating physical memory. 114 | //| Parms: 115 | //| inptr The base pointer to grow/shrink 116 | //| cbFrom What current size? 117 | //| cbTo What is desired size? 118 | //| Returns: 119 | //| TRUE if we're successful 120 | //*--------------------------------------------------------------------------------- 121 | #ifndef WIN32 122 | BOOL INTFUN ReAllocAdjMem(LPVOID inptr, DWORD cbFrom, DWORD cbTo) 123 | { 124 | ASSERTCHECK((!inptr), TEXT("Attempt to realloc NULL pointer")); 125 | return (GlobalReAllocPtr(inptr, cbTo, GHND /*GMEM_ZEROINIT*/) != NULL); 126 | } 127 | #else 128 | BOOL INTFUN ReAllocAdjMem(LPVOID inptr, DWORD cbFrom, DWORD cbTo) 129 | { 130 | LPVOID ptr; 131 | UINT_PTR dwPtr=(UINT_PTR)inptr; 132 | int iCurrentPages, iReqPages; 133 | DWORD cbBytes; 134 | 135 | ASSERTCHECK((!inptr), TEXT("Attempt to realloc NULL pointer")); 136 | ASSERTCHECK((!cbTo), TEXT("Cannot adjust to 0 bytes")); 137 | 138 | // cbFrom is not necessarily on a page boundary. Determine how many 139 | // pages we have based on the users byte count 140 | iCurrentPages = (cbFrom / cbPageSize) + 141 | ((cbFrom % cbPageSize) ? 1 : 0); 142 | iReqPages = (cbTo / cbPageSize) + 143 | ((cbTo % cbPageSize) ? 1 : 0); 144 | 145 | // Need more memory so commit more pages for read/write 146 | if(iCurrentPages < iReqPages) { 147 | dwPtr = (UINT_PTR)inptr + (iCurrentPages * cbPageSize); 148 | ptr = (LPVOID)dwPtr; 149 | cbBytes = (iReqPages - iCurrentPages) * cbPageSize; 150 | if(!VirtualAlloc(ptr, 151 | cbBytes, 152 | MEM_COMMIT, 153 | PAGE_READWRITE)) 154 | return FALSE; 155 | } 156 | // Have more memory than required so uncommit it 157 | else if(iCurrentPages > iReqPages) { 158 | dwPtr = (UINT_PTR)inptr + (iReqPages * cbPageSize); 159 | ptr = (LPVOID)dwPtr; 160 | cbBytes = (iCurrentPages - iReqPages) * cbPageSize; 161 | if(!VirtualFree(ptr, 162 | cbBytes, 163 | MEM_DECOMMIT)) 164 | return FALSE; 165 | } 166 | 167 | return TRUE; 168 | } 169 | #endif 170 | 171 | 172 | //*--------------------------------------------------------------------------------- 173 | //| FreeAdjMem: 174 | //| Free any committed/uncommitted memory. 175 | //| Parms: 176 | //| inptr The base pointer to grow/shrink 177 | //| Returns: 178 | //| TRUE if we're successful 179 | //*--------------------------------------------------------------------------------- 180 | BOOL INTFUN FreeAdjMem(LPVOID inptr) 181 | { 182 | ASSERTCHECK((!inptr), TEXT("Attempt to free NULL pointer")); 183 | 184 | #ifndef WIN32 185 | 186 | return GlobalFreePtr(inptr); 187 | 188 | #else 189 | 190 | return VirtualFree(inptr, 0, MEM_RELEASE); 191 | 192 | #endif 193 | } 194 | 195 | 196 | #ifdef WIN32 197 | //*--------------------------------------------------------------------------------- 198 | //| DebugReleaseMem: 199 | //| Free any committed/uncommitted memory. 200 | //| Parms: 201 | //| lpMem pointer to memory location 202 | //| Returns: 203 | //| TRUE if we're successful 204 | //*--------------------------------------------------------------------------------- 205 | BOOL INTFUN DebugReleaseMem(HWND hwnd,LPCVOID lpMem) 206 | { 207 | HGLOBAL hGlobal=NULL; 208 | BOOL fSuccess=FALSE; 209 | LPVOID lpMessageBuffer=NULL; 210 | LPTSTR lpstr=NULL; 211 | 212 | if (lpMem) 213 | { 214 | if (hGlobal=(HGLOBAL)GlobalHandle(lpMem)) 215 | if (GlobalUnlock(hGlobal)) 216 | if (!GlobalFree(hGlobal)) 217 | fSuccess=TRUE; 218 | 219 | } 220 | 221 | if (!fSuccess) 222 | { 223 | GtrFormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 224 | FORMAT_MESSAGE_FROM_SYSTEM, 225 | NULL, 226 | GetLastError(), 227 | MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 228 | (LPTSTR)lpMessageBuffer, 229 | 0, 230 | NULL); 231 | 232 | lpstr=(LPTSTR)lpMessageBuffer; 233 | GtrMessageBox(hwnd,lpstr,TEXT("Release Memory"),MB_ICONEXCLAMATION | MB_OK); 234 | 235 | } 236 | 237 | return(fSuccess); 238 | 239 | 240 | } //DebugReleaseMem() 241 | 242 | #endif 243 | -------------------------------------------------------------------------------- /src/odbctest/mem.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: MEM.H 6 | //| 7 | //| Purpose: 8 | //| Header file for memory functions. 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef MEM_DEFS 11 | #define MEM_DEFS 12 | 13 | #include 14 | #include 15 | #include 16 | #include "portable.h" 17 | #include "standard.h" 18 | #include "gtrcomm.h" 19 | 20 | 21 | //---------------------------------------------------------------------------------- 22 | // Defines and macros 23 | //---------------------------------------------------------------------------------- 24 | 25 | // NOTE: Although NT gives us 2GB of address space which we could reserve, this 26 | // would be stupid since you're really limiting the number of allocs you can 27 | // do. The purpose of Gator is to allow ad-hoc testing of drivers, and the 28 | // most common test on NT will be do test 64KB boundary code, therefore, the 29 | // logical max alloc size is 2*64KB which will allow you to test these 30 | // boundary conditions without chewing up your address space. 31 | #define MAXVIRTMEM (2 * 65535) 32 | #define DFTPAGESIZE (254) 33 | #define FREE_ADJPTR(ptr) \ 34 | { \ 35 | if(ptr) \ 36 | FreeAdjMem(ptr); \ 37 | ptr = NULL; \ 38 | } 39 | 40 | 41 | //---------------------------------------------------------------------------------- 42 | // Function Prototypes 43 | //---------------------------------------------------------------------------------- 44 | #ifdef WIN32 45 | VOID AdjMemInit(void); 46 | #endif 47 | LPVOID AllocateAdjMem(DWORD cbBytes); 48 | BOOL INTFUN ReAllocAdjMem(LPVOID inptr, DWORD cbFrom, DWORD cbTo); 49 | BOOL INTFUN FreeAdjMem(LPVOID inptr); 50 | BOOL INTFUN DebugReleaseMem(HWND hwnd,LPVOID lpMem); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/odbctest/menus.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: MENUS.H 6 | //| 7 | //| Purpose: 8 | //| This header file contains the menu ids. Note that the 9 | //| SQL function values are based so that we may hash to their 10 | //| control information quickly. 11 | //| 12 | //| Menu ranges: 13 | //| 101 to 299 Base menu items, not include ODBC API functions 14 | //| 300 to 399 ODBC API functions (hashed based on SQL_API_xxx 15 | //| 400 to 450 MDI Child windows, created and handled by Windows 16 | //*--------------------------------------------------------------------------------- 17 | #ifndef MENUS_DEFS 18 | #define MENUS_DEFS 19 | 20 | 21 | // 22 | // For lack of a better place, here are the constants used for the icons 23 | // Note that Win32s and Chicago use the first icon found as the default as 24 | // opposed to Win 16 and NT which used the first registered. For this 25 | // reason, always leave GATORICON as the first icon 26 | // 27 | #define GATORICON 700 28 | #define CONNECTICON 701 29 | #define RESULTICON 702 30 | #define OUTWINICON 703 31 | 32 | 33 | // Normally menu numbers start at 0 and go up, which is how each offset is shown 34 | // in this file. If a child MDI window is zoomed, however, then the child 35 | // system menu becomes menu number 0 and others are offset. The following 36 | // macro will look at the current active window and return the correct 37 | // 0 based menu number. 38 | #define GETMENUNUM(iMenu) (iMenu - (int)IsZoomed(hwndCurMDIChild)) 39 | 40 | 41 | 42 | #define IDM_SYSTEM_CLOSE_POS 6 43 | #define USER_MOD_MDI_CHILD_MENU (WM_USER + 301) 44 | 45 | #define IDM_LOWEST_MENU API_SQLALLOCCONNECT 46 | #define IDM_HIGHEST_MENU NUM_ODBC_APIS 47 | 48 | #define MENU25 1001 49 | #define MENU30 1002 50 | #define MENUALL 1003 51 | 52 | 53 | // Following is accelerator for the F6=Move window focus key 54 | #define IDM_MOVE_WINDOW 250 55 | 56 | // File menu IDs 57 | #define IDM_FILE_MENU 0 58 | #define IDM_FILE_OPEN 251 59 | #define IDM_FILE_SAVEAS 252 60 | #define IDM_FILE_USEROPTIONS 253 61 | #define IDM_FILE_EXIT 254 62 | 63 | 64 | // Edit menu IDs 65 | #define IDM_EDIT_MENU 1 66 | #define IDM_EDIT_UNDO 255 67 | #define IDM_EDIT_CUT 256 68 | #define IDM_EDIT_COPY 257 69 | #define IDM_EDIT_PASTE 258 70 | #define IDM_EDIT_DELETE 259 71 | #define IDM_EDIT_CLEAR 260 72 | #define IDM_EDIT_SELECT_ALL 261 73 | #define IDM_EDIT_WRAP 262 74 | 75 | #define IDM_DIAG_MENU 2 76 | 77 | // Connect menu IDs 78 | // 79 | #define IDM_ENV_MENU 3 80 | 81 | 82 | // Connect menu IDs 83 | // 84 | #define IDM_CONNECT_MENU 4 85 | #define IDM_FULL_CONNECT 3000 86 | #define IDM_FULL_DISCONNECT 3001 87 | #define IDM_DATA_SOURCES_ALL 3002 88 | #define IDM_GET_INFO_ALL 3003 89 | #define IDM_DRIVERS_ALL 3004 90 | #define IDM_CONNECT_SET_DRIVER_DEP_MENUS 3005 91 | #define IDM_ALL_ERRORS 3006 92 | #define IDM_GET_FUNCTIONS_ALL 3007 93 | #define IDM_GET_DESCRIPTOR_ALL 3008 94 | #define IDM_LOAD_DESCRIPTOR_DEFAULTS 3009 95 | #define IDM_CLEAR_ERROR_QUEUE 3010 96 | 97 | #define IDM_DESC_MENU 5 98 | 99 | // Statement menu 100 | // 101 | #define IDM_STATEMENT_MENU 6 102 | #define IDM_FILL_PARAM 3100 103 | #define IDM_SHOW_PARAMS 3101 104 | #define IDM_SHOW_CURSOR_SETTINGS 3102 105 | //-- Following not really on menu, but in results win child system menu 106 | #define IDM_FREESTMT_CLOSE 3103 107 | #define IDM_MAKE_TABLE 3104 108 | 109 | #define IDM_ATTR_MENU 7 110 | #define IDM_SET_CURSOR_ATTR 3150 111 | 112 | // Results Menu 113 | // 114 | #define IDM_RESULTS_MENU 8 115 | #define IDM_DESCRIBE_COL_ALL 3200 116 | #define IDM_BIND_COL_ALL 3201 117 | #define IDM_SHOW_BOUND_COLS 3202 118 | #define IDM_FETCH_ALL 3203 119 | #define IDM_GET_DATA_ROW 3204 120 | #define IDM_GET_DATA_ALL 3205 121 | #define IDM_UPDATE_CELL 3206 122 | #define IDM_DISPLAY_ROWSET 3207 123 | 124 | // Catalog Menu 125 | // 126 | #define IDM_CATALOG_MENU 9 127 | 128 | 129 | // Misc Menu 130 | // 131 | #define IDM_INSTALLER_MENU 10 132 | 133 | // Tools Menu 134 | // 135 | #define IDM_TOOLS_MENU 11 136 | // Other 137 | #define IDM_TOOLS_USER_OPTIONS 3402 138 | #define IDM_USER_ROWSET_OPTIONS 3403 139 | #define IDM_TRACE 3404 140 | //#define IDM_ASYNC 3405 141 | #define IDM_TOOLS_MANAGE_SOURCES 3406 142 | #define IDM_TOOLS_MANAGE_TESTS 3407 143 | #define IDM_TOOLS_MANAGE_GROUPS 3408 144 | #define IDM_TOOLS_RUN_AUTO_TESTS 3409 145 | #define IDM_TOOLS_RECORD 3410 146 | #define IDM_TOOLS_PLAYBACK 3411 147 | 148 | // Window menu 149 | #define IDM_WINDOW_MENU 12 150 | #define IDM_CASCADE 3500 151 | #define IDM_TILE 3501 152 | #define IDM_TILE_HORZ 3502 153 | #define IDM_ARRANGE 3503 154 | #define IDM_CLOSEALL 3504 155 | 156 | // Help menu 157 | #define IDM_HELP_MENU 13 158 | #define IDM_TEST_HELP 3600 159 | #define IDM_API_HELP 3601 160 | #define IDM_ABOUT 3602 161 | 162 | 163 | 164 | 165 | // Toolbar menu-type item 166 | #define IDM_BIND_COL_EXT_FETCH 499 167 | #define IDM_FETCH_FIRST 498 168 | #define IDM_FETCH_PRIOR 497 169 | #define IDM_FETCH_NEXT 496 170 | #define IDM_FETCH_LAST 495 171 | #define IDM_FREE_STMT_CLOSE 494 172 | 173 | #define NUM_MENUS (IDM_HELP_MENU + 1) 174 | #define MENU_MDI_BEGIN 500 175 | #define MENU_MDI_END 550 176 | #define MENU_POPUP_HELP_BEGIN (IDM_HELP_MENU + 10) 177 | 178 | 179 | // 180 | // The SQL_API number found in sqlext.h is used to define a menu number 181 | // for each of the menu items which are in the API. This way the 182 | // menu number serves as a hash to the function to be executed 183 | // 184 | #define IDM_API_BASE 300 185 | #define IDM_CORE_FUNCS 300 186 | #define IDM_EXT_FUNCS 300 187 | #define INSTALLER_ADDITIONS 24 188 | #define TOOL_ADDITIONS 2 //+INSTALLER_ADDITIONS 189 | #define NUM_API_ITEMS (SQL_NUM_FUNCTIONS + SQL_NUM_EXTENSIONS + TOOL_ADDITIONS) 190 | 191 | 192 | 193 | //---------------------------------------------------------------------------------- 194 | // Function Prototypes 195 | //---------------------------------------------------------------------------------- 196 | VOID INTFUN DoMenuSelect(UINT uMenu, UINT uFlags, HMENU hMenu); 197 | VOID INTFUN ResetMenuStatus(HMENU hMenu, int iMenu, int iCalledFrom); 198 | 199 | 200 | 201 | #endif 202 | 203 | -------------------------------------------------------------------------------- /src/odbctest/outwin.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: OUTWIN.C 6 | //| 7 | //| Purpose: 8 | //| This module contains code to handle generic output messages which 9 | //| will include: 10 | //| 1) Function output when no connnection window is present 11 | //| 2) Auto test output when no connection window is present 12 | //| 3) Output for functions which do not require a connection window, 13 | //| example: SQLDataSources 14 | //*--------------------------------------------------------------------------------- 15 | #include "fhheader.h" 16 | 17 | //---------------------------------------------------------------------------------- 18 | // Defines and macros 19 | //---------------------------------------------------------------------------------- 20 | #define GETOUTWINDOW(x) GetWindowLong(x, 0) 21 | #define SETOUTWINDOW(x, y) SetWindowLong(x, 0, (LONG)y) 22 | 23 | 24 | 25 | //---------------------------------------------------------------------------------- 26 | // Globals 27 | //---------------------------------------------------------------------------------- 28 | VszFile; 29 | extern HINSTANCE hInst; 30 | extern TCHAR szOutBuff[MAXOUTBUFF]; 31 | extern HWND hwndClient; 32 | extern HWND hwndStatBar; 33 | extern HWND hwndCurMDIChild; // Current active MDI child at all times 34 | extern TCHAR szWNDPOSSECTION[]; 35 | extern lpHEADENV lpHeadEnv; 36 | extern lpUSROPTIONS lpUsrOptions; 37 | 38 | static TCHAR szOUTWINCLASS[] = TEXT("GATOR:OUTWIN"); 39 | 40 | 41 | //---------------------------------------------------------------------------------- 42 | // Local Function Prototypes 43 | //---------------------------------------------------------------------------------- 44 | LRESULT EXTFUN OutWinWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 45 | 46 | HWND hwndOutWin; 47 | 48 | 49 | //*--------------------------------------------------------------------------------- 50 | //| CreateOutWinWindow: 51 | //| This function will create the generic output window used as described above. 52 | //| Parms: 53 | //| hwndClient Client window handle 54 | //| hInst For use in CreateWindow call 55 | //| Returns: 56 | //| Window handle of the status bar if successful, NULL on error 57 | //*--------------------------------------------------------------------------------- 58 | HWND INTFUN CreateOutWinWindow(HWND hwndClient, HINSTANCE hInst) 59 | { 60 | MDICREATESTRUCT mdicreate; 61 | TCHAR szTitle[30]; 62 | 63 | // Allocate memory for a new node 64 | GetGtrString(szTitle, sizeof(szTitle)/sizeof(szTitle[0]), idsOutWinTitle); 65 | 66 | //Setup output window with default size 67 | mdicreate.szClass = szOUTWINCLASS; 68 | mdicreate.szTitle = szTitle; 69 | mdicreate.hOwner = hInst; 70 | mdicreate.x = 0; 71 | mdicreate.y = 0; 72 | mdicreate.cx = OUTWIN_WIDTH; 73 | mdicreate.cy = OUTWIN_HEIGHT; 74 | mdicreate.style = 0; 75 | mdicreate.lParam = (LPARAM)(NULL); 76 | 77 | //Create the Output window with default size 78 | return (HWND)SendMessage(hwndClient, WM_MDICREATE, 0, 79 | (LPARAM)(LPMDICREATESTRUCT)&mdicreate); 80 | 81 | } 82 | 83 | 84 | 85 | //*--------------------------------------------------------------------------------- 86 | //| DestroyOutWinWindow: 87 | //| This function cleans up the output window by destroying it. 88 | //| Parms: 89 | //| hwndClient Window handle of the client area 90 | //| hwnd Window handle of the output window 91 | //| Returns: 92 | //| Nothing 93 | //*--------------------------------------------------------------------------------- 94 | VOID INTFUN DestroyOutWinWindow(HWND hwndClient, HWND hwnd) 95 | { 96 | // Destroy window 97 | SendMessage(hwndClient, WM_MDIDESTROY, (WPARAM)hwnd, 0L); 98 | hwndOutWin = NULL; 99 | } 100 | 101 | 102 | 103 | //*--------------------------------------------------------------------------------- 104 | //| OutWinWndProc: 105 | //| Handles any messages that must be processed by the window. 106 | //*--------------------------------------------------------------------------------- 107 | LRESULT EXTFUN OutWinWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 108 | { 109 | switch(msg) { 110 | //-------------------------------------------------------------------- 111 | // WM_CREATE: Create the output edit window and remove the 112 | // system menu Close option 113 | //-------------------------------------------------------------------- 114 | case WM_CREATE: 115 | { 116 | HWND hOUT=NULL; 117 | 118 | hOUT = CreateEditWindow(hwnd, hInst, IDW_OUTWIN, 0, 119 | lpUsrOptions->xOutput, 120 | lpUsrOptions->yOutput, 121 | lpUsrOptions->nWidthOutput, 122 | lpUsrOptions->nHeightOutput); 123 | 124 | hwndOutWin=hOUT; 125 | 126 | if(!hwndOutWin) 127 | return -1; 128 | PostMessage(hwnd, USER_MOD_MDI_CHILD_MENU, 0, 0L); 129 | } 130 | return 0; 131 | 132 | 133 | //-------------------------------------------------------------------- 134 | // USER_MOD_MDI_CHILD_MENU: 135 | // The default handling of the MDI child system menu 136 | // is to replace the system version with a special 137 | // version during WM_CREATE. For this reason, we 138 | // cannot modify it until after that message. 139 | //-------------------------------------------------------------------- 140 | case USER_MOD_MDI_CHILD_MENU: 141 | { 142 | HMENU hMenu; 143 | 144 | // Remove the Close system menu item for the child, as well as its separator 145 | if(hMenu = GetSystemMenu(hwnd, FALSE)) { 146 | RemoveMenu(hMenu, IDM_SYSTEM_CLOSE_POS, MF_BYPOSITION); 147 | RemoveMenu(hMenu, IDM_SYSTEM_CLOSE_POS, MF_BYPOSITION); 148 | DrawMenuBar(hwnd); 149 | } 150 | } 151 | return 0; 152 | 153 | 154 | //-------------------------------------------------------------------- 155 | // WM_MENUSELECT: This message is sent when a menu item is 156 | // selected. Show the description in the status bar. 157 | //-------------------------------------------------------------------- 158 | case WM_MENUSELECT: 159 | { 160 | DoMenuSelect(GET_WM_MENUSELECT_ID(wParam, lParam), // menu id 161 | GET_WM_MENUSELECT_FLAGS(wParam, lParam), // flags 162 | GET_WM_MENUSELECT_HMENU(wParam, lParam)); // hMenu 163 | } 164 | break; 165 | 166 | 167 | //-------------------------------------------------------------------- 168 | // WM_SIZE: Use this message to move the child windows to 169 | // correct locations. Note that we must break to 170 | // allow DefMDIWndProc to handle min/max messages 171 | //-------------------------------------------------------------------- 172 | case WM_SIZE: 173 | { 174 | WORD dx = LOWORD(lParam); 175 | WORD dy = HIWORD(lParam); 176 | 177 | // Simply move the edit window to fill the entire MDI child 178 | MoveWindow(hwndOutWin, 0, 0, dx, dy, TRUE); 179 | } 180 | break; 181 | 182 | 183 | //-------------------------------------------------------------------- 184 | // Hande the WM_INITMENUPOPUP message so that when the user selects 185 | // a menu, we enable/disable each item based on our current state. 186 | //-------------------------------------------------------------------- 187 | case WM_INITMENUPOPUP: 188 | { 189 | if(!(BOOL)HIWORD(lParam)) // Not the system menu 190 | ResetMenuStatus((HMENU)wParam, (int)LOWORD(lParam), 2); 191 | } 192 | break; 193 | 194 | 195 | //-------------------------------------------------------------------- 196 | // WM_SYSCOMMAND: We don't want anyone to close the Output window. 197 | // The Close menu item was deleted, but the hot-key 198 | // (Ctrl+F4) is still intact. 199 | //-------------------------------------------------------------------- 200 | case WM_SYSCOMMAND: 201 | if(wParam == SC_CLOSE) 202 | return 0; 203 | break; 204 | 205 | 206 | //-------------------------------------------------------------------- 207 | // WM_COMMAND: For stat bar text 208 | //-------------------------------------------------------------------- 209 | case WM_COMMAND: 210 | { 211 | UINT id=GET_WM_COMMAND_ID(wParam, lParam); 212 | UINT code=GET_WM_COMMAND_CODE(wParam, lParam); 213 | 214 | // Check WM_COMMAND only to set stat bar text 215 | switch(code) { 216 | // Put in status bar description of output window 217 | case EN_SETFOCUS: 218 | SetStatBarText(hwndStatBar, 219 | GetGtrString(szOutBuff, MAXOUTBUFF, id), 220 | BLACK_TEXT); 221 | break; 222 | 223 | // Sent when the edit control is out of room. We'll truncate contents 224 | case EN_ERRSPACE: 225 | TruncateEditContents(hwndOutWin); 226 | break; 227 | 228 | case EN_UPDATE: 229 | case EN_CHANGE: 230 | { 231 | RefreshToolbarSaveAs(hwndOutWin); 232 | } 233 | break; 234 | } 235 | } 236 | break; 237 | 238 | 239 | //-------------------------------------------------------------------- 240 | // WM_MDIACTIVATE: Just change status bar description for user. 241 | //-------------------------------------------------------------------- 242 | case WM_MDIACTIVATE: 243 | { 244 | #ifndef WIN32 245 | if(wParam) { // Activate 246 | #else 247 | if(lParam) { 248 | #endif 249 | hwndCurMDIChild = GetParent(hwndOutWin); 250 | SetStatBarText(hwndStatBar, 251 | GetGtrString(szOutBuff, MAXSTATTEXT, idsOutputWinDesc), 252 | BLACK_TEXT); 253 | RefreshToolbar(); 254 | SetFocus(hwndOutWin); 255 | 256 | //output window has been selected, now change hEnv Combo box 257 | //to display NULL 258 | if (lpHeadEnv) 259 | SendMessage(lpHeadEnv->hwndEnvs, CB_SETCURSEL, 0L, 0L); 260 | } 261 | } 262 | break; 263 | 264 | default: 265 | break; 266 | } 267 | 268 | // 269 | // If we haven't already processed the message, do default behavior. 270 | // 271 | return DefMDIChildProc(hwnd, msg, wParam, lParam); 272 | } 273 | -------------------------------------------------------------------------------- /src/odbctest/outwin.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: OUTWIN.H 6 | //| 7 | //| Purpose: 8 | //| Header file for Output Window functions 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef OUTWIN_DEFS 11 | #define OUTWIN_DEFS 12 | 13 | #include 14 | #include "portable.h" 15 | #include "standard.h" 16 | #include "handles.h" 17 | 18 | //---------------------------------------------------------------------------------- 19 | // Globals 20 | //---------------------------------------------------------------------------------- 21 | extern HWND hwndOutWin; // The edit child window 22 | 23 | 24 | //---------------------------------------------------------------------------------- 25 | // Function Prototypes 26 | //---------------------------------------------------------------------------------- 27 | HWND INTFUN CreateOutWinWindow(HWND hwndClient, HINSTANCE hInst); 28 | VOID INTFUN DestroyOutWinWindow(HWND hwndClient, HWND hwnd); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/odbctest/outwin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/outwin.ico -------------------------------------------------------------------------------- /src/odbctest/paramidx.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: PARAMIDX.H 6 | //| 7 | //| Purpose: 8 | //| This file contains constants that represent the parameter number of 9 | //| a particular field in dlgtmplt.c and usrwndp.c 10 | //*--------------------------------------------------------------------------------- 11 | #ifndef PARAMIDX_DEFS 12 | #define PARAMIDX_DEFS 13 | 14 | 15 | // SQLBindParameter 16 | #define IPAR_BP_HSTMT 0 17 | #define IPAR_BP_IPAR 1 18 | #define IPAR_BP_FPARAMTYPE 2 19 | #define IPAR_BP_FCTYPE 3 20 | #define IPAR_BP_FSQLTYPE 4 21 | #define IPAR_BP_CBCOLDEF 5 22 | #define IPAR_BP_IBSCALE 6 23 | #define IPAR_BP_RGBVALUE 7 24 | #define IPAR_BP_CBVALUEMAX 8 25 | #define IPAR_BP_PCBVALUE 9 26 | #define IPAR_BP_DAE 10 27 | #define IPAR_BP_RS_HDBC 11 28 | #define IPAR_BP_RS_HSTMT 12 29 | #define IPAR_BP_COLUMN 13 30 | #define IPAR_BP_ROW 14 31 | #define IPAR_BP_BUFFERSIZE 15 32 | 33 | // SQLBindParam 34 | #define IPAR_BPARAM_HSTMT 0 35 | #define IPAR_BPARAM_IPAR 1 36 | #define IPAR_BPARAM_FCTYPE 2 37 | #define IPAR_BPARAM_FSQLTYPE 3 38 | #define IPAR_BPARAM_CBCOLDEF 4 39 | #define IPAR_BPARAM_IBSCALE 5 40 | #define IPAR_BPARAM_RGBVALUE 6 41 | #define IPAR_BPARAM_PCBVALUE 7 42 | #define IPAR_BPARAM_DAE 8 43 | #define IPAR_BPARAM_RS_HDBC 9 44 | #define IPAR_BPARAM_RS_HSTMT 10 45 | #define IPAR_BPARAM_COLUMN 11 46 | #define IPAR_BPARAM_ROW 12 47 | #define IPAR_BPARAM_BUFFERSIZE 13 48 | #define IPAR_BPARAM_FPARAMTYPE -1 49 | #define IPAR_BPARAM_CBVALUEMAX -1 50 | 51 | // SQLGetInfo 52 | #define IPAR_GI_HSTMT 0 53 | #define IPAR_GI_FINFOTYPE 1 54 | #define IPAR_GI_RGBINFOVALUE 2 55 | #define IPAR_GI_CBINFOVALUEMAX 3 56 | #define IPAR_GI_PCBINFOVALUE 4 57 | #define IPAR_GI_INFORMATION_VALUE_TYPE 5 58 | 59 | 60 | // SQLColAttributes 61 | #define IPAR_CAS_HSTMT 0 62 | #define IPAR_CAS_ICOL 1 63 | #define IPAR_CAS_FDESCTYPE 2 64 | #define IPAR_CAS_RGBDESC 3 65 | #define IPAR_CAS_CBDESCMAX 4 66 | #define IPAR_CAS_PCBDESC 5 67 | #define IPAR_CAS_PFDESC 6 68 | #define IPAR_CAS_DESCRIPTION_TYPE 7 69 | 70 | // SQLColAttribute 71 | #define IPAR_CA_HSTMT 0 72 | #define IPAR_CA_ICOLUMNNUMBER 1 73 | #define IPAR_CA_FFIELDINDENTIFIER 2 74 | #define IPAR_CA_RGBCHARACTERATTRIBUTE 3 75 | #define IPAR_CA_CBBUFFERLENGTH 4 76 | #define IPAR_CA_PCBSTRINGLENGTH 5 77 | #define IPAR_CA_PVNUMERICATTRIBUTE 6 78 | #define IPAR_CA_FFIELDINDENTIFIER_TYPE 7 79 | 80 | // SQLGetConnectOption 81 | #define IPAR_GCO_HDBC 0 82 | #define IPAR_GCO_FOPTION 1 83 | #define IPAR_GCO_PVPARAM 2 84 | #define IPAR_GCO_PARAMETER_TYPE 3 85 | 86 | // SQLSetConnectOption 87 | #define IPAR_SCO_HDBC 0 88 | #define IPAR_SCO_FOPTION 1 89 | #define IPAR_SCO_VPARAM 2 90 | #define IPAR_SCO_PARAMETER_TYPE 3 91 | 92 | // SQLGetConnectAttr 93 | #define IPAR_GCA_HDBC 0 94 | #define IPAR_GCA_FATTRIBUTE 1 95 | #define IPAR_GCA_RGBVALUE 2 96 | #define IPAR_GCA_CBVALUE 3 97 | #define IPAR_GCA_PCBVALUE 4 98 | #define IPAR_GCA_PARAMETER_TYPE 5 99 | 100 | // SQLSetConnectAttr 101 | #define IPAR_SCA_HDBC 0 102 | #define IPAR_SCA_FATTRIBUTE 1 103 | #define IPAR_SCA_RGBVALUE 2 104 | #define IPAR_SCA_CBVALUE 3 105 | #define IPAR_SCA_PARAMETER_TYPE 4 106 | 107 | // SQLGetDescField 108 | #define IPAR_GDF_HDESC 0 109 | #define IPAR_GDF_IRECNUM 1 110 | #define IPAR_GDF_IFIELDIDENTIFIER 2 111 | #define IPAR_GDF_RGBVALUE 3 112 | #define IPAR_GDF_CBVALUEMAX 4 113 | #define IPAR_GDF_PCBVALUE 5 114 | #define IPAR_GDF_IFIELDIDENTIFIER_TYPE 6 115 | 116 | // SQLSetDescField 117 | #define IPAR_SDF_HDESC 0 118 | #define IPAR_SDF_IRECNUM 1 119 | #define IPAR_SDF_IFIELDIDENTIFIER 2 120 | #define IPAR_SDF_RGBVALUE 3 121 | #define IPAR_SDF_CBBUFFERLENGTH 4 122 | #define IPAR_SDF_IFIELDIDENTIFIER_TYPE 5 123 | 124 | // SQLGetDescRec 125 | #define IPAR_GDR_HDESC 0 126 | #define IPAR_GDR_IRECNUM 1 127 | #define IPAR_GDR_SZNAME 2 128 | #define IPAR_GDR_CBNAME 3 129 | #define IPAR_GDR_PCBNAME 4 130 | #define IPAR_GDR_FTYPE 5 131 | #define IPAR_GDR_FSUBTYPE 6 132 | #define IPAR_GDR_PCOLDEF 7 133 | #define IPAR_GDR_PPRECISION 8 134 | #define IPAR_GDR_PSCALE 9 135 | #define IPAR_GDR_PFNULLABLE 10 136 | 137 | // SQLSetDescRec 138 | #define IPAR_SDR_HDESC 0 139 | #define IPAR_SDR_IRECNUM 1 140 | #define IPAR_SDR_FTYPE 2 141 | #define IPAR_SDR_FSUBTYPE 3 142 | #define IPAR_SDR_CBLENGTH 4 143 | #define IPAR_SDR_CBCOLDEF 5 144 | #define IPAR_SDR_IBSCALE 6 145 | #define IPAR_SDR_RGBVALUE 7 146 | #define IPAR_SDR_PCBSTRINGLENGTH 8 147 | #define IPAR_SDR_PFINDICATOR 9 148 | 149 | // SQLGetDiagField 150 | #define IPAR_GDF_FHANDLETYPE 0 151 | #define IPAR_GDF_HHANDLE 1 152 | #define IPAR_GDF_IRECRECNUMBER 2 153 | #define IPAR_GDF_FDIAGIDENTIFIER 3 154 | #define IPAR_GDF_RGBDIAGINFO 4 155 | #define IPAR_GDF_CBBUFFERLENGTH 5 156 | #define IPAR_GDF_PCBSTRINGLENGTH 6 157 | #define IPAR_GDF_FDIAGIDENTIFIER_TYPE 7 158 | 159 | #define IPAR_GDR_FHANDLETYPE 0 160 | #define IPAR_GDR_HHANDLE 1 161 | #define IPAR_GDR_IRECRECNUMBER 2 162 | #define IPAR_GDR_SZSQLSTATE 3 163 | #define IPAR_GDR_PFNATIVEERROR 4 164 | #define IPAR_GDR_SZMESSAGETEXT 5 165 | #define IPAR_GDR_CBBUFFERLENGTH 6 166 | #define IPAR_GDR_PCBTEXTLENGTH 7 167 | 168 | // SQLEndTran 169 | #define IPAR_ET_FHANDLETYPE 0 170 | #define IPAR_ET_HHANDLE 1 171 | #define IPAR_ET_FCOMPLETIONTYPE 2 172 | 173 | // SQLFetchScroll 174 | #define IPAR_FS_HSTMT 0 175 | #define IPAR_FS_FFETCHORIENTATION 1 176 | #define IPAR_FS_FFETCHOFFSET 2 177 | #define IPAR_FS_DISPLAY_ROWSET 3 178 | 179 | // SQLFetch 180 | #define IPAR_F_HSTMT 0 181 | #define IPAR_F_DISPLAY_ROWSET 1 182 | 183 | // SQLExtendedFetch 184 | #define IPAR_EF_HSTMT 0 185 | #define IPAR_EF_FFETCHTYPE 1 186 | #define IPAR_EF_IROW 2 187 | #define IPAR_EF_PCROW 3 188 | #define IPAR_EF_RGFROWSTATUS 4 189 | #define IPAR_EF_DISPLAY_ROW 5 190 | 191 | // SQLCloseCursor 192 | #define IPAR_CC_HSTMT 0 193 | 194 | // SQLFreeHandle 195 | #define IPAR_FH_FHANDLETYPE 0 196 | #define IPAR_FH_INPUTHANDLE 1 197 | 198 | // SQLGetEnvAttr 199 | #define IPAR_GEA_HENV 0 200 | #define IPAR_GEA_FATTRIBUTE 1 201 | #define IPAR_GEA_RGBVALUE 2 202 | #define IPAR_GEA_CBVALUE 3 203 | #define IPAR_GEA_PCBVALUE 4 204 | #define IPAR_GEA_FATTRIBUTE_TYPE 5 205 | 206 | // SQLSetEnvAttr 207 | #define IPAR_SEA_HENV 0 208 | #define IPAR_SEA_FATTRIBUTE 1 209 | #define IPAR_SEA_RGBVALUE 2 210 | #define IPAR_SEA_CBVALUE 3 211 | #define IPAR_SEA_FATTRIBUTE_TYPE 4 212 | 213 | // SQLSetStmtAttr 214 | #define IPAR_SSA_HSTMT 0 215 | #define IPAR_SSA_FATTRIBUTE 1 216 | #define IPAR_SSA_RGBVALUE 2 217 | #define IPAR_SSA_CBVALUE 3 218 | #define IPAR_SSA_PARAMETER_TYPE 4 219 | 220 | // SQLGetStmtAttr 221 | #define IPAR_GSA_HSTMT 0 222 | #define IPAR_GSA_FATTRIBUTE 1 223 | #define IPAR_GSA_RGBVALUE 2 224 | #define IPAR_GSA_CBVALUE 3 225 | #define IPAR_GSA_PCBVALUE 4 226 | #define IPAR_GSA_PARAMETER_TYPE 5 227 | 228 | // SQLSetStmtOption 229 | #define IPAR_SSO_HSTMT 0 230 | #define IPAR_SSO_FOPTION 1 231 | #define IPAR_SSO_VPARAM 2 232 | #define IPAR_SSO_PARAMETER_TYPE 3 233 | 234 | // SQLGetStmtOption 235 | #define IPAR_GSO_HSTMT 0 236 | #define IPAR_GSO_FOPTION 1 237 | #define IPAR_GSO_PVPARAM 2 238 | #define IPAR_GSO_PARAMETER_TYPE 3 239 | 240 | // SQLBulkOperations 241 | #define IPAR_BO_HSTMT 0 242 | #define IPAR_BO_OPERATION 1 243 | 244 | #endif 245 | 246 | -------------------------------------------------------------------------------- /src/odbctest/picktype.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: PICKTYPES.H 3 | //| Copyright (c) Microsoft Corporation 4 | //| 5 | //| This file contains defines and macros which allow 6 | //| the user to add and remove groups SQL Types from the "AutoMakeTable" 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef PICKTYPES_DEFS 9 | #define PICKTYPES_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | #define USER_RESET_TYPES WM_USER + 150 16 | #define USER_SET_BUTTON_STATE WM_USER + 151 17 | #define USER_RESET_INSTALLED WM_USER + 152 18 | #define USER_RESET_AVAILABLE WM_USER + 153 19 | #define USER_ADD_ITEM WM_USER + 154 20 | #define USER_REMOVE_ITEM WM_USER + 155 21 | #define USER_RESET_RUNLISTS WM_USER + 156 22 | 23 | #define AUTO_MAX_TEST_NAME 35 24 | #define AUTO_MAX_TESTCASE_NAME 35 25 | #define AUTO_MAX_TESTDESC_NAME 75 26 | #define MAXTESTDESC 70 27 | #define MAXTESTSOURCE 50 28 | #define MAXLISTBOXSIZE 100 29 | 30 | //------------------------------------------------------------------------------------------ 31 | // .INI macros 32 | //------------------------------------------------------------------------------------------ 33 | #define INI_STRING_NOT_FOUND 0 34 | #define INI_DATA_SOURCE 1 35 | #define INI_AUTO_TEST 2 36 | #define INI_GROUP_NAME 4 37 | 38 | 39 | // For Types 40 | #define GetTypeList(outbuff, cboutbuff) \ 41 | (GtrGetPrivateProfileString(szTYPES, NULL, NULL, outbuff, cboutbuff, szGATORINI)) 42 | #define GetTypeAutoTests(group, outbuff, cboutbuff) \ 43 | (GtrGetPrivateProfileString(group, NULL, NULL, outbuff, cboutbuff, szGATORINI)) 44 | #define GetTypeNameFromIni(group, outbuff, cboutbuff) \ 45 | (GtrGetPrivateProfileString(szTYPES, group, NULL, outbuff, cboutbuff, szGATORINI)) 46 | #define AddTypeToIni(group) \ 47 | (GtrWritePrivateProfileString(szTYPES, group, szINSTALLED, szGATORINI)) 48 | #define AddTypeAutoTest(group, autotest) \ 49 | (GtrWritePrivateProfileString(group, autotest, szINSTALLED, szGATORINI)) 50 | #define RemoveTypeAutoTest(group, autotest) \ 51 | (GtrWritePrivateProfileString(group, autotest, NULL, szGATORINI)) 52 | #define RemoveTypeFromIni(group) \ 53 | (GtrWritePrivateProfileString(szTYPES, group, NULL, szGATORINI)) 54 | #define RemoveType(group) \ 55 | (GtrWritePrivateProfileString(group, NULL, NULL, szGATORINI)) 56 | #define GetInstalledTestList(outbuff, cboutbuff) \ 57 | (GtrGetPrivateProfileString(szAUTOTESTS, NULL, NULL, outbuff, cboutbuff, szGATORINI)) 58 | #define GetSourceName(name, outbuff, cboutbuff) \ 59 | (GtrGetPrivateProfileString(szSQLDRIVERS, name, NULL, outbuff, cboutbuff, szGATORINI)) 60 | #define GetTestNameFromIni(test, outbuff, cboutbuff) \ 61 | (GtrGetPrivateProfileString(szAUTOTESTS, test, NULL, outbuff, cboutbuff, szGATORINI)) 62 | 63 | //---------------------------------------------------------------------------------- 64 | // Functions 65 | //---------------------------------------------------------------------------------- 66 | int EXTFUN PickTypes(HWND hwnd, HINSTANCE hInst,lpFIELDINFO rgFields); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /src/odbctest/pressed.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/pressed.bmp -------------------------------------------------------------------------------- /src/odbctest/rsltwin.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: RSLTWIN.H 6 | //| 7 | //| Purpose: 8 | //| Header file for Results Window information used to track connections. 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef RSLTWIN_DEFS 11 | #define RLSTWIN_DEFS 12 | 13 | #include 14 | #include "portable.h" 15 | #include "standard.h" 16 | #include "handles.h" 17 | 18 | 19 | //---------------------------------------------------------------------------------- 20 | // Defines and macros 21 | //---------------------------------------------------------------------------------- 22 | 23 | 24 | 25 | //---------------------------------------------------------------------------------- 26 | // Globals 27 | //---------------------------------------------------------------------------------- 28 | 29 | 30 | 31 | 32 | //---------------------------------------------------------------------------------- 33 | // Function Prototypes 34 | //---------------------------------------------------------------------------------- 35 | RESULTWININFO * CreateResultWindow(HWND hwndClient, HINSTANCE hInst, 36 | HENV henv, lpCONNECTIONINFO lpci, lpSTATEMENTINFO lpStmt, 37 | RETCODE rc); 38 | VOID INTFUN DestroyResultWindow(lpRESULTWININFO lprw, BOOL fFreeRowStatus); 39 | VOID INTFUN ResetRsltWin(lpRESULTWININFO lprw); 40 | VOID INTFUN SetMiniBarText(lpRESULTWININFO lprw, LPCTSTR szStr); 41 | 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/odbctest/rsltwin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ODBCTest/0d629c7e4ff7b01398a5ac71d20c43362d0f43bf/src/odbctest/rsltwin.ico -------------------------------------------------------------------------------- /src/odbctest/sources.inc: -------------------------------------------------------------------------------- 1 | TARGETTYPE=PROGRAM 2 | !INCLUDE $(PROJROOT)\user.mk 3 | EXEDEF=..\gator32.def 4 | 5 | UMTYPE=windows 6 | USE_MSVCRT=1 7 | USE_ATL=1 8 | ATL_VER=30 9 | LOCALIZE_NO_MUI=0 10 | 11 | C_DEFINES=$(C_DEFINES) 12 | 13 | TARGETLIBS=\ 14 | $(SDK_LIB_PATH)\kernel32.lib \ 15 | $(SDK_LIB_PATH)\gdi32.lib \ 16 | $(SDK_LIB_PATH)\comdlg32.lib \ 17 | $(SDK_LIB_PATH)\comctl32.lib \ 18 | $(SDK_LIB_PATH)\rpcrt4.lib \ 19 | $(SDK_LIB_PATH)\htmlhelp.lib \ 20 | $(SDK_LIB_PATH)\odbc32.lib \ 21 | $(SDK_LIB_PATH)\oleaut32.lib \ 22 | $(SDK_LIB_PATH)\odbccp32.lib 23 | 24 | INCLUDES=..;..\..\include;$(INCLUDE) 25 | 26 | SOURCES=\ 27 | ..\gator.rc \ 28 | ..\bigint.c \ 29 | ..\blddata.c \ 30 | ..\connwin.c \ 31 | ..\dlgbldr.c \ 32 | ..\dlgmngr.c \ 33 | ..\dlgparms.c \ 34 | ..\dlgtmplt.c \ 35 | ..\dlgtools.c \ 36 | ..\fhattr.c \ 37 | ..\fhbind.c \ 38 | ..\fhcatl.c \ 39 | ..\fhconn.c \ 40 | ..\fhdesc.c \ 41 | ..\fhdiag.c \ 42 | ..\fhenv.c \ 43 | ..\fhhndl.c \ 44 | ..\fhinst.c \ 45 | ..\fhlocatr.c \ 46 | ..\fhmisc.c \ 47 | ..\fhrslt.c \ 48 | ..\fhstmt.c \ 49 | ..\fileio.c \ 50 | ..\globals.c \ 51 | ..\gtrcomm.c \ 52 | ..\main.c \ 53 | ..\mem.c \ 54 | ..\optwin.c \ 55 | ..\outwin.c \ 56 | ..\picktype.c \ 57 | ..\rsltwin.c \ 58 | ..\runtest.c \ 59 | ..\statbar.c \ 60 | ..\table.c \ 61 | ..\toolbar.c \ 62 | ..\usrwndp.c 63 | 64 | UMENTRYABS=WinMainCRTStartup 65 | -------------------------------------------------------------------------------- /src/odbctest/statbar.c: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: STATBAR.C 6 | //| 7 | //| Purpose: 8 | //| This module contains all functions required for the status bar 9 | //| which is present at the bottom of the screen. 10 | //*--------------------------------------------------------------------------------- 11 | #include "fhheader.h" 12 | 13 | 14 | //---------------------------------------------------------------------------------- 15 | // Defines and macros 16 | //---------------------------------------------------------------------------------- 17 | #define ID_STATBAR 111 18 | #define DFT_STAT_PT_SIZE 10 19 | #define DFT_STAT_FONT "MS Sans Serif" 20 | 21 | 22 | //---------------------------------------------------------------------------------- 23 | // Globals 24 | //---------------------------------------------------------------------------------- 25 | VszFile; 26 | lpSTATUSWINDOWINFO lpStat; // Global pointer to the status window 27 | extern HFONT hEditFont; // Default for system, only use if required 28 | 29 | extern lpUSROPTIONS lpUsrOptions; 30 | static TCHAR szSTATBARCLASS[] = TEXT("GATOR:STATBAR"); 31 | 32 | 33 | //---------------------------------------------------------------------------------- 34 | // Local Function Prototypes 35 | //---------------------------------------------------------------------------------- 36 | LRESULT EXTFUN StatusWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 37 | VOID INTFUN SizeStatBar(HWND hwnd, UINT dx); 38 | 39 | 40 | 41 | //*--------------------------------------------------------------------------------- 42 | //| CreateStatBar: 43 | //| Call this function to create a window of type status bar. When 44 | //| the parent is sized, the SizeStatBar function should be called. 45 | //| Parms: 46 | //| hwndParent Parent window handle 47 | //| hInst For use in CreateWindow call 48 | //| Returns: 49 | //| Window handle of the status bar if successful, NULL on error 50 | //*--------------------------------------------------------------------------------- 51 | HWND INTFUN CreateStatBar(HWND hwndParent, HINSTANCE hInst) 52 | { 53 | return CreateWindow(szSTATBARCLASS, 54 | NULL, 55 | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, 56 | 0, 0, 0, 0, 57 | hwndParent, 58 | (HMENU)(ID_STATBAR), 59 | hInst, 60 | NULL); 61 | } 62 | 63 | 64 | 65 | 66 | //*--------------------------------------------------------------------------------- 67 | //| StatusWndProc: 68 | //| Handles any messages that must be processed by the window. 69 | //*--------------------------------------------------------------------------------- 70 | LRESULT EXTFUN StatusWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) 71 | { 72 | 73 | switch(msg) { 74 | //--------------------------------------------------------------------- 75 | // WM_CREATE: Allocate memory for the status window information 76 | // and store it with our window handle. 77 | //--------------------------------------------------------------------- 78 | case WM_CREATE: 79 | { 80 | TEXTMETRIC tm; 81 | HFONT hf; 82 | HDC hdc; 83 | LOGFONT lf; 84 | 85 | if(!(lpStat = (lpSTATUSWINDOWINFO)AllocateMemory(sizeof(STATUSWINDOWINFO)))) 86 | return -1; 87 | lpStat->hwnd = hwnd; 88 | *lpStat->szStr = '\0'; 89 | 90 | 91 | // Now determine size information 92 | hdc = GetDC(hwnd); 93 | if(hdc) { 94 | // Create a font to use 95 | InitFont(&lf,(LPTSTR)lpUsrOptions->szFont); 96 | lf.lfHeight = -MulDiv(DFT_STAT_PT_SIZE, 97 | GetDeviceCaps(hdc, LOGPIXELSY), 72); 98 | lf.lfWeight = FW_THIN; 99 | lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; 100 | lpStat->hFont = CreateFontIndirect(&lf); 101 | if(!lpStat->hFont) 102 | lpStat->hFont = hEditFont; // Take default if there is an error 103 | 104 | // Now size based on current font 105 | hf = SelectObject(hdc, lpStat->hFont); 106 | GetTextMetrics(hdc, &tm); 107 | lpStat->cx = tm.tmAveCharWidth; 108 | lpStat->cy = tm.tmHeight + tm.tmExternalLeading; 109 | lpStat->dy = lpStat->cy + (7 * GetSystemMetrics(SM_CYBORDER)) + 2; 110 | SelectObject(hdc,hf); 111 | ReleaseDC(hwnd, hdc); 112 | } 113 | } 114 | return FALSE; 115 | 116 | 117 | //--------------------------------------------------------------------- 118 | // WM_PAINT: Paint the window 119 | //--------------------------------------------------------------------- 120 | case WM_PAINT: 121 | { 122 | HDC hdc; 123 | PAINTSTRUCT ps; 124 | 125 | if(hdc = BeginPaint(hwnd, &ps)) { 126 | Draw3DBorder(hwnd, hdc, &lpStat->rect, lpStat->dx); 127 | if(*lpStat->szStr) { 128 | HFONT hf; 129 | hf=SelectObject(hdc, lpStat->hFont); 130 | SetTextColor(hdc, lpStat->color); 131 | SetBkColor(hdc, GetSysColor(COLOR_BTNFACE)); 132 | ExtTextOut(hdc, 133 | lpStat->rect.left + 3, 134 | lpStat->rect.top, 135 | DFT_ETO_FLAGS, 136 | &lpStat->rect, 137 | lpStat->szStr, 138 | lstrlen(lpStat->szStr), 139 | NULL); 140 | SelectObject(hdc, hf); 141 | } 142 | EndPaint(hwnd, &ps); 143 | } 144 | } 145 | return FALSE; 146 | 147 | 148 | //--------------------------------------------------------------------- 149 | // WM_DESTORY: Process this message to free memory and destroy font. 150 | //--------------------------------------------------------------------- 151 | case WM_DESTROY: 152 | { 153 | DeleteObject(lpStat->hFont); 154 | FREE_PTR(lpStat); 155 | } 156 | return 0; 157 | 158 | 159 | default: 160 | break; 161 | } 162 | 163 | return DefWindowProc(hwnd, msg, wParam, lParam); 164 | } 165 | 166 | 167 | 168 | //*--------------------------------------------------------------------------------- 169 | //| SetStatBarText: 170 | //| Will change the current status bar text and cause it to be painted. 171 | //| Parms: 172 | //| hwnd The window handle of the status bar 173 | //| str The new value 174 | //| color The text color to use 175 | //| Returns: 176 | //| Nothing. 177 | //*--------------------------------------------------------------------------------- 178 | VOID INTFUN SetStatBarText(HWND hwnd, LPTSTR str, COLORREF color) 179 | { 180 | if(lpStat) { 181 | lpStat->color = color; 182 | lstrcpy(lpStat->szStr, str); 183 | InvalidateRect(hwnd, &lpStat->rect, TRUE); 184 | UpdateWindow(hwnd); 185 | } 186 | } 187 | 188 | 189 | 190 | 191 | //*--------------------------------------------------------------------------------- 192 | //| SetStatBarText: 193 | //| Simply store the flags with the status information and then force a paint. 194 | //| Parms: 195 | //| hwnd The window handle of the status bar 196 | //| uFlags New flag information 197 | //| Returns: 198 | //| Nothing. 199 | //*--------------------------------------------------------------------------------- 200 | VOID INTFUN SetStatBarFlags(HWND hwnd, UDWORD uFlags) 201 | { 202 | if(lpStat) { 203 | lpStat->uFlags = uFlags; 204 | InvalidateRect(hwnd, &lpStat->rect, TRUE); 205 | } 206 | } 207 | 208 | 209 | //*--------------------------------------------------------------------------------- 210 | //| SizeStatBar: 211 | //| This function will adjust the size of our status bar and move it to 212 | //| the new location. 213 | //| Parms: 214 | //| hwnd The window handle of the status bar 215 | //| dx The width of the client window 216 | //| bottom The bottom of the client window 217 | //| Returns: 218 | //| Nothing. 219 | //*--------------------------------------------------------------------------------- 220 | VOID INTFUN SizeStatBar(HWND hwnd, UINT dx) 221 | { 222 | UINT cyExtra = (3 * GetSystemMetrics(SM_CYBORDER)); 223 | UINT cxExtra = cyExtra * 2; 224 | 225 | lpStat->dx = dx; 226 | lpStat->rect.left = cxExtra; 227 | lpStat->rect.top = cyExtra + 2; 228 | lpStat->rect.right = lpStat->dx - cxExtra; 229 | lpStat->rect.bottom = lpStat->dy - cyExtra; 230 | } 231 | 232 | 233 | //*--------------------------------------------------------------------------------- 234 | //| Draw3DBorder: 235 | //| This function will draw a 3d border around the text rectangle. 236 | //| Parms: 237 | //| hwnd The window handle 238 | //| hdc Device context to draw in 239 | //| lpStat The status information 240 | //| Returns: 241 | //| Nothing. 242 | //*--------------------------------------------------------------------------------- 243 | VOID INTFUN Draw3DBorder(HWND hwnd, HDC hdc, RECT * lpRect, UINT dx) 244 | { 245 | HPEN hdPen, hlPen, hOldPen; 246 | int iPenWidth = GetSystemMetrics(SM_CYBORDER);// * 2; 247 | 248 | 249 | // Create a dark pen for the left and top borders 250 | hdPen = CreatePen(PS_SOLID, iPenWidth, GetSysColor(COLOR_BTNSHADOW)); 251 | hOldPen = SelectObject(hdc, hdPen); 252 | MoveTo(hdc, lpRect->left-1, lpRect->bottom+1); 253 | LineTo(hdc, lpRect->left-1, lpRect->top-1); 254 | LineTo(hdc, lpRect->right+1, lpRect->top-1); 255 | 256 | // Create a light pen for the right and bottom borders 257 | hlPen = CreatePen(PS_SOLID, iPenWidth, PORT_GETCOLOR_BTN_HIGHLIGHT); 258 | SelectObject(hdc, hlPen); 259 | LineTo(hdc, lpRect->right+1, lpRect->bottom+1); 260 | LineTo(hdc, lpRect->left-1, lpRect->bottom+1); 261 | 262 | // Use light pen for the very top line 263 | if(dx != (UINT)-1) { 264 | MoveTo(hdc, 0, 0); 265 | LineTo(hdc, dx, 0); 266 | } 267 | 268 | SelectObject(hdc, hOldPen); 269 | DeleteObject(hdPen); 270 | DeleteObject(hlPen); 271 | } 272 | -------------------------------------------------------------------------------- /src/odbctest/statbar.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: STATBAR.H 6 | //| 7 | //| Purpose: 8 | //| Header file for the status bar functions 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef STATBAR_DEFS 11 | #define STATBAR_DEFS 12 | 13 | #include 14 | #include "portable.h" 15 | #include "standard.h" 16 | 17 | 18 | //---------------------------------------------------------------------------------- 19 | // Defines and macros 20 | //---------------------------------------------------------------------------------- 21 | #define MAXSTATTEXT 256 22 | #define WHITE_TEXT RGB(255,255,255) 23 | #define BLACK_TEXT RGB(0,0,0) 24 | #define RED_TEXT RGB(255,0,0) 25 | #define GREEN_TEXT RGB(0,255,0) 26 | #define BLUE_TEXT RGB(0,0,255) 27 | #define YELLOW_TEXT RGB(255,255,0) 28 | #define LTBLUE_TEXT RGB(0,255,255) 29 | #define LTYELLOW_TEXT RGB(255,255,128) 30 | #define GRAY_TEXT RGB(192,192,192) 31 | 32 | #define STAT_ACCESS_MODE_READ 0x00000001L 33 | #define STAT_AUTO_COMMIT_TRUE 0x00000002L 34 | #define STAT_TRACING_ON 0x00000004L 35 | #define STAT_ASYNC_ON 0x00000008L 36 | #define STAT_BIND_TYPE_COL 0x00000010L 37 | 38 | 39 | //*------------------------------------------------------------------------ 40 | //| STATUSWINDOWINFO: 41 | //| This structure is used to track all information in the status bar. 42 | //| A pointer to this structure is kept in the extra bytes of the 43 | //| window so given the status bar window handle, you can access this 44 | //| structure. 45 | //*------------------------------------------------------------------------ 46 | typedef struct tagSTATUSWINDOWINFO { 47 | HWND hwnd; // Handle to our window 48 | UINT dx; // Width of the window at this point 49 | UINT dy; // Height of window 50 | UINT cx; // Average width of a TCHARacter 51 | UINT cy; // Average height of a character 52 | HFONT hFont; // The font to use for the display 53 | COLORREF color; // Color to use 54 | TCHAR szStr[MAXSTATTEXT]; // The text to display 55 | UDWORD uFlags; // Bitmask indicates the value of other items 56 | // Now for the rectangles 57 | RECT rect; // Bounding rect for text only 58 | RECT amRect; // SQL_ACCESS_MODE 59 | RECT acRect; // SQL_AUTO_COMMIT 60 | RECT trRect; // SQL_OPT_TRACE 61 | RECT ayRect; // SQL_ASYNC_ENABLE 62 | RECT btRect; // SQL_BIND_TYPE 63 | } STATUSWINDOWINFO; 64 | typedef STATUSWINDOWINFO * lpSTATUSWINDOWINFO; 65 | 66 | 67 | 68 | //---------------------------------------------------------------------------------- 69 | // Function Prototypes 70 | //---------------------------------------------------------------------------------- 71 | HWND INTFUN CreateStatBar(HWND hwndParent, HINSTANCE hInst); 72 | VOID INTFUN SetStatBarText(HWND hwnd, LPTSTR str, COLORREF color); 73 | VOID INTFUN SetStatBarFlags(HWND hwnd, UDWORD uFlags); 74 | VOID INTFUN SizeStatBar(HWND hwnd, UINT dx); 75 | VOID INTFUN Draw3DBorder(HWND hwnd, HDC hdc, RECT * lpRect, UINT dx); 76 | 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/odbctest/szserver: -------------------------------------------------------------------------------- 1 | connwin.c: WORD wIndex=(WORD)SendMessage(lpci->hwndStmts, CB_GETCURSEL, 0, 0L); 2 | connwin.c: lpci->lpCurStmt = lpci->lpStmt; 3 | connwin.c: lpci->lpCurStmt = NULL; 4 | connwin.c: lpci->lpCurStmt = lpci->lpCurStmt->next; 5 | connwin.c: for(lpStmt = lpci->lpStmt; 6 | connwin.c: SendMessage(lpci->hwndStmts, CB_SETCURSEL, iPos, 0L); 7 | connwin.c: SendMessage(lpci->hwndStmts, CB_SHOWDROPDOWN, FALSE, 0L); 8 | connwin.c: if(fHwnd == lpci->hwndIn) 9 | connwin.c: SetFocus(lpci->hwndOut); 10 | connwin.c: else if(fHwnd == lpci->hwndOut) 11 | connwin.c: SetFocus(lpci->hwndStmts); 12 | connwin.c: SetFocus(lpci->hwndIn); 13 | connwin.c: if(lpci->uState & STATE_CONNECTED_HDBC) 14 | connwin.c: (*lpci->szUser) ? (LPTSTR)lpci->szUser : (LPTSTR)szUNKNOWN, 15 | connwin.c: (LPTSTR)lpci->szServer, 16 | connwin.c: lpci->lpActiveEnv->cEnvNum, 17 | connwin.c: GETADDRINFO(lpci->lpActiveEnv->henv), 18 | connwin.c: GETADDRINFO(lpci->hdbc)); 19 | fhconn.c: if(lpci->uState & STATE_CONNECTED_HDBC) { 20 | fhconn.c: if(lpci->szUser) 21 | fhconn.c: ReleaseMemory(lpci->szUser); 22 | fhconn.c: *lpci->szServer = '\0'; 23 | fhconn.c: wsprintf((LPTSTR)lpci->szClientTitle, 24 | fhconn.c: lpci->lpActiveEnv->cEnvNum, 25 | fhconn.c: GETADDRINFO(lpci->lpActiveEnv->henv),lpci->uConNum); 26 | fhconn.c: SetWindowText(lpci->hwnd, (LPTSTR)lpci->szClientTitle); 27 | fhconn.c: FREE_PTR(lpci->uSupportedFunctions); 28 | fhconn.c: lpci->uState &= ~STATE_CONNECTED_HDBC; 29 | fhconn.c: lpci->uState &= ~STATE_BROWSING_HDBC; 30 | fhconn.c: lpci->hdbc = hdbc; 31 | fhconn.c: lpci->uState = STATE_ALLOCATED_HDBC; 32 | fhconn.c: // if(SQL_SUCCESS != SQLSetConnectOption(lpci->hdbc, 33 | fhconn.c: // ToolOptionsAllErrors(lpci, henv, lpci->hdbc, NULL); 34 | fhconn.c: lpci->hdbc = hdbc; 35 | fhconn.c: lpci->uState = STATE_ALLOCATED_HDBC; 36 | fhconn.c: if(SQL_SUCCESS != SQLSetConnectOption(lpci->hdbc, 37 | fhconn.c: ToolOptionsAllErrors(lpci, henv, lpci->hdbc, NULL); 38 | fhconn.c: if (DisplayErrors(hwndOutWin,lpci->lpActiveEnv->henv,hdbc,FALSE,0)) 39 | fhconn.c: rc = SQLConnect(lpci->hdbc, 40 | fhconn.c: (LPTSTR)lpci->szServer); 41 | fhconn.c: SetFocus(lpci->hwndIn); 42 | fhconn.c: HDBC hdbctmp=lpci ? lpci->hdbc:NULL; 43 | fhconn.c: lpEi=lpci->lpActiveEnv; 44 | fhconn.c: if(lpci->uState & STATE_CONNECTED_HDBC || 45 | fhconn.c: lpci->uState & STATE_BROWSING_HDBC) 46 | fhconn.c: rc = SQLDisconnect(lpci->hdbc); 47 | fhconn.c: if(lpci->hdbc) 48 | fhconn.c: rc = SQLFreeHandle(SQL_HANDLE_DBC,lpci->hdbc); 49 | fhconn.c: rc = SQLFreeConnect(lpci->hdbc); 50 | fhconn.c: lpci->uState &= ~STATE_BROWSING_HDBC; 51 | fhdesc.c: lpDESCRIPTORINFO lpDesc=lpci->lpCurDesc; 52 | fhdesc.c: for(lpDesc=lpci->lpDesc; --dwIndex>0; ) 53 | fhdesc.c: if(lpci->lpDesc == lpDesc) // Removing head node? 54 | fhdesc.c: lpci->lpDesc = lpDesc->next; 55 | fhdesc.c: lpci->lpDesc = NULL; 56 | fhdesc.c: --lpci->cDescs; 57 | fhdesc.c: if(!lpci || !lpci->lpDesc) 58 | fhdesc.c: while(lpci->lpStmt) 59 | fhdesc.c: // SendMessage(lpci->hwndStmts, CB_SETCURSEL, (WPARAM)1, 0L); // Head node 60 | fhdesc.c: rc = SQLFreeHandle(SQL_HANDLE_DESC,lpci->lpCurDesc->hdesc); 61 | fhrslt.c: ToolOptionsAllErrors(lpci,lpci->lpActiveEnv->henv, lpci->hdbc, lpci->lpCurStmt->hstmt); 62 | fhrslt.c: ToolOptionsAllErrors(lpci, lpci->lpActiveEnv->henv, lpci->hdbc, lpci->lpCurStmt->hstmt); 63 | fhrslt.c: ToolOptionsAllErrors(lpci, lpci->lpActiveEnv->henv, lpci->hdbc, hstmt); \ 64 | fhrslt.c: if(lpci && lpci->lpCurStmt) { 65 | fhrslt.c: hstmt = lpci->lpCurStmt->hstmt; 66 | fhrslt.c: uHighestBoundCol = lpci->lpCurStmt->uHighestBoundCol; 67 | fhrslt.c: if(lpci && lpci->lpCurStmt) { 68 | fhrslt.c: hstmt = lpci->lpCurStmt->hstmt; 69 | fhrslt.c: uHighestBoundCol = lpci->lpCurStmt->uHighestBoundCol; 70 | fhrslt.c: rc = SQLGetFunctions(lpci->hdbc, SQL_API_SQLMORERESULTS, &fMoreResultsSupported); 71 | fhrslt.c: lpStmt = lpci->lpCurStmt; 72 | fhrslt.c: ResultsShowBoundCols(lpci, lpci->lpCurStmt->lpVars, rc, dex, fHdr); 73 | fhrslt.c: ResultsShowBoundCols(lpci, lpci->lpCurStmt->lpVars, rc, dex, fHdr); 74 | fhrslt.c: if(!lpci->lpCurStmt->fColBinding) { 75 | fhrslt.c: lpSTATEMENTINFO lpStmt=lpci->lpCurStmt; 76 | fhrslt.c: ToolOptionsAllErrors(lpci, lpci->lpActiveEnv->henv, lpci->hdbc, lpStmt->hstmt); 77 | fhrslt.c: HSTMT hstmt=lpci->lpCurStmt->hstmt; 78 | fhrslt.c: rc = SQLGetFunctions(lpci->hdbc, SQL_API_SQLMORERESULTS, &fMoreResultsSupported); 79 | fhrslt.c: ToolOptionsAllErrors(lpci, lpci->lpActiveEnv->henv, lpci->hdbc, hstmt); 80 | fhrslt.c: lpStmt->lpResults = CreateResultWindow(lpci->lpActiveEnv->hwndClient, hInst, henv, 81 | fhrslt.c: lpci, lpci->lpCurStmt); 82 | fhstmt.c: if(!lpci || !lpci->lpStmt) 83 | fhstmt.c: while(lpci->lpStmt) { 84 | fhstmt.c: SendMessage(lpci->hwndStmts, CB_SETCURSEL, (WPARAM)1, 0L); // Head node 85 | fhstmt.c: SQLCancel(lpci->lpCurStmt->hstmt); 86 | fhstmt.c: rc = SQLFreeHandle(SQL_HANDLE_STMT,lpci->lpCurStmt->hstmt); 87 | fhstmt.c: rc = SQLFreeStmt(lpci->lpCurStmt->hstmt, SQL_DROP); 88 | fhstmt.c: lpSTATEMENTINFO lpStmt = lpci->lpStmt; 89 | fhstmt.c: SWORD iStmts = lpci->cStmts; 90 | fhstmt.c: SWORD cStmts=lpci->cStmts; 91 | fhstmt.c: lpStmt = lpci->lpStmt; 92 | fhstmt.c: cStmts=lpci->cStmts; 93 | fhstmt.c: lpStmt = lpci->lpStmt; 94 | fhstmt.c: lpci->uRowWiseSize = uNewVal; 95 | main.c: if(!(lpci->uState & STATE_CONNECTED_HDBC)) 96 | main.c: if(lpci->uSupportedFunctions) 97 | main.c: return lpci->uSupportedFunctions; 98 | main.c: else if(GetSupportedFunctions(lpci->hdbc, lpci)) 99 | main.c: return lpci->uSupportedFunctions; 100 | rsltwin.c: (LPTSTR)lpci->szClientTitle); 101 | rsltwin.c: ToolOptionsAllErrors(lprw->lpci, lprw->lpci->lpActiveEnv->henv, lprw->lpci->hdbc, lpStmt->hstmt); 102 | usrwndp.c: if((lpci) && (lpci->lpCurStmt) && (lpci->lpCurStmt->lpParams)){ 103 | usrwndp.c: wsprintf(szTemp, "%u", lpci->lpCurStmt->lpParams->ipar); 104 | usrwndp.c: ((lpci) && (lpci->lpCurStmt) && (lpci->lpCurStmt->fParamOpt) && 105 | usrwndp.c: ((irow + lpci->lpCurStmt->cParamRows - 1) > lpSiList->uRowSetSize))){ 106 | usrwndp.c: &lpci->lpCurStmt->hstmt, &lpci->lpDesc->hdesc, 107 | usrwndp.c: lpci->lpCurStmt->cStmtNum); 108 | usrwndp.c: wsprintf(szTemp,"%u",lpci->lpCurStmt->lpParams->ipar); 109 | usrwndp.c: UpdateFillParamControls(hDlg, lpDlg, lpci->lpCurStmt->lpParams, 1); 110 | usrwndp.c: lpParam = SearchParamList(lpci->lpCurStmt, ipartmp); 111 | usrwndp.c: if(lpci->lpCurStmt->cParamRows > 1){ 112 | usrwndp.c: if((udRowTmp != 0) && (udRowTmp <= lpci->lpCurStmt->cParamRows)) 113 | usrwndp.c: if(!(lpci->lpCurStmt->fDisabled)) 114 | usrwndp.c: if((lpci) && (lpci->lpCurStmt) && (lpci->lpCurStmt->lpParams)){ 115 | usrwndp.c: lpParam=SearchParamList(lpci->lpCurStmt,ipar); 116 | usrwndp.c: if(lpci->lpStmt){ 117 | usrwndp.c: lpsi = lpci->lpStmt; 118 | usrwndp.c: for(idx=0;idx<(UINT)(lpci->cStmts);idx++){ 119 | usrwndp.c: &lpci->lpCurStmt->hstmt, NULL, 120 | usrwndp.c: lpci->lpCurStmt->cStmtNum); 121 | usrwndp.c: if(lpci->lpCurStmt->uBoundCols) { 122 | usrwndp.c: lpBOUNDVARS lpbv=lpci->lpCurStmt->lpVars; 123 | usrwndp.c: if(!IsBoundColumn(uCol, lpci->lpCurStmt)) 124 | usrwndp.c: uRow > TOT_ROWSET_SIZE(lpci->lpCurStmt)) 125 | usrwndp.c: lpSTATEMENTINFO lpStmt=lpci->lpCurStmt; 126 | usrwndp.c: lpSTATEMENTINFO lpStmt=lpci->lpCurStmt; 127 | usrwndp.c: lpbv = IsBoundColumn(uCol, lpci->lpCurStmt); 128 | usrwndp.c: uRow > TOT_ROWSET_SIZE(lpci->lpCurStmt)) 129 | -------------------------------------------------------------------------------- /src/odbctest/table.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| Title: MAKETBL.H 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| MAKETBL is part of the common test functions which are not part of the 6 | //| retail build. 7 | //*--------------------------------------------------------------------------------- 8 | #ifndef MAKETBL_DEFS 9 | #define MAKETBL_DEFS 10 | 11 | 12 | //---------------------------------------------------------------------------------- 13 | // Defines and Macros 14 | //---------------------------------------------------------------------------------- 15 | #ifndef VSZFile 16 | #define VSZFile static TCHAR vszFile[]=__FILE__; 17 | #endif 18 | 19 | 20 | #define MAXTYPENAMES 30 21 | #define QP_MAXSTRINGSIZE 40 22 | #define QP_MAXSIZE 20 23 | #define AUTO_MAKE_TABLE TRUE 24 | 25 | #define QUIET_MODE 1 26 | 27 | //Used by MakeGenderTable() 28 | #define GIRLS_TABLE 0 29 | #define BOYS_TABLE 1 30 | 31 | 32 | // Driver Name Bitmasks 33 | #define DRVR_SQLSRVR 0x00000001L 34 | #define DRVR_SIMBA 0x00000002L 35 | #define DRVR_ORACLE 0x00000004L 36 | #undef DRVR_QJET 37 | #define DRVR_QJET 0x00000008L 38 | #define DRVR_ODS 0x00000010L 39 | 40 | 41 | 42 | // for GetHdbState & Disc 43 | #define UNALLOCATED_HENV 99 44 | #define ALLOCATED_HENV 1 45 | #define ALLOCATED_HDBC 2 46 | #define CONNECTED_HDBC 3 47 | #define FREE_HENV 1 48 | #define DONT_FREE_HENV 0 49 | #define NEW_HENV 1 50 | #define SAME_HENV 0 51 | // used in GetHstmtState 52 | #define ALLOCATED_HSTMT 5 53 | #define PREPARED_HSTMT 6 54 | #define EXECUTED_HSTMT 7 55 | #define POSITIONED_HSTMT 8 56 | #define TABLE_EXISTS 13 57 | 58 | #define DLL_UNKNOWN -1 59 | #define DLL_SQLSRVR 1 60 | #define DLL_SQORA 2 61 | #define DLL_SIMBA 4 62 | 63 | // For GATORSTR.DLL 64 | extern HINSTANCE hGatorStrInst; 65 | 66 | //extern dCSEG(TCHAR) sz_Returned[]; 67 | 68 | 69 | #define IH_MAX_RC 10 70 | 71 | 72 | #define MAX_TYPE 129 73 | #define MAX_PREFIX 129 74 | #define MAX_SUFFIX 129 75 | #define MAX_PARAMS 129 76 | #define MAX_LENGTH_BUF 11 77 | #define MAX_SZ_SIZE 4048 78 | #define TABLENAMESIZE 31 79 | #define MAX_TYPES 29 80 | 81 | #define MAX_VALUE 512 82 | 83 | typedef struct FieldInfo { 84 | TCHAR szType[MAX_TYPE]; 85 | TCHAR szFieldName[MAX_TYPE + 1]; 86 | int iFieldNum; 87 | SWORD wSQLType; 88 | TCHAR szPrefix[MAX_PREFIX]; 89 | TCHAR szSuffix[MAX_SUFFIX]; 90 | TCHAR szParams[MAX_PARAMS]; 91 | TCHAR szColDef[SMALLBUFF]; //Full column definition (i.e. "col1 TCHAR(255)") 92 | TCHAR szLength[MAX_LENGTH_BUF]; 93 | SQLULEN precision; 94 | UDWORD scale; 95 | UDWORD precisionUsed; 96 | SWORD scaleUsed; 97 | SWORD nullable; 98 | SWORD UseNulls; 99 | SQLLEN length; 100 | int fAutoUpdate; 101 | SQLLEN fSearchable; 102 | SQLLEN fUnsigned; 103 | UWORD fAutoInc; 104 | BOOL fUse; 105 | } FIELDINFO, *lpFIELDINFO; 106 | 107 | #define MAX_PARAM 30 108 | #define MAXSTR 45 109 | 110 | typedef struct tagQtStruct { 111 | TCHAR sz[MAX_SZ_SIZE]; 112 | TCHAR szParam[MAX_PARAM]; 113 | TCHAR szDataItem[MAXSTR]; 114 | TCHAR szTableName[TABLENAMESIZE]; 115 | TCHAR szColNames[500]; 116 | TCHAR szValues[20 * MAX_TYPES]; 117 | } QTSTRUCT, *lpQTSTRUCT; 118 | 119 | 120 | #define MAX_IDS_STRING_LEN 80 121 | #define LEVEL_AREA 1 122 | #define LEVEL_SUBAREA 2 123 | #define LEVEL_TEST 3 124 | #define LEVEL_COMMENT 3 125 | #define LEVEL_ERROR 3 126 | #define LEVEL_FILE 3 127 | #define LEVEL_PASSED 3 128 | //int failed; 129 | int DEBUG_MSG; 130 | 131 | typedef TCHAR VALUESARRAY[MAX_TYPES][MAX_VALUE+1]; 132 | 133 | // Only declare this if we are compiling GATORTST.DLL 134 | #ifdef DLL_INVOKED 135 | jmp_buf env; 136 | #endif 137 | 138 | 139 | #define DROPPED_TABLE 0 140 | #define DELETED_ROWS 1 141 | #define UNIQUE_INDEX 1 142 | #define CLUSTERED_INDEX 2 143 | #define STANDARD_INDEX 3 144 | #define FORCE 1 145 | #define NOFORCE 0 146 | 147 | 148 | //---------------------------------------------------------------------------------- 149 | // Defines and macros 150 | //---------------------------------------------------------------------------------- 151 | #ifdef WIN32 152 | #define HUGE 153 | #else 154 | #define HUGE _huge 155 | #endif 156 | 157 | typedef BYTE HUGE * HPBYTE; 158 | 159 | #define MAX_CREATED_DATA_LEN 40 160 | #define MAX_SCALE 5 161 | typedef struct tagParamS { 162 | TCHAR pbs[MAX_TYPES][MAX_CREATED_DATA_LEN]; 163 | SQLLEN cbValue[MAX_TYPES]; 164 | } PSTRUCT, *lpPSTRUCT; 165 | 166 | 167 | #define TABLE_NORMAL 0 168 | #define TABLE_EXT 1 169 | #define TABLE_PATH 2 170 | #define TABLE_PATH_EXT 3 171 | #define TABLE_SPACES 4 172 | #define TABLE_SPECIAL 5 173 | #define MAX_TABLE_TYPES 6 174 | 175 | 176 | int INTFUN MakeTable(HDBC *pHdbc,LPTSTR szCreatedTable, FIELDINFO *rgFields, 177 | UINT uSeed,int *pcTypes); 178 | 179 | UINT INTFUN GetTypeInfo(HDBC *pHdbc,HSTMT *pHstmt0,lpFIELDINFO rgFields, 180 | UINT uSeed); 181 | 182 | #define FSSQLColAttributes(arg1,arg2,arg3,arg4,arg5,arg6,arg7)\ 183 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 184 | SQLColAttributes(arg1,arg2,arg3,arg4,arg5,arg6,arg7)) 185 | 186 | #define FSSQLFreeStmt(arg1,arg2) \ 187 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL,\ 188 | SQLFreeStmt(arg1,arg2)) 189 | 190 | #define FSSQLGetInfo(arg1, arg2,arg3,arg4,arg5) \ 191 | ToolOptionsAllErrors(lpActiveConnWin,NULL,(arg1),NULL,NULL, \ 192 | SQLGetInfo(arg1, arg2,arg3,arg4,arg5)) 193 | 194 | #define FSSQLGetConnectOption(arg1,arg2,arg3) \ 195 | ToolOptionsAllErrors(lpActiveConnWin,NULL,(arg1),NULL,NULL, \ 196 | SQLGetConnectOption(arg1,arg2,arg3)) 197 | 198 | #define FSSQLGetTypeInfo(arg1,arg2) \ 199 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 200 | SQLGetTypeInfo(arg1,arg2)) 201 | 202 | #define FSSQLGetData(arg1,arg2,arg3,arg4,arg5,arg6) \ 203 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 204 | SQLGetData(arg1,arg2,arg3,arg4,arg5,arg6)) 205 | 206 | #define FSSQLColumns(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\ 207 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 208 | SQLColumns(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)) 209 | 210 | #define FSSQLColAttributes(arg1,arg2,arg3,arg4,arg5,arg6,arg7)\ 211 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 212 | SQLColAttributes(arg1,arg2,arg3,arg4,arg5,arg6,arg7)) 213 | 214 | #define FSSQLBindParameter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \ 215 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 216 | SQLBindParameter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10)) 217 | 218 | #define FSSQLPrepare(arg1,arg2,arg3) \ 219 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 220 | SQLPrepare(arg1,arg2,arg3)) 221 | 222 | #define FSSQLExecute(arg1) \ 223 | ToolOptionsAllErrors(lpActiveConnWin,NULL,NULL,(arg1),NULL, \ 224 | SQLExecute(arg1)) 225 | 226 | #define FSSQLAllocStmt(arg1,arg2) \ 227 | ToolOptionsAllErrors(lpActiveConnWin,NULL,(arg1),NULL,NULL, \ 228 | SQLAllocStmt(arg1,arg2)) 229 | 230 | #endif 231 | -------------------------------------------------------------------------------- /src/odbctest/toolbar.h: -------------------------------------------------------------------------------- 1 | //*--------------------------------------------------------------------------------- 2 | //| ODBC Test Tool 3 | //| Copyright (c) Microsoft, All rights reserved 4 | //| 5 | //| Title: TOOLBAR.H 6 | //| 7 | //| Purpose: 8 | //| Header file for the status bar functions 9 | //*--------------------------------------------------------------------------------- 10 | #ifndef TOOLBAR_DEFS 11 | #define TOOLBAR_DEFS 12 | 13 | #include 14 | #include "portable.h" 15 | #include "standard.h" 16 | 17 | 18 | //---------------------------------------------------------------------------------- 19 | // Defines and macros 20 | //---------------------------------------------------------------------------------- 21 | 22 | // This enum gives the offsets of each button found in the toolbar bitmaps 23 | enum TBButtons{ 24 | TB_FILE_OPEN, 25 | TB_FILE_SAVEAS, 26 | TB_FULL_CONNECT, 27 | TB_FULL_DISCONNECT, 28 | TB_EXEC_DIRECT, 29 | TB_GET_DATA_ALL, 30 | TB_BIND_COL_EXT_FETCH, 31 | TB_ERROR_ALL, 32 | TB_FREE_STMT_CLOSE, 33 | TB_USER_OPTIONS, 34 | TB_TRACE, 35 | TB_RUN_AUTO_TESTS, 36 | TB_FETCH_FIRST, 37 | TB_FETCH_PRIOR, 38 | TB_FETCH_NEXT, 39 | TB_FETCH_LAST, 40 | TB_TOOLS_RECORD, 41 | TB_TOOLS_PLAYBACK 42 | }; 43 | 44 | 45 | //*------------------------------------------------------------------------ 46 | //| TOOLBARINFO: 47 | //| This structure is used to track the tool bar. 48 | //*------------------------------------------------------------------------ 49 | typedef struct tagTOOLBARINFO { 50 | HWND hwnd; // Handle to our window 51 | UINT dx; // Width of the window at this point 52 | UINT dy; // Height of window 53 | RECT rect; // Bounding rect for text only 54 | } TOOLBARINFO; 55 | typedef TOOLBARINFO * lpTOOLBARINFO; 56 | 57 | //*------------------------------------------------------------------------ 58 | //| TBBUTTONINFO: 59 | //| This structure is used to track each button's information. 60 | //*------------------------------------------------------------------------ 61 | typedef struct tagTBBUTTONINFO { 62 | UINT uBtnID; // The ID of the button 63 | UINT uMenuID; // ID of the associated menu; (-1) if no menu item associated 64 | UINT uOptID; // If no assocated menu, this ID is the ID of the assocated control (ie. IDX_ERR in the UserOpts dlg) 65 | UINT uStyle; // The type of button (Push, toggle) 66 | UINT xOffset; // The offset of the button's bitmap in the AllButtons bitmap 67 | BOOL fDown; // Flag telling if the button is in the Up or Down position; TRUE if Down 68 | int idsStatus; // The ids string number to be displayed in the status bar when button is pressed 69 | } TBBUTTONINFO; 70 | 71 | //*------------------------------------------------------------------------ 72 | //| TBBUTTONINFO: 73 | //| This structure is used to track each button's information. 74 | //*------------------------------------------------------------------------ 75 | typedef struct tagTBLAYOUT { 76 | UINT uBtnID; // The ID of the button 77 | } TBLAYOUT; 78 | 79 | 80 | //---------------------------------------------------------------------------------- 81 | // Function Prototypes 82 | //---------------------------------------------------------------------------------- 83 | HWND INTFUN CreateToolBar(HWND hwndParent, HINSTANCE hInst); 84 | VOID INTFUN SizeToolBar(HWND hwnd, UINT dx); 85 | VOID INTFUN RefreshToolbar(); 86 | VOID INTFUN RefreshToolbarSaveAs(HWND hwnd); 87 | VOID INTFUN DoFreeStmtClose(BOOL fNoLog); 88 | 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/odbctest/unicode/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /src/odbctest/unicode/sources: -------------------------------------------------------------------------------- 1 | !include ..\sources.inc 2 | 3 | TARGETNAME=odbct32w 4 | LOCALIZE_NO_MUI=0 #Make DLL or EXE end up in the testbin directory 5 | C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE 6 | TARGETLIBS=$(TARGETLIBS) \ 7 | $(PROJROOT_OBJ)\ODBC\Tools\OdbcTest\gatortst\unicode\$(O)\gtrts32w.lib 8 | --------------------------------------------------------------------------------