Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Evaluate() in TCC-RT

Charles Dye

Super Moderator
May
4,948
126
Staff member
TakeCommand.dll in TCC-RT v20 exported Evaluate(). In v21 it doesn't. Is this change deliberate? Permanent?
 
OT, but ... Charles, have you somehow automated trying to figure out what function isn't supplied by takecmd.dll? I hadn't, and often struggled with the chore. If you have, please share it. Today I came up with this which works, at least in this specific case. It shows that of the functions 4UTILS needs, Evaluate() is missing. I'll see if I can make it robust, and put it in a BTM.
Code:
g:\tcc-rt\plugins> do f in /P (dumpbin /imports:takecmd.dll 4utils.dll | grep "^[ ]*[^ ][^ ][^ ] [^ ]*$" | cut -c 23-) ( echo %f & dumpbin /exports ..\takecmd.dll | grep " %f" )
MakeFullName
        312  251 0013B950 MakeFullName
StripEnclosingQuotes
        555  2A5 00184E50 StripEnclosingQuotes
Qprintf
        381  264 001859F0 Qprintf
QueryIsFile
        417  279 00140510 QueryIsFile
        418  27A 00140620 QueryIsFileOrDirectory
        420  27B 0013F1B0 QueryIsFileUnicode
NthArgument
        335  257 001E5860 NthArgument
Evaluate
QueryIsFileUnicode
        420  27B 0013F1B0 QueryIsFileUnicode
FreeMem
        159  230 0019C210 FreeMem
AllocMem
         11  212 0019C220 AllocMem
honk
        691  31B 0010AD80 honk
QueryIsDirectory
        414  278 001409F0 QueryIsDirectory
ExpandVariables
        141  22C 0010DC60 ExpandVariables
ASCIIToUnicode
          1  20F 00184AE0 ASCIIToUnicode
QueryTrueName
        455  28F 001D8410 QueryTrueName
ReallocMem
        469  293 0019C260 ReallocMem
QueryOptionValue
        446  28B 00162B00 QueryOptionValue
GetKeystroke
        183  23B 00188220 GetKeystroke
QueryKeyWaiting
        440  288 00187480 QueryKeyWaiting
EscapeLine
        126  22A 00126570 EscapeLine
?TakeCommandIPC@@YAHPA_W0@Z
        580  1A9 00183260 ?TakeCommandIPC@@YAHPA_W0@Z
?UpdateEnvironment@@YAXXZ
        624  1D2 00106050 ?UpdateEnvironment@@YAXXZ
tty_yield
        698  31F 001C59C0 tty_yield
UnicodeToASCII
        613  2A9 00184B50 UnicodeToASCII
WildcardComparison
        649  2AD 001E89B0 WildcardComparison
        650  2AE 001E89D0 WildcardComparisonEx
Sscanf
        551  2A4 00184780 Sscanf
Printf
        369  260 00185BD0 Printf
Sprintf
        550  2A3 001847A0 Sprintf
Command
         55  21D 001BBC00 Command
SetEVariable
        524  29E 00109250 SetEVariable
 
No, I haven't found any easy way either. I keep thinking there should be some simple way using Dependency Walker, but I haven't found one.
 
Actually, Evaluate() is still there; it's just decorated now.
That's something I've naver quite understood. When it's undecorated, it has the correct signature.
Code:
g:\sdk9-17> undecorate ?Evaluate@@YGHPA_W@Z
int __stdcall Evaluate(wchar_t *)
That's how it's decorated in the LIB, and you can link with it. So why can't it be found at run time?
 
Charles, here's something to play with. It will have to be edited to call the correct VCVARS batfile and if you use non-standard plugin directoty names. It also may need fixing if your DUMPBIN produces different output from mine (VS10). It's faster with GREP.EXE, but that's not terribly important to me, and a TCC-only solution is nice. Below is an example of its use showing that Evaluate is missing.
Code:
v:\> type tcmdexports.btm
set plugname=%1.dll
set tccdir=%2
set plugdir=%tccdir\plugins
if not defined VCINSTALLDIR call l:\VS10\vc\bin\vcvars32.bat
do line in /P dumpbin /imports:takecmd.dll %plugdir\%plugname
   if "%line" == "" .or. %@words[%line] != 2 .or. %@index[%line,.,0] GT 0 iterate
   echo %@word[1,%line]
   set search= %@word[1,%line] & REM the leading space in "search" is crucial
   do l in /P dumpbin /exports %tccdir\takecmd.dll
       set p=%@index[%l,%search,1]
       if %p == -1 iterate
       if "%@instr[%p,,%l]" == "%search" echo %l
   enddo
   echo.
enddo

Code:
v:\> tcmdexports.btm 4utils g:\tcc-rt\
MakeFullName
        312  251 0013B950 MakeFullName

StripEnclosingQuotes
        555  2A5 00184E50 StripEnclosingQuotes

Qprintf
        381  264 001859F0 Qprintf

QueryIsFile
        417  279 00140510 QueryIsFile

NthArgument
        335  257 001E5860 NthArgument

Evaluate

QueryIsFileUnicode
        420  27B 0013F1B0 QueryIsFileUnicode

FreeMem
        159  230 0019C210 FreeMem

AllocMem
         11  212 0019C220 AllocMem

honk
        691  31B 0010AD80 honk

QueryIsDirectory
        414  278 001409F0 QueryIsDirectory

ExpandVariables
        141  22C 0010DC60 ExpandVariables

ASCIIToUnicode
          1  20F 00184AE0 ASCIIToUnicode

QueryTrueName
        455  28F 001D8410 QueryTrueName

ReallocMem
        469  293 0019C260 ReallocMem

QueryOptionValue
        446  28B 00162B00 QueryOptionValue

GetKeystroke
        183  23B 00188220 GetKeystroke

QueryKeyWaiting
        440  288 00187480 QueryKeyWaiting

EscapeLine
        126  22A 00126570 EscapeLine

?TakeCommandIPC@@YAHPA_W0@Z
        580  1A9 00183260 ?TakeCommandIPC@@YAHPA_W0@Z

?UpdateEnvironment@@YAXXZ
        624  1D2 00106050 ?UpdateEnvironment@@YAXXZ

tty_yield
        698  31F 001C59C0 tty_yield

UnicodeToASCII
        613  2A9 00184B50 UnicodeToASCII

WildcardComparison
        649  2AD 001E89B0 WildcardComparison

Sscanf
        551  2A4 00184780 Sscanf

Printf
        369  260 00185BD0 Printf

Sprintf
        550  2A3 001847A0 Sprintf

Command
         55  21D 001BBC00 Command

SetEVariable
        524  29E 00109250 SetEVariable
 
It's undecorated in build 61. (As in the current Take Command, and TCC/LE.)
 
Back
Top