I'm not really sure why, but my custom strcpy and strAlloc functions that operate on Tchars appear to be corrupting the heap (VS 2010 gives me an error message saying so).
Thanks for the help
<code>
TCHAR* volumeCircle::mAllocTCHARPtr(TCHAR *src, int maxSrcLength, TCHAR **dstPtr){
size_t length;
StringCchLength(src, maxSrcLength, &length);
*dstPtr = (TCHAR *)malloc(length);
return *dstPtr;
};
TCHAR* volumeCircle::mStrcpyTCHARPtr(TCHAR *src, int maxSrcLength, TCHAR **dst){
volumeCircle::mAllocTCHARPtr(src, maxSrcLength, dst);
return _tcscpy(*dst,src);
};
</code>
this is where I call the function:
<code>
for(int i = 0; i < this->numVolumes; i++){
TCHAR tempVolumePathName[256];
GetVolumePathNamesForVolumeName(this->systemVolumeNames[i], tempVolumePathName, 256, &returnedLength);
this->mStrcpyTCHARPtr(tempVolumePathName, 356, &this->volumePathNames[i]); //volumePathName is just a NUL pointer which I want to //be allocated and copied
};
</code>
thanks







