Documentation SDK signature mismatch

Oct 18, 2008
273
1
#1
Hello –

There seems to be a signature mismatch with some of the memory functions in
TakeCmd.h and TakeCmd.lib SDK

void WINAPI FreeMem( LPVOID lpMemory );
[email protected]@[email protected] (void __stdcall FreeMem(void *))

LPVOID WINAPI AllocMem( unsigned int * puSize );
[email protected]@[email protected] (void * __stdcall AllocMem(unsigned int))

LPVOID WINAPI CallocMem( unsigned int * puSize );
[email protected]@[email protected] (void * __stdcall CallocMem(unsigned int,unsigned int))

LPVOID WINAPI ReallocMem( LPVOID lpMemory, ULONG_PTR uSize ); [email protected]@[email protected] (void * __stdcall ReallocMem(void *,unsigned long))

In the case of CallocMem it seems to require 2 arguments – is one the fill byte?
 
#4
There are lots of discrepancies between TakeCmd.h and TakeCmd.lib, but I was able to solve that by editing the header-file. At least the lib and dll match in the x86 architecture.
Right now I got stuck in x64 world as there is a difference between TakeCmdx64.lib and the dll: The function QueryPluginPathname() has a LPCTSTR argument in the lib and a LPTSTR argument in the dll. This I cannot resolve.
It is sad that the SDK is not properly maintained...

Josef
 
Oct 18, 2008
273
1
#5
Hello -- thanks for the reply ... I thought that all the function in the header were free to use .. I thought that
the internal memory routines would make sense since the plugin would be using the same memory as the the (base) code itself ... OK I will stick to the win RTL calls -- thanks for clearing this up
 

rconn

Administrator
Staff member
May 14, 2008
10,551
97
#7
There are lots of discrepancies between TakeCmd.h and TakeCmd.lib, but I was able to solve that by editing the header-file. At least the lib and dll match in the x86 architecture.
Right now I got stuck in x64 world as there is a difference between TakeCmdx64.lib and the dll: The function QueryPluginPathname() has a LPCTSTR argument in the lib and a LPTSTR argument in the dll. This I cannot resolve.
QueryPluginPathname has an LPCTSTR argument in the .h, .lib and the .dll, unless you're using an older (pre-v17) version of takecmd.dll. (There is no difference in the .h files between x86 & x64.)
 

rconn

Administrator
Staff member
May 14, 2008
10,551
97
#8
Hello -- thanks for the reply ... I thought that all the function in the header were free to use .. I thought that
the internal memory routines would make sense since the plugin would be using the same memory as the the (base) code itself
Well -- no, they wouldn't. The AllocMem / CallocMem / ReallocMem routines are wrappers for Window's VirtualAlloc routines. (And optimized for very large allocations.)

When allocating anything less than 1Mb, TCC & TCMD use the RTL functions.