Rohit
2008-10-17 06:31:56 UTC
I am using a procedure which calls HeapAlloc to allocate memory.
void myAlloc(DWORD Size)
{
if ( Size > 0 ) {
char *Temp;
Temp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (DWORD) Size);
return Temp;
}
else
return (void *)0;
}
And the call to this function is :
myVar = (structname *)myAlloc( sizeof(structvar));
This sometimes gives me a crash and analysing Dr.Watson logs, stack
can be traced as
ntdll!wcsncpy+0x74f
for call to : myAlloc->wcsncpy
Can anyone comment ?
void myAlloc(DWORD Size)
{
if ( Size > 0 ) {
char *Temp;
Temp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (DWORD) Size);
return Temp;
}
else
return (void *)0;
}
And the call to this function is :
myVar = (structname *)myAlloc( sizeof(structvar));
This sometimes gives me a crash and analysing Dr.Watson logs, stack
can be traced as
ntdll!wcsncpy+0x74f
for call to : myAlloc->wcsncpy
Can anyone comment ?